Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGL Development Tools » Extending the Google Map widget
Extending the Google Map widget [message #975505] Wed, 07 November 2012 18:09
Richard Moulton is currently offline Richard Moulton
Messages: 92
Registered: August 2011
Location: Devon, UK
Member
I've just revisited the Google Maps widget that's included with the downloadable mortgage calculator project, found on the EDT downloads page.

With the application I had in mind I wanted to plot multiple markers on a map and then have the map automatically centre itself on those markers.

I couldn't see a way to do that with the supplied widget so I started googling to see how this could be done. It didn't take long to find an example of this in javascript that worked with the Google Maps v3 API so I've extended the Google Maps widget to include a new autoCenter() function.

I changed the EGLSource/utils/map/GoogleMap.egl external type to include a reference to the new function and modified the Webcontent/utils/maps/GoogleMap.js to include the new function.

The attached project includes the extended widget plus a sample EGL handler that demonstrates the new feature. The sample adds four markers (four IBM UK offices) to the map and by default the map is positioned to the last marker that was added. There's an 'Auto Center' button that when clicked executes the new autoCenter() function.

Richard
Previous Topic:Service Call Syntax
Next Topic:Switching to another DojoMobileView
Goto Forum:
  


Current Time: Fri Aug 22 15:56:06 EDT 2014

Powered by FUDForum. Page generated in 0.03811 seconds