Gagaro
Gagaro
We have a Django 2 working fine with django leaflet. Do you have any error in the javascript console ?
The dev tag is used to build on master (so 2.1 right now): https://github.com/makinacorpus/django-leaflet/blob/master/.travis.yml#L103-L104 However, it is the master of the moment the travis build was made, and it is...
Hi, JS/CSS are inlines because it needs a lot of context data, it was the most convenient way to do it. https://github.com/makinacorpus/django-leaflet/blob/master/leaflet/templates/leaflet/_leaflet_map.html https://github.com/makinacorpus/django-leaflet/blob/master/leaflet/templates/leaflet/css.html https://github.com/makinacorpus/django-leaflet/blob/master/leaflet/templates/leaflet/js.html You can overwrite those templates in...
You first need to fork the repository (button on the upper right), then you push your branch in your fork: ``` bash git remote add fork [email protected]:rodolvbg-divineslns/django-leaflet.git git push fork...
the slugify is done to ensure that the result would be a valid CSS id. You could inherit from `LeafletWidget`, overwrite _get_attrs to set the correct `map_id_css` and use this...
I'd say it's called there : https://github.com/makinacorpus/django-leaflet/blob/master/leaflet/templates/leaflet/_leaflet_map.html#L10 But you should rather change how the id is generated (that would be on the block directly: https://github.com/wagtail/wagtail/blob/b6ee2db6ac8dbf4b47a81f4b2684b7aca8cc2501/wagtail/wagtailcore/blocks/field_block.py#L25-L26)
The solution I found to work in formset was to recreate the map entirely with ```L.Map.djangoMap('id_of_the_field', options);```
django-leaflet uses a custom `GeometryField` to display those: https://github.com/makinacorpus/django-leaflet/blob/master/leaflet/static/leaflet/leaflet.forms.js#L90 Which is used there: https://github.com/makinacorpus/django-leaflet/blob/master/leaflet/templates/leaflet/widget.html#L20
Instead of ranting for nothing, feel free to contribute and actually add something to the conversation. You're hitting an edge case that we couldn't reproduce. You're probably on windows, so...
I did something similar for JSON field, I guess the same logic can be used to display a map: ```python class MapModelAdmin(admin.ModelAdmin): [...] @property def media(self): js = ["leaflet.min.js", "js/my_readonly_script.js"]...