我正在尝试使用google maps api获取地址的经度和纬度,但我不知道该怎么做?这是我正在尝试的一个例子:
GoogleObjectAdress("New york") -> and it should return the longitude and latitude for me!
任何解决方案?
答案 0 :(得分:1)
请尝试以下代码:
<script src="http://maps.google.com/maps?file=api&v=2.x&key=YourApiKey"
type="text/javascript"></script>
var geocoder = new GClientGeocoder();
geocoder.getLatLng("New York", function(point) {
//code
});
有关详情,请参阅documentation。