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