如何找到位置名称(纬度/经度)? [英] How to find name of place given location (latitude/longitude)?.

查看:88
本文介绍了如何找到位置名称(纬度/经度)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如何使用谷歌地图获取正确的地名?



地理编码谷歌地图的服务仅提供近似名称,

即点''(8.55941666666667,76.8800266666667)''是Dimensions Logisoft



在谷歌地图中。但是通过使用地理编码返回长名称为Technopark Rd。



code,

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,

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..

推荐答案

你可以通过裁判以下网址来获得这个想法

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


这篇关于如何找到位置名称(纬度/经度)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆