Google map api v3: can I use a div instead of an image to create a custom icon?

google map api v3: can i use a div instead of an image to create a custom icon?

I want to be able to attach a marker and change the icon, ven betetr, if I could use fade fx ... so how can I set a div instead of an image, what is the default?

+4
source share
2 answers

First, I give a demo website .

On this question, I found several similar questions that I have already answered, for example:

(following the theory)

HTML / CSS markers using the Google Maps Javascript v3 APIs

(next to implementation)

How to create a custom google map marker

In the first answer, I explained in detail why custom icons and markers should be implemented by extending the overlayView class. In the second answer, I wrote how to write HTML / CSS to specify what a single user icon / marker looks like. Of course, you can also write event handlers to add JS logic to your icon / marker.

When overflowing the stack, I found some interesting points. When I found similar questions, I cannot answer the question using my previous answer. One content manager even deletes my answer, although what I answer here is definitely asking a question.

Finally, if you need to see how to extend the overlayView class to implement a single marker, see this source code (starting below comment //====custom-marker management starts )

Thanks.

0
source

Source: https://habr.com/ru/post/1337540/


All Articles