I'm trying to style a GeoJSON based on a layer's classification by classes. I'm trying to do it using the method of the greaterThan type filters etc ... This would be more or less how I'd like to classify the GeoJSON.
I did the following, initially, I wanted to test with just one interval to see if it worked.
//style
var individuals = new ol.style.Style({
symbolizers: [
new ol.style.Stroke({color: '#000000', width: 1}),
new ol.style.Fill({color: '#ff0000'})
],
filter:ol.format.filter.greaterThan(
ol.format.filter.GreaterThanOrEqualTo('individuals', '0'),
ol.format.filter.LessThanOrEqualTo('individuals', '500')
)
});
//vecLayer
var vectorDistribution = new ol.source.Vector({
url: 'data/distribution.json',
projection: 'EPSG:4326',
format: new ol.format.GeoJSON(),
});
var distribution = new ol.layer.Vector({
name: 'Distribution',
source: vectorDistribution,
visible:true,
displayInLayerSwitcher: false,
style: individuo,
maxZoom:7,
//minResolution: 200,
//maxResolution: 2000,
});
Well, it does not symbolize, Someone did something similar and can help me.