从链接Google Map API中提取坐标

发布于 2025-02-12 10:50:15 字数 414 浏览 1 评论 0原文

有什么方法可以使用这种类型的Google Map链接来检索纬度和经度?

https://goo.gl/maps/7jnqztpa5cjfa5cjf333k7

不是指的是iD正确吗?我真的很努力地使用这种链接来提取纬度和经度。如果有人能给我一个主意,真的很感谢您的帮助。否则检索位置ID也可能对我有所帮助,因此我可以使用这样的链接以JSON格式检索响应。

https://maps.googleapis.com/maps/api/geocode/json?place_id=7jNqZtPa5Cjf333k7&key=YOUR_API_KEY

Is there any way to retrieve latitude and longitude using this type of google map link?

https://goo.gl/maps/7jNqZtPa5Cjf333k7

In this URL 7jNqZtPa5Cjf333k7 is not referring to place id right? I'm really struggling to extract latitude and longitude using this type of link. Really appreciate your help if somebody can give me an idea. Or else retrieving the place id also can be a help for me so I can use the link like this to retrieve the response in a JSON format.

https://maps.googleapis.com/maps/api/geocode/json?place_id=7jNqZtPa5Cjf333k7&key=YOUR_API_KEY

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

败给现实 2025-02-19 10:50:15

如果不遵循重定向,就无法解码它。

该链接重定向到:
https://www.google.com/maps/place/kandanawatta,+sri++lanka/@6.8391224,80.0308563,17Z/dat a =!3M1!4B1!4M5!3M4!1S0X3AE2523FF96D8ABF:0X4A6D8D4B68830686!8M2!3D6.8391224!4D80.0308563?

要解码该链接中的信息,请参见相关问题:

时间和经度该链接是:

8m2!3d6.8391224!4d80.0308563
6.8391224,80.0308563

对于Sri Lanka的Kandanawatta,Google Places API返回:

Kandanawatta, Sri Lanka (6.837274799999999, 80.0325338)

这不是完全同样,很难说为什么不知道您从哪里获得“缩短” URL。

开头的坐标(跟随 @):

6.8391224,80.0308563,17z

是地图的中心和变焦级别,不一定是原始请求中的位置

There is no way to decode it without following the redirection.

That link redirects to:
https://www.google.com/maps/place/Kandanawatta,+Sri+Lanka/@6.8391224,80.0308563,17z/data=!3m1!4b1!4m5!3m4!1s0x3ae2523ff96d8abf:0x4a6d8d4b68830686!8m2!3d6.8391224!4d80.0308563?hl=en-US

To decode the information in that link, see related questions:

The latitude and longitude for the location in that link is:

8m2!3d6.8391224!4d80.0308563
6.8391224,80.0308563

For Kandanawatta, Sri Lanka, the Google Places API returns:

Kandanawatta, Sri Lanka (6.837274799999999, 80.0325338)

Which is not quite the same, hard to say why without knowing where you got the "shortened" URL from.

The coordinates at the beginning (following the @):

6.8391224,80.0308563,17z

Are the center and zoom level of the map, not necessarily the location in the original request

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文