src/ol-ext: fix validation GeoJSON GeometryCollection geometry coordinates type #518
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe the bug
The
<vl-interaction-select>
component incorrectly validatefeature
property if it is GeoJSON GeometryCollection geometry type.vuelayers/src/components/select-interaction/interaction.vue
Line 84 in 6dc131f
To Reproduce
Steps to reproduce the behavior:
<vl-source-vector>
component which load GeoJSON GeometryCollection geometry type data and<vl-interaction-select>
component.Example:
<!-- POI vector layer --> <vl-layer-vector :id="poiLayerId"> <vl-source-vector :wrap-x="true" :loader-factory="poiFeaturesLoader" :strategy-factory="loadingStrategyFactory" :attributions="attributions" :ref="poiLayerId" > <vl-style-func :factory="poiFeatureStyleFuncFactory" /> </vl-source-vector> </vl-layer-vector> <vl-interaction-select :features.sync="selectedFeatures" ref="selectPoiFeature" :hitTolerance="hitTolerance" :filter="filterPOILayer" > <vl-style-func :factory="selectedPoiFeatureStyleFuncFactory" ></vl-style-func> </vl-interaction-select>
Error:
Expected behavior
<vl-interaction-select>
component should be properly validatefeature
property if it is GeoJSON GeometryCollection geometry type.Additional context:
For validation GeoJSON GeometryCollection geometry coordinates type is correct path
feature.geometry.geometries[0].coordinates
vuelayers/src/ol-ext/format.js
Line 350 in 6dc131f
Example of a GeometryCollection: