1 |
|
2 |
|
3 |
|
4 | import styleSpec from '../../style-spec/reference/latest';
|
5 |
|
6 | import {
|
7 | Properties,
|
8 | DataConstantProperty,
|
9 | DataDrivenProperty,
|
10 | CrossFadedDataDrivenProperty,
|
11 | CrossFadedProperty,
|
12 | ColorRampProperty,
|
13 | PossiblyEvaluatedPropertyValue,
|
14 | CrossFaded
|
15 | } from '../properties';
|
16 |
|
17 | import type Color from '../../style-spec/util/color';
|
18 |
|
19 | import type Formatted from '../../style-spec/expression/types/formatted';
|
20 |
|
21 | import type ResolvedImage from '../../style-spec/expression/types/resolved_image';
|
22 | import {StylePropertySpecification} from '../../style-spec/style-spec';
|
23 |
|
24 | export type FillLayoutProps = {
|
25 | "fill-sort-key": DataDrivenProperty<number>,
|
26 | };
|
27 |
|
28 | export type FillLayoutPropsPossiblyEvaluated = {
|
29 | "fill-sort-key": PossiblyEvaluatedPropertyValue<number>,
|
30 | };
|
31 |
|
32 | const layout: Properties<FillLayoutProps> = new Properties({
|
33 | "fill-sort-key": new DataDrivenProperty(styleSpec["layout_fill"]["fill-sort-key"] as any as StylePropertySpecification),
|
34 | });
|
35 |
|
36 | export type FillPaintProps = {
|
37 | "fill-antialias": DataConstantProperty<boolean>,
|
38 | "fill-opacity": DataDrivenProperty<number>,
|
39 | "fill-color": DataDrivenProperty<Color>,
|
40 | "fill-outline-color": DataDrivenProperty<Color>,
|
41 | "fill-translate": DataConstantProperty<[number, number]>,
|
42 | "fill-translate-anchor": DataConstantProperty<"map" | "viewport">,
|
43 | "fill-pattern": CrossFadedDataDrivenProperty<ResolvedImage>,
|
44 | };
|
45 |
|
46 | export type FillPaintPropsPossiblyEvaluated = {
|
47 | "fill-antialias": boolean,
|
48 | "fill-opacity": PossiblyEvaluatedPropertyValue<number>,
|
49 | "fill-color": PossiblyEvaluatedPropertyValue<Color>,
|
50 | "fill-outline-color": PossiblyEvaluatedPropertyValue<Color>,
|
51 | "fill-translate": [number, number],
|
52 | "fill-translate-anchor": "map" | "viewport",
|
53 | "fill-pattern": PossiblyEvaluatedPropertyValue<CrossFaded<ResolvedImage>>,
|
54 | };
|
55 |
|
56 | const paint: Properties<FillPaintProps> = new Properties({
|
57 | "fill-antialias": new DataConstantProperty(styleSpec["paint_fill"]["fill-antialias"] as any as StylePropertySpecification),
|
58 | "fill-opacity": new DataDrivenProperty(styleSpec["paint_fill"]["fill-opacity"] as any as StylePropertySpecification),
|
59 | "fill-color": new DataDrivenProperty(styleSpec["paint_fill"]["fill-color"] as any as StylePropertySpecification),
|
60 | "fill-outline-color": new DataDrivenProperty(styleSpec["paint_fill"]["fill-outline-color"] as any as StylePropertySpecification),
|
61 | "fill-translate": new DataConstantProperty(styleSpec["paint_fill"]["fill-translate"] as any as StylePropertySpecification),
|
62 | "fill-translate-anchor": new DataConstantProperty(styleSpec["paint_fill"]["fill-translate-anchor"] as any as StylePropertySpecification),
|
63 | "fill-pattern": new CrossFadedDataDrivenProperty(styleSpec["paint_fill"]["fill-pattern"] as any as StylePropertySpecification),
|
64 | });
|
65 |
|
66 | export default ({ paint, layout } as {
|
67 | paint: Properties<FillPaintProps>,
|
68 | layout: Properties<FillLayoutProps>
|
69 | }); |
\ | No newline at end of file |