Geocode another address

 Geocode

Example Code

Provider specific code is highlighted below.
<!-- HTML Map element - the size must be specified here, or in the CSS -->
<div id="mapstraction" style="width: 400px; height: 400px;"></div>

<!-- Map Provider & Geocoder Javascript includes -->
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAKRwVKGgdK08PzFOkI4mzwBSxwhHJj4F5mVjLsNT2AfMLlpoynxTk5g96WAoVkzIABODCjMST2qhLwg" type="text/javascript"></script>


var mapstraction = new Mapstraction('mapstraction',''google');
mapstraction.setCenterAndZoom(new LatLonPoint(0,0), 1);


function geocode_return(geocoded_location) {

    // display the map centered on a latitude and longitude (Google zoom levels)
    mapstraction.setCenterAndZoom(geocoded_location.point, 15);

    mapstraction.addControls({
        pan: true, 
        zoom: 'small',
        map_type: true 
    });
    // create a marker positioned at a lat/lon 
    geocode_marker = new Marker(geocoded_location.point);

    var address = geocoded_location.street + ", " 
                    + geocoded_location.locality + ", " 
                    + geocoded_location.region;
    geocode_marker.setLabel("A");
    geocode_marker.setInfoBubble(address);

    // display marker 
    mapstraction.addMarker(geocode_marker);

    // open the marker
    geocode_marker.openBubble();
}

// initialise the map with your choice of API
var geocoder = new MapstractionGeocoder(geocode_return, 'google');

var address = new Object();
address.street = "752 Spring Dr.";
address.locality = "Northville";
address.region = "Michigan";
address.country = "US";

geocoder.geocode(address);

function user_submit() {
    var address = new Object();
    address.address = document.getElementById('address').value;
    geocoder.geocode(address);
}
</script> 
            

Information

Demonstrations of v2

Old Demos for v1

Old Specific Provider Demos for v1

  1. FreeEarth
  2. Google
  3. Map24
  4. MapQuest
  5. Microsoft
  6. MultiMap Commercial and OpenAPI
  7. OpenLayers
  8. OpenSpace
  9. OpenStreetMap
  10. ViaMichelin (new)
  11. Yahoo