1

I am currently developping an native Android app using Mapbox with Visual Studio (using some Mapbox nugets). I have to do the whole dev to address iOS customers but Xamarin.Forms nuget version of Mapbox is out of date, both Android & iOS SDKs have been updated since.

As Microsoft has just released the first .NET MAUI Release Candidate RC1, i.e. the successor of Xamarin.Forms, I would like to start over a new project so I can manage one development pipeline to deploy on either Android or iOS afterwards.

So I open this thread in order to share help to embbed Mapbox in a fresh new .NET MAUI project.

How should we proceed to simply display a Mapbox map view with a .NET MAUI project? Thank you!

  • I'll describe what needs to be done. Anything that can be integrated into a java (or objective c on iOS) app, can be integrated into a Maui (or Xamarin) app. For Xamarin, this requires mostly code in platform-specific (Android) project. For Maui, the equivalent is code wrapped in `#if Android`, that implements a custom handler. Someone needs to take the source code of that Xamarin Mapbox nuget, and change the xamarin custom renderer logic to Maui custom handler logic. ... – ToolmakerSteve Apr 13 '22 at 16:00
  • ... And because the Mapbox SDK has been updated, the [Java library bindings](https://learn.microsoft.com/en-us/xamarin/android/platform/binding-java-library/) must be regenerated. Likewise for the iOS library bindings. (I'm busy on a project that won't switch to Maui for another six months, so I don't have time to do this myself.) – ToolmakerSteve Apr 13 '22 at 16:02
  • Thank for the feedback. Is there any unofficial Xamarin Forms implementation of Mapbox using both SDKs? It could be useful to have a look about how it has been done in Forms in order to redo in MAUI. – StarChick971 Apr 18 '22 at 16:34

1 Answers1

1

The best way for now is implementing a Maui Blazor app and using a BlazorWebView to put a MapBox in your page.

See Build a .NET MAUI Blazor app documentation