Django model to store and serve mapbox base layer config
Project description
Django Mapbox Baselayer
Django application to store, manage and serve map base layers and overlay configurations for MapLibre GL JS and Mapbox GL JS.
This package provides:
- Django models to store base layers and overlay layers configuration
- Admin interface to manage layers
- API endpoints to serve layer configurations as TileJSON
- Support for raster tiles, vector tiles, and Mapbox styles
Getting started
Installation
Install it in your project like any dependency
pip install django-mapbox-baselayer
Usage
Declare django-mapbox-baselayer in the INSTALLED_APPS
# settings.py
INSTALLED_APPS = [
# ... other django apps
"mapbox_baselayer",
]
For Mapbox base layers, you do not need to describe the tiles with the BaseLayerTile object, but an url is mandatory.
For Raster base layers, is it necessary to create a BaseLayerTile for each url (a.tiles.xxx, b.tiles.xxx, etc ...)
Tile size should be 256 for raster and 512 for vector.
Commands
Unified install_layer command
# OSM base layer
./manage.py install_layer osm
./manage.py install_layer osm --order 2
# OpenTopoMap base layer
./manage.py install_layer opentopomap
./manage.py install_layer opentopomap --order 3
# IGN base layers (list available layers)
./manage.py install_layer ign
# IGN base layers (install specific layers)
./manage.py install_layer ign ortho plan maps scan_25 cadastre plan_vt
./manage.py install_layer ign maps scan_25 --key my_api_key --order=1
./manage.py install_layer ign cadastre --overlay
CHANGELOG
1.2.0 (2026-02-10)
Improvements
- Provide default OSM base layer if no layer in database.
- Change default glyph by demo glyph to avoid map style problems on raster based layer.
- Commands are replaced by
ìnstall_layercommand with different options to install different layers. - Use proxy models in admin for Base layers / Overlays / Style URL / Raster.
- Customize forms for Raster or Style URL layers
- Ability to enable / disable layers in admin without deleting them.
1.1.1 (2026-02-07)
Improvements
- mapbox url is now labeled as "Style URL".
- IGN Plan Vector tile layer is available
Bugfixes
- IGN layers are updated to use the new style url instead of the old tile url.
Development
- Use ruff instead of flake / black / isort
1.1.0 (2026-02-06)
New features
- Add overlays concept to allow adding layers on top of baselayers. This is useful for example to add a layer with markers on top of a baselayer.
- Add JSON endpoint to get baselayer data. This is useful for example to get the real url of a mapbox style.
Improvements
- Add example view
Maintenance
- Drop official support for python <= 3.9
- Add official support for python 3.13
- Add official support for python 5.2 and 6.0
1.0.0 (2023-07-11)
- Increase attribution size to 1024 chars.
- Support django 4.2, drop django 2.2
- Support python 3.11
0.0.9 (2022-11-09)
- Improve install_ign_baselayer command. Add Plan IGN V2 and fix multi layer import.
- Support django 3.2, 4.0 and 4.1
- Support python 3.10
0.0.8 (2020-11-03)
- Add command to create Mapbox layer
- Add command to create different IGN layers
0.0.7 (2020-10-30)
- Admin is now registered by default. Delete enabling code in your project.
- Set default mapbox glyphs to avoid map style problems on raster based layer
- Add commands to create OSM and OpenTopoMap base layers
0.0.6 (2020-09-09)
- Support django 3.1
0.0.5 (2020-06-03)
- Fix translations
0.0.4 (2019-12-04)
- Allow using map_box_url to store vector external json
0.0.3 (2019-12-03)
- add tile Size option for raster layers
- add attribution option for all layers
- Add real_url property to model MapBaseLayer, to get real url for mapbox styles
- fix MapBaseLayer deletion
- Enable fr translation
0.0.2 (2019-11-29)
- Increase tile url max size
0.0.1 (2019-11-25)
- First release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_mapbox_baselayer-1.2.0.tar.gz.
File metadata
- Download URL: django_mapbox_baselayer-1.2.0.tar.gz
- Upload date:
- Size: 19.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9381b8c8f7f52aaf54b8f7db25757cdf418c1f8ae191f228ab4e5a10a30a137
|
|
| MD5 |
7f650b11ca7b6293ab3092bb1a61acaf
|
|
| BLAKE2b-256 |
b1439fbd46a2c9e519b137784d0a297ff4ffaacb4799af8eafd3a4397210e4e1
|
Provenance
The following attestation bundles were made for django_mapbox_baselayer-1.2.0.tar.gz:
Publisher:
python-ci.yml on makinacorpus/django-mapbox-baselayer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_mapbox_baselayer-1.2.0.tar.gz -
Subject digest:
f9381b8c8f7f52aaf54b8f7db25757cdf418c1f8ae191f228ab4e5a10a30a137 - Sigstore transparency entry: 936730743
- Sigstore integration time:
-
Permalink:
makinacorpus/django-mapbox-baselayer@3de49aaf99c022dc1248e6a0f59d241e3071500e -
Branch / Tag:
refs/tags/1.2.0 - Owner: https://github.com/makinacorpus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-ci.yml@3de49aaf99c022dc1248e6a0f59d241e3071500e -
Trigger Event:
release
-
Statement type:
File details
Details for the file django_mapbox_baselayer-1.2.0-py3-none-any.whl.
File metadata
- Download URL: django_mapbox_baselayer-1.2.0-py3-none-any.whl
- Upload date:
- Size: 36.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57be948eaf2abe8a2a958a895a467c4a5fbe97bda08efd1955bee231598fa0f0
|
|
| MD5 |
8eb7ee8038f8e7a5fafbe53b5ee473e5
|
|
| BLAKE2b-256 |
f59d6a9e55e2f635fe727e7492c027553856634be255af18bf2a0a1cbc1a1bd4
|
Provenance
The following attestation bundles were made for django_mapbox_baselayer-1.2.0-py3-none-any.whl:
Publisher:
python-ci.yml on makinacorpus/django-mapbox-baselayer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_mapbox_baselayer-1.2.0-py3-none-any.whl -
Subject digest:
57be948eaf2abe8a2a958a895a467c4a5fbe97bda08efd1955bee231598fa0f0 - Sigstore transparency entry: 936730749
- Sigstore integration time:
-
Permalink:
makinacorpus/django-mapbox-baselayer@3de49aaf99c022dc1248e6a0f59d241e3071500e -
Branch / Tag:
refs/tags/1.2.0 - Owner: https://github.com/makinacorpus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-ci.yml@3de49aaf99c022dc1248e6a0f59d241e3071500e -
Trigger Event:
release
-
Statement type: