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.

setWhere callback is not called

See original GitHub issue

Changing the where condition on a newly created layer doesn’t let the callback to be executed.

var layer = L.esri.featureLayer({
    url: "link",
    where: "1=1",
});
layer.addTo(map);
layer.setWhere("1=2", function(){
    console.log("callback called");
});

The callback is correctly executed if the setWhere is executed after a few seconds.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jwasilgeocommented, Aug 9, 2019

I’ve been able to see this happening, too, at esri-leaflet v2.2.3, described more or less the by the title of #780. One way to repro (and thanks for the idea, @gavinr) is to slow down network traffic speeds with the browser dev tools.

  1. Navigate to this sample page: https://esri.github.io/esri-leaflet/examples/querying-feature-layers-1.html
  2. Dev tools --> network tab --> throttle to a slower speed
  3. Refresh the sample page
  4. Choose a new bus direction where clause filter as soon as you can and before the feature layer is fully loaded and ready
  5. Although it may be hard to see with point icon markers, the state of the layer is a bit off and you may see both all (1=1) and the filtered subset of features
0reactions
jwasilgeocommented, Jun 29, 2020

I think this had to do with network request race conditions prior to v2.4.0. Let’s be sure to look at this issue while investigating #1196.

Read more comments on GitHub >

github_iconTop Results From Across the Web

setWhere callback is not called · Issue #132 - GitHub
While the callback is correctly executed if the setWhere is executed after a few seconds. Looking at the code, this seems to happen...
Read more >
Callback function "is not defined" - javascript - Stack Overflow
The JSONP/callback system all depends on your code having already defined the callbackFunctionName function, so there's something to be called.
Read more >
Failed to fetch from ssh://<repo_url>: authentication required ...
Failed to fetch from ssh://<repo_url>: authentication required but no callback set. When I try "Fetch from origin" on a branch, ...
Read more >
Oraclize callback is not called with more data in it
When I try to add functionality inside of callback, callback is not called, but when I delete functionality callback works without problem.
Read more >
setwhere on the mboset got by relationship does not work - IBM
Here userinfo can be obtained from multiple ways from MXServer or from MboSet. this will not require a call to reset(). attribute =...
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