I want to change the default styles for vector layers in my Leaflet version 0.7.2. I can't find anything about that in in the documentation, so I made this hack:
map.on('layeradd', function(e){ if(typeof e.layer.setStyle === 'function'){ e.layer.setStyle(myApp.Map.Styles['default']); }});I don't find that a sustainable way of setting a default style, since I may sometimes want e.g. to overrule the default style or some other scenario.
Any suggestions?
أكثر...
map.on('layeradd', function(e){ if(typeof e.layer.setStyle === 'function'){ e.layer.setStyle(myApp.Map.Styles['default']); }});I don't find that a sustainable way of setting a default style, since I may sometimes want e.g. to overrule the default style or some other scenario.
Any suggestions?
أكثر...