Hacker News new | ask | show | jobs
by twelvechairs 1827 days ago
Im curious as to integration with DeckGL which seems to be the emerging standard for 3d maps and also for interactivity. Do you know if maplibre will work the same with it as mapboxgl does?
2 comments

Yes. deck.gl has two ways of interfacing with Mapbox GL, either where deck.gl is a layer on top of Mapbox GL (with a separate WebGL context) or by sharing the same WebGL context. Sharing the same WebGL context allows e.g. Mapbox's 3D buildings to "pop" above deck.gl or to put Mapbox's labels above deck.gl layers. Those docs are here [0].

Either way, the recommended way of connecting deck.gl with Mapbox is through React Map GL. Those docs describe how to use Maplibre GL here [1] and here [2].

[0]: https://deck.gl/docs/get-started/using-with-map#using-deckgl...

[1]: https://visgl.github.io/react-map-gl/docs/get-started/mapbox...

[2]: https://visgl.github.io/react-map-gl/docs/get-started/get-st...

> Either way, the recommended way of connecting deck.gl with Mapbox is through React Map GL.

I should note this is only the recommended way when you're using React

I'm not sure as to specifics (as I haven't tried this), but if DeckGL worked with 1.x Mapbox GL JS, it should just work with MapLibre, with a few potential minor adjustments (e.g., nomenclature). Can't promise it though.
I can verify this: I upgraded my Deck.gl project from MapBox to MapLibre recently, and it was a simple matter of renaming some imports.

This works absolutely seamlessly.

I'm using Vue instead of the React integration and that's also working without any issues.