-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Allow users to pre-load and pre-render specific scenes #4047
Comments
Thanks @andrewharvey 😄 This is a duplicate of #2470. Let's focus discussion there. |
Awesome, sorry for not finding that. The one thing that isn't covered by this is actually pre-rendering the GeoJSON source on top of the pre-loaded tiles, which would also be useful. Thanks so much @lucaswoj |
@pwilczynski WebGL doesn't really have a concept of pre-rendering. Every frame is rendered from scratch. The expensive preprocessing is done as part of the tile "loading" flow mentioned in #2470 |
OK, that makes sense - thanks for the response. Sometimes, the client side rendering of a map with a lot of GeoJSON elements on it is a few seconds, and so I was just looking for a way to improve the drawing speed, but prefetching tiles and sending more of our features to the BE behind an MVT server might be the right way to do this... |
@pwilczynski If you spread your GeoJSON features to several sources, you will get better performance 🙆♂️ |
Motivation
We are in the process of building a lightweight GIS application on top of Mapbox GL JS. Often, users want to have a dynamic and interactive experience similar to what Mapbox GL JS currently supports. However, after doing work, users often want to provide a geospatial presentation which starts at a high zoom level then zooms into a couple of key locations to provide additional context. The end product is often something that looks quite similar to this New York Times feature about island building in the South China Sea.
Currently, jumping from viewport to viewport is a relatively clunky process for two main reasons:
These two issues cause us to have a fairly clunky presentation mode where jumping from viewport to viewport doesn't feel snappy.
I could imagine this feature also being useful for generating thumbnails from a given map or for maps where the data doesn't span the entire world and users tend to jump from city to city versus panning across entire oceans.
Design Alternatives
If Mapbox GL JS doesn't do anything we will likely start by warming the tile cache manually and then proceed to either:
I think that providing a list of future viewports (and possibly paths, though that is obviously a lot harder) to pre-render would be a huge benefit to our users.
Implementation
I think that we'd probably start by using methods in
source_cache.js
to pre-cache future tiles, and then evaluate other options.The text was updated successfully, but these errors were encountered: