Closed FazelSaeedi closed 2 years ago
I was able to rotate my markers like so:
const marker = L.marker(latLong, {
icon: L.icon({
iconUrl: 'myIcon.png'.
iconSize: [20, 20],
iconAnchor: [10, 10],
rotationAngle: 45, // Pick your rotation
}),
});
If you want to try to change the angle of a marker after drawing I think you could probably do something like:
const markerCanvas = new L.MarkersCanvas();
let marker = L.marker(latLong, {
icon: L.icon({
iconUrl: 'myIcon.png'.
iconSize: [20, 20],
iconAnchor: [10, 10],
rotationAngle: 45, // Pick your rotation
}),
});
markerCanvas.addMarkers([marker]); // Draw at 45
markerCanvas.removeMarkers([marker]);
let marker = L.marker(latLong, {
icon: L.icon({
iconUrl: 'myIcon.png'.
iconSize: [20, 20],
iconAnchor: [10, 10],
rotationAngle: 90, // Pick your rotation
}),
});
markerCanvas.addMarkers([marker]); // Draw at 90
hi please create an example that can CreateMarker EditsameMarker change angle of marker (use for flight )