diff --git a/README.md b/README.md index 62d5e444a98c0b9abb23fe408edbf2afa643c22f..cedb1f3f58c1e08a47994c3541dd1eeb2f75b270 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,22 @@ -# Leaflet.Marker.rotate +# Leaflet Marker rotate This is a plugin for [Leaflet](http://leafletjs.com/). It allows Markers (map icons) to be rotated using a CSS transform. Rotation is set in degrees. It is based on comments by users coomsie and runanet on [Leaflet/issues/386](https://github.com/Leaflet/Leaflet/issues/386). + +Features include an `iconAngle` marker option, and a `setIconAngle()` marker method. + +## Usage + +To set a marker's initial rotation: + + var myMarker = L.marker(lat, lon, { + icon: L.icon(iconOptions), + iconAngle: 90, // Rotate 90 degrees clockwise. + }); + +To rotate an existing marker: + + myMarker.setIconAngle(180); // Rotate 180 degrees. \ No newline at end of file