wmguk Posted March 15, 2010 Share Posted March 15, 2010 Hi Guys, I have a google Maps API installed, So I have a postcode saved in a database, and when you access the account it should show a road map of the postcode. The guy who wrote the code has set it to only show postcodes within London, and any postcodes outside default to the US maps... Any ideas? var geocoder; var map; function initialize() { geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 14, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); } function codeAddress(address) { if (geocoder) { geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); } else { alert("Geocode was not successful for the following reason: " + status); } }); } Link to comment https://forums.phpfreaks.com/topic/195323-google-maps-api/ Share on other sites More sharing options...
Wolphie Posted March 15, 2010 Share Posted March 15, 2010 This should be in the JavaScript forum. Link to comment https://forums.phpfreaks.com/topic/195323-google-maps-api/#findComment-1026419 Share on other sites More sharing options...
wmguk Posted March 15, 2010 Author Share Posted March 15, 2010 Oh sorry, I though as I was drawing out the postcodes etc in PHP I should go here Sorry Link to comment https://forums.phpfreaks.com/topic/195323-google-maps-api/#findComment-1026423 Share on other sites More sharing options...
Wolphie Posted March 15, 2010 Share Posted March 15, 2010 Not a problem, although you didn't mention that you were trying to draw out the postcode using PHP. What is it *exactly* you're trying to do? Link to comment https://forums.phpfreaks.com/topic/195323-google-maps-api/#findComment-1026425 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.