-
Notifications
You must be signed in to change notification settings - Fork 15.2k
feat(deckgl): add support for OpenStreetMap as our new default and make "tile-providers" more configurable #33603
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
base: master
Are you sure you want to change the base?
Changes from all commits
3df24f3
fe59791
cd1db20
f9fd7d5
ced3e6f
5b9fce0
098e41f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
title: Map Tiles | ||
sidebar_position: 12 | ||
version: 1 | ||
--- | ||
|
||
# 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. | ||
|
||
## Setting map tiles | ||
|
||
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. | ||
|
||
```python | ||
DECKGL_BASE_MAP = [ | ||
['tile://https://your_personal_url/{z}/{x}/{y}.png', 'MyTile'] | ||
] | ||
``` | ||
Openstreetmap tiles url can be added without prefix. | ||
```python | ||
DECKGL_BASE_MAP = [ | ||
['https://c.tile.openstreetmap.org/{z}/{x}/{y}.png', 'OpenStreetMap'] | ||
] | ||
``` | ||
|
||
Default values are: | ||
```python | ||
DECKGL_BASE_MAP = [ | ||
['https://tile.openstreetmap.org/{z}/{x}/{y}.png', 'Streets (OSM)'], | ||
['https://tile.osm.ch/osm-swiss-style/{z}/{x}/{y}.png', 'Topography (OSM)'], | ||
['mapbox://styles/mapbox/streets-v9', 'Streets'], | ||
['mapbox://styles/mapbox/dark-v9', 'Dark'], | ||
['mapbox://styles/mapbox/light-v9', 'Light'], | ||
['mapbox://styles/mapbox/satellite-streets-v9', 'Satellite Streets'], | ||
['mapbox://styles/mapbox/satellite-v9', 'Satellite'], | ||
['mapbox://styles/mapbox/outdoors-v9', 'Outdoors'], | ||
] | ||
``` | ||
|
||
It is possible to set only mapbox by removing osm tiles and other way around. | ||
|
||
:::warning | ||
Setting `DECKGL_BASE_MAP` overwrite default values | ||
::: | ||
|
||
After defining your map tiles, set them in these variables: | ||
- `CORS_OPTIONS` | ||
- `connect-src` of `TALISMAN_CONFIG` and `TALISMAN_CONFIG_DEV` variables. | ||
|
||
```python | ||
ENABLE_CORS = True | ||
CORS_OPTIONS: dict[Any, Any] = { | ||
"origins": [ | ||
"https://tile.openstreetmap.org", | ||
"https://tile.osm.ch", | ||
"https://your_personal_url/{z}/{x}/{y}.png", | ||
] | ||
} | ||
|
||
. | ||
. | ||
|
||
TALISMAN_CONFIG = { | ||
"content_security_policy": { | ||
... | ||
"connect-src": [ | ||
"'self'", | ||
"https://api.mapbox.com", | ||
"https://events.mapbox.com", | ||
"https://tile.openstreetmap.org", | ||
"https://tile.osm.ch", | ||
"https://your_personal_url/{z}/{x}/{y}.png", | ||
], | ||
... | ||
} | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,7 @@ flask==2.3.3 | |
# flask-babel | ||
# flask-caching | ||
# flask-compress | ||
# flask-cors | ||
# flask-jwt-extended | ||
# flask-limiter | ||
# flask-login | ||
|
@@ -126,6 +127,8 @@ flask-caching==2.3.1 | |
# via apache-superset (pyproject.toml) | ||
flask-compress==1.17 | ||
# via apache-superset (pyproject.toml) | ||
flask-cors==4.0.2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, wondering if you added this manually? This is not self-evident, but this file is supposed to be compiled by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm trying to clarify how it should be done here -> #33714 In you case I think adding a line for |
||
# via apache-superset (pyproject.toml) | ||
flask-jwt-extended==4.7.1 | ||
# via flask-appbuilder | ||
flask-limiter==3.12 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! A+ for change-management here!