How can I show a custom DIV element on a google map as a marker?

后端 未结 1 1330
没有蜡笔的小新
没有蜡笔的小新 2021-02-09 23:54

I want to be able to show a custom DIV element on a Google Map (V3 API) as a marker but it only seems to allow images to be used instead. Is there any way around this using the

1条回答
  •  情深已故
    2021-02-10 00:47

    Here's an excellent little library: RichMarker. Its documentation is here.

    You can use the content property of the json object passed to the constructor like this:

    var marker = new RichMarker({
          position: yourLatLng,
          map: yourMap,
          content: '
    initial content
    ' });

    And later change the content with the setContent method:

    marker.setContent('
    new content
    ');

    0 讨论(0)
提交回复
热议问题