Skip to content

Commit

Permalink
Added fix to allow multipoints saving, see makinacorpus#130
Browse files Browse the repository at this point in the history
  • Loading branch information
Rukaya Johaadien committed Feb 1, 2016
1 parent b68342a commit f2d3726
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions leaflet/static/leaflet/leaflet.forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ L.FieldStore = L.Class.extend({
}
geojson = flat;
}
// In order to make multipoint work, it seems we need to treat it similarly to the GeometryCollections
else if (this.options.geom_type == 'MULTIPOINT') {
var flat = {type: 'MultiPoint', coordinates: []};
for (var i=0; i < geojson.features.length; i++) {
flat.coordinates.push(geojson.features[i].geometry.coordinates);
}
geojson = flat;
}
else {
geojson = geojson.geometry;
}
Expand Down

0 comments on commit f2d3726

Please sign in to comment.