You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current code in MauiProgram.cs does not enclose the UseCommunityToolkitMaps("key") in a #ifdef WINDOWS directive.
The 2.0.1 Release of the Community Toolkit Maps component introduced a change that requires the #ifdef Windows directive when compiling a multiple platform application with Maps.
This can cause confusion for people trying to incorporate Maps into the application due to the fact that since Maui 8.0.10 now throws an exception on Windows when using the standard Maps component.
This can cause hours of wasted effort tracking down the cause of the exception.
Expected Behavior
The current Sample code would include the #ifdef compiler directive for WINDOWS around the .UseCommunityToolkitMaps("key") method.
Further Discussion
Unsure whether to add just the #ifdef WINDOWS directive or also include the #IFDEF IOS || ANDROID as well. If doing the latter, we would also want to update the appropriate platforms to include setting API Keys.
Steps To Reproduce
Add Maps support for Android by calling .UseMauiMaps().
Get an exception when running on Windows that Maps is not supported on Windows.
…way to initialize Maps in MauiProgram.cs to support Maps on all platforms. (#2325)
* Modified sample to support Maps on all platforms.
* Added XML documentation to reflect proper usage of UseCommunityToolkitMaps() in a multi-platform app.
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
The current code in MauiProgram.cs does not enclose the UseCommunityToolkitMaps("key") in a #ifdef WINDOWS directive.
The 2.0.1 Release of the Community Toolkit Maps component introduced a change that requires the #ifdef Windows directive when compiling a multiple platform application with Maps.
This can cause confusion for people trying to incorporate Maps into the application due to the fact that since Maui 8.0.10 now throws an exception on Windows when using the standard Maps component.
This can cause hours of wasted effort tracking down the cause of the exception.
Expected Behavior
The current Sample code would include the #ifdef compiler directive for WINDOWS around the
.UseCommunityToolkitMaps("key")
method.Further Discussion
Unsure whether to add just the
#ifdef WINDOWS
directive or also include the#IFDEF IOS || ANDROID
as well. If doing the latter, we would also want to update the appropriate platforms to include setting API Keys.Steps To Reproduce
.UseMauiMaps()
.Link to public reproduction project repository
https://github.com/mikelor/CommunityToolkit-Maui/
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: