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); } }); } Quote Link to comment Share on other sites More sharing options...
Wolphie Posted March 15, 2010 Share Posted March 15, 2010 This should be in the JavaScript forum. Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.