Merge pull request #13217 from EvertEt/fix/13213

Fix MVT incorrect feature data handling
This commit is contained in:
Andreas Hocevar
2022-01-11 11:16:46 +01:00
committed by GitHub

View File

@@ -164,7 +164,7 @@ class MVT extends FeatureFormat {
* @param {PBF} pbf PBF
* @param {Object} rawFeature Raw Mapbox feature.
* @param {import("./Feature.js").ReadOptions} options Read options.
* @return {import("../Feature.js").FeatureLike} Feature.
* @return {import("../Feature.js").FeatureLike|null} Feature.
*/
createFeature_(pbf, rawFeature, options) {
const type = rawFeature.type;
@@ -293,7 +293,10 @@ class MVT extends FeatureFormat {
for (let i = 0, ii = pbfLayer.length; i < ii; ++i) {
const rawFeature = readRawFeature(pbf, pbfLayer, i);
features.push(this.createFeature_(pbf, rawFeature, options));
const feature = this.createFeature_(pbf, rawFeature, options);
if (feature !== null) {
features.push(feature);
}
}
}