Google Maps API version 2 3

I have upgraded the GPX Viewer mashup script to version 2 of the Google Maps API. There are only some minor changes to the API and some of the objects used. It doesn’t make the script any better, but now it is more likely to be compatible with future versions of the API.

As part of the update, I added an extra parameter to CenterAndZoom to set the type of map so that it can be set as part of the initialization. You should pass in one of G_NORMAL_MAP, G_SATELLITE_MAP, or G_HYBRID_MAP (or another custom map type you may have created).

The order of initialization is now more strict. As part of the update I tried to make the center and zoom more efficient by calculating the bounding box while adding the points to the map. However, the new API requires that the map position and zoom be set before anything else is done, so I have reverted that change. The code is still in there, but it is commented out for now.

Get it here…

Leave a comment

Your email address will not be published. Required fields are marked *


3 thoughts on “Google Maps API version 2

  • Andreas Schwenk

    This is a great idea. I is exactly what i was looking for to visualize our walking trips and include some geotagged photos. I already use on my site. Since you are also using wordpress it would be great to include this as a wordpress plugin. There is already a geo plugin and a geo mashup plugin for wordpress, it would be an idea to extend them to include an gpx track and show that within wordpress.

  • Jeremy Cherfas

    Did anything happen to the idea of a WordPress plugin to display KML files in Google Earth or Google Maps on a WordPress blog post? I have KML files with photographs embedded from flickr, and I would love to include the map in my posts.



  • Phil Ingle

    I have to add that it would be great if this could be made into a wordpress plugin. I have played with the Geo Mashup plugin by Dylan Kuhn and the Inline Google Maps plugin by Mikehail Kornienko but neither offer the features of yours