Hi,
I need to show uk map (single marker) using postcode. When I use
postcode the map is not accurate. Position of the marker is different
from that using latitude and longitude. If I pass latitude and
longitude the map is correct. I need to use postcode for showing the
map. Could any one help me to solve this issue?
This is the code i'm using:
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(51.5, -0.1166667), 13);
geocoder = new GClientGeocoder();
mapAddress(postcode, address);
}
function mapAddress(postcode,address)
{
if (geocoder) {
geocoder.getLatLng(
postcode,
function(point)
{
if (!point) {
// alert(postcode + " not found");
}
else {
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
map.enableScrollWheelZoom();
GEvent.addListener(marker,"mouseover", function() {
// marker.openInfoWindowHtml(address);
}
);
}
}
);
}
}
For example I pass poscode as 'HA8 6LD'. The map so obtained is
different from the map obtained using latitude and longitude of
postcode (51.60873644,-0.28139464). Could some one please correct this
code so that I can use postcode for showing the map?
Thanks,
sare
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---