如何使用“地点ID"直接链接到Google地图上的地点 [英] How do I get a direct link to a place on google maps with the Place Id

查看:146
本文介绍了如何使用“地点ID"直接链接到Google地图上的地点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中在Google地图上有一个地方的地方ID.有没有一种方法可以将地点ID放置在URL中并将其直接链接到页面?还是必须通过URL来完成?

I have the Place Id of a place on google maps in my app. Is there a way to put the place Id in a URL and have it directly link to the page? Or does it have to be done through the URL?

我似乎在文档中找不到任何详细信息.我在下面尝试过,但这只是为我提供了标准的Google地图页面:

I can't seem to find anything detailing this in the docs. I've tried below, but it just gets me the standard google maps page:

https://maps.google.com/maps?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4

推荐答案

最近,2017年5月,Google启动了新的Google Maps URLs API.您可以在官方文档中了解有关此API的信息

Recently, in May 2017, Google launched the new Google Maps URLs API. You can read about this API in the official documentation

https://developers.google.com/maps/documentation/urls/guide

因此,从现在开始,您可以使用地点ID为Google Maps构造一个URL.在您的特定情况下,该网址为

So, from now on you can construct a URL for Google Maps using the place ID. In your particular case this URL will be

https://www.google.com/maps/search/?api = 1& query = Google& query_place_id = ChIJN1t_tDeuEmsRUsoyG83frY4

希望这会有所帮助!

这篇关于如何使用“地点ID"直接链接到Google地图上的地点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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