Created
December 29, 2010 00:38
-
-
Save pilate/757964 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
centerMapOnCity: function() { | |
var that = this; | |
this.deleteOverlays(); | |
var entered_city = $("post_location_name").value; | |
if(entered_city) { | |
var city = "", state = "", country = ""; | |
this.geocoder.geocode( { 'address': entered_city}, function(results, status) { | |
if (status == google.maps.GeocoderStatus.OK) { | |
var latlng = results[0].geometry.location; | |
general_location = that.getGeneralLocation('address', results); | |
if (general_location != null) { | |
$("post_location_name").value = general_location; | |
zoom = 10; | |
map.setCenter(latlng); | |
map.setZoom(10); | |
$('general_location').innerHTML = general_location; // set the label for the address field | |
Posts.toggleAddress(); | |
} else { | |
alert("Please enter a more specific location, like a city name."); | |
} | |
} else { | |
alert("Couldn't find that location, try again!"); | |
} | |
}); | |
} | |
setTimeout(checkCanSubmit, 200); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment