geocoding accuracy
Hi
I am trying to display a map that zooms in to street level if
geolocation returns a point from a valid street address. If it can't
find the street level address it should display a map at of the
overall town.
The problem I have is that geolocation still retuns a point if an
invalid street address is used...
Any idea's??? My code is below:-
Thanks
Asa
function initialize(){
if(GBrowserIsCompatible()){
map = new GMap2(document.getElementById('map_canvas'));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
geocoder = new GClientGeocoder();
var address = "<?php echo $room['street_name'].', '.
$room['location']; ?>, UK";
alert(address);
geocoder.getLatLng(address, function(point){
if(point){
alert('got point: ' + address + point);
map.setCenter(point, 16);
}else{
var address = "<?php echo $room['location']; ?>";
geocoder.getLatLng(
address,
function(point){
if(!point){
var address = "<?php echo $room['location']; ?>";
point;
}
map.setCenter(point, 10);
}
);
}
});
}
}
--
You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home