jMapping 2 - Google Maps v3 API support

jMapping has been long overdue for an update. Google announced a beta of version 3 of their Maps API in May of last year, and then made it the official version this May. jMapping has always used version 2 of the API along with the MapIconMaker (which is dependent on version 2 of the API). But as of today we have now moved to full version 3 support. Additionally, we're now officially supporting version 1.4.x of jQuery.

Making the change to version 3 of the Maps API meant we could no longer use the MapIconMaker library. Instead we've switched over to the StyledMarker library. This doesn't mean much of a functionality change for most users, but it does mean the values for the category_icon_options option has changed slightly (see the documentation for details).

The other change that will break compatibility with existing apps that use jMapping is what value type is expected of the map_config option. Previously, this was expected to be a callback that took the GMap2 object as its parameter, and allowed the developer to call functions on the GMap2 object to modify how the map would be rendered. In version 3 of the API most of the render options are no longer modifiable after initialization, so instead we accept a MapOptions object that will be used to create the map object instead of the jMapping defaults.

Those changes aside the plugin should work exactly as it always has, providing a quick and easy way to add Google maps integration to a page via a jQuery style API.

As always, feel free to contribute by forking the project on Github, or submitting feature request or bug reports. You can find the latest download links here.

Brian Landau

Posted in Article Category: #Code