Create and display maps with points in Wagtail
Project description
wagtail-maps
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.
Requirements
This package requires the following:
- Wagtail >= 2.14: upstream patches have been submitted to provide a proper integration of this extension into the admin - see #7562, #7565 and #7590
- Django (3.1, 3.2)
- Python 3 (3.7, 3.8, 3.9)
Installation
- Install using
pip
:pip install wagtail-maps
- Add
wagtail_maps
to yourINSTALLED_APPS
setting:INSTALLED_APPS = [ # ... 'wagtail_maps', # ... ]
- Include the URL of wagtail-maps to your
urls.py
file:from wagtail_maps import urls as wagtailmaps_urls urlpatterns = [ # ... path('maps/', include(wagtailmaps_urls)), # ... ]
- Run
python manage.py migrate
to create the models
Usage
A StreamField block wagtail_maps.blocks.MapBlock
can be used to display a
map - choosen from the current ones - in your page. The JavaScript code and the
Leaflet package is currently not shipped, but you can find an example in
examples/frontend/.
Development
Quick start
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]
Contributing
The Python code is formatted and linted thanks to flake8, isort and black. To ease the use of this tools, the following commands are available:
make lint
: check the Python code syntax and imports ordermake format
: fix the Python code syntax and imports order
The tests are written with pytest and code coverage is measured with coverage. You can use the following commands for that:
make test
: run the tests and output a quick report of code coveragemake 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.
License
This extension is mainly developed by Cliss XXI and licensed under the AGPLv3+. Any contribution is welcome!
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
Hashes for wagtail_maps-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf190b4e2b09822ff721adab9a6a792b646a396430f6e975e79bea2900fc9870 |
|
MD5 | 6b8daf168d7d88f87b8bb6796db0673f |
|
BLAKE2b-256 | 67665aaf26e2b2f4c7359b4a7083ceb595187d32021dc8343de54e9fa5cccc76 |