Skip to content

Commit c002e3d

Browse files
committed
- align Layer classes
1 parent 188373d commit c002e3d

28 files changed

+2369
-985
lines changed

src/libs/Mapbox.Maui/Mapbox.Maui.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<RepositoryUrl>https://github.com/tuyen-vuduc/mapbox-maui</RepositoryUrl>
6262
<PackageProjectUrl>https://mapbox.tuyen-vuduc.tech</PackageProjectUrl>
6363
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
64-
<PackageVersion>11.5.1-alpha07</PackageVersion>
64+
<PackageVersion>11.5.1-alpha08</PackageVersion>
6565
<PackageReadmeFile>README.md</PackageReadmeFile>
6666
<PackageLicenseFile>LICENSE</PackageLicenseFile>
6767
<PackageIcon>tv-mapbox.png</PackageIcon>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
namespace MapboxMaui.Styles;
2+
3+
/// The background color or pattern of the map.
4+
///
5+
/// - SeeAlso: [Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/#layers-background)
6+
public class BackgroundLayer : MapboxLayer
7+
{
8+
public BackgroundLayer(string id)
9+
: base(id)
10+
{
11+
Type = LayerType.Background;
12+
Visibility = new PropertyValue<Visibility>(MapboxMaui.Visibility.Visible);
13+
}
14+
/// The color with which the background will be drawn.
15+
/// Default value: "#000000".
16+
public PropertyValue<Color> BackgroundColor
17+
{
18+
get => GetProperty<PropertyValue<Color>>(
19+
PaintCodingKeys.BackgroundColor,
20+
default,
21+
MapboxLayerKey.paint
22+
);
23+
set => SetProperty(
24+
PaintCodingKeys.BackgroundColor,
25+
value,
26+
MapboxLayerKey.paint
27+
);
28+
}
29+
/// Transition options for `backgroundColor`.
30+
public PropertyValue<StyleTransition> BackgroundColorTransition
31+
{
32+
get => GetProperty<PropertyValue<StyleTransition>>(
33+
PaintCodingKeys.BackgroundColorTransition,
34+
default,
35+
MapboxLayerKey.paint
36+
);
37+
set => SetProperty(
38+
PaintCodingKeys.BackgroundColorTransition,
39+
value,
40+
MapboxLayerKey.paint
41+
);
42+
}
43+
/// Controls the intensity of light emitted on the source features.
44+
/// Default value: 0. Minimum value: 0.
45+
public PropertyValue<double> BackgroundEmissiveStrength
46+
{
47+
get => GetProperty<PropertyValue<double>>(
48+
PaintCodingKeys.BackgroundEmissiveStrength,
49+
default,
50+
MapboxLayerKey.paint
51+
);
52+
set => SetProperty(
53+
PaintCodingKeys.BackgroundEmissiveStrength,
54+
value,
55+
MapboxLayerKey.paint
56+
);
57+
}
58+
/// Transition options for `backgroundEmissiveStrength`.
59+
public PropertyValue<StyleTransition> BackgroundEmissiveStrengthTransition
60+
{
61+
get => GetProperty<PropertyValue<StyleTransition>>(
62+
PaintCodingKeys.BackgroundEmissiveStrengthTransition,
63+
default,
64+
MapboxLayerKey.paint
65+
);
66+
set => SetProperty(
67+
PaintCodingKeys.BackgroundEmissiveStrengthTransition,
68+
value,
69+
MapboxLayerKey.paint
70+
);
71+
}
72+
/// The opacity at which the background will be drawn.
73+
/// Default value: 1. Value range: [0, 1]
74+
public PropertyValue<double> BackgroundOpacity
75+
{
76+
get => GetProperty<PropertyValue<double>>(
77+
PaintCodingKeys.BackgroundOpacity,
78+
default,
79+
MapboxLayerKey.paint
80+
);
81+
set => SetProperty(
82+
PaintCodingKeys.BackgroundOpacity,
83+
value,
84+
MapboxLayerKey.paint
85+
);
86+
}
87+
/// Transition options for `backgroundOpacity`.
88+
public PropertyValue<StyleTransition> BackgroundOpacityTransition
89+
{
90+
get => GetProperty<PropertyValue<StyleTransition>>(
91+
PaintCodingKeys.BackgroundOpacityTransition,
92+
default,
93+
MapboxLayerKey.paint
94+
);
95+
set => SetProperty(
96+
PaintCodingKeys.BackgroundOpacityTransition,
97+
value,
98+
MapboxLayerKey.paint
99+
);
100+
}
101+
/// Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
102+
public PropertyValue<ResolvedImage> BackgroundPattern
103+
{
104+
get => GetProperty<PropertyValue<ResolvedImage>>(
105+
PaintCodingKeys.BackgroundPattern,
106+
default,
107+
MapboxLayerKey.paint
108+
);
109+
set => SetProperty(
110+
PaintCodingKeys.BackgroundPattern,
111+
value,
112+
MapboxLayerKey.paint
113+
);
114+
}
115+
116+
public static class PaintCodingKeys {
117+
public const string BackgroundColor = "background-color";
118+
public const string BackgroundColorTransition = "background-color-transition";
119+
public const string BackgroundEmissiveStrength = "background-emissive-strength";
120+
public const string BackgroundEmissiveStrengthTransition = "background-emissive-strength-transition";
121+
public const string BackgroundOpacity = "background-opacity";
122+
public const string BackgroundOpacityTransition = "background-opacity-transition";
123+
public const string BackgroundPattern = "background-pattern";
124+
}
125+
126+
public static class LayoutCodingKeys {
127+
128+
}
129+
}

0 commit comments

Comments
 (0)