diff --git a/examples/vectors.html b/examples/vectors.html index 300ffa144..3e4f49505 100644 --- a/examples/vectors.html +++ b/examples/vectors.html @@ -18,6 +18,8 @@ onclick="javascript:toggleStyle()" />
+
=1.81.0 <=1.97.0", "copy-webpack-plugin": "^9.0.0", "cross-env": "7.0.3", "eslint": "^7.26.0", diff --git a/src/olcs/VectorSynchronizer.js b/src/olcs/VectorSynchronizer.js index bdc757e03..2f70a669b 100644 --- a/src/olcs/VectorSynchronizer.js +++ b/src/olcs/VectorSynchronizer.js @@ -10,6 +10,7 @@ import olLayerVector from 'ol/layer/Vector.js'; import olLayerVectorTile from 'ol/layer/VectorTile.js'; import olcsAbstractSynchronizer from './AbstractSynchronizer.js'; import olcsFeatureConverter from './FeatureConverter.js'; +import olLayerVectorImage from 'ol/layer/VectorImage.js'; class VectorSynchronizer extends olcsAbstractSynchronizer { /** @@ -99,8 +100,16 @@ class VectorSynchronizer extends olcsAbstractSynchronizer { * @inheritDoc */ createSingleLayerCounterparts(olLayerWithParents) { - const olLayer = olLayerWithParents.layer; - if (!(olLayer instanceof olLayerVector) || olLayer instanceof olLayerVectorTile) { + let olLayer = olLayerWithParents.layer; + + if(olLayerWithParents.layer instanceof olLayerVectorImage){ + let convertedVectorLayer = new olLayerVector({source: null}); + convertedVectorLayer.setStyle(olLayerWithParents.layer.getStyle()) + convertedVectorLayer.setSource(olLayerWithParents.layer.getSource()) + olLayer = convertedVectorLayer; + } + + if (!(olLayer instanceof olLayerVector) || olLayer instanceof olLayerVectorTile || olLayer instanceof olLayerVectorImage) { return null; } console.assert(olLayer instanceof olLayerLayer);