Enables scaling of the marker icons in Leaflet
Compatible with versions 0.7.* and 1.* of Leaflet. Doesn't work on IE < 9.
npm install leaflet-scalemarker
L.marker([52.229833, 21.011723], {
scalingVector: 1.5
}).addTo(map);
It simply extends the L.Marker
class with two new options:
Option | Type | Default | Description |
---|---|---|---|
scalingVector |
Number or String |
1 | Scaling vector as a scale CSS rule. |
scalingOrigin |
String |
'center bottom' |
The scaling center, as a transform-origin CSS rule. |
and two new methods:
Method | Returns | Description |
---|---|---|
setScalingVector(vector) |
this |
Sets the scaling vector value. |
setScalingOrigin(origin) |
this |
Sets the scaling origin value. |
The default scalingOrigin
value will rotate around the bottom center point, corresponding to the "tip" of the marker for most commonly used icons. If your marker icon has no tip, or you want to rotate around its center, use center center
.