Metadata-Version: 2.4
Name: django-mapbox-baselayer
Version: 1.1.1
Summary: Django model to store and serve mapbox base layer config
Home-page: https://github.com/makinacorpus/django-mapbox-baselayer.git
Author: Makina Corpus
Author-email: geobi@makina-corpus.com
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Framework :: Django
Description-Content-Type: text/markdown
Requires-Dist: django>=2.2
Provides-Extra: dev
Requires-Dist: factory-boy; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: coverage; extra == "dev"
Requires-Dist: django-debug-toolbar; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: summary

[![codecov](https://codecov.io/gh/makinacorpus/django-mapbox-baselayer/branch/master/graph/badge.svg)](https://codecov.io/gh/makinacorpus/django-mapbox-baselayer)
[![CI](https://github.com/makinacorpus/django-mapbox-baselayer/actions/workflows/python-ci.yml/badge.svg)](https://github.com/makinacorpus/django-mapbox-baselayer/actions/workflows/python-ci.yml)

# 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

![Map Example](docs/map_example.png)

# Getting started
### Installation
Install it in your project like any dependency
```bash
pip install django-mapbox-baselayer
```

### Usage
Declare django-mapbox-baselayer in the `INSTALLED_APPS`
```python
# 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

#### OSM base layer

```bash
./manage.py install_osm_baselayer
```

#### OpenTopoMap base layer

```bash
./manage.py install_opentopomap_baselayer
```

#### Mapbox base layer

```bash
./manage.py install_mapbox_baselayer (use mapbox://styles/mapbox/streets-v11 as default)
./manage.py install_mapbox_baselayer --mapbox-url=mapbox://styles/mapbox/satellite-streets-v11
```

#### IGN base layer

```bash
./manage.py install_ign_baselayer --layers ortho plan maps scan_25 cadastre plan_vt
```


CHANGELOG
=========

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
