Click here to Skip to main content
15,885,869 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
Hi,

how to get the correct place name using google map?

the geocode service of google map only provide the approximate name,
that is, the point '(8.55941666666667, 76.8800266666667)' is Dimensions Logisoft

in google map.but by using geocode return the long name as Technopark Rd.

code,
JavaScript
function getCountry(latLng) {
    geocoder.geocode( {'latLng': latLng},
      function(results, status) {
        if(status == google.maps.GeocoderStatus.OK) {
          if(results[0]) {
            for(var i = 0; i < results[0].address_components.length; i++) {
              if(results[0].address_components[i].types[0] == "country") {
                alert(results[0].address_components[i].long_name);
              }
            }
          }
          else {
            alert("No results");
          }
        }
        else {
          alert("Status: " + status);
        }
      }
    );
  }


have any idea?


Thanks..
Posted
v2
Comments
Member 9581488 11-Dec-12 14:12pm    
Not sure but refer the following link
http://stackoverflow.com/questions/8366610/google-maps-js-api-find-name-of-place-given-location-latitude-longitude
hasbina 11-Dec-12 23:00pm    
the same thing..
jisha1111 12-Mar-13 0:30am    
using gridview to display time table in asp.net

1 solution

You can get the idea by refereeing following URL
https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900