A module for django-leaflet-storage and Leaflet.Storage (a.k.a. uMap) which adds support for adding images to Markers. If the image contains GPS-informations, the Marker position can be updated.
git clone https://github.com/arbu/leaflet-storage-images
cd leaflet-storage-images
python setup.py install
Add storage_images
to you apps:
INSTALLED_APPS = (
...
"storage_images",
)
Include storage_images
urls:
(r'', include('storage_images.urls')),
Add Leaflet.Storage.Images
scripts to your base.html:
<script src="{{ STATIC_URL }}images/js/leaflet.storage.images.js"></script>
{% if locale %}
<script src="{{ STATIC_URL }}images/locale/{{ locale }}.js"></script>
{% endif %}
Depending on your setup you may need to run:
python manage.py collectstatic
Also make sure you have configured MEDIA_URL
and MEDIA_PATH
.
If you want to limit the maximum filesize to upload, I recommend to configure the webserver (apache, nginx etc.) accordingly.
The only dependency is pillow, while django-leaflet-storage or uMap is recommended
When adding a new or editing an existing Marker, you can choose an image to upload under "Add image". The image is automatically uploaded. If the image contains GPS-informations, you are asked if you want to update the Marker.