Skip to content

Commit ec49dac

Browse files
woodroofstepankuzmin
authored andcommitted
Fixing definitions of *-cross-fade properties: they are not feature-dependent (internal-2456)
1 parent 76d1c14 commit ec49dac

10 files changed

+20
-42
lines changed

src/render/draw_fill.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ function drawFillTiles(params: DrawFillParams, elevatedGeometry: boolean, stenci
293293
const gl = painter.context.gl;
294294

295295
const patternProperty = layer.paint.get('fill-pattern');
296-
const patternTransition = layer.paint.get('fill-pattern-cross-fade').constantOr(0);
296+
const patternTransition = layer.paint.get('fill-pattern-cross-fade');
297297
const constantPattern = patternProperty.constantOr(null);
298298

299299
let activeElevationType = elevationType;

src/render/draw_fill_extrusion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ function drawExtrusionTiles(painter: Painter, source: SourceCache, layer: FillEx
274274
const gl = context.gl;
275275
const tr = painter.transform;
276276
const patternProperty = layer.paint.get('fill-extrusion-pattern');
277-
const patternTransition = layer.paint.get('fill-extrusion-pattern-cross-fade').constantOr(0);
277+
const patternTransition = layer.paint.get('fill-extrusion-pattern-cross-fade');
278278
const constantPattern = patternProperty.constantOr(null);
279279

280280
// eslint-disable-next-line @typescript-eslint/no-explicit-any

src/render/draw_line.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default function drawLine(painter: Painter, sourceCache: SourceCache, lay
9595

9696
// eslint-disable-next-line @typescript-eslint/no-explicit-any
9797
const image = patternProperty.constantOr((1 as any));
98-
const patternTransition = layer.paint.get('line-pattern-cross-fade').constantOr(0);
98+
const patternTransition = layer.paint.get('line-pattern-cross-fade');
9999
const constantPattern = patternProperty.constantOr(null);
100100

101101
const lineOpacity = layer.paint.get('line-opacity').constantOr(1.0);

src/render/draw_symbol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ function drawLayerSymbols(
402402

403403
const projectedPosOnLabelSpace = alongLine || updateTextFitIcon;
404404

405-
const transitionProgress = layer.paint.get('icon-image-cross-fade').constantOr(0.0);
405+
const transitionProgress = layer.paint.get('icon-image-cross-fade');
406406
if (painter.terrainRenderModeElevated() && iconPitchWithMap) {
407407
baseDefines.push('PITCH_WITH_MAP_TERRAIN');
408408
}

src/style-spec/reference/v8.json

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6625,16 +6625,14 @@
66256625
},
66266626
"fill-pattern-cross-fade": {
66276627
"type": "number",
6628-
"property-type": "data-driven",
6628+
"property-type": "data-constant",
66296629
"default": 0.0,
66306630
"minimum": 0,
66316631
"maximum": 1,
66326632
"expression": {
66336633
"interpolated": true,
66346634
"parameters": [
66356635
"zoom",
6636-
"feature",
6637-
"feature-state",
66386636
"measure-light"
66396637
]
66406638
},
@@ -6644,9 +6642,6 @@
66446642
"sdk-support": {
66456643
"basic functionality": {
66466644
"js": "3.12.0"
6647-
},
6648-
"data-driven styling": {
6649-
"js": "3.12.0"
66506645
}
66516646
},
66526647
"doc": "Controls the transition progress between the image variants of fill-pattern. Zero means the first variant is used, one is the second, and in between they are blended together.",
@@ -6896,16 +6891,14 @@
68966891
},
68976892
"fill-extrusion-pattern-cross-fade": {
68986893
"type": "number",
6899-
"property-type": "data-driven",
6894+
"property-type": "data-constant",
69006895
"default": 0.0,
69016896
"minimum": 0,
69026897
"maximum": 1,
69036898
"expression": {
69046899
"interpolated": true,
69056900
"parameters": [
69066901
"zoom",
6907-
"feature",
6908-
"feature-state",
69096902
"measure-light"
69106903
]
69116904
},
@@ -6915,9 +6908,6 @@
69156908
"sdk-support": {
69166909
"basic functionality": {
69176910
"js": "3.12.0"
6918-
},
6919-
"data-driven styling": {
6920-
"js": "3.12.0"
69216911
}
69226912
},
69236913
"doc": "Controls the transition progress between the image variants of fill-extrusion-pattern. Zero means the first variant is used, one is the second, and in between they are blended together.",
@@ -7943,16 +7933,14 @@
79437933
},
79447934
"line-pattern-cross-fade": {
79457935
"type": "number",
7946-
"property-type": "data-driven",
7936+
"property-type": "data-constant",
79477937
"default": 0.0,
79487938
"minimum": 0,
79497939
"maximum": 1,
79507940
"expression": {
79517941
"interpolated": true,
79527942
"parameters": [
79537943
"zoom",
7954-
"feature",
7955-
"feature-state",
79567944
"measure-light"
79577945
]
79587946
},
@@ -7962,9 +7950,6 @@
79627950
"sdk-support": {
79637951
"basic functionality": {
79647952
"js": "3.12.0"
7965-
},
7966-
"data-driven styling": {
7967-
"js": "3.12.0"
79687953
}
79697954
},
79707955
"doc": "Controls the transition progress between the image variants of line-pattern. Zero means the first variant is used, one is the second, and in between they are blended together.",
@@ -9024,16 +9009,14 @@
90249009
},
90259010
"icon-image-cross-fade": {
90269011
"type": "number",
9027-
"property-type": "data-driven",
9012+
"property-type": "data-constant",
90289013
"default": 0.0,
90299014
"minimum": 0,
90309015
"maximum": 1,
90319016
"expression": {
90329017
"interpolated": true,
90339018
"parameters": [
90349019
"zoom",
9035-
"feature",
9036-
"feature-state",
90379020
"measure-light"
90389021
]
90399022
},
@@ -9045,11 +9028,6 @@
90459028
"js": "3.0.0",
90469029
"android": "11.0.0",
90479030
"ios": "11.0.0"
9048-
},
9049-
"data-driven styling": {
9050-
"js": "3.0.0",
9051-
"android": "11.0.0",
9052-
"ios": "11.0.0"
90539031
}
90549032
},
90559033
"doc": "Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.",

src/style-spec/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ export type FillLayerSpecification = {
595595
"fill-translate-transition"?: TransitionSpecification,
596596
"fill-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">,
597597
"fill-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>,
598-
"fill-pattern-cross-fade"?: DataDrivenPropertyValueSpecification<number>,
598+
"fill-pattern-cross-fade"?: PropertyValueSpecification<number>,
599599
"fill-pattern-cross-fade-transition"?: TransitionSpecification,
600600
"fill-emissive-strength"?: PropertyValueSpecification<number>,
601601
"fill-emissive-strength-transition"?: TransitionSpecification,
@@ -682,7 +682,7 @@ export type LineLayerSpecification = {
682682
"line-blur-transition"?: TransitionSpecification,
683683
"line-dasharray"?: DataDrivenPropertyValueSpecification<Array<number>>,
684684
"line-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>,
685-
"line-pattern-cross-fade"?: DataDrivenPropertyValueSpecification<number>,
685+
"line-pattern-cross-fade"?: PropertyValueSpecification<number>,
686686
"line-pattern-cross-fade-transition"?: TransitionSpecification,
687687
"line-gradient"?: ExpressionSpecification,
688688
"line-gradient-use-theme"?: PropertyValueSpecification<string>,
@@ -808,7 +808,7 @@ export type SymbolLayerSpecification = {
808808
"icon-translate"?: PropertyValueSpecification<[number, number]>,
809809
"icon-translate-transition"?: TransitionSpecification,
810810
"icon-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">,
811-
"icon-image-cross-fade"?: DataDrivenPropertyValueSpecification<number>,
811+
"icon-image-cross-fade"?: PropertyValueSpecification<number>,
812812
"icon-image-cross-fade-transition"?: TransitionSpecification,
813813
"text-opacity"?: DataDrivenPropertyValueSpecification<number>,
814814
"text-opacity-transition"?: TransitionSpecification,
@@ -967,7 +967,7 @@ export type FillExtrusionLayerSpecification = {
967967
"fill-extrusion-translate-transition"?: TransitionSpecification,
968968
"fill-extrusion-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">,
969969
"fill-extrusion-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>,
970-
"fill-extrusion-pattern-cross-fade"?: DataDrivenPropertyValueSpecification<number>,
970+
"fill-extrusion-pattern-cross-fade"?: PropertyValueSpecification<number>,
971971
"fill-extrusion-pattern-cross-fade-transition"?: TransitionSpecification,
972972
"fill-extrusion-height"?: DataDrivenPropertyValueSpecification<number>,
973973
"fill-extrusion-height-transition"?: TransitionSpecification,

src/style/style_layer/fill_extrusion_style_layer_properties.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export type PaintProps = {
3232
"fill-extrusion-translate": DataConstantProperty<[number, number]>;
3333
"fill-extrusion-translate-anchor": DataConstantProperty<"map" | "viewport">;
3434
"fill-extrusion-pattern": DataDrivenProperty<ResolvedImage | null | undefined>;
35-
"fill-extrusion-pattern-cross-fade": DataDrivenProperty<number>;
35+
"fill-extrusion-pattern-cross-fade": DataConstantProperty<number>;
3636
"fill-extrusion-height": DataDrivenProperty<number>;
3737
"fill-extrusion-base": DataDrivenProperty<number>;
3838
"fill-extrusion-height-alignment": DataConstantProperty<"terrain" | "flat">;
@@ -65,7 +65,7 @@ export const getPaintProperties = (): Properties<PaintProps> => paint || (paint
6565
"fill-extrusion-translate": new DataConstantProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-translate"]),
6666
"fill-extrusion-translate-anchor": new DataConstantProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),
6767
"fill-extrusion-pattern": new DataDrivenProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-pattern"]),
68-
"fill-extrusion-pattern-cross-fade": new DataDrivenProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-pattern-cross-fade"]),
68+
"fill-extrusion-pattern-cross-fade": new DataConstantProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-pattern-cross-fade"]),
6969
"fill-extrusion-height": new DataDrivenProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-height"]),
7070
"fill-extrusion-base": new DataDrivenProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-base"]),
7171
"fill-extrusion-height-alignment": new DataConstantProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-height-alignment"]),

src/style/style_layer/fill_style_layer_properties.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export type PaintProps = {
3838
"fill-translate": DataConstantProperty<[number, number]>;
3939
"fill-translate-anchor": DataConstantProperty<"map" | "viewport">;
4040
"fill-pattern": DataDrivenProperty<ResolvedImage | null | undefined>;
41-
"fill-pattern-cross-fade": DataDrivenProperty<number>;
41+
"fill-pattern-cross-fade": DataConstantProperty<number>;
4242
"fill-emissive-strength": DataConstantProperty<number>;
4343
"fill-z-offset": DataDrivenProperty<number>;
4444
"fill-bridge-guard-rail-color": DataDrivenProperty<Color>;
@@ -58,7 +58,7 @@ export const getPaintProperties = (): Properties<PaintProps> => paint || (paint
5858
"fill-translate": new DataConstantProperty(styleSpec["paint_fill"]["fill-translate"]),
5959
"fill-translate-anchor": new DataConstantProperty(styleSpec["paint_fill"]["fill-translate-anchor"]),
6060
"fill-pattern": new DataDrivenProperty(styleSpec["paint_fill"]["fill-pattern"]),
61-
"fill-pattern-cross-fade": new DataDrivenProperty(styleSpec["paint_fill"]["fill-pattern-cross-fade"]),
61+
"fill-pattern-cross-fade": new DataConstantProperty(styleSpec["paint_fill"]["fill-pattern-cross-fade"]),
6262
"fill-emissive-strength": new DataConstantProperty(styleSpec["paint_fill"]["fill-emissive-strength"]),
6363
"fill-z-offset": new DataDrivenProperty(styleSpec["paint_fill"]["fill-z-offset"]),
6464
"fill-bridge-guard-rail-color": new DataDrivenProperty(styleSpec["paint_fill"]["fill-bridge-guard-rail-color"]),

src/style/style_layer/line_style_layer_properties.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export type PaintProps = {
5353
"line-blur": DataDrivenProperty<number>;
5454
"line-dasharray": DataDrivenProperty<Array<number | null | undefined>>;
5555
"line-pattern": DataDrivenProperty<ResolvedImage | null | undefined>;
56-
"line-pattern-cross-fade": DataDrivenProperty<number>;
56+
"line-pattern-cross-fade": DataConstantProperty<number>;
5757
"line-gradient": ColorRampProperty;
5858
"line-trim-offset": DataConstantProperty<[number, number]>;
5959
"line-trim-fade-range": DataConstantProperty<[number, number]>;
@@ -80,7 +80,7 @@ export const getPaintProperties = (): Properties<PaintProps> => paint || (paint
8080
"line-blur": new DataDrivenProperty(styleSpec["paint_line"]["line-blur"]),
8181
"line-dasharray": new DataDrivenProperty(styleSpec["paint_line"]["line-dasharray"]),
8282
"line-pattern": new DataDrivenProperty(styleSpec["paint_line"]["line-pattern"]),
83-
"line-pattern-cross-fade": new DataDrivenProperty(styleSpec["paint_line"]["line-pattern-cross-fade"]),
83+
"line-pattern-cross-fade": new DataConstantProperty(styleSpec["paint_line"]["line-pattern-cross-fade"]),
8484
"line-gradient": new ColorRampProperty(styleSpec["paint_line"]["line-gradient"]),
8585
"line-trim-offset": new DataConstantProperty(styleSpec["paint_line"]["line-trim-offset"]),
8686
"line-trim-fade-range": new DataConstantProperty(styleSpec["paint_line"]["line-trim-fade-range"]),

src/style/style_layer/symbol_style_layer_properties.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export type PaintProps = {
128128
"icon-halo-blur": DataDrivenProperty<number>;
129129
"icon-translate": DataConstantProperty<[number, number]>;
130130
"icon-translate-anchor": DataConstantProperty<"map" | "viewport">;
131-
"icon-image-cross-fade": DataDrivenProperty<number>;
131+
"icon-image-cross-fade": DataConstantProperty<number>;
132132
"text-opacity": DataDrivenProperty<number>;
133133
"text-occlusion-opacity": DataDrivenProperty<number>;
134134
"text-color": DataDrivenProperty<Color>;
@@ -160,7 +160,7 @@ export const getPaintProperties = (): Properties<PaintProps> => paint || (paint
160160
"icon-halo-blur": new DataDrivenProperty(styleSpec["paint_symbol"]["icon-halo-blur"]),
161161
"icon-translate": new DataConstantProperty(styleSpec["paint_symbol"]["icon-translate"]),
162162
"icon-translate-anchor": new DataConstantProperty(styleSpec["paint_symbol"]["icon-translate-anchor"]),
163-
"icon-image-cross-fade": new DataDrivenProperty(styleSpec["paint_symbol"]["icon-image-cross-fade"]),
163+
"icon-image-cross-fade": new DataConstantProperty(styleSpec["paint_symbol"]["icon-image-cross-fade"]),
164164
"text-opacity": new DataDrivenProperty(styleSpec["paint_symbol"]["text-opacity"]),
165165
"text-occlusion-opacity": new DataDrivenProperty(styleSpec["paint_symbol"]["text-occlusion-opacity"]),
166166
"text-color": new DataDrivenProperty(styleSpec["paint_symbol"]["text-color"], { runtimeType: ColorType, getOverride: (o) => o.textColor, hasOverride: (o) => !!o.textColor }),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy