Leaflet.PolylineDecorator icon indicating copy to clipboard operation
Leaflet.PolylineDecorator copied to clipboard

rotationAngle conflicts with Leaflet.RotatedMarker

Open thammarith opened this issue 5 years ago • 4 comments

I imported this library and your Leaflet.RotatedMarker. When I want to rotate the marker using Leaflet.RotatedMarker, the markers are not rotated properly, e.g., 45 degrees rotates as 90 degrees.

import 'leaflet-polylinedecorator';
import 'leaflet-rotatedmarker';

L.marker([point.lat, point.lon], {
  rotationAngle: point.azm,
}).addTo(this.map));

Is it possible if you would please name the rotationAngle option differently?

thammarith avatar Jun 12 '19 10:06 thammarith

i also met

lucid111 avatar Sep 09 '19 09:09 lucid111

Did you guys fix this? How? We are having the same issue.

jmanghani avatar Oct 28 '19 20:10 jmanghani

Same issue, guys...

Update: Fixed by using only leaflet-polylinedecorator and removing leaflet-rotatedmarker package from project.
This package has all functionality of rotatedmarker

pavloniym avatar Jan 21 '21 12:01 pavloniym

Oh, I forgot that I had opened this issue. What I did for workaround was divide the angle by 2.

What it does (if I recall correcty since I haven't touched this for about a year) is leaflet-polylinedecorator rotates for x degrees then leaflet-rotatedmarker rotates for another x degrees, i.e., it rotates for 90 degrees since it rotates 45 degrees twice.

Since @pavloniym informed that leaflet-polylinedecorator can do that by itself, this workaround isn't needed. Follow what suggested above.

thammarith avatar Jan 21 '21 15:01 thammarith