keplergl / kepler.gl

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
http://kepler.gl
MIT License
10.3k stars 1.73k forks source link

Integrate an existing MapBox/MapLibre instance #2247

Open alvarolozano opened 1 year ago

alvarolozano commented 1 year ago

I'm currently developing an advanced visualization app which uses MapLibre as base. I'm using my self hosted layers and some advanced user interactions built by me.

Kepler has a powerful editor and advanced visualizations (arc maps). It would be great to add kepler layers to an existing Mapbox/Maplibre instance.

DeckGL currently offers a way to achieve that, but Kepler does not actually export visualizations to DeckGL JSON format.

chrisgervang commented 4 months ago

It sounds like you're interested in changing how the basemap in Kepler is implemented. Kepler has a component injection feature in the framework which allows you to redefine how components are implemented. It also has an extensible redux store that allows you to set custom state, such as different map styles.

Example to inject custom map styles https://github.com/keplergl/kepler.gl/blob/master/examples/custom-map-style/src/store.ts

MapContainerFactory https://github.com/keplergl/kepler.gl/blob/master/src/components/src/map-container.tsx

Check out the custom factories in this example and implement CustomMapContainer by starting with a copy of the one implemented in Kepler.

Example of how to inject a custom component https://github.com/keplergl/kepler.gl/blob/master/examples/replace-component/src/app.js