-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix label collisions across sources by combining tiles from different sources #1042
Comments
👍 -- I'm on board with this approach, which I've been calling "client-side compositing". I think eventually we will need to support multiple vector tile sources. The easiest way for someone to throw together a basemap + tiled overlay will be to use one of our default styles and then add their own VT data layer on the fly. |
I was thinking of doing the same thing, so 👍. |
This sounds like a reasonable approach. |
I would like to combine two vector tiles sources (from different servers) to use with mapbox-gl-js. This seems indeed a sensible approach. This is not possible I understand at the moment? Any idea on when this will be implemented? Thanks! |
@musicformellons yeah, this isn't possible at the moment and we're not sure when it will be. This issue will be updated as we make progress on it |
A workaround, if you're using For example, if you set the source URL to
You will get a single source that is a composite of mapbox streets and mapbox terrain. This allows for proper label collision. |
GeoJSON tiles are all created in a single worker. Vector tiles are loaded across all the workers. Placement needs to be done together in the same work. We'll need to move some data between workers (worker1 --> main thread --> worker2). What gets moved? all the raw geometries? just enough to do placement? can it be moved in a transferrable array? could geojsonvt produce actual pbf vector tiles? How do we handle sources with different max zooms? If we have only one vectortile source we can just match the geojson sources with it, but if we have multiple vectortile sources this gets complicated. Do we want to also implement automatic serverside compositing for mapbox sources? How big is the benefit of downloading a single composited tile vs three separate ones? |
I think this already exists! EDIT depending on your definition of automatic -- just realized you probably mean "even if compositing is not explicitly specified in the stylesheet" |
We could reencode to pbf, e.g. https://github.com/anandthakker/vt-pbf does this. Or we could explore my geobuf idea from #1504 #1979. |
👍 Thanks for posting that, work's a charm. |
🆕 ✏️ 👉 #2703 |
Replaced by #2703 |
We don't avoid collisions of labels from different sources. Labels from geojson overlap with labels from vector tiles. We should fix this.
I think we need to combine tiles from different sources. It would wait until both the geojson and vectortile tiles are loaded and do placement on them together. Nothing from the geojson tile would be rendered until the vector tile has loaded. From the rendering perspective, you wouldn't have a separate tile from each source. You would have a single tile with the data from all the sources.
The relationship between the tile pyramid and sources would be inverted. There would be only one pyramid requesting tiles. Each requested tile would then request the data from all the sources. Or something like that.
For example:
Raster tiles would still be completely separate for now.
other notes
@mourner @jfirebaugh @kkaefer
The text was updated successfully, but these errors were encountered: