Gary
asked on
Google Maps
I'm using the following to get a Google map based on the address but it has stopped working - 204 No Content is returned (404)
Has anything changed in the past month?
Has anything changed in the past month?
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false"></script>
function initialize() {
if($("#address1").val()!="" && $("#city").val()!="" && $('[name="country"]').val()!=""){
map = new google.maps.Map(document.getElementById('map_canvas'), {
mapTypeId: google.maps.MapTypeId.ROADMAP
});
mapGeo = new google.maps.Geocoder();
mapGeo.geocode({'address': 'Europe'}, function (results, status) {
var ne = results[0].geometry.viewport.getNorthEast();
var sw = results[0].geometry.viewport.getSouthWest();
map.fitBounds(results[0].geometry.viewport);
});
codeAddress()
}
else{
alert("Please enter your street address, city and country on the Property Details tab")
}
}
ASKER
Exact same code as I have except I had map.checkResize() at the end
Removing this and now it works again. I think this was a remnant from when the map was created even though it wasn't visible
Removing this and now it works again. I think this was a remnant from when the map was created even though it wasn't visible
ASKER
Ahh that is why i need map.checkResize(), because if you leave the tab and come back to it, maybe because of a change of address then it doesn't resize the map correctly - so it's not solved
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Solved myself
I have a working mock up using the code you provided, plus my version of the codeAddress function.
Open in new window