You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add CSS class .django-leaflet-raw-textarea to raw textarea, default width 100% (makinacorpus#249)
* Add CSS class .django-leaflet-raw-textarea to raw textarea, default width 100%
* Add link to GeoJSONLint.com to textarea label
* Fix whitespace in widget.html
* Add hover tip to link in raw textarea label
* Add summary to CHANGES
* Geometry text area label link: change target to _blank
* Fix formatting in leaflet.css
* Docs, round 1
* Docs, round 2
* Change to working WMS overlay example
The widget attribute `display_raw` toggles the textarea input.
116
+
The textarea can be resized by overriding its CSS class ``.django-leaflet-raw-textarea``.
117
+
118
+
36
119
In forms
37
120
--------
38
121
@@ -52,6 +135,9 @@ With *Django* >= 1.6:
52
135
fields = ('name', 'geom')
53
136
widgets = {'geom': LeafletWidget()}
54
137
138
+
Again, the LeafletWidget can be intialized with custom attributes,
139
+
e.g. ``LeafletWidget(attrs=LEAFLET_WIDGET_ATTRS)`` as shown above.
140
+
55
141
With all *Django* versions:
56
142
57
143
::
@@ -100,7 +186,9 @@ Every map field will trigger an event you can use to add your custom machinery :
100
186
});
101
187
102
188
103
-
If you need a reusable customization of widgets maps, first override the JavaScript field behaviour by extending ``L.GeometryField``, then in Django subclass the ``LeafletWidget`` to specify the custom ``geometry_field_class``.
189
+
If you need a reusable customization of widgets maps, first override the JavaScript
190
+
field behavior by extending ``L.GeometryField``, then in *Django* subclass the
191
+
``LeafletWidget`` to specify the custom ``geometry_field_class``.
104
192
105
193
::
106
194
@@ -124,6 +212,43 @@ If you need a reusable customization of widgets maps, first override the JavaScr
124
212
fields = ('name', 'geom')
125
213
widgets = {'geom': YourMapWidget()}
126
214
215
+
216
+
To customise individual forms, you can either extend the geometry field as shown above,
217
+
or inject a script into the form template.
218
+
219
+
In this example, a custom set of overlays is added as shown for both ref::overlays_
220
+
and ref::admin_ widgets, insert an extra script into the form template
0 commit comments