Skip to content

Commit

Permalink
backport #6745 and fix rebase flubs
Browse files Browse the repository at this point in the history
  • Loading branch information
Molly Lloyd committed Aug 21, 2018
1 parent 22a55a6 commit 4626d35
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/style-spec/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export type FillExtrusionLayerSpecification = {|
"fill-extrusion-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
"fill-extrusion-translate"?: PropertyValueSpecification<[number, number]>,
"fill-extrusion-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">,
"fill-extrusion-pattern"?: PropertyValueSpecification<string>,
"fill-extrusion-pattern"?: DataDrivenPropertyValueSpecification<string>,
"fill-extrusion-height"?: DataDrivenPropertyValueSpecification<number>,
"fill-extrusion-base"?: DataDrivenPropertyValueSpecification<number>
|}
Expand Down
4 changes: 4 additions & 0 deletions src/style/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,10 @@ export class DataDrivenProperty<T> implements Property<T, PossiblyEvaluatedPrope
return value.evaluate(parameters, feature, featureState);
}
}

getPossibleOutputs() {
return [];
}
}

/**
Expand Down
8 changes: 7 additions & 1 deletion src/style/style_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,17 @@ class StyleLayer extends Evented {
this._transitionablePaint.setTransition(name.slice(0, -TRANSITION_SUFFIX.length), (value: any) || undefined);
return false;
} else {
// if a cross-faded value is changed, we need to make sure the new icons get added to each tile's iconAtlas
// so a call to _updateLayer is necessary, and we return true from this function so it gets called in
// Style#setPaintProperty
const prop = this._transitionablePaint._values[name];
const newCrossFadedValue = prop.property.specification["property-type"] === 'cross-faded-data-driven' && !prop.value.value && value;

const wasDataDriven = this._transitionablePaint._values[name].value.isDataDriven();
this._transitionablePaint.setValue(name, value);
const isDataDriven = this._transitionablePaint._values[name].value.isDataDriven();
this._handleSpecialPaintPropertyUpdate(name);
return isDataDriven || wasDataDriven;
return isDataDriven || wasDataDriven || newCrossFadedValue;
}
}

Expand Down

0 comments on commit 4626d35

Please sign in to comment.