File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ CHANGELOG
5
5
0.13.8 (unreleased)
6
6
-------------------
7
7
8
- - Nothing changed yet.
8
+ * Fix GeoJSON serialization when creating new MultiPoint records
9
9
10
10
11
11
0.13.7 (2014-06-26)
Original file line number Diff line number Diff line change @@ -26,6 +26,14 @@ L.FieldStore = L.Class.extend({
26
26
if ( typeof geom . toGeoJSON != 'function' ) {
27
27
throw 'Unsupported layer type ' + geom . constructor . name ;
28
28
}
29
+
30
+ // Leaflet requires access to original feature attribute for GeoJSON
31
+ // serialization. (see https://github.com/Leaflet/Leaflet/blob/v0.7.3/src/layer/GeoJSON.js#L256-L258)
32
+ // When creating new records, it's empty so we force it here.
33
+ if ( ! geom . feature ) {
34
+ geom . feature = { geometry : { type : this . options . geom_type } } ;
35
+ }
36
+
29
37
var geojson = geom . toGeoJSON ( ) ;
30
38
if ( is_multi && is_generic ) {
31
39
var flat = { type : 'GeometryCollection' , geometries : [ ] } ;
You can’t perform that action at this time.
0 commit comments