Skip to content

Conversation

@fxprunayre
Copy link

SUMMARY

In the DeckGL map plugin we can only select a Mapbox style from the predefined list or typing a new Mapbox style URL.

This change add support for tile server layer making use of Deck.gl TileLayer. The well known OpenStreeMap layer provided by https://[abc].tile.openstreetmap.org/{z}/{x}/{y}.png is added to the list making easier for users not having a Mapbox account to have a background layer on map charts.

It has been tested with other tile server URL

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Choose Mapbox, Openstreetmap or use a custom mapbox or tile URL

image

OSM background layer

image

image

TESTING INSTRUCTIONS

Select the OpenStreetMap background layer or paste a tile server URL eg. tile://https://tile.osm.ch/name-it/{z}/{x}/{y}.png, tile://https://c.tile.openstreetmap.org/{z}/{x}/{y}.png

ADDITIONAL INFORMATION

  • Has associated issue: Add tile layer (XYZ) support in deck.gl maps #27475
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@john-bodley john-bodley requested a review from villebro March 12, 2024 17:20
@fxprunayre fxprunayre force-pushed the feat-chart-map-tile-server-support branch from 2aec87e to bd9f8d1 Compare March 14, 2024 15:03
In the DeckGL map plugin we can only select a Mapbox style from the [predefined list](https://github.com/apache/superset/blob/2499a1cf5a7f298c1ee2f34b3d67ca1d18bb7457/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.jsx#L373-L380) or [typing a new Mapbox style URL](apache#26031).

This change add support for tile server layer making use of Deck.gl [TileLayer](https://deck.gl/docs/api-reference/geo-layers/tile-layer).
The well known OpenStreeMap layer provided by https://[abc].tile.openstreetmap.org/{z}/{x}/{y}.png is added to the list making easier for users not having a Mapbox account to have a background layer on map charts.

It has been tested with other tile server URL eg. tile://https://tile.osm.ch/name-it/{z}/{x}/{y}.png
@fxprunayre fxprunayre force-pushed the feat-chart-map-tile-server-support branch from bd9f8d1 to 55e122c Compare March 14, 2024 15:08
@fxprunayre
Copy link
Author

When running npm run type, I still see some issues

plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx:108:11 - error TS2345: Argument of type 'TileLayer<any, { data: string; minZoom: 0; maxZoom: 19; tileSize: 256; renderSubLayers: (props: any) => BitmapLayer<{ data: undefined; image: any; bounds: [number, number, number, number]; }>[]; }>' is not assignable to parameter of type 'Layer<{}> | (() => Layer<{}>)'.

TileLayer extends CompositeLayer. Superset codebase is quite new to me, so any guidance appreciated.

@datasc24
Copy link

Hello ! Any update on this PR ?

@rusackas
Copy link
Member

Relates to a SIP where we want to move from MapBox to MapLibre:
#28356

@rusackas
Copy link
Member

Closing and reopening to kickstart CI.

@rusackas rusackas closed this Oct 30, 2024
@rusackas rusackas reopened this Oct 30, 2024
@rusackas rusackas requested a review from kgabryje October 30, 2024 18:20
@rusackas
Copy link
Member

Maybe @Mattc1221 would be interested in reviewing this!

@datasc24
Copy link

datasc24 commented Nov 4, 2024

Tank you @rusackas ! And thank you in advance @Mattc1221 !

@rusackas
Copy link
Member

rusackas commented Nov 4, 2024

Looks like the frontend build is failing CI, but I'm re-running it in case we get lucky.

@lum4chi
Copy link

lum4chi commented Mar 13, 2025

Hello, is this feature still in progress? It seems missing just the last mile. I've read about a mapbox switch to maplibre, but meanwhile this feature will be very valuable! I'm really not into frontend dev, but willing to help if someone can provide additional info on the failing pipeline step.

@lum4chi
Copy link

lum4chi commented Mar 19, 2025

I managed to get this feature works with just 2 additional changes to superset/config.py:

  1. Enabling CORS and adding openstreetmap as origin:
# CORS Options
ENABLE_CORS = True
CORS_OPTIONS: dict[Any, Any] = {
    "origins": [
        "https://c.tile.openstreetmap.org",
    ]
}
  1. Appending openstreetmap also in TALISMAN_CONFIG (both prod and dev config)
"connect-src": [
      "'self'",
      "https://api.mapbox.com",
      "https://events.mapbox.com",
      "https://c.tile.openstreetmap.org",
  ],

Can be these the cause of the failing pipeline?

Anyway, thanks @fxprunayre for your work!

@heyromnivan
Copy link

Looks like there's a newer PR with pretty much the same functionality #32867

@fxprunayre
Copy link
Author

Done in #34204

@fxprunayre fxprunayre closed this Oct 16, 2025
@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.36%. Comparing base (2a5b5fe) to head (55e122c).
⚠️ Report is 3063 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #27476   +/-   ##
=======================================
  Coverage   67.36%   67.36%           
=======================================
  Files        1909     1909           
  Lines       74678    74676    -2     
  Branches     8325     8324    -1     
=======================================
- Hits        50309    50308    -1     
+ Misses      22318    22317    -1     
  Partials     2051     2051           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants