Skip to content

Commit

Permalink
improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed Mar 23, 2020
1 parent 0342357 commit 0257429
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,6 @@ export class DynamicStyleProperty extends AbstractStyleProperty {
}
}

getFormattedValue(value) {
return this.isOrdinal() ? this.getNumericalMbFeatureStateValue(value) : this.formatField(value);
}

getNumericalMbFeatureStateValue(value) {
const valueAsFloat = parseFloat(value);
return isNaN(valueAsFloat) ? null : valueAsFloat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,12 @@ export class VectorStyle extends AbstractStyle {
//in practice, a new system property will only be created for:
// - label text: this requires the value to be formatted first.
// - icon orientation: this is a lay-out property which do not support feature-state (but we're still coercing to a number)
feature.properties[computedName] = dynamicStyleProp.getFormattedValue(rawValue);

const formattedValue = dynamicStyleProp.isOrdinal()
? dynamicStyleProp.getNumericalMbFeatureStateValue(rawValue)
: dynamicStyleProp.formatField(rawValue);

feature.properties[computedName] = formattedValue;
}
}
tmpFeatureIdentifier.source = mbSourceId;
Expand Down

0 comments on commit 0257429

Please sign in to comment.