This example shows DOM Marker with SVG icon which rotates every second by 45 degrees.

Code

The DOM node provided in constructor of H.map.DomIcon is cloned and rendered every time a DOM marker reaches (is visible within) the map view port. Therefore all manipulation has to be done in onAtach callback where the currently displayed clone reference is available. The API manipulates position of rendered DOM element (e.g. when panning the map, zooming the map, etc.) by changing the transform CSS property of the clonedElement. Therefore in order to rotate DOM icon, we need to manipulate its child node transform CSS property (in our case SVG node).