I am using a divIcon (an svg) for markers given to a point layer from a geoJSON for a map built with Leaflet/Mapbox. I can set the (initial) icon size with a css class, but if I try to set the divicon size using the options given by Leaflet, they seem to be ignored.In the case below, the icon will be sized according to the height and width in the css class:
var divIcon = L.divIcon({ iconSize:new L.Point(12, 12), iconAnchor: new L.Point(12, 12), popupAnchor: new L.Point(0, -12), html: ''});If I remove the css class, the icon size seems to be derived from the 'viewbox' property in the svg markup (given in the index page of the app:
......I would prefer to use the options. I need to resize the icon dynamically on different zoom levels (I have tried doing this with css set by JQuery for the icon, but this results in a 2nd set of icons that are disconnected from the original layer..it's odd. and I haven't figured out a workaround)
أكثر...
var divIcon = L.divIcon({ iconSize:new L.Point(12, 12), iconAnchor: new L.Point(12, 12), popupAnchor: new L.Point(0, -12), html: ''});If I remove the css class, the icon size seems to be derived from the 'viewbox' property in the svg markup (given in the index page of the app:
......I would prefer to use the options. I need to resize the icon dynamically on different zoom levels (I have tried doing this with css set by JQuery for the icon, but this results in a 2nd set of icons that are disconnected from the original layer..it's odd. and I haven't figured out a workaround)
أكثر...