-
-
Notifications
You must be signed in to change notification settings - Fork 716
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
Single-tile rendering mode #166
Comments
just to add my 2 cents here, AFAIK, https://github.com/maptiler/tileserver-gl has implemented a single tile rendering + tile rasterizer service with these packages. |
If I understand you correctly you are asking if it is possible to produce raster tiles from vector data with maplibre as the rendering engine, right? If this is the case, maybe you can explain further what your use case is? One great thing about vector maps is step-less zooming. Would you want to produce raster tiles for certain zoom levels? |
In my case, I would like to write style in being able to render raster tiles on the fly in the backend using the mapbox-gl-style saves a lot of cartographic work and reduces the tech stack to a minimum while being able to support many different web map components. |
Then |
We've written a proxy server that utilizes dropping the link for the project https://github.com/MapColonies/vector-tiles-rasterizer |
@syncush Interesting. Could you perhaps convert the coordinates of the tile request and the vector tile content so that when |
converting the coordinates to the wanted projection won't result in an image with the requested projection because |
I think I am missing something in this discussion. Basically, this library has one of the best WebGL renderers for vector tiles available, and I'd like to use it in a somewhat "standalone" mode to generate tiles on demand. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
I definitely get your point of having a single tile render. At the moment to get the best performance I have build a service in our app that will select the best performing render based on the clients possible renders. Right now that is eg. Openlayers Native, and Openlayers rendered in offscreen canvas (good performance). Here I would like to add MapLibre since we already use mapbox styles this would be a no brainer to start implementing and we have already made room for it. I see a few ways doing this.
I really like both 1 and 2. |
Hi @vittrup88 and thanks for the thoughts! Just FYI, I have started working on this last month, taking the approach of the Land Technologies renderer, but trying to import current Maplibre code rather than forking. Right now it's still running on a fork, but I'm trying to keep it up to date with the rest of the codebase. See it here: https://github.com/davenquinn/maplibre-gl-js/tree/pluggable-render. It's probably similar to yours! Once I get the fork working OK, I will try to spin this out into a separate module, either making PRs for the necessary hooks into maplibre-gl or directly importing maplibre source code. My goals are pretty similar to yours (not a shock given our aligned approach thus far), except for the Cesium platform. Because I'm working in Cesium, which does not especially care about web mercator, I have taken your option 1 for now. But I'm hoping to get a little lower level and have some hooks into the label rendering, etc. that are obviously not good fits for single-tile rendering but instead require screen-space layout. Eventually this will hopefully lead to a Cesium-based digital globe with an optional visualization/filtering API based on vector tiles. It'll be used at macrostrat.org and other Earth data visualization properties. (Side note, I've already got the LandTech renderer working successfully for a Mars science visualization, see https://dev.macrostrat.org/mars/syrtis-jezero/layers#a=355&e=6&overlays=%2Cgeology&ve=1.5&x=78.051&y=16.047&z=602097.) In short, I think we are moving towards a really great approach and I suggest we team up for a mutually satisfying solution. |
It's great to hear that you guys are working on that! Thanks for sharing. |
Hi @davenquinn that sound really awesome. If I can help in any way I will try to. You already have things rendering like polygon, line and Point I guess on your Cesium Example. Do you have example in your fork or should we make any? Should we keep the discussion here or on your branch? We will clearly make this a plugin when things are running, and we know what exports are needed! |
Hi @HarelM |
I'm not aware of anyone working on offscreen canvas support, but the best place to ask would be slack I think. |
Hi @vittrup88 sorry for the confusion. Right now all of the work to actually use the renderer I have created is happening in another project: https://github.com/davenquinn/cesium-vector-provider. This one includes examples. Apologies are in order, though – I've sort of overloaded that repository currently with several submodules being developed in concert towards a virtual globe...so it is no longer just about a "Cesium vector provider". Consequently, the examples may be complex to get running. The most relevant file is here: https://github.com/davenquinn/cesium-vector-provider/blob/master/src/base.ts I think we will need to decide where to do this work, but a fork or branch of Maplibre seems the most appropriate. |
Adding some updates here: I've gotten this to work a bit better for raster and hillshade layers. It's still quite rough, but the technique shows promise. On the left is Maplibre GL atop Cesium, and on the right is Mapbox GL v2. The Cesium version loads lower-res hillshade tiles than Mapbox and everything is a bit more janky. But it's headed in the right direction I think...code is here |
FYI, I've just done a major clean-up of the code for the There is quite a laundry list of improvements needed for a high-quality implementation of vector maps within Cesium (labels, glyphs, and efficiency/caching harmonization foremost). A major ongoing task will be to stabilize the API links with Maplibre GL and begin to plot what hooks will be needed within the codebase here to make this work sustainably. I'd love to collaborate with @vittrup88 and others interested in implementing Maplibre-based renderers within other mapping stacks, to see if we can find a way to support multiple used cases here. |
Motivation
Mapbox's renderer is the best in the world for vector tiles, and the future of the 1.x series and open API clearly resides with MapLibre. However, there are other open mapping platforms, notably Cesium and Leaflet, that excel at other aspects (namely high-fidelity 3D and lightweight/no-frills mapping). It would be amazing to use the capabilities of the MapLibre renderer in these projects.
For this, I propose a "single-tile" rendering mode for vector tiles. This would allow tiles to be generated from a map style and exported to a canvas or image element for inclusion in other rendering pipelines. This was requested in Mapbox GL JS (mapbox/mapbox-gl-js#4420) but rejected out of hand.
Prior art
Land Technologies created a fork that implements this functionality. This fork has been used successfully in a few contexts (see the vector tiles tracking issue on Cesium JS as well as my recent work at Macrostrat). However, it is out of date, and moving to a MapLibre renderer would provide a strong base for future work (for example, we'd like to figure out how to render labels separately from the basemap) as well as likely increase performance.
Potential issues and limitations
Although I haven't yet delved significantly into the code, this might be a significant and complicated additional API to support, especially if options for partial renders and custom layers are supported. Given that, a potential alternative solution might be to expose hooks within the MapLibre API so that this functionality can be implemented as a wrapping library.
I'm happy to investigate how this could be implemented a bit further; I am also happy to defer to others' expertise. Is this a feasible or desirable API break from mapbox-gl-js?
The text was updated successfully, but these errors were encountered: