diff --git a/doc/Learn/Maui/Assets/Screenshots/MacCatalyst/EsriMaps.png b/doc/Learn/Maui/Assets/Screenshots/MacCatalyst/EsriMaps.png new file mode 100644 index 0000000000..7c72503b91 Binary files /dev/null and b/doc/Learn/Maui/Assets/Screenshots/MacCatalyst/EsriMaps.png differ diff --git a/doc/Learn/Maui/Assets/Screenshots/Windows/EsriMaps.png b/doc/Learn/Maui/Assets/Screenshots/Windows/EsriMaps.png index 6ea26e1148..c9678ee37e 100644 Binary files a/doc/Learn/Maui/Assets/Screenshots/Windows/EsriMaps.png and b/doc/Learn/Maui/Assets/Screenshots/Windows/EsriMaps.png differ diff --git a/doc/Learn/Maui/Assets/Screenshots/iOS/EsriMaps.png b/doc/Learn/Maui/Assets/Screenshots/iOS/EsriMaps.png new file mode 100644 index 0000000000..648e507c1b Binary files /dev/null and b/doc/Learn/Maui/Assets/Screenshots/iOS/EsriMaps.png differ diff --git a/doc/Learn/Maui/ThirdParty-EsriMaps.md b/doc/Learn/Maui/ThirdParty-EsriMaps.md index 8362dc4016..4ad6e12762 100644 --- a/doc/Learn/Maui/ThirdParty-EsriMaps.md +++ b/doc/Learn/Maui/ThirdParty-EsriMaps.md @@ -9,8 +9,10 @@ The MapView control, that's part of the ArcGIS Maps SDK for .NET, can be used in An existing sample app that showcases the controls is available [here](https://github.com/unoplatform/Uno.Samples/tree/master/UI/MauiEmbedding/ArcGisApp). -> [!NOTE] +> [!NOTE] > For this sample you don't need to have a license, because it's just a demo and for development purposes. +> +> Esri ArcGIS Maps SDK for .NET is currently only compatible with Windows, Android, iOS, and Mac Catalyst when used with Uno Platform at the moment. ## Installation @@ -18,45 +20,85 @@ In order to use the MapView control, you first need to create an account via the ## Getting Started -1. Create a new application using the `unoapp` template, enabling .NET MAUI Embedding. In this case, we're going to use the Blank template (`-preset blank`) and include .NET MAUI Embedding support (`-maui`). +### [Visual Studio](#tab/vs) - ``` - dotnet new unoapp -preset blank -maui -o MauiEmbeddingApp - ``` +> [!NOTE] +> If you don't have the **Uno Platform Extension for Visual Studio** installed, follow [these instructions](xref:Uno.GetStarted.vs2022). -1. Next, add a reference to the [Esri.ArcGISRuntime.Maui NuGet package](https://www.nuget.org/packages/Esri.ArcGISRuntime.Maui) to the `MauiEmbeddingApp.MauiControls` project. +- Launch **Visual Studio** and click on **Create new project** on the Start Window. Alternatively, if you're already in Visual Studio, click **New, Project** from the **File** menu. -1. In the `AppBuilderExtensions` class, on `MauiEmbeddingApp.MauiControls` project, update the `UseMauiControls` extension method to call the `UseArcGISRuntime` method. +- Type `Uno Platform` in the search box - ```cs - using Esri.ArcGISRuntime; - using Esri.ArcGISRuntime.Maui; - using Esri.ArcGISRuntime.Security; +- Click **Uno Platform App**, then **Next** - namespace MauiEmbeddingApp; +- Name the project `ArcGisApp` and click **Create** - public static class AppBuilderExtensions - { - public static MauiAppBuilder UseMauiControls(this MauiAppBuilder builder) - => builder - .UseArcGISRuntime( - //config => config - // .UseLicense("[Your ArcGIS Maps SDK License key]") - // .UseApiKey("[Your ArcGIS location services API Key]") - // .ConfigureAuthentication(auth => auth - // .UseDefaultChallengeHandler() // Use the default authentication dialog - // ) - ) - .ConfigureFonts(fonts => - { - fonts.AddFont("MauiEmbeddingApp/Assets/Fonts/OpenSansRegular.ttf", "OpenSansRegular"); - fonts.AddFont("MauiEmbeddingApp/Assets/Fonts/OpenSansSemibold.ttf", "OpenSansSemibold"); - }); - } - ``` +At this point you'll enter the **Uno Platform Template Wizard**, giving you options to customize the generated application. + +- Select **Blank** in **Presets** selection + +- Select the **Platforms** tab and unselect **Desktop** and **Web Assembly** platforms + +- Select the **Features** tab and click on **.NET MAUI Embedding** - > [!NOTE] - > If you have a license key and/or a location service API key, uncomment the `delegate` provided on `UseArcGISRuntime` method. This isn't required to run this sample. +- Click **Create** to complete the wizard + +The template will create a solution with a single cross-platform project, named `ArcGisApp`, ready to run. + +For more information on all the template options, see [Using the Uno Platform Template](xref:Uno.GettingStarted.UsingWizard). + +### [Command Line](#tab/cli) + +> [!NOTE] +> If you don't have the **Uno Platform dotnet new templates** installed, follow [dotnet new templates for Uno Platform](xref:Uno.GetStarted.dotnet-new). + +Create a new application using the `unoapp` template, enabling .NET MAUI Embedding. In this case, we're going to use the Blank template (`-preset blank`) and include .NET MAUI Embedding support (`-maui`). + +```bash +dotnet new unoapp -preset blank -maui -platforms "android" -platforms "ios" -platforms "maccatalyst" -platforms "windows" -o ArcGisApp +``` + +This will create a new folder called **ArcGisApp** containing the new application. + +--- + +## Nuget Packages + +Add a reference to the [Esri.ArcGISRuntime.Maui NuGet package](https://www.nuget.org/packages/Esri.ArcGISRuntime.Maui) to the `ArcGisApp.MauiControls` project. + +## Updating AppBuilderExtensions + +In the `AppBuilderExtensions` class, on `ArcGisApp.MauiControls` project, update the `UseMauiControls` extension method to call the `UseArcGISRuntime` method. + +```cs +using Esri.ArcGISRuntime; +using Esri.ArcGISRuntime.Maui; +using Esri.ArcGISRuntime.Security; + +namespace ArcGisApp; + +public static class AppBuilderExtensions +{ + public static MauiAppBuilder UseMauiControls(this MauiAppBuilder builder) + => builder + .UseArcGISRuntime( + //config => config + // .UseLicense("[Your ArcGIS Maps SDK License key]") + // .UseApiKey("[Your ArcGIS location services API Key]") + // .ConfigureAuthentication(auth => auth + // .UseDefaultChallengeHandler() // Use the default authentication dialog + // ) + ) + .ConfigureFonts(fonts => + { + fonts.AddFont("Assets/Fonts/OpenSansRegular.ttf", "OpenSansRegular"); + fonts.AddFont("Assets/Fonts/OpenSansSemibold.ttf", "OpenSansSemibold"); + }); +} +``` + +> [!NOTE] +> If you have a license key and/or a location service API key, uncomment the `delegate` provided on `UseArcGISRuntime` method. This isn't required to run this sample. ## Adding MapView @@ -68,7 +110,7 @@ In order to use the MapView control, you first need to create an account via the xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui" - x:Class="MauiEmbeddingApp.MauiControls.EmbeddedControl"> + x:Class="ArcGisApp.MauiControls.EmbeddedControl">