Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time filtering for FeatureLayer does not persist when zooming or panning map #1156

Closed
pjbiogit opened this issue Jul 8, 2019 · 3 comments
Closed

Comments

@pjbiogit
Copy link
Contributor

pjbiogit commented Jul 8, 2019

  • Browser and version: Chrome Version 75.0.3770.100

  • Version of Leaflet (L.version): 1.3.4

  • Version of esri Leaflet (L.esri.VERSION): 2.0.8

Description:

I am creating a time-based layerGroup with several feature layers from https://wildfire.cr.usgs.gov/arcgis/rest/services/geomac_dyn/MapServer. Whenever the date range is updated by the user I want to only show features within that time range based on datetime properties of the features themselves. Upon adding the layer and changing date ranges the features loaded properly, but when zooming or panning on the map, all features in a given feature layer would then be added to the map. The images below show what the view looked like before and after zooming.
I found in my testing that the createLayers function did not check to see if the feature was within the set time range. By slightly altering the code to match the if statement later in the same function I was able to get the layers to function as I wanted.

wildfireLayerPreZoom
wildfireLayerPostZoom

image

@pjbiogit
Copy link
Contributor Author

I hadn't realized before, but I also added the same code into the if statement of the addLayers function of the Feature Management Methods to get the featureLayers to function properly. Basically just adding a check for the time range before any feature is added to the map.

@jgravois
Copy link
Contributor

do you think you could open a pull request with your suggested fix?

@gavinr
Copy link
Contributor

gavinr commented Jul 15, 2019

addressed in #1157

@gavinr gavinr closed this as completed Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants