The simple OverlayView extension proposed by giogiga is probably the safest way, but it is clearly not an easy way, because Marker has many built-in elements such as icon, shadow and drag and drop.
It is truly tempting to simply extend the Marker class, but this class is opaque - it does not show its internal functions, for example. you cannot easily access the basic DOM elements that you will need to animate the marker. You could hack something with setPosition , but the result would be something fragile and buggy. Alternatively, you could hack your way into the base DOM nodes, but then yours might be even more fragile.
Thus, it seems that completely re-executing Marker remains the best way.
Reene saarsoo
source share