Skip to content
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

[EPIC] Add Google Maps JS API vector map option to Lonboard #454

Open
4 tasks
ryanbaumann opened this issue Apr 5, 2024 · 3 comments
Open
4 tasks

[EPIC] Add Google Maps JS API vector map option to Lonboard #454

ryanbaumann opened this issue Apr 5, 2024 · 3 comments

Comments

@ryanbaumann
Copy link

ryanbaumann commented Apr 5, 2024

Context

Offer developers the flexibility to choose another map, such as a Google Map JS API map, provided the map SDK supports native Deck.gl layers as the deck.gl and Google Maps Platform JS API does. Supporting additional base map types (such as ESRI / HERE / Google) would expand developer reach and value of the library

Keeping the base map to a vector style is key to maintain UX parity with Lonboard today via MapLibre GL. Support for another base map using ZXY raster tiles as a Maplibre source is a potential option to fulfil this user journey, but it is not the specific proposal I'm making in this issue as raster base map sources would significantly change the UX (e.g. no collision detection, z-layer ordering, etc)

Issue

This would require:

  1. Instantiating the map using Google Maps JS API vs. MapLibre GL JS
  2. Updating any UI bindings tightly coupled to the Maplibre GL e.g. placing legends, map controls, etc on the Map div.
  3. Adding a developer option for the user to bring their own API access key and map id instead of just hard-coded map styles in https://github.com/developmentseed/lonboard/blob/main/lonboard/basemap.py
  4. Other considerations - please add additional details / risks here, looking for feedback!

Acceptance-Criteria

The tasks that need to be completed or artifacts that need to be produced:

  • Determine feasibility and alignment with repo owners
  • Mock up the API design and options, get feedback from repo owners
  • Create PR with map options and updates, tests, release notes
  • Review and merge
@ryanbaumann ryanbaumann changed the title [EPIC] Add Google Maps JS API vector map option [EPIC] Add Google Maps JS API vector map option to Lonboard Apr 5, 2024
@kylebarron
Copy link
Member

Hey Ryan, thanks for the issue.

This chart from the deck docs shows that there are 10 different basemap combinations:
image

It's not clear to me how many of these Lonboard should try to integrate with.

There's been some discussion recently (#442, #437) of whether Lonboard should be less tied to any basemap. In the sense of: to enable things like multiple views and alternate map projections, we don't want to tie ourselves too closely to Maplibre by using MapboxOverlay. But connecting to the Google Maps API ties us to another mast, and it's not clear if it's worth the engineering and maintenance burden at this point.

And then there are the technical questions of actually implementing the integration. I've never used the Google Maps API so it would take time to figure out the integration. And should we load every basemap library for every Python user?

@ryanbaumann
Copy link
Author

ryanbaumann commented Apr 13, 2024

Great discussion @kylebarron. I wasn't aware of some of the limitations of the custom style layer limitations with Deck.gl and MapLibre/Mapbox e.g. projections, some events, etc. I also agree that it's not obvious where Lonboard as a viz framework should draw the line for support with various map rendering SDKs.

It sounds like there's a need to separate concerns between the visualization context of Lonboard viz with other background scenes like a map renderer e.g. Maplibre, Mapbox, Google Maps JS API. An abstraction layer right now doesn't exist that works across Map SDK. and likely would be complicated to support as each flavor of Map Rendering SDK has different developer interfaces.

Given that, I agree that this is bug likely not feasible today to support many vector map SDKs via an abstraction layer.

The workaround that's more feasible and likely "good enough" would be supporting Z/X/Y raster tile sources as a Maplibre raster source for a Lonboard viz base map. That would have downsides as a raster vs. vector map data format, but would provide flexibility for developers that need to reference a specific base map - even for a bespoke use case like a construction job site with totally custom references, as long as their tiles are projected into Web Mercator.

@kylebarron
Copy link
Member

The workaround that's more feasible and likely "good enough" would be supporting Z/X/Y raster tile sources as a Maplibre raster source for a Lonboard viz base map.

This already exists when rendered by deck https://developmentseed.org/lonboard/latest/api/layers/bitmap-tile-layer/

It would be better to use Maplibre in some instances where you want to put the raster below labels. An advanced user can do this themselves by modifying the Maplibre Style JSON

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants