Skip to content

Commit

Permalink
Merge pull request #136 from PetrDlouhy/geometrycollectionfield
Browse files Browse the repository at this point in the history
LeafletWidget behaviour on GeometryCollectionField (fixes #135)
  • Loading branch information
leplatrem committed Jan 4, 2016
2 parents fda63ac + bebb6fd commit d73d88a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion leaflet/static/leaflet/leaflet.forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d73d88a

Please sign in to comment.