Closed mnutt closed 2 years ago
I agree this needs to be taken care of, and the maplibre project seems like the best place to put the effort since it supports the entire "mapbox" suite. Maplibre is still working on phase 1 of the refactoring project, after that they will catch up on things like this and start adding features.
My understanding from looking at mapbox-gl-native's commit history is that besides not wanting to keep up with nan
's upgrades, node support added a bit more complexity in requiring libuv
for the runloop, especially on non-linux platforms.
I've split out the runloop here: https://github.com/maplibre/maplibre-gl-native/compare/master...mnutt:node-14?expand=1 and tested it on linux and mac but I'm just getting familiar with cmake so it's likely not quite right yet.
Yep, I had to debug this for almost 4 hours & ended up setting v10 in the projects .nvmrc
, upgrading to latest node or at least latest LTS is mandatory
If you're just building it for yourself, my branch above should work ok.
This should be completed.
In https://github.com/maptiler/tileserver-gl/pull/602 we upgraded to Maplibre-Native
In https://github.com/maptiler/tileserver-gl/pull/608 I added a separate pool of renderers that are in static mode instead of tile mode, to be used by these static endpoint
Node 10 was end-of-lifed yesterday, and unfortunately one of tileserver-gl's primary dependencies (mapbox-gl-native) only runs on node 10. The mapbox-gl-native node bindings seem to unfortunately be in limbo; the latest releases don't actually seem to build on any node version or platform and only work at all because they rely on downloading binary blobs on npm module install.
I am exploring
@naturalatlas/mapbox-gl-native
, a fork ofmapbox-gl-native
, which also fixes a rendering issue[0] but am noticing a new issue with it: it seems that in newermapbox-gl-native
, usingmode: "tile"
means that only a single tile will be loaded per map render. This means that static requests will often be missing tile data. In adding mbgl logging, I see:I haven't confirmed, but I wouldn't be surprised if this is upstream in
@mapbox/mapbox-gl-native
in unreleased versions too.So it seems that going forward it may not be possible to have a single
Map
that can render both tiles and static maps:mode: "static"
is needed to render static maps with multiple tiles, while rendering tiles continues to needmode: "tile"
to remedy https://github.com/maptiler/tileserver-gl/issues/344.If this is the case, perhaps it would make sense to have separate pools for static and tile. Or maybe there's another better way?
There is also another fork called
@maplibre/maplibre-gl-native
but they don't have newer node support yet. Hopefully they'll either adopt@naturalatlas
's patches, or developn-api
bindings.[0] (rendering issue)
Adding map overlays with image icons basically works, but on some platforms (linux xvfb) the transparency is incorrectly high. Switching from
@mapbox/mapbox-gl-native
to@naturalearth/mapbox-gl-native
fixes it. Example:Map with image marker rendered with canvas on top of map:
Map with same image marker added as layer, using
@mapbox/mapbox-gl-native
: