Create and display maps with points in Wagtail.
Warning! This project is still early on in its development lifecycle. It is possible for breaking changes to occur between versions until reaching a stable 1.0. Feedback and pull requests are welcome.
This package extend Wagtail to add a new Map model, which is composed by one or more points. Each point may have a title, some content and link to an internal or external URL. Once you have configured your map from the Wagtail admin, you will be able to display it in a page - e.g. as a StreamField block.
This package requires the following:
- Wagtail >= 2.15
- Django (3.1, 3.2)
- Python 3 (3.7, 3.8, 3.9)
- Install using
pip install wagtail-maps
INSTALLED_APPS = [ # ... 'wagtail_maps', # ... ]
- Include the URL of wagtail-maps to your
from wagtail_maps import urls as wagtailmaps_urls urlpatterns = [ # ... path('maps/', include(wagtailmaps_urls)), # ... ]
python manage.py migrateto create the models
A StreamField block
wagtail_maps.blocks.MapBlock can be used to display a
Leaflet package is currently not shipped, but you can find an example in
To set up a development environment, ensure that Python 3 is installed on your system. Then:
- Clone this repository
- Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate
- Install this package in develop mode with extra requirements:
pip install -e .[test]
make lint: check the Python code syntax and imports order
make format: fix the Python code syntax and imports order
make test: run the tests and output a quick report of code coverage
make coverage: run the tests and produce an HTML report of code coverage
When submitting a pull-request, please ensure that the code is well formatted and covered, and that all the other tests pass.