Closed andreas-nesheim closed 1 year ago
I'll take a look
@andreas-nesheim just init the maps manually before .UseGoogleMaps()
MauiGoogleMaps.Init("Key"); //ios
MauiGoogleMaps.Init(this, savedInstanceState); //android
Great, I'll have a try next week when I'm back at work!
This worked perfectly, thank you very much for your help!
SUMMARY
Hi! Thank you very much for your work in porting this library to .NET MAUI, it is greatly appreciated!
We have an app that utilizes MAUI Embedding to use MAUI pages in ".NET for Android" and ".NET for iOS" apps (previously Xamarin.Android and Xamarin.iOS). I was hoping to use your library in this app, but it seems that the map registration doesn't seem to take effect when using this approach. Do you know if this is possible at all with this approach, or if this is something that's possible to implement? When I try to do this from the iOS project, I get this error at runtime:
On Android I just get a NullReferenceException at runtime.
DETAILS
The use-case involves having one class library for the iOS/Android app and one class library where the MAUI pages are located. I use the embedding technique (as described in the previous link) and I use the host builder to add the
.UseGoogleMaps()
in my AppDelegate.cs / MainActivity.cs. I've attached a repro of a project that uses MAUI embedding and that tries to use this package.I understand that this embedding technique might not be all that used, but it would be great if there is a way to make this package work with this setup.
PLATFORMS
MAUIEmbedding.zip