2

I have a feature layer that I am trying to toggle on / off via click. The problem I am having is that if I toggle the layer on and then off, it does not update to the screen unless I zoom in / out and the screen refreshes.

Is there any way around this?

The toggle is in the upper right corner "Markers".

This example does not work with IE 11 for some reason.

https://plnkr.co/fjPvS5AVBSIztzRxNfVV


I just discovered the refresh() method.


This does not work in all my scenarios, however. When I perform a query, the search results are added via a separate layer and zoomed to bounds. If the feature layer is already visible, it works as expected. But if I activate the layer after the search has taken place, the layer does not show unless I zoom in / out. If I can not figure this out, I will add a query to the plunker.


You can see this behaviour in the current plunker .

  1. Turn off the feature layer.
  2. Zoom the map either in or out.
  3. Turn on the feature layer, no features will appear.
  4. Zoom in or out and the features will appear.

Is there maybe an event or something I am missing?

closed as off-topic by PolyGeo Feb 5 '18 at 21:19

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

1

i can reproduce the behavior and this looks to be a bug in leaflet-virtual-grid 1.0.3. based on my own testing, the problem is resolved in the master branch of the library.

i'll tag 1.0.4 shortly and ensure that the dependency is rolled into our next release of esri-leaflet on the cdn in the coming days. we already needed to push something out to fix that stupid IE bug anyway.

it's a bit of work, but you're also welcome to clone the library down to your own machine and npm link the dependency if you want to compile a fixed build of esri-leaflet yourself now.

  • Thanks John, I will give npm link a try just to become familiar but I can wait a few days. I do have a question that is tangentially related. I was initially using a dynamic map layer (which automatically returned symbology) instead of a feature layer, but try as I might, I could not dynamically bind a popup to the dynamic layer point data; polygon and polyline worked fine. Should I not use a dynamic layer for this use case? I can pose this as a new question and create a plunker if it is merited. Thanks – joffreyj Apr 22 '16 at 11:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.