Thursday, April 27, 2006

MGeocoder: A Geocoding Google Maps API Extention

location based services

The Google Maps API lacks a Geocoder. This extension integrates free geocoders (for non-commercial use) directly into Google Maps.
Click the "Geocode" button in the map above to search for US addresses, or International cities.
How: Adding a geocoder to your Google Map is as simple as the following Javascript.
For version 1..

..and version 2..

Download: A proxy is required to work around browser security. A simple proxy in php is available here. Rename to proxy.php and place in the same directory as your GMap application. The javascript GMaps v1, and GMaps v2.
License: Use of the MGeocoder class requires compliance with Terms of Use of geocoder.us and brainoff.com/geocoder. Check with these services before deploying MGeocoder!
Contact: I am reachable at [mikel_maron yahoo com]. My weblog.
Todos (help welcome!):
Make the button look better. Maybe subclass GMapTypeControl
Option to add marker when location is navigated to.
Generally more control over what happens when location is found. Callback mechanism.
better error messages
allow MGeocoder to be called from form external to map

No comments: