Leaflet addlayer KML file - icon shifts during zoom

19 views
Skip to first unread message

Mathew Thomas

unread,
May 4, 2017, 3:10:30 PM5/4/17
to Leaflet
Hi,
I am adding a new layer on a map, using a kml file with one of the leaflet-plugins. The kml file uses custom icons (16x16 images) for point markers. Everything looks fine when initially loaded. However on zoom, the icons appear to be shifting. Looks like this is a known issue and the recommendation is to use "iconAnchor". I am not sure how to specify this for the entire kml file though, when using the addlayer option.

var track = new L.KML("data/modelcase.kml", { async: true });
view.addLayer(track);

Any help is appreciated.

Thanks,
Mathew
Reply all
Reply to author
Forward
0 new messages