简体   繁体   English

如何在Google Maps Pin上放置文本标签?

[英]How do I put a text label on a google maps pin?

Google maps has changed their maps url parameters recently. Google地图最近更改了其地图网址参数。 There is a great rundown of how they work right here . 他们在这里的工作方式简直糟透了。

I have a line of JavaScript that constructs a google maps URL and adds a label to the map. 我有一行JavaScript,可构造一个Google Maps URL并在地图上添加标签。 The old URL was: 旧网址为:

https://www.google.com/maps?q=37.350544,-121.897047+(User+was+here+on+07/02/2015+at+10:15+AM) https://www.google.com/maps?q=37.350544,-121.897047+(User+was+here+on+07/02/2015+at+10:15+AM)

The text under the pin is what is between the parenthesis after the latitude and longitude. 图钉下方的文字是经度和括号之间的括号。 This URL however, no longer works. 但是,此URL不再起作用。 I have exhausted every resource I know of. 我已经用尽了所有我知道的资源。 Including google documentation. 包括Google文档。

I would like to know how to add text to a google maps by putting that text in the URL. 我想知道如何通过将文本放在URL中来向Google地图添加文本。 Thank you. 谢谢。

There doesn't seem to be a way to pass text to the url that I can see right now with the new URL. 似乎没有一种方法可以将文本传递到使用新URL现在可以看到的URL。 I will try and work this API into or program. 我将尝试将此API应用于程序或将其编程。 If anyone else needs to do this, google maps has an API that will allow text and the marker. 如果其他人需要执行此操作,则Google Maps具有一个允许文本和标记的API。

https://github.com/googlemaps/js-map-label https://github.com/googlemaps/js-map-label

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM