gpt4 book ai didi

javascript - 如何在 Google Maps API Javascript 中按城市获取 GPOINT

转载 作者:行者123 更新时间:2023-11-30 18:42:48 24 4
gpt4 key购买 nike

我有字符串 - “Moscow”。

如何从我的字符串中获取 Gpoint(坐标)?

我需要关于 new GPoint(30.3112,59.99322); 的结果

最佳答案

好吧,v2 API 表示 GPoint does not represent地球上的地理坐标点,但 GLatLng 确实如此。

要获取坐标,您需要使用 geocoding :

geocoder = new GClientGeocoder();
geocoder.getLatLng("Moscow", function(point)
{
if (point == null)
{
// nothing found
}
else
{
// point is an instance of GLatLng with coordinates you need
}
});

关于javascript - 如何在 Google Maps API Javascript 中按城市获取 GPOINT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6370530/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com