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.
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 .
- Turn off the feature layer.
- Zoom the map either in or out.
- Turn on the feature layer, no features will appear.
- Zoom in or out and the features will appear.
Is there maybe an event or something I am missing?