From 2eb889634c14583be6e127f719103616295c3675 Mon Sep 17 00:00:00 2001 From: Robyn Thiessen-Bock Date: Tue, 27 Jun 2023 17:11:25 -0400 Subject: [PATCH] Fix bug with VectorData highlight & outline color Allow properly configuring the highlight and outline color in CesiumVectorData model --- src/js/models/maps/assets/CesiumVectorData.js | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/js/models/maps/assets/CesiumVectorData.js b/src/js/models/maps/assets/CesiumVectorData.js index 836814308..89f874ac5 100644 --- a/src/js/models/maps/assets/CesiumVectorData.js +++ b/src/js/models/maps/assets/CesiumVectorData.js @@ -119,15 +119,31 @@ define( // rendered. Used to know when it's safe to calculate a bounding sphere. this.set('displayReady', false) - if (assetConfig.outlineColor && !assetConfig.outlineColor instanceof AssetColor) { - this.set('outlineColor', new AssetColor(assetConfig.outlineColor)) + if ( + assetConfig.outlineColor && + !(assetConfig.outlineColor instanceof AssetColor) + ) { + this.set( + "outlineColor", + new AssetColor({ color: assetConfig.outlineColor }) + ); + } + + if ( + assetConfig.highlightColor && + !(assetConfig.highlightColor instanceof AssetColor) + ) { + this.set( + "highlightColor", + new AssetColor({ color: assetConfig.highlightColor }) + ); } this.createCesiumModel(); } catch (error) { - console.log('Wrror initializing a CesiumVectorData model.', error); + console.log('Error initializing a CesiumVectorData model.', error); } },