From eea112c261eb0c83f203a480bbd8fe26c9f70039 Mon Sep 17 00:00:00 2001 From: Oliver Rudoll Date: Mon, 24 Oct 2022 11:32:40 +0200 Subject: [PATCH 1/2] Fix #998 - ol layer vectorImage is not rendered in the 3d map --- examples/vectors.html | 2 ++ examples/vectors.js | 17 +++++++++++++++++ package.json | 2 +- src/olcs/VectorSynchronizer.js | 13 +++++++++++-- 4 files changed, 31 insertions(+), 3 deletions(-) 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); From 626e93dd6816a4fd8c6e7caf37b221cbd0f01cc0 Mon Sep 17 00:00:00 2001 From: Oliver Rudoll Date: Mon, 24 Oct 2022 13:17:26 +0200 Subject: [PATCH 2/2] change package name and version number --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6133bb8ab..49667743c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "ol-cesium", - "version": "2.13.1", + "name": "@inveni/ol-cesium", + "version": "0.00.1", "description": "OpenLayers Cesium integration library", "scripts": { "build-examples": "cross-env NODE_ENV=production TARGET=examples webpack --progress --bail",