How do you know when a source is done loading from a url? #2401
Unanswered
togakangaroo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am passing a url to my source data to fetch and display a potentially large geojson file. After it is done loading and rendering I want to fit my map to the data.
The issue I'm running into is that no event seems to be reliable. I get multiple
dataloading
anddata
andsourcedata
events as I pan and zoom, not just when I query new data. Yes, I am checkingsourceId
and the loading status and that it is not for metadata. At least some of the events received as I move around the map are the same as some of the events I receive after a data source load are indistinguishable from the events I receive as I pan and move. I know there aren't multiple requests being sent out on the network though.The thing is that there isn't enough documentation either here or in mapbox to really understand if this is intentional or unexpected behavior. It seems to be so vested in the use case of either passing. in your geojson directly or using tilesets that other options are really left unclear.
Beta Was this translation helpful? Give feedback.
All reactions