mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
This commit is contained in:
parent
932b84cb7e
commit
a30dc7dae2
1 changed files with 4 additions and 6 deletions
|
@ -312,11 +312,7 @@ export class VectorStyle extends AbstractStyle {
|
|||
range: this._getFieldRange(name),
|
||||
computedName: VectorStyle.getComputedFieldName(name),
|
||||
};
|
||||
})
|
||||
.filter(({ range }) => {
|
||||
return !!range;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
clearFeatureState(featureCollection, mbMap, sourceId) {
|
||||
|
@ -352,11 +348,12 @@ export class VectorStyle extends AbstractStyle {
|
|||
//scale to [0,1] domain
|
||||
for (let i = 0; i < featureCollection.features.length; i++) {
|
||||
const feature = featureCollection.features[i];
|
||||
|
||||
for (let j = 0; j < scaledFields.length; j++) {
|
||||
const { name, range, computedName } = scaledFields[j];
|
||||
const unscaledValue = parseFloat(feature.properties[name]);
|
||||
let scaledValue;
|
||||
if (isNaN(unscaledValue)) {//cannot scale
|
||||
if (isNaN(unscaledValue) || !range) {//cannot scale
|
||||
scaledValue = -1;//put outside range
|
||||
} else if (range.delta === 0) {//values are identical
|
||||
scaledValue = 1;//snap to end of color range
|
||||
|
@ -389,7 +386,8 @@ export class VectorStyle extends AbstractStyle {
|
|||
|
||||
_getMbDataDrivenSize({ fieldName, minSize, maxSize }) {
|
||||
const targetName = VectorStyle.getComputedFieldName(fieldName);
|
||||
return ['interpolate',
|
||||
return [
|
||||
'interpolate',
|
||||
['linear'],
|
||||
['feature-state', targetName],
|
||||
0, minSize,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue