Skip to content

Commit

Permalink
Merge pull request #139 from rukayaj/master
Browse files Browse the repository at this point in the history
Added fix to allow multipoints saving (fixes #130)
  • Loading branch information
leplatrem committed Feb 8, 2016
2 parents d12ffc1 + f2d3726 commit abc9d87
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 abc9d87

Please sign in to comment.