Skip to content

Commit

Permalink
Fix bug with VectorData highlight & outline color
Browse files Browse the repository at this point in the history
Allow properly configuring the highlight and outline color in CesiumVectorData model
  • Loading branch information
robyngit committed Jun 27, 2023
1 parent b18c27f commit 2eb8896
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/js/models/maps/assets/CesiumVectorData.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
},

Expand Down

0 comments on commit 2eb8896

Please sign in to comment.