GeoJSON strings should not include internal feature ids, r=bbinet (closes #3313)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@12109 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -530,12 +530,15 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
|
||||
*/
|
||||
'feature': function(feature) {
|
||||
var geom = this.extract.geometry.apply(this, [feature.geometry]);
|
||||
return {
|
||||
var json = {
|
||||
"type": "Feature",
|
||||
"id": feature.fid == null ? feature.id : feature.fid,
|
||||
"properties": feature.attributes,
|
||||
"geometry": geom
|
||||
};
|
||||
if (feature.fid != null) {
|
||||
json.id = feature.fid;
|
||||
}
|
||||
return json;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user