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

Add a synchronous version of GeoJSONSource#setData #2275

Open
lucaswoj opened this issue Mar 16, 2016 · 3 comments
Open

Add a synchronous version of GeoJSONSource#setData #2275

lucaswoj opened this issue Mar 16, 2016 · 3 comments

Comments

@lucaswoj
Copy link
Contributor

Having a synchronous (main-thread) setData API dovetails nicely with the synchronous queryRenderedFeatures API. I see this API being useful in cases where

  • very small GeoJSON sources need to be updated very quickly for animations
  • users want to know exactly when a setData operation completes

previously implemented in #1979 as skipWorker

@ajfickas
Copy link

ajfickas commented Jan 3, 2018

Any plans or workarounds for this?

I appear to be running into #2776 which this issue would appear to address.

I'm seeing features mysteriously disappear occasionally when zooming out for a GeoJSON source that is updated dynamically as the user repositions the map. Best workaround I have so far is to limit how often setData is called, but so far that means waiting a couple seconds between updates which significantly degrades the user experience.

@jdeboer-geoplan
Copy link

@ajfickas did you get anywhere with your issue? I'm also seeing the same issue as you

  1. call setdata on a geojson source url that takes while to return
  2. call setdata again on the source with a different url.
    The layer displays the second geoJSON and then the first overwrites it when it returns.
    I'm not sure a synchronous version is what I want I think I just want setData to abort any previous operation when it gets called again.

@ajfickas
Copy link

@jdeboer-geoplan My issue went away by upgrading to v0.43.0. However, my use case is was using setData to set a data object not a URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants