Onion.Maui.GoogleMaps 5.1.2
Maui.GoogleMaps
Maps library for MAUI that uses Google maps on both mobile platforms - Android and iOS.
Usage is almost the same as Xamarin.Forms.GoogleMaps - github because it was forked from it. More information about library capabilities can be found there. Please note that after the migration to MAUI some properties, events or commands may have been omitted. Also, the namespace is Maui.GoogleMaps instead of Xamarin.Forms.GoogleMaps.
Platform Support
| Platform | Supported |
|---|---|
| iOS | Yes |
| Android | Yes |
| Windows 10/11 | No |
| Others | No |
Setup
- Target .NET 8 for best experience
- Install into your MAUI project by downloading the library from nuget:
- Finish the Google Cloud Console setup
- Get your API Keys from Google, then in Platforms/Android:
// MainApplication.cs
[Application]
[MetaData("com.google.android.maps.v2.API_KEY",
Value = Variables.GOOGLE_MAPS_ANDROID_API_KEY)]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{ }
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
And in the MauiProgram.cs file
// MauiProgram.cs
using Maui.GoogleMaps.Hosting;
...
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder.UseMauiApp<App>();
#if ANDROID
builder.UseGoogleMaps();
#elif IOS
builder.UseGoogleMaps(Variables.GOOGLE_MAPS_IOS_API_KEY);
#endif
return builder.Build();
}
Sample application is here.
Contribution
I really appreciate your contribution. If u have spotted a bug you want to fix or have a feature/enhancement you would like to implement please open a pull request targeting the maui branch. If u have any questions you are free to reach out to me - all contact info is available in my profile.
License
See LICENSE .
- logo.png by alecive - CC BY-SA 4.0
No packages depend on Onion.Maui.GoogleMaps.
5.1.2
- Fixed android/ios obsolete code, small code cleanings
5.1.1
- Fixed min/max zoom level mapping for MvvmMapHandler
5.1.0
- Added MvvmMap control, which has a lot of useful bindings, has support for custom info window.
- Added ability to allow different patterns on polylines (Android: dashed and dotted lines, iOS: dashed lines only at this point)
- Fixed snapshots on iOS 17+
- MAUI update
.NET 8.0
- Microsoft.Maui.Controls (>= 8.0.61)
.NET 8.0
- Microsoft.Maui.Controls (>= 8.0.61)
- Xamarin.GooglePlayServices.Maps (>= 118.2.0.1)
.NET 8.0
- Microsoft.Maui.Controls (>= 8.0.61)
- Xamarin.Build.Download (>= 0.11.4)
- Xamarin.Google.iOS.Maps (>= 6.0.1.1)