Created
November 12, 2013 13:48
-
-
Save Tobur/7431086 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var geocoder = new google.maps.Geocoder(); | |
geocoder.geocode({"address":$('#'+settings.findInputId).val()}, function(results, status) { | |
if (status == google.maps.GeocoderStatus.OK) { | |
var lat = results[0].geometry.location.lat(), | |
lng = results[0].geometry.location.lng(), | |
placeName = results[0].address_components[0].long_name, | |
latlng = new google.maps.LatLng(lat, lng); | |
marker.setPosition(latlng); | |
infowindow.setContent(placeName); | |
infowindow.open(self.map, marker); | |
console.info(results); | |
//$("#"+settings.findInputId).val(addressText); | |
//self.data = {'address': results[0].address_components, 'geometry':results[0].geometry}; | |
//executeSearch(self.data); | |
} else { | |
self.showError(Translator.get('select.from.drop.down.list')); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment