Mapbox.Maui 10.11.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Mapbox.Maui --version 10.11.1
NuGet\Install-Package Mapbox.Maui -Version 10.11.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mapbox.Maui" Version="10.11.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mapbox.Maui --version 10.11.1
#r "nuget: Mapbox.Maui, 10.11.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Mapbox.Maui as a Cake Addin
#addin nuget:?package=Mapbox.Maui&version=10.11.1

// Install Mapbox.Maui as a Cake Tool
#tool nuget:?package=Mapbox.Maui&version=10.11.1

Mapbox for MAUI

A dedicated library and starting sample for integrating Mapbox into your MAUI application.

Installation

Install-Package Mapbox.Maui --version 10.11.1

Setup

1/ MAPBOX_DOWNLOADS_TOKEN

All Mapbox libraries required an access token to download them for use. Please follow the guide from Mapbox and go the dashboard of your Mapbox account and grab one.

a/ Android On Android, we will leverage the gradle way of downloading Mapbox native libraries, please set MAPBOX_DOWNLOADS_TOKEN property and put it in ~/.gradle/gradle.properties as below example

MAPBOX_DOWNLOADS_TOKEN=YOUR_MAPBOX_DOWNLOADS_TOKEN

b/ iOS oOn iOS, we will need to edit iOS's CSPROJ file to have MAPBOX_DOWNLOADS_TOKEN property as below example.

<Project ...>
    ...

	<PropertyGroup>
		<MAPBOX_DOWNLOADS_TOKEN>YOUR_MAPBOX_DOWNLOADS_TOKEN</MAPBOX_DOWNLOADS_TOKEN>
	</PropertyGroup>
    ...
</Project>

2/ Android addtional setup As Mapbox has its own private Gradle repository, we need to add these lines to Android's CSPROJ file.

<Project ...>
    ...

	<ItemGroup>
		<GradleRepository Include="https://api.mapbox.com/downloads/v2/releases/maven">
			<Repository>
			maven {
				url 'https://api.mapbox.com/downloads/v2/releases/maven'
				authentication {
					basic(BasicAuthentication)
				}
				credentials {
					// Do not change the username below.
					// This should always be `mapbox` (not your username).
					username = "mapbox"
					// Use the secret token you stored in gradle.properties as the password
					password = MAPBOX_DOWNLOADS_TOKEN
				}
			}
			</Repository>
		</GradleRepository>
	</ItemGroup>

    ...
</Project>

2/ YOUR_ACCESS_TOKEN

To display Mapbox Map in your app, you will need another access token which can be easily grabbed by following the guide from Mapbox.

You can set it conventionally in strings.xml for Android or in info.plist for iOS. Otherwise, you can also set the value in code as the guide from Mapbox documetation.

a/ Android's strings.xml

<string name="mapbox_access_token">YOUR_MAPBOX_ACCESS_TOKEN</string>

b/ iOS's info.plist

<key>MBXAccessToken</key>
<string>YOUR_MAPBOX_ACCESS_TOKEN</string>

Ported Examples

# Example Ported
1 AddMarkersSymbolExample OK
2 AddOneMarkerSymbolExample OK
3 AdvancedViewportGesturesExample
4 AnimateGeoJSONLineExample
5 AnimateImageLayerExample
6 AnimateLayerExample
7 AnimatedMarkerExample OK
8 BasicLocationPulsingExample
9 BasicMapExample OK
10 BuildingExtrusionsExample OK
11 CameraAnimationExample
12 CameraAnimatorsExample
13 CircleAnnotationExample OK
14 ColorExpressionExample
15 Custom2DPuckExample
16 Custom3DPuckExample
17 CustomLayerExample
18 CustomLocationProviderExample
19 CustomPointAnnotationExample OK
20 CustomStyleURLExample OK
21 DataDrivenSymbolsExample
22 DataJoinExample
23 DebugMapExample OK
24 DistanceExpressionExample
25 ExternalVectorSourceExample
26 FeatureStateExample
27 FeaturesAtPointExample
28 FrameViewAnnotationsExample
29 GlobeExample
30 GlobeFlyToExample
31 HeatmapLayerGlobeExample
32 IconSizeChangeExample OK
33 LargeGeoJSONPerformanceExample
34 LayerPositionExample
35 LineAnnotationExample OK
36 LineGradientExample
37 LiveDataExample
38 LocalizationExample
39 MultipleGeometriesExample OK
40 NavigationSimulatorExample
41 OfflineManagerExample OK
42 OfflineRegionManagerExample
43 PitchAndDistanceExample
44 PointAnnotationClusteringExample OK
45 PointClusteringExample
46 PolygonAnnotationExample OK
47 RasterTileSourceExample
48 ResizableImageExample
49 RestrictCoordinateBoundsExample
50 SceneKitExample N/A
51 ShowHideLayerExample
52 SkyLayerExample OK
53 SnapshotterCoreGraphicsExample
54 SnapshotterExample
55 SpinningGlobeExample
56 StoryboardMapViewExample N/A
57 SwitchStylesExample
58 SymbolClusteringExample OK
59 TerrainExample OK
60 TrackingModeExample
61 ViewAnnotationAnimationExample
62 ViewAnnotationBasicExample
63 ViewAnnotationMarkerExample
64 ViewAnnotationWithPointAnnotationExample
65 ViewportExample
66 VoiceOverAccessibilityExample

NOTE: A handy command to generate a new example

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."

Known issues

  • The library is not yet able to build to run on iOS real device. Issue

Maintainer

This project is maintained by tuyen-vuduc in his spare time and/or when requested.<br>

If you find this project is helpful and benefit your work/business, please give it a star, become a sponsor of the project and/or buy him a coffee.

"Buy Me A Coffee"

LICENSE

This library is release under The BSD 3-Clause License. You are freely to use and make changes. However, this license doesn't override the license from Mapbox.

Product Compatible and additional computed target framework versions.
.NET net6.0-android31.0 is compatible.  net6.0-ios16.1 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net8.0-android was computed.  net8.0-ios was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
11.1.0-alpha01 109 2/28/2024
10.11.1.1 455 7/20/2023
10.11.1 225 7/15/2023