Skip to content

Commit d45cbf8

Browse files
committed
fix: single Polygon and Polyline considered as a collection
1 parent cae97cb commit d45cbf8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

leaflet/static/leaflet/leaflet.forms.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ L.GeometryField = L.Class.extend({
185185
this.drawnItems.addLayer(l);
186186
}, this);
187187
}
188-
else if (geometry instanceof L.Polygon || geometry instanceof L.Polyline) {
188+
else if (this.options.collection_type !== 'featureGroup'
189+
&& (geometry instanceof L.Polygon || geometry instanceof L.Polyline)) {
189190
var latlngs = geometry.getLatLngs();
190191
for (var i = 0; i < latlngs.length; i++) {
191192
this.drawnItems.addLayer(L[this.options.collection_type](latlngs[i]));

0 commit comments

Comments
 (0)