AnimatedMarker.js; Rotating the animated marker

346 views
Skip to first unread message

Geet Kumar

unread,
Jun 16, 2015, 5:11:57 PM6/16/15
to leafl...@googlegroups.com
I am trying to add the functionality to create a rotated animated marker. My code is attached (I extended the AnimatedMarker.js src).

When I initialize a new animatedMarker with an angle, the marker remains unchanged.: 

add_animated_marker = function(tpls) {
  var a_marker, poly;
  poly = tpls[0][1];
  a_marker = L.animatedMarker(poly.getLatLngs(), {
    icon: carIcon,
    angle: 90,
    onEnd: function() {
      var rest;
      map.removeLayer(this);
      rest = tpls.slice(1);
      if (rest.length > 0) {
        add_animated_marker(rest);
      }
    }
  });
  map.addLayer(a_marker);
};

I have noticed that the transform attribute is not being updated (or is getting overwritten). Any ideas on what I am missing?

Thanks!


AnimatedMarker.js

Iván Sánchez Ortega

unread,
Jun 18, 2015, 7:46:26 AM6/18/15
to leafl...@googlegroups.com
On Tuesday, 16 June 2015 23:11:57 UTC+2, Geet Kumar wrote:
I have noticed that the transform attribute is not being updated (or is getting overwritten). Any ideas on what I am missing?

Markers cannot (yet) be rotated. See https://github.com/Leaflet/Leaflet/issues/143
 
Reply all
Reply to author
Forward
0 new messages