Leaflet.pattern icon indicating copy to clipboard operation
Leaflet.pattern copied to clipboard

individual patterns based on attribute for GeoJSON layer?

Open Beuthmaster opened this issue 4 years ago • 2 comments

Hey there, as far as I know, it is only possible to set only one pattern of a layer containing various features, but I'm looking for a way to have one GeoJSON layer with various patterns based on an attribute? Is there any way to achieve this?

Thanks in advance!

Beuthmaster avatar Aug 05 '21 12:08 Beuthmaster

var circle1 = new L.Circle({LatLng}, {radius}, { fillPattern: stripes, fillOpacity: 1.0});
circle1.addTo(layer);
var circle2 = new L.Circle({LatLng}, {radius}, { fillPattern: dots, fillOpacity: 1.0});
circle2.addTo(layer);

Gjum avatar Aug 05 '21 15:08 Gjum

@Gjum I'm using a GeoJSON layer. You are just styling two different features.

Beuthmaster avatar Aug 10 '21 06:08 Beuthmaster