question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`removefeature` not triggered when moving map

See original GitHub issue
  • Browser and version: Chrome 54
  • Version of Leaflet (L.version): 0.7.7
  • Version of esri Leaflet (L.esri.VERSION): 1.0.4

Steps to reproduce the error:

  1. Add a ESRI feature map
  2. Move to a position where you are sure you have a polygon marker on the map
  3. Now move away from this position so the polygon marker out of view from the map

What happens is [X]. Nothing happens

I was expecting [Y]. A removefeature-event to be triggered when the feature moves out of view from the map

(if possible, create a jsbin that demonstrates the problem)

  • Optional: I’m not using the CDN, I’m loading/bundling the library using:

webpack, browserify, RequireJS?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
patrickarltcommented, Dec 2, 2016

@kt-weyert If you want your list to display ONLY features on the map use FeatureLayer#forEach:

function updateList () {
  layer.forEach(function (layer) {
    if (map.hasLayer(layer)) {
      // this layer is shown on the map, note the layer MIGHT still outside the map bounds
    }
  });
}

map.on('moveend', updateList); // update the list whenever the map finishes moving
layer.on('loadend', updateList); // updat the list after we load new features
0reactions
weyertcommented, Dec 5, 2016

Cool, thank you! I have gotten a step closer now! And that’s fantastic 💃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to remove feature in OpenLayers 3
In terms of what I see in the console, everything looks good. But the problem is that the feature is not removed from...
Read more >
Remove selected feature Openlayers 3
I'm using openlayers 3 to create web application that allow to user to draw LineString features in the map.
Read more >
OpenLayers v7.2.2 API - Class: Map
If this is not defined, a map with no layers will be rendered. ... after the map is moved. movestart (MapEvent) - Triggered...
Read more >
"Harvest Resource vs Remove Feature" or "Instant Boost vs ...
Remove Feature : A builder can use a charge to remove a terrain feature to ... (henceforth called “long-term benefit”), or should you...
Read more >
Data Layer | Maps JavaScript API
NOTE: This uses cross-domain XHR, and may not work on older browsers. ... This function will be called each time a feature's properties...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found