Html instead of google maps image

Is it possible to display HTML instead of an image as a Google Maps marker?

What's the best way to do this? I believe that something like an invisible marker and a custom info window can play a role in achieving this

+3


source to share


2 answers


You can use the class OverlayView

to create custom overlays with html elements - https://developers.google.com/maps/documentation/javascript/overlays#CustomOverlays



Simple example - http://jsfiddle.net/BCr2B/

+4


source


You can check it out: https://github.com/jonyt/gmaps-div-overlay



DivOverlay is a very simple HTML container that will appear above the Google Map at any position. All it does is calculate fields from the map, so all of its content is inside the map. Take a look at the demo. The constructor takes 3 arguments: HTML container, map to attach, and overlay position. DivOverlay only has two functions: show () and hide (). It should be clear.

0


source







All Articles