Skip to content

Conversation

@mistercrunch
Copy link
Member

Somehow this PR #34017 reverted a bunch of stuff from #33603 , guessing this was a badly resolved merge conflict and people missed in around review/merge

…ke "tile-providers" more configurable (#33603)

Co-authored-by: Maxime Beauchemin <[email protected]>
@github-actions github-actions bot added doc Namespace | Anything related to documentation plugins dependencies:npm packages labels Jul 15, 2025
@dosubot dosubot bot added risk:breaking-change Issues or PRs that will introduce breaking changes viz:charts:deck.gl Related to deck.gl charts labels Jul 15, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Functionality Incomplete Warning About Configuration Override ▹ view 🧠 Not in scope
Functionality Incorrect Configuration Key for OSM Tiles ▹ view 🧠 Not in standard
Functionality Missing Default Value for Map Tiles Configuration ▹ view 🧠 Not in scope
Documentation Improper Sentence Structure ▹ view 🧠 Not in scope
Readability Unclear Documentation Grammar ▹ view 🧠 Not in standard
Readability Unclear Parameter Name Abbreviation ▹ view 🧠 Incorrect
Design Incorrect CORS Origin Format ▹ view 🧠 Not in scope
Functionality Props Mutation in Tile Layer Addition ▹ view 🧠 Not in scope
Readability Hard-to-Parse Conditional Logic ▹ view 🧠 Not in scope
Security Unvalidated Tile Source URL ▹ view 🧠 Incorrect
Files scanned
File Path Reviewed
superset-frontend/packages/superset-ui-core/src/validator/validateMapboxStylesUrl.ts
superset/examples/misc_dashboard.py
docs/docs/configuration/map-tiles.mdx
superset/examples/long_lat.py
superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx
superset-frontend/plugins/legacy-preset-chart-deckgl/src/utils.ts
superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx
superset/views/base.py
superset/examples/deck.py
superset/config.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X


# Map tiles

Superset uses OSM and Mapbox tiles by default. OSM is free but you still need setting your MAPBOX_API_KEY if you want to use mapbox maps.

This comment was marked as resolved.

const layers = useCallback(() => {
if (
(props.mapStyle?.startsWith(TILE_LAYER_PREFIX) ||
OSM_LAYER_KEYWORDS.some(tilek => props.mapStyle?.includes(tilek))) &&

This comment was marked as resolved.

Comment on lines +54 to +60
CORS_OPTIONS: dict[Any, Any] = {
"origins": [
"https://tile.openstreetmap.org",
"https://tile.osm.ch",
"https://your_personal_url/{z}/{x}/{y}.png",
]
}

This comment was marked as resolved.

Comment on lines +13 to +14
Map tiles can be set with `DECKGL_BASE_MAP` in your `superset_config.py` or `superset_config_docker.py`
For adding your own map tiles, you can use the following format.

This comment was marked as resolved.

Comment on lines +44 to +46
:::warning
Setting `DECKGL_BASE_MAP` overwrite default values
:::

This comment was marked as resolved.

"all_columns_x": "LON",
"all_columns_y": "LAT",
"mapbox_style": "mapbox://styles/mapbox/light-v9",
"mapbox_style": "https://tile.openstreetmap.org/{z}/{x}/{y}.png",

This comment was marked as resolved.

"d3_format": conf.get("D3_FORMAT"),
"d3_time_format": conf.get("D3_TIME_FORMAT"),
"currencies": conf.get("CURRENCIES"),
"deckgl_tiles": conf.get("DECKGL_BASE_MAP"),

This comment was marked as resolved.

Comment on lines +118 to +123
props.layers.unshift(
buildTileLayer(
(props.mapStyle ?? '').replace(TILE_LAYER_PREFIX, ''),
'tile-layer',
),
);

This comment was marked as resolved.

Comment on lines +111 to +117
if (
(props.mapStyle?.startsWith(TILE_LAYER_PREFIX) ||
OSM_LAYER_KEYWORDS.some(tilek => props.mapStyle?.includes(tilek))) &&
props.layers.some(
l => typeof l !== 'function' && l?.id === 'tile-layer',
) === false
) {

This comment was marked as resolved.

Comment on lines +224 to +246
export function buildTileLayer(url: string, id: string) {
interface TileLayerProps {
id: string;
data: string;
minZoom: number;
maxZoom: number;
tileSize: number;
renderSubLayers: (props: any) => (BitmapLayer | PathLayer)[];
}

interface RenderSubLayerProps {
tile: {
bbox: GeoBoundingBox;
};
data: any;
}

return new TileLayer({
data: url,
id,
minZoom: 0,
maxZoom: 19,
tileSize: 256,

This comment was marked as resolved.

@michael-s-molina michael-s-molina added the review:checkpoint Last PR reviewed during the daily review standup label Jul 15, 2025
@plavacquery
Copy link
Contributor

@mistercrunch I have somehow fixed the problem when printing deckgl map
I added on root package.json

    "@luma.gl/constants": "^9.1.9",
    "@luma.gl/core": "^9.1.9",
    "@luma.gl/engine": "^9.1.9",
    "@luma.gl/shadertools": "^9.1.9",
    "@luma.gl/webgl": "^9.1.9",
    "deck.gl": "^9.1.13",

and also set deckgl library version in folder legacy-preset-chart-deckg to 9.1.3,
and then regenerated package-lock.json

@plavacquery
Copy link
Contributor

plavacquery commented Jul 16, 2025

@mistercrunch Is it possible to get access to this PR, so I can contribute for fixing ?

@mistercrunch
Copy link
Member Author

@mistercrunch Is it possible to get access to this PR, so I can contribute for fixing ?

Unfortunately I can't give you access to the ASF (apache) org, there's a complex process to do this and it's managed by the ASF, but you can open a new PR from your fork, happy to close this one in favor of yours.

Can also try to put in your suggested fix in package.json real quick. Giving it a quick shot but don't want to block you if you want to open a new PR.

@mistercrunch
Copy link
Member Author

I added on root package.json

Seems this belongs in superset-frontend/plugins/legacy-preset-chart-deckgl/package.json, and probably better to use the sub-packages of deck-gl to specify exactly what we need (unless that's causing the problem).

I'll push my interpretation of your fix to see if it works ... Feel free to fork but make sure to add deck.gl libs in the plugin not the main app...

"@deck.gl/core": "^9.0.37",
"@deck.gl/layers": "^9.0.38",
"@deck.gl/react": "^9.1.4",
"@deck.gl/aggregation-layers": "^9.1.13",
Copy link
Member Author

Choose a reason for hiding this comment

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

@plavacquery trying your suggested fix (upgraded to 9.1.13) while keeping the sub-packages, and adding luma.gl deps explicitely

@mistercrunch
Copy link
Member Author

Tried a few things locally and bumped into dep hell, passing the baton as I can't take this on RN. @plavacquery please open a new PR from your fork if you can. Still hoping we can push forward.

@mistercrunch
Copy link
Member Author

Oh, this didn't work locally but seems to work on CI, the hypothesis around getting node_modules/ tangled up seems right, broke locally but PR / CI is working from a clean slate. Might be easy to fix the couple unit tests failing here. Could be related to the lib upgrade.

@mistercrunch
Copy link
Member Author

Seems to be pointing around webpack / mapbox / es6 support...

@Josee-xav
Copy link

Josee-xav commented Jul 22, 2025

I was struggling to get openstreetmaps to be default view to work with the pip superset version by changing settings but it just wouldnt work. Your github changes made getting openstreetmaps to work perfectly without much trouble.

If anyone is struggling to get it to work the only thing i needed to do is:

#32187
cd superset-frontend/
npm install -f --no-optional --global webpack webpack-cli
npm install -f --no-optional
npm install -f --global webpack webpack-cli
npm install -f
npm run dev
cd ..

.
edit- latest version of superset still uses mapbox! absolutely ridiculous.
.
for future self or other people. to get the OSM working i had to git clone
https://github.com/plavacquery/superset/tree/config-map-tiles2

that specific one as the config-map-tiles sql lab didnt work so well and then follow
https://superset.apache.org/docs/contributing/development/
flask server

@mistercrunch
Copy link
Member Author

Another PR tackled this, closing

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

Labels

dependencies:npm doc Namespace | Anything related to documentation packages plugins risk:breaking-change Issues or PRs that will introduce breaking changes size/L viz:charts:deck.gl Related to deck.gl charts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants