Using the L.esri.Cluster.featureLayer
plugin for Leaflet to cluster features from Esri does not call the style
method despite the documentation stating that this is the way to style vector layers.
Docs: https://esri.github.io/esri-leaflet/api-reference/layers/cluster-feature-layer.html
Options has a style
method like the one for vanilla Leaflet feature layers. L.esri.featureLayer does use the style
option properly, but the cluster version does not appear to be doing this - or I am doing something wrong.
Sample code:
var bikePaths = L.esri.Cluster.featureLayer({
url: 'https://services.arcgis.com/uCXeTVveQzP4IIcx/ArcGIS/rest/services/Bike_Routes/FeatureServer/0',
onEachFeature: function(feature, layer)
{
// this works - called for each feature
},
pointToLayer: function (feature, latlng)
{
// this works - called for each point feature
},
style: function (feature, layer)
{
// never called - despite having linear and polygon features
// the linear and polygon features do show up fine.
// they don't cluster, but that's to be expected (they are vectors)
// wth documentation?
},
}).addTo(map)
Anybody have a solution for this?