naeemqaswar
11/14/2016 - 10:43 AM

Get location lat and lng from Zipcode

Get location lat and lng from Zipcode

var geocoder = new google.maps.Geocoder();
geocoder.geocode({address: /* zip you got from user input */},
    function(results_array, status) { 
        // Check status and do whatever you want with what you get back
        // in the results_array variable if it is OK.
        var lat = results_array[0].geometry.location.lat();
        var lng = results_array[0].geometry.location.lng();
});