Bindings.Mapbox.iOS.Common
24.23.0.2
dotnet add package Bindings.Mapbox.iOS.Common --version 24.23.0.2
NuGet\Install-Package Bindings.Mapbox.iOS.Common -Version 24.23.0.2
<PackageReference Include="Bindings.Mapbox.iOS.Common" Version="24.23.0.2" />
<PackageVersion Include="Bindings.Mapbox.iOS.Common" Version="24.23.0.2" />
<PackageReference Include="Bindings.Mapbox.iOS.Common" />
paket add Bindings.Mapbox.iOS.Common --version 24.23.0.2
#r "nuget: Bindings.Mapbox.iOS.Common, 24.23.0.2"
#:package Bindings.Mapbox.iOS.Common@24.23.0.2
#addin nuget:?package=Bindings.Mapbox.iOS.Common&version=24.23.0.2
#tool nuget:?package=Bindings.Mapbox.iOS.Common&version=24.23.0.2
Mapbox .NET iOS Bindings
.NET iOS bindings for the native Mapbox iOS SDK.[^tuyen] These packages target
net10.0-ios and iOS 15 or later.
Install
For an app that renders Mapbox maps, install the Maps package and the Objective-C bridge package:
dotnet add package Bindings.Mapbox.iOS --version 11.23.0.2
dotnet add package Bindings.Mapbox.iOS.MapsObjC --version 11.23.0.2
Bindings.Mapbox.iOS brings in the Common, CoreMaps, and Turf binding packages.
Install those directly only when you need those APIs without a map view.
Tokens
Set MAPBOX_DOWNLOADS_TOKEN to a secret Mapbox downloads token before building.
The package targets use it to download the native Mapbox frameworks:
export MAPBOX_DOWNLOADS_TOKEN=sk...
Set a public Mapbox access token for runtime tile access. The usual options are
an MBXAccessToken entry in Info.plist:
<key>MBXAccessToken</key>
<string>$(MapboxAccessToken)</string>
or setting it in code before creating the map:
MapboxCommon.MBXMapboxOptions.SetAccessTokenForToken("pk...");
Minimal Map
using CoreGraphics;
using CoreLocation;
using MapboxCoreMaps;
using MapboxMaps;
using MapboxMapsObjC;
using UIKit;
var camera = new TMBCameraOptions(
new CLLocationCoordinate2D(40.7128, -74.0060),
UIEdgeInsets.Zero,
CGPoint.Empty,
10,
0,
0);
var options = MapInitOptionsFactory.CreateWithMapOptions(
null,
camera,
BuiltInStyles.Streets,
null,
(nint)1);
var mapView = MapViewFactory.CreateWithFrame(View.Bounds, options);
mapView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
View.AddSubview(mapView);
Links
- Source: mapbox-for-dotnet
- Mapbox iOS docs: docs.mapbox.com/ios/maps
[^tuyen]: The iOS binding and Objective-C bridge strategy build on Tuyen Vu Duc's mapbox-ios-binding and mapbox-ios-objective-c. Native Mapbox SDK components and Mapbox artifacts are copyright Mapbox, Inc. Please consider sponsoring Tuyen.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-ios26.0 is compatible. |
-
net10.0-ios26.0
- Xamarin.Build.Download (>= 0.11.4)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Bindings.Mapbox.iOS.Common:
| Package | Downloads |
|---|---|
|
Bindings.Mapbox.iOS.CoreMaps
.NET iOS bindings for Mapbox SDK - MapboxCoreMaps |
|
|
Bindings.Mapbox.iOS
C# bindings for Mapbox iOS SDK - MapboxMaps |
GitHub repositories
This package is not used by any popular GitHub repositories.