Posted by
Gareth Johnson | 02-Apr-09 5:55 AM EDT
Well I've got a bumper edition of a blog article for everyone today! I would first like to say a big thank you to all who attended and helped with the European Niagara Forum 2009. It was great to see everyone.
For the developer session this year, I choose to take apart the code for a Niagara Google Maps implementation. Imagine having a Google Maps/Earth view of all of your Stations in your Web Supervisor? I should note, this isn't a new Tridium product but just a neat academic code example for the community to benefit from. It's my hope that Tridium development partners will take this code, develop and support it further.
The demo was based upon an oBIX Watch JavaScript library that's now available from here. This JavaScript library will aid anyone interested in creating live oBIX enabled web pages. The site contains a Station with a few fun HTML pages. The library is completely Open Source and hence can be freely used by everyone.
For the Google Maps demo, the code is available here and the module and demo Station are available here. The code demonstrates the following Niagara development principles...
- Advanced Niagara Component Modelling
- Developing Manager Views and custom Workbench Field Editors
- Hx Views
- Google Maps API
- oBIX Watches
I had a lot of fun demoing this application and look forward to seeing what happens with the code. As I mentioned before, the attached code isn't something that we're going to support as a product just yet. Of course, you're welcome to use the ever vibrant developer community to develop it further! Finally, I should also point out that if you do want to use this as an extra Smart Service to your customers, that you need to abide by Google's Terms of Service for using the Maps API.
Nice job Gareth. I loaded this on a Jace here and all went well.
Hey gareth any thouhts to using this with adobe air ?
I'm afraid I don't have any experience with Adobe Air at the moment to be able to comment on this.
ok i will wrestle with it. on another note i added google maps to a websupervisor for one of my school districts but it is behind a VPN google supports this but they want 10,000.00 a year BASE!
Awesome example Gareth! I liked how you handled the tree children and markers as BComponents and used your encodeCompToJson() method.
John, you could definitely do the same thing in Adobe Air/Flex although the code would need to be changed quite a bit.
Google Maps API for Flex:
http://code.google.com/apis/maps/documentation/flash/tutorial-flexbuilder.html
Also, thanks for pointing out the Google TOS which seems restrictive. They do have a "Premier" version as well:
http://www.google.com/enterprise/maps/
I'm really glad you like the example. I had a lot of fun demoing it at the Niagara Forum.
At the heart of the example is the oBIX Watch JavaScript library. The link is on the Blog article and has a quite a lot of potential for other Web Apps to be built.
For instance, I would hope to see the community come up with some other Web 2.0 Niagara implementations. For instance, what about an oBIX Google Gadget? Or some other fun Map implementations?
gareth i looked at gagets but there are some security issues there so thats why i was thinking about adobe air Tucker well when are you going to make the changes
John
This thing is Awesome!!!! Thanks Gareth!! Needed this for one of my jobs about a year back....the customer will be ecstatic!!!
Stunning, added some of my sites, easy, and amazing! Thanks for sharing.
Hey guys I was trying to play around with this and cannot seem to get the demo station to display a map.....I lot of customers with many sites would like a application like this. Any help would be very appreciated.
Jon
Does this module work for 3.5? I am having a hard time getting it on a websup.
This is the error that I get when I try to use the IE web interface:
500: Internal Server Error
javax.baja.naming.SyntaxException: select from gMapsDemo:GoogleMapsDeviceExt stop where !status.isDisabled
at javax.baja.bql.BBqlScheme.parse(BBqlScheme.java:40)
at javax.baja.naming.BOrd.parse(BOrd.java:408)
at javax.baja.naming.BOrd.parse(BOrd.java:392)
at javax.baja.naming.BOrd.parse(BOrd.java:374)
at javax.baja.naming.BOrd.resolve(BOrd.java:239)
at com.tridium.gmapsdemo.hx.BGoogleMapsHxView.write(BGoogleMapsHxView.java:112)
at com.tridium.hx.BDefaultHxProfile.doBody(BDefaultHxProfile.java:57)
at javax.baja.hx.BHxProfile.writeDocument(BHxProfile.java:197)
at javax.baja.hx.BHxView.doGet(BHxView.java:67)
at javax.baja.web.BServletView.service(BServletView.java:52)
at com.tridium.web.WebProcess.serviceServletView(WebProcess.java:629)
at com.tridium.web.WebProcess.service(WebProcess.java:82)
at com.tridium.web.SysServlet.service(SysServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at com.tridium.httpd.ServiceThread.handleRequest(ServiceThread.java:251)
at com.tridium.httpd.ServiceThread.run(ServiceThread.java:80)
Caused by: com.tridium.bql.compiler.RuntimeCompilerException: The WHERE clause must be a boolean expression.
at com.tridium.bql.compiler.SelectParser.predicate(SelectParser.java:221)
at com.tridium.bql.compiler.SelectParser.parse(SelectParser.java:43)
at com.tridium.bql.compiler.SelectParser.parse(SelectParser.java:33)
at com.tridium.bql.compiler.BqlParser.parse(BqlParser.java:92)
at com.tridium.bql.compiler.BqlParser.parse(BqlParser.java:57)
at javax.baja.bql.BqlQuery.make(BqlQuery.java:45)
at javax.baja.bql.BBqlScheme.parse(BBqlScheme.java:36)
... 15 more