Is it possible to pass options into a
var circle = new L.Circle({LatLng}, {radius}, { fillPattern: stripes({spaceColor: '#FFFF00'}), fillOpacity: 1.0}); circle.addTo(_map);
I'd like to do this so I can declare the pattern once, but pass through a background color for different map features in geojson, something like this:
var features = new L.GeoJSON.AJAX("/my_features",{
onEachFeature: onEachFeature,
style: function (feature) {
style = feature.properties && feature.properties.style ;
if (feature.properties.pattern == 'stripes'){
style.fillPattern = stripes({spaceColor: feature.properties.style['fillColor']});
}
return style;
},
pointToLayer: pointToLayer
}).addTo(map);
Is it possible to pass options into a
var circle = new L.Circle({LatLng}, {radius}, { fillPattern: stripes({spaceColor: '#FFFF00'}), fillOpacity: 1.0}); circle.addTo(_map);
I'd like to do this so I can declare the pattern once, but pass through a background color for different map features in geojson, something like this: