Skip to main content
100%

Leaflet rotated marker example

✓ Published0🌍 Public
TThomasG77
Last edited Oct 28, 2021
Created on Oct 28, 2021

This example displays a bus route in Málaga as a GeoJSON LineString on a Leaflet map, with red leaf icons at each recorded stop. The code uses the Leaflet rotatedMarker plugin to rotate each marker according to a `rotation` property array, visualizing the bus's changing heading over time. It loads the map with `L.map` and an OpenStreetMap tile layer, then iterates through the feature coordinates to place custom icons whose rotation angles are set via `rotationAngle`. The plugin overrides `_setPos` and `_applyRotation` to apply CSS transforms for rotation.

AI-generated description

Similar vizzes