Google Maps JavaScript V3 Api将标记放置在div上 [英] Google Maps JavaScript V3 Api place div on marker
问题描述
我觉得很奇怪,之前没有人需要这个(我认为这是因为我没有找到关于这个主题的任何内容......)。
无论如何,我想在地图上放一个div而不是标记。这可能吗?我之前在Actionscript中这样做过: markerOptions.icon = new customDisplayObject();
您可以给标记提供一些选项并为其定义一个DisplayObject。所以我现在想要的是,我可以把:
< p
DIV>
< p>一些文字。< / p>
< / div>
而不是地图上的标记。
感谢!
您的假设是错误的,您可能会创建一个可能包含HTML标记的自定义覆盖。 >
编辑:替换旧链接: Google Developers:Overlay
I find it strange that no one needed this before (I assume this, because I didn't find anything about this subject ...).
Anyways, I want to put a div instead of a marker on a map. Is this possible? I did that before in Actionscript like this: markerOptions.icon = new customDisplayObject();
You were able to give some options to the marker and define a DisplayObject to it.
So what I want now is that I can put:
<div>
<p>Some text.</p>
</div>
instead of a marker on the map.
Thanks!
Your assumption is wrong, you may create a custom overlay which may contain HTML-markup.
Start your research at OverlayView
edit: replaced old link: Google Developers: Overlay
Sample that draws a custom image on a map
这篇关于Google Maps JavaScript V3 Api将标记放置在div上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!