问题
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!
回答1:
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
来源:https://stackoverflow.com/questions/9433058/google-maps-javascript-v3-api-place-div-on-marker