Type a location in the text box below and click the button to geocode and display it on the map.
Geocoding data was loaded from the following URL. Note the use of the 'oe' parameter in the query string to select UTF-8 encoded responses.
http://maps.google.com/maps/geo?output=xml&key=API-KEY-HERE&oe=utf-8&q=10+Downing+Street%2C+London
which returned the following XML:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0"><Response>
<name>10 Downing Street, London</name>
<Status>
<code>200</code>
<request>geocode</request>
</Status>
<Placemark id="p1">
<address>10 Downing St, Westminster, London SW1A 2, UK</address>
<AddressDetails xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" Accuracy="8"><Country><CountryNameCode>GB</CountryNameCode><CountryName>UK</CountryName><AdministrativeArea><AdministrativeAreaName>Greater London</AdministrativeAreaName><SubAdministrativeArea><SubAdministrativeAreaName>Westminster</SubAdministrativeAreaName><Locality><LocalityName>London</LocalityName><Thoroughfare><ThoroughfareName>10 Downing St</ThoroughfareName></Thoroughfare><PostalCode><PostalCodeNumber>SW1A 2</PostalCodeNumber></PostalCode></Locality></SubAdministrativeArea></AdministrativeArea></Country></AddressDetails>
<ExtendedData>
<LatLonBox north="51.5063289" south="51.5000337" east="-0.1232689" west="-0.1295642"/>
</ExtendedData>
<Point><coordinates>-0.1264161,51.5031857,0</coordinates></Point>
</Placemark>
</Response></kml>
The above map is generated like this:
// Setup map
var map = new google.maps.Map2(document.getElementById('map'));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
//map.setMapType(G_HYBRID_MAP);
var point = new google.maps.LatLng(51.5031857, -0.1264161)
map.setCenter(point, 14);
// Add marker
var marker = new GMarker(point);
var info = "<strong>10 Downing Street, London</strong><br />Latitude: 51.5031857<br />Longitude: -0.1264161<br />";
map.addOverlay(marker);
marker.openInfoWindowHtml(info);
GEvent.addListener(marker, 'click', function(){
marker.openInfoWindowHtml(info);
});