javascript - How to get place Name of location from google.maps.Geocoder()? -


i want name of location google geocoder(). have draggeble marker on map, when dragend marker, position of marker following code. geocodeposition(marker.getposition());

i able address of location, how name of location, if drage marker on known building white house, should give name of location white house.

 var geocoder = new google.maps.geocoder();       function geocodeposition(pos){          geocoder.geocode({             latlng: pos          }, function(responses){             if (responses && responses.length >0){               $scope.address=responses[0].formatted_address;               $scope.name=responses[0].address_components[0].long_name;             } else{               $scope.address='cannot determine address @ location';             }          });       } 

the geocoder translating postal addresses coordinates. reverse geocoder reverse (translates coordinates addresses).

if need name of place (or if want include name of place along address), need use places library


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -