From bebb6fd1a2523b84b68d3b825f360a3d9c69d8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Sat, 2 Jan 2016 23:46:11 +0100 Subject: [PATCH] fix #135 (LeafletWidget behaviour on GeometryCollectionField) --- leaflet/static/leaflet/leaflet.forms.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/leaflet/static/leaflet/leaflet.forms.js b/leaflet/static/leaflet/leaflet.forms.js index 08d0d2e1..7a409ed2 100644 --- a/leaflet/static/leaflet/leaflet.forms.js +++ b/leaflet/static/leaflet/leaflet.forms.js @@ -35,7 +35,8 @@ L.FieldStore = L.Class.extend({ } var geojson = geom.toGeoJSON(); - if (is_multi && is_generic) { + var is_geometrycollection = (geojson.geometry.type == 'GeometryCollection'); + if (is_multi && is_generic && !is_geometrycollection) { var flat = {type: 'GeometryCollection', geometries: []}; for (var i=0; i < geojson.features.length; i++) { flat.geometries.push(geojson.features[i].geometry);