Skip to content

Commit

Permalink
Merge pull request #5442 from camptocamp/fix-permalink
Browse files Browse the repository at this point in the history
Fix permalink when no color is provided
  • Loading branch information
sbrunner committed Jan 21, 2020
2 parents 9d6de01 + b2a078b commit dfc7f76
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/misc/FeatureHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -974,21 +974,23 @@ FeatureHelper.prototype.getAngleProperty = function(feature) {

/**
* @param {olFeature<import("ol/geom/Geometry.js").default>} feature Feature.
* @return {string} Color.
* @return {?string} Color.
*/
FeatureHelper.prototype.getColorProperty = function(feature) {
const color = feature.get(ngeoFormatFeatureProperties.COLOR);
console.assert(typeof color == 'string');
return color;
};


/**
* @param {olFeature<import("ol/geom/Geometry.js").default>} feature Feature.
* @return {import('ol/color.js').Color} Color.
* @return {?import('ol/color.js').Color} Color.
*/
FeatureHelper.prototype.getRGBAColorProperty = function(feature) {
const color = this.getColorProperty(feature);
if (typeof color != 'string') {
return null;
}
return colorFromString(color);
};

Expand Down

0 comments on commit dfc7f76

Please sign in to comment.