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.
source share