diff --git a/CHANGES.md b/CHANGES.md index 78568dbca..8405785ea 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ * Changes * CanvasPattern and CanvasGradient styles are now handled for polygons. * Port to Cesium 1.51. + * Port to OpenLayers 5.3.0. # v 2.4 - 2018-10-01 diff --git a/package.json b/package.json index b04e9d874..89c8895cb 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "jsdoc": "3.5.5", "ls": "0.2.1", "nomnom": "1.8.1", - "ol": "5.2.0", + "ol": "5.3.0", "proj4": "2.4.4", "temp": "0.8.3", "webpack": "^4.20.2", diff --git a/src/olcs/FeatureConverter.js b/src/olcs/FeatureConverter.js index d8b9e646b..616e0e879 100644 --- a/src/olcs/FeatureConverter.js +++ b/src/olcs/FeatureConverter.js @@ -718,10 +718,10 @@ class FeatureConverter { }); if (imageStyle instanceof olStyleIcon) { - bbOptions.pixelOffset = new Cesium.Cartesian2( - image.width / 2 - imageStyle.getAnchor()[0], - image.height / 2 - imageStyle.getAnchor()[1] - ); + const anchor = imageStyle.getAnchor(); + if (anchor) { + bbOptions.pixelOffset = new Cesium.Cartesian2(image.width / 2 - anchor[0], image.height / 2 - anchor[1]); + } } const bb = this.csAddBillboard(billboards, bbOptions, layer, feature, olGeometry, style);