Parse MVT id property

This commit is contained in:
drnextgis
2016-07-19 11:34:44 +07:00
parent 8a0f18de56
commit 2685dd1bd9
2 changed files with 11 additions and 0 deletions

View File

@@ -95,6 +95,7 @@ ol.format.MVT.prototype.getType = function() {
ol.format.MVT.prototype.readFeature_ = function(
rawFeature, layer, opt_options) {
var feature = new this.featureClass_();
var id = rawFeature.id;
var values = rawFeature.properties;
values[this.layerName_] = layer;
var geometry = ol.format.Feature.transformWithOptions(
@@ -104,6 +105,7 @@ ol.format.MVT.prototype.readFeature_ = function(
goog.asserts.assertInstanceof(geometry, ol.geom.Geometry);
values[this.geometryName_] = geometry;
}
feature.setId(id);
feature.setProperties(values);
feature.setGeometryName(this.geometryName_);
return feature;