Skip to content

Commit

Permalink
feat: add RasterSource (#38)
Browse files Browse the repository at this point in the history
* feature: add RasterLayer and RasterSource

* - [WIP] RasterTileSourceExample

* - add SetSourceProperty
  • Loading branch information
tuyen-vuduc authored Aug 26, 2024
1 parent 17d117c commit 4bd5113
Show file tree
Hide file tree
Showing 15 changed files with 958 additions and 187 deletions.
1 change: 1 addition & 0 deletions src/libs/Mapbox.Maui/IMapboxView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ void CameraForCoordinates(
double? maxZoom = default,
ScreenPosition? offset = default
);
void SetSourcePropertyFor<T>(string sourceId, string propertyName, T value, Action<Exception> completion = default);
}

public class MapTappedEventArgs : EventArgs
Expand Down
4 changes: 2 additions & 2 deletions src/libs/Mapbox.Maui/Mapbox.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<RepositoryUrl>https://github.com/tuyen-vuduc/mapbox-maui</RepositoryUrl>
<PackageProjectUrl>https://mapbox.tuyen-vuduc.tech</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageVersion>11.5.1-alpha05</PackageVersion>
<PackageVersion>11.5.1-alpha06</PackageVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageIcon>tv-mapbox.png</PackageIcon>
Expand Down Expand Up @@ -90,7 +90,7 @@
<PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.8.0.1" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
<PackageReference Include="MapboxMapsObjC.iOS" Version="11.5.2.6" />
<PackageReference Include="MapboxMapsObjC.iOS" Version="11.5.2.7" />
<PackageReference Include="MapboxMaps.iOS" Version="11.5.2" />
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/libs/Mapbox.Maui/Models/Styles/Layers/LayerType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ namespace MapboxMaui;
/// Raster map textures such as satellite imagery.
public static readonly LayerType Raster = new ("raster");

/// Layer repsenting particles on the map.
public static readonly LayerType RasterParticle = new ("raster-particle");

/// Client-side hillshading visualization based on DEM data.
/// Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.
public static readonly LayerType Hillshade = new ("hillshade");
Expand Down
8 changes: 8 additions & 0 deletions src/libs/Mapbox.Maui/Models/Styles/Layers/MapboxLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static class MapboxLayerKey
public const string filter = "filter";
public const string source = "source";
public const string sourceLayer = "source-layer";
public const string slot = "slot";
public const string minZoom = "minzoom";
public const string maxZoom = "maxzoom";
public const string layout = "layout";
Expand Down Expand Up @@ -91,6 +92,13 @@ public string SourceLayer
set => SetProperty(MapboxLayerKey.sourceLayer, value);
}

// /// The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.
public string Slot
{
get => GetProperty<string>(MapboxLayerKey.slot, default);
set => SetProperty(MapboxLayerKey.slot, value);
}

public double? MinZoom
{
get => GetProperty<double?>(MapboxLayerKey.minZoom, default);
Expand Down
Loading

0 comments on commit 4bd5113

Please sign in to comment.