Skip to content

Commit

Permalink
- MultipleGeometriesExample: OK
Browse files Browse the repository at this point in the history
  • Loading branch information
tuyen-vuduc committed Jun 26, 2023
1 parent 2889e63 commit 451846a
Show file tree
Hide file tree
Showing 7 changed files with 5,431 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ b/ iOS's `info.plist`
| 36 | [LineGradientExample](./mapboxqs/LineGradientExample.m) | |
| 37 | [LiveDataExample](./mapboxqs/LiveDataExample.m) | |
| 38 | [LocalizationExample](./mapboxqs/LocalizationExample.m) | |
| 39 | [MultipleGeometriesExample](./mapboxqs/MultipleGeometriesExample.m) | |
| 39 | [MultipleGeometriesExample](./mapboxqs/MultipleGeometriesExample.m) | OK |
| 40 | [NavigationSimulatorExample](./mapboxqs/NavigationSimulatorExample.m) | |
| 41 | [OfflineManagerExample](./mapboxqs/OfflineManagerExample.m) | OK |
| 42 | [OfflineRegionManagerExample](./mapboxqs/OfflineRegionManagerExample.m) | |
Expand Down
212 changes: 212 additions & 0 deletions src/libs/Mapbox.Maui/Models/Styles/Layers/FillLayer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
namespace MapboxMaui.Styles;

public class FillLayer : MapboxLayer
{
public FillLayer(string id)
: base(id)
{
Type = LayerType.fill;
Visibility = new PropertyValue<Visibility>(MapboxMaui.Visibility.visible);
}
/// Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
public PropertyValue<double> FillSortKey
{
get => GetProperty<PropertyValue<double>>(
LayoutCodingKeys.fillSortKey,
default,
MapboxLayerKey.paint
);
set => SetProperty(
LayoutCodingKeys.fillSortKey,
value,
MapboxLayerKey.layout
);
}

/// Whether or not the fill should be antialiased.
public PropertyValue<bool> FillAntialias
{
get => GetProperty<PropertyValue<bool>>(
FillLayerKey.fillAntialias,
default,
MapboxLayerKey.paint
);
set => SetProperty(
FillLayerKey.fillAntialias,
value,
MapboxLayerKey.paint
);
}

/// The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.
public PropertyValue<Color> FillColor
{
get => GetProperty<PropertyValue<Color>>(
FillLayerKey.fillColor,
default,
MapboxLayerKey.paint
);
set => SetProperty(
FillLayerKey.fillColor,
value,
MapboxLayerKey.paint
);
}

/// Transition options for `fillColor`.
public PropertyValue<StyleTransition> FillColorTransition
{
get => GetProperty<PropertyValue<StyleTransition>>(
FillLayerKey.fillColorTransition,
default,
MapboxLayerKey.paint
);
set => SetProperty(
FillLayerKey.fillColorTransition,
value,
MapboxLayerKey.paint
);
}

/// The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.
public PropertyValue<double> FillOpacity
{
get => GetProperty<PropertyValue<double>>(
FillLayerKey.fillOpacity,
default,
MapboxLayerKey.paint
);
set => SetProperty(
FillLayerKey.fillOpacity,
value,
MapboxLayerKey.paint
);
}

/// Transition options for `fillOpacity`.
public PropertyValue<StyleTransition> FillOpacityTransition
{
get => GetProperty<PropertyValue<StyleTransition>>(
FillLayerKey.fillOpacityTransition,
default,
MapboxLayerKey.paint
);
set => SetProperty(
FillLayerKey.fillOpacityTransition,
value,
MapboxLayerKey.paint
);
}

/// The outline color of the fill. Matches the value of `fill-color` if unspecified.
public PropertyValue<Color> FillOutlineColor
{
get => GetProperty<PropertyValue<Color>>(
FillLayerKey.fillOutlineColor,
default,
MapboxLayerKey.paint
);
set => SetProperty(
FillLayerKey.fillOutlineColor,
value,
MapboxLayerKey.paint
);
}

/// Transition options for `fillOutlineColor`.
public PropertyValue<StyleTransition> FillOutlineColorTransition
{
get => GetProperty<PropertyValue<StyleTransition>>(
FillLayerKey.fillOutlineColorTransition,
default,
MapboxLayerKey.paint
);
set => SetProperty(
FillLayerKey.fillOutlineColorTransition,
value,
MapboxLayerKey.paint
);
}

/// Name of image in sprite to use for drawing image fills. 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.
public PropertyValue<ResolvedImage> FillPattern
{
get => GetProperty<PropertyValue<ResolvedImage>>(
FillLayerKey.fillPattern,
default,
MapboxLayerKey.paint
);
set => SetProperty(
FillLayerKey.fillPattern,
value,
MapboxLayerKey.paint
);
}

/// The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
public PropertyValue<double[]> FillTranslate
{
get => GetProperty<PropertyValue<double[]>>(
FillLayerKey.fillTranslate,
default,
MapboxLayerKey.paint
);
set => SetProperty(
FillLayerKey.fillTranslate,
value,
MapboxLayerKey.paint
);
}

/// Transition options for `fillTranslate`.
public PropertyValue<StyleTransition> FillTranslateTransition
{
get => GetProperty<PropertyValue<StyleTransition>>(
FillLayerKey.fillTranslateTransition,
default,
MapboxLayerKey.paint
);
set => SetProperty(
FillLayerKey.fillTranslateTransition,
value,
MapboxLayerKey.paint
);
}

/// Controls the frame of reference for `fill-translate`.
public PropertyValue<FillTranslateAnchor> FillTranslateAnchor
{
get => GetProperty<PropertyValue<FillTranslateAnchor>>(
FillLayerKey.fillTranslateAnchor,
default,
MapboxLayerKey.paint
);
set => SetProperty(
FillLayerKey.fillTranslateAnchor,
value,
MapboxLayerKey.paint
);
}

static class LayoutCodingKeys
{
public const string fillSortKey = "fill-sort-key";
public const string visibility = "visibility";
}

static class FillLayerKey
{
public const string fillAntialias = "fill-antialias";
public const string fillColor = "fill-color";
public const string fillColorTransition = "fill-color-transition";
public const string fillOpacity = "fill-opacity";
public const string fillOpacityTransition = "fill-opacity-transition";
public const string fillOutlineColor = "fill-outline-color";
public const string fillOutlineColorTransition = "fill-outline-color-transition";
public const string fillPattern = "fill-pattern";
public const string fillTranslate = "fill-translate";
public const string fillTranslateTransition = "fill-translate-transition";
public const string fillTranslateAnchor = "fill-translate-anchor";
}
}

Loading

0 comments on commit 451846a

Please sign in to comment.