Skip to main content

Django model to store and serve mapbox base layer config

Project description

codecov Build Status

Django model and view to store, generate and serve configuration for MapBox GL JS map base layer

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

OSM base layer

./manage.py install_osm_baselayer

OpenTopoMap base layer

./manage.py install_opentopomap_baselayer

Mapbox base layer

./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

./manage.py install_ign_baselayer _your_api_key_ --layers ortho plan maps se-classique se-standard cadastre

CHANGELOG

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-mapbox-baselayer-1.0.0.tar.gz (9.4 kB view details)

Uploaded Source

File details

Details for the file django-mapbox-baselayer-1.0.0.tar.gz.

File metadata

File hashes

Hashes for django-mapbox-baselayer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5e719d031032074133854e7032a37f2b76cd8ff50e41a057093204092616b73c
MD5 69ed18b32588b35d4179548ffc9641ff
BLAKE2b-256 69e2cdc12aa9097f16797b5fc7284e593237adedc62aba58f93a2accc1f5d525

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page