makinacorpus / django-leaflet

Use Leaflet in your Django projects
GNU Lesser General Public License v3.0
716 stars 282 forks source link

add django-geojson template filter to the documentation #369

Closed lukasalexanderweber closed 10 months ago

lukasalexanderweber commented 10 months ago

Thanks for both django-geojson and django-leaflet, it's really convenient to use!

In django-geojson is stated that I can simply put

// Leaflet JS
L.geoJson({{ object_list|geojsonfeature|safe}}).addTo(map);

to add data from my queryset to a map. However, it seems to be a bit more complicated.

I thought it might be a good idea to contribute a working solution. If you think it is correct, we might also want to update the django-geojson docs or link to this page.

Gagaro commented 10 months ago

Thanks for the PR :+1: . Feel free to do another one in django-geojson.