Allow GeoJSON features with id equal to 0

fixes #4326
This commit is contained in:
Frederic Junod
2015-10-28 11:20:46 +01:00
parent 2f06d214f5
commit 7cf12d1c12
2 changed files with 16 additions and 1 deletions

View File

@@ -408,7 +408,7 @@ ol.format.GeoJSON.prototype.readFeatureFromObject = function(
feature.setGeometryName(this.geometryName_);
}
feature.setGeometry(geometry);
if (geoJSONFeature.id) {
if (geoJSONFeature.id !== undefined) {
feature.setId(geoJSONFeature.id);
}
if (geoJSONFeature.properties) {