-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #998 - ol layer vectorImage is not rendered #1005
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
|
@@ -31,7 +31,7 @@ | |
"@mapbox/geojsonhint": "^3.0.1", | ||
"@types/webpack": "^5.28.0", | ||
"babel-loader": "8.2.2", | ||
"cesium": "^1.81.0", | ||
"cesium": ">=1.81.0 <=1.97.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, see #1004. |
||
"copy-webpack-plugin": "^9.0.0", | ||
"cross-env": "7.0.3", | ||
"eslint": "^7.26.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
Comment on lines
+106
to
+109
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please directly pass source and style as constructor parameter. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will fix it next week |
||
} | ||
|
||
if (!(olLayer instanceof olLayerVector) || olLayer instanceof olLayerVectorTile || olLayer instanceof olLayerVectorImage) { | ||
return null; | ||
} | ||
console.assert(olLayer instanceof olLayerLayer); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change this.