The most up to date code is found in marker-resize-svg.js located at the github repo. Currently tested with Leaflet v0.7.7 & v1.0.0-rc.1.
View the example on a separate page here.
<script src="/path/to/marker-resize-svg.js"></script>
var myIcon = L.icon({
iconUrl: 'StatementFloodOutlineHaloed.svg',
iconSizeArray: // Three zoomed sizes of the SVG
[
[32, 32], [96, 96], [256, 256]
],
iconAnchorArray: // The corresponding anchor points
[
[16, 32], [48, 96], [128, 256]
]
})
Params:
All standard L.Icon params are available, simply
append 'Array' and provide an array of 3 objects.
Required option is icon, an instance of L.Icon like ours above.
L.autoResizeMarkerSVG([42.486, -71.236], {icon: myIcon).addTo(mymap);