Skip to content

Commit c196bbf

Browse files
committed
- use latest Mapbox Android SDK
1 parent 2cd57ec commit c196bbf

File tree

7 files changed

+68
-12
lines changed

7 files changed

+68
-12
lines changed

README.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,27 @@ NOTE: A handy command to generate a new example
117117
dotnet cake -- --name SymbolClustering --index 58 --group Annotations --title "Add Cluster Symbol Annotations" --subtitle "Show fire hydrants in Washington DC area in a cluster using a symbol layer."
118118
````
119119
120-
# Known issues
121-
- The library is not yet able to build to run on iOS real device. [Issue](https://github.com/xamarin/xamarin-macios/issues/8917)
120+
# NOTES
121+
122+
1) Failed to delete `.gradle` folder
123+
Due to Java process not killed gratefully.
124+
```
125+
taskkill -F -im java.exe
126+
```
127+
128+
2) Xamarin.Build.Download
129+
Xamarin.Build.Download is a tool to help download artifacts from remote URL to avoid embedding the native artifacts within the NuGet package with advantages
130+
- Very thin and lightweight NuGet package
131+
- Avoid any license viloation if the owner of the native lib doesn't want us to redistribute their lib
132+
133+
The downloaded artifact will be located at
134+
- MacOS: `~/Library/Caches/XamarinBuildDownload`
135+
- Windows: `%USERPROFILE%/AppData/Local/XamarinBuildDownloadCache`
136+
137+
3) Kill all .NET processes
138+
```
139+
taskkill -F -im dotnet.exe
140+
```
122141
123142
# Maintainer
124143
This project is maintained by [tuyen-vuduc](https://github.com/tuyen-vuduc) in his spare time and/or when requested.<br>

build.sh

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
dotnet nuget locals -c all
22

3-
# Build to trigger gradle process
4-
dotnet build -t:Clean,Rebuild src/qs/MapboxMauiQs/MapboxMauiQs.csproj \
5-
-property:MAPBOX_DOWNLOADS_TOKEN=$MAPBOX_DOWNLOADS_TOKEN
6-
73
dotnet pack -c Release -t:Clean,Rebuild src/libs/Mapbox.Maui/Mapbox.Maui.csproj \
84
--output $PWD/nugets

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

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Condition="EXISTS('Mapbox.Maui.props')" Project="Mapbox.Maui.props" />
3+
<Import Condition="EXISTS('Mapbox.Maui.targets')" Project="Mapbox.Maui.targets" />
24
<Target Name="_CleanAarOutputPath" AfterTargets="_CreateAar" BeforeTargets="_IncludeAarInNuGetPackage">
35
<Delete Files="$(_AarOutputPath)" />
46
</Target>
@@ -42,6 +44,12 @@
4244
<Compile Remove="**\**\*.iOS.cs" />
4345
</ItemGroup>
4446

47+
<PropertyGroup>
48+
<AndroidTargetSdkVersion>34</AndroidTargetSdkVersion>
49+
<AndroidSdkDirectory Condition=" '$(OS)' == 'Unix' ">$(Home)/Library/Android/sdk</AndroidSdkDirectory>
50+
<AndroidSdkDirectory Condition=" '$(OS)' != 'Unix' ">$(UserProfile)/AppData/Local/Android/sdk</AndroidSdkDirectory>
51+
</PropertyGroup>
52+
4553
<PropertyGroup>
4654
<PackageId>Mapbox.Maui</PackageId>
4755
<Title>Mapbox SDK for .NET MAUI</Title>
@@ -53,7 +61,7 @@
5361
<RepositoryUrl>https://github.com/tuyen-vuduc/mapbox-maui</RepositoryUrl>
5462
<PackageProjectUrl>https://mapbox.tuyen-vuduc.tech</PackageProjectUrl>
5563
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
56-
<PackageVersion>11.4.0-alpha02</PackageVersion>
64+
<PackageVersion>11.5.0-alpha01</PackageVersion>
5765
<PackageReadmeFile>README.md</PackageReadmeFile>
5866
<PackageLicenseFile>LICENSE</PackageLicenseFile>
5967
<PackageIcon>tv-mapbox.png</PackageIcon>
@@ -72,12 +80,13 @@
7280
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.40" />
7381
</ItemGroup>
7482
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
75-
<PackageReference Include="Com.Mapbox.Maps.Android" Version="11.4.1" />
83+
<PackageReference Include="Com.Mapbox.Maps.Android" Version="11.5.0" />
7684
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.6.1.10" />
7785
<PackageReference Include="Xamarin.AndroidX.Fragment " Version="1.7.0.2" />
7886
<PackageReference Include="Xamarin.AndroidX.Fragment.Ktx" Version="1.7.0.2" />
7987
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.9.23.3" PrivateAssets="none" />
8088
<PackageReference Include="Xamarin.Kotlin.StdLib.Common" Version="1.9.23.3" PrivateAssets="none" />
89+
<PackageReference Include="Dependencies.Gradle" Version="8.6.0.1" />
8190
</ItemGroup>
8291
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
8392
<PackageReference Include="MapboxMapsObjC.iOS" Version="11.4.0.2" />
@@ -113,4 +122,10 @@
113122
<ItemGroup>
114123
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.40" />
115124
</ItemGroup>
125+
126+
<Target
127+
Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'"
128+
Name="_GradleDependencyResolverTrigger"
129+
DependsOnTargets="_GradleSync"
130+
BeforeTargets="CoreCompile" />
116131
</Project>
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<ItemGroup>
4+
<GradleRepository Include="https://api.mapbox.com/downloads/v2/releases/maven">
5+
<Repository>
6+
maven {
7+
url = uri("https://api.mapbox.com/downloads/v2/releases/maven")
8+
authentication {
9+
create&lt;BasicAuthentication&gt;("basic")
10+
}
11+
credentials {
12+
// Do not change the username below.
13+
// This should always be `mapbox` (not your username).
14+
username = "mapbox"
15+
// Use the secret token you stored in gradle.properties as the password
16+
password = providers.gradleProperty("MAPBOX_DOWNLOADS_TOKEN").get()
17+
}
18+
}
19+
</Repository>
20+
</GradleRepository>
21+
</ItemGroup>
22+
</Project>

src/libs/Mapbox.Maui/Models/Annotations/ClusterOptions.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ public class ClusterOptions
2222

2323
/// Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal
2424
/// to the width of a tile, 50 by default. Value must be greater than or equal to 0.
25-
public double ClusterRadius { get; set; }
25+
public double ClusterRadius { get; set; } = 50;
2626

2727
/// Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less
2828
/// than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom
2929
/// levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15.
30-
public double ClusterMaxZoom { get; set; }
30+
public double ClusterMaxZoom { get; set; } = 14;
31+
32+
/// Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`.
33+
public double ClusterMinPoints { get; set; } = 2;
3134

3235
/// An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from
3336
/// clustered points. Has the form `{"property_name": [operator, map_expression]}`.

src/libs/Mapbox.Maui/Platforms/Android/ClusterOptionsExtensions.cs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public static class ClusterOptionsExtensions
2020
clusterOptions.TextSize?.GetConstant(12.0) ?? 12.0,
2121
clusterOptions.TextField?.Expression?.ToPlatformValue(),
2222
(long)clusterOptions.ClusterMaxZoom,
23+
(long)clusterOptions.ClusterMinPoints,
2324
new List<Kotlin.Pair> {
2425
new Kotlin.Pair(new Java.Lang.Integer(250), new Java.Lang.Integer(Color.LightPink)),
2526
new Kotlin.Pair(new Java.Lang.Integer(150), new Java.Lang.Integer(Color.Orange)),

src/qs/MapboxMauiQs/MapboxMauiQs.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@
8989
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.40" />
9090
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
9191
<PackageReference Include="Xamarin.Build.Download" Version="0.11.4" />
92-
<PackageReference Include="GeoJSON.Text" Version="1.0.2" />
92+
<PackageReference Include="GeoJSON.Text" Version="1.0.2" />
9393
</ItemGroup>
9494

9595
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
96-
<PackageReference Include="Com.Mapbox.Maps.Android" Version="11.4.1" />
96+
<PackageReference Include="Com.Mapbox.Maps.Android" Version="11.5.0" />
9797
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.6.1.10" />
9898
<PackageReference Include="Xamarin.AndroidX.Fragment " Version="1.7.0.2" />
9999
<PackageReference Include="Xamarin.AndroidX.Fragment.Ktx" Version="1.7.0.2" />

0 commit comments

Comments
 (0)