Open eruiz67 opened 3 years ago
You can add a JS script which use the map:init
event: https://django-leaflet.readthedocs.io/en/latest/templates.html#use-leaflet-api
All events from Leaflet Draw: https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html#l-draw-event
In my django app I have a Worker model with a name and location (Point). Using django-leflet LeafletWidget I can create a Form where the user can set a location (marker to that worker). Is it possible to add an event to the widget, so, every time the user sets the marker, or change the marker position it gets the coordinates of that point and perform other actions (like an ajax request)?
in the template i just call 'forms.location' and it renders the map with the controls to set a marker