简体   繁体   中英

How to create something in between a marker and infowindow with googlemaps api

I need to create markers for my map that contain html. After looking at lots of tutorials, it seems like markers are made of an image, and do not allow html to be added.

InfoWindows half solve my problem, I know I can add multiple instances of them, but my problem is I need to be able to stylize them, and I don't want close buttons on them.

Can anyone advize me as to the best approach to take.

I am currently thinking I have three options:

  1. edit markers so they can contain html.
  2. edit infowindows so they look like i want and dont have a close button.
  3. create something seperate, and try and tie its location to the map dynamically.

Any advice would be greatfully recieved.

Would something like the ELabel work for you?. It's implemented like this:

var label = new ELabel(new GLatLng(44.3,-78.8), "Your HTML String", "styleName");
map.addOverlay(label);

And here's the example .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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