Esri / esri-leaflet-cluster

Plugin for Esri Leaflet that clusters a Feature Layer using Leaflet.markercluster
http://esri.github.io/esri-leaflet/
Apache License 2.0
23 stars 23 forks source link

Where clause is not always persisting #52

Closed francharbo closed 2 years ago

francharbo commented 2 years ago

When using the clusterlayer with a where clause on a feature layer, the where clause is not always persisted.

This seems like this issue on esri-leaflet : https://github.com/Esri/esri-leaflet/issues/1196

It looks like it should be resolved though.

gavinr commented 2 years ago

Hi, thanks for the report. Can you please post a replication (using jsbin, for example), that shows the issue you're referring to? Thanks!

francharbo commented 2 years ago

Hello,

I'm using esri-leaflet 2.5.1, leaflet 1.7.1, leaflet.markercluster 1.5.3 and esri-leaflet-cluster 2.1.0

However, using that configuration in jsbin i get this error : image

So this will be quite hard to show you. However I can share you some code

   var map = L.map('map').setView([45.526, -122.667], 6);

  L.esri.basemapLayer('Streets').addTo(map);
  const layer = L.esri.Cluster.featureLayer({
    url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0',
    fetchAllfeatures: true
  }).addTo(map);

  layer.setWhere('pop2000 >= 15000')
gavinr commented 2 years ago

Here is a working sample with that code: https://jsbin.com/kapifomovi/edit?html,output

francharbo commented 2 years ago

Thank you for your quick responses !

I may have done something terribly stupid on my side ! I'll look into it and let you know

Update :

Indeed the mistake was in my code. This is working just fine :)