Speed improvements, custom cursors & geocoder updates

Thursday, July 20, 2006 at 11:57:00 PM

Revision 2.59 of the Maps API v2 includes four cool new features, brought to you by Bo Majewski, Rob Schonberger and Doug Ricket:

  • Significant speed improvements in removeOverlay() and clearOverlays(). As promised, we've made removing overlays much faster. According to our tests, removing 100 markers now takes 1.5 seconds instead of 18 seconds in Internet Explorer, and 0.5 seconds instead of 8 seconds in Firefox. See for yourself. Next up, we're working on making addOverlay() faster.

  • Custom mouse cursors. We've introduced new GMapOptions that allow you to set custom mouse cursors for the map. For example, if you prefer a pointer cursor (instead of the hand cursor) but want a crosshair cursor for when the map is being dragged, initialize the map using this call: var map = new GMap2(document.getElementById("mapelement"), {draggableCursor: 'crosshair', draggingCursor: 'pointer'});. We've also added GDraggableObject, which lets you set custom cursors for any draggable object, such as the slider in the zoom control and the overview map.

  • Accuracy in the geocoder response. As requested by many developers, we've modified the geocoder to include information about how accurately the address could be geocoded. Look for the Accuracy attribute in the response, which will be one of the following nine values:

    Value Description
    0 Unknown location.
    1 Country level accuracy.
    2 Region (state, province, prefecture, etc.) level accuracy.
    3 Sub-region (county, municipality, etc.) level accuracy.
    4 Town (city, village) level accuracy.
    5 Post code (zip code) level accuracy.
    6 Street level accuracy.
    7 Intersection level accuracy.
    8 Address level accuracy.

    For example, the geocoder returns 7 (intersection level accuracy) for the address "Haight and Ashbury St, San Francisco" and 4 (town level accuracy) for "New York City".

  • Simple geocoder response. If you want to save bandwidth by downloading a smaller geocode response and don't need fancy features like multiple results or pretty formatting, we now offer a simpler output type for batch geocoding -- comma-separated values. Simply set your output parameter to csv and you'll get a response in the following form: 200,6,42.730070,-73.690570. The first number is the GGeoStatusCode, the second number is the Accuracy, the third number is the latitude and the fourth number is the longitude.

For more information on these features, please see the documentation.

API v1 Current: 1.31
API v1 Default: 1.31
API v2 Current: 2.59
API v2 Default: 2.58

Zoooooooom!

Tuesday, July 11, 2006 at 11:18:00 AM

Today we're enabling some new zoom features on Google Maps. We're making these features available to API v2 users as well, so please test them out and send us your feedback!

  • Double-click to zoom. Instead of double-clicking to recenter the map, we now support left double-clicking to recenter and zoom in one level, and right double-clicking to zoom out one level. This can be enabled or disabled by calling enableDoubleClickZoom() or disableDoubleClickZoom() from a GMap2 instance. By default, double-click to zoom is disabled for API sites, since navigation in some API applications relies on the old behavior.

  • Continuous zoom. For users of Firefox and Internet Explorer on Windows, we provide a smooth, continuous zoom animation when you zoom in one level. We turn off overlays during the zoom animation, so this may not be suitable for all API sites. To enable or disable continuous zoom, call enableContinuousZoom() or disableContinuousZoom() from a GMap2 instance. By default, continuous zoom is off.

For more details on zooming, please see the documentation. Don't forget to let us know what you think via the Maps API discussion forum.

Happy zooming!

Revision 2.58 of API v2

Friday, July 07, 2006 at 4:00:00 PM

This week we are releasing revision 2.58 of the Google Maps API v2. Since we neglected to write a blog post for revision 2.57, here's a summary of all the changes since 2.56.

Massive update to our satellite imagery. According to our calculations, we've increased our high-resolution global coverage by 4x, meaning Google Maps now covers 20% of the earth's landmass and 1/3 of the world's population. Here are some cool examples of international destinations that you can see in great detail:

The "hand" cursor over a map. We know this feature has attracted some controversy on the discussion forum. However, it may surprise readers of this blog to learn that some Google Maps users never realize that they can drag the map. The new "hand" icon is our effort to make this feature more discoverable -- it helps users realize that they can grab the map and move it around. For developers who want the pointer cursor back, we plan to add a method in the API so you can do that. We'll keep you posted.

Fixed JSON formatting for the geocoder. Several developers reported that their JSON parsers could not accept key names without quotation marks. We added the missing quotation marks to our JSON geocoder response.

Fixed API key validation for geocoder. It was noted in this thread that the API key validation used by the geocoder is different from the validation used for the maps. This has been fixed.

API v1 Current: 1.31
API v1 Default: 1.31
API v2 Current: 2.58
API v2 Default: 2.57