从链接Google Map API中提取坐标
有什么方法可以使用这种类型的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果不遵循重定向,就无法解码它。
该链接重定向到:
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?
要解码该链接中的信息,请参见相关问题:
时间和经度该链接是:
对于Sri Lanka的Kandanawatta,Google Places API返回:
这不是完全同样,很难说为什么不知道您从哪里获得“缩短” URL。
开头的坐标(跟随 @):
是地图的中心和变焦级别,不一定是原始请求中的位置
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:
For Kandanawatta, Sri Lanka, the Google Places API returns:
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 @):
Are the center and zoom level of the map, not necessarily the location in the original request