diff --git a/GettingStarted.png b/GettingStarted.png new file mode 100644 index 0000000..b247299 Binary files /dev/null and b/GettingStarted.png differ diff --git a/MapsGettingStarted_Sample/MapsGettingStarted_Sample.csproj b/MapsGettingStarted_Sample/MapsGettingStarted_Sample.csproj index 7643050..4e5e7e1 100644 --- a/MapsGettingStarted_Sample/MapsGettingStarted_Sample.csproj +++ b/MapsGettingStarted_Sample/MapsGettingStarted_Sample.csproj @@ -11,7 +11,7 @@ MapsGettingStarted_Sample en-US UAP - 10.0.16299.0 + 10.0.26100.0 10.0.16299.0 14 512 @@ -158,7 +158,7 @@ - 6.2.7 + 6.2.14 * diff --git a/README.md b/README.md index 92fcf30..e598005 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,85 @@ # Getting Started with UWP Map (SfMaps) -This repository contains sample to getting started with the [Syncfusion UWP Map](https://help.syncfusion.com/uwp/map/getting-started) control. +This sample demonstrates how to create a UWP Map using the Syncfusion `SfMap` control. -## Syncfusion controls +## Prerequisites -This project used the following Syncfusion control(s): -* [SfMaps](https://www.syncfusion.com/uwp-ui-controls/map) +- Visual Studio 2022 or later +- Windows 10 SDK (10.0.16299.0 or later) +- [Syncfusion.SfMaps.UWP](https://www.nuget.org/packages/Syncfusion.SfMaps.UWP) NuGet package (latest) -## Requirements to run the sample +## Adding Assembly Reference -* [Visual Studio](https://visualstudio.microsoft.com/downloads/) -* Windows 10 SDK +### Option 1: Via NuGet Package Manager -Refer to the following link for more details - [System Requirements](https://help.syncfusion.com/uwp/system-requirements) +1. Right-click on the project in **Solution Explorer** and select **Manage NuGet Packages**. +2. Search for `Syncfusion.SfMaps.UWP` and install it. -## How to run the sample +### Option 2: Via Extension Reference -1. Clone the sample and open it in Visual Studio. +1. Open the **Add Reference** window from your project. +2. Choose **Windows > Extensions > Syncfusion Controls for UWP XAML**. - *Note: If you download the sample using the "Download ZIP" option, right-click it, select Properties, and then select Unblock.* - -2. Register your license key in the App.cs file as demonstrated in the following code. +## Adding Namespace - public App() - { - //Register Syncfusion license - Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); +After adding the reference, include the following namespace in your `MainPage.xaml`: - this.InitializeComponent(); - this.Suspending += OnSuspending; - } - - Refer to this [link](https://help.syncfusion.com/uwp/licensing/overview) for more details. - -3. Clean and build the application. +```xml +xmlns:syncfusion="using:Syncfusion.UI.Xaml.Maps" +``` -4. Run the application. +## Initializing the Map (XAML) -## License +In `MainPage.xaml`, initialize `SfMap` by adding a `ShapeFileLayer` and setting the `Uri` property to point to your shape file: -Syncfusion has no liability for any damage or consequence that may arise by using or viewing the samples. The samples are for demonstrative purposes, and if you choose to use or access the samples, you agree to not hold Syncfusion liable, in any form, for any damage that is related to use, for accessing, or viewing the samples. By accessing, viewing, or seeing the samples, you acknowledge and agree Syncfusion’s samples will not allow you seek injunctive relief in any form for any claim related to the sample. If you do not agree to this, do not view, access, utilize, or otherwise do anything with Syncfusion’s samples. +```xml + + + + + + + + + + + +``` + +## Initializing the Map (Code-Behind) + +Alternatively, you can create the map entirely in C# code-behind: + +```csharp +using Syncfusion.UI.Xaml.Maps; + +// Initializing the map +SfMap syncMap = new SfMap(); + +// Creating and configuring the shape file layer +ShapeFileLayer layer = new ShapeFileLayer(); +layer.Uri = "MapsGettingStarted_Sample.Assets.ShapeFiles.world1.shp"; + +// Adding the layer to the map +syncMap.Layers.Add(layer); + +// Adding map to the Grid +mainGrid.Children.Add(syncMap); +``` + +![Maps getting started image](GettingStarted.png) + +## Reference + +- [Syncfusion UWP Maps Getting Started Documentation](https://help.syncfusion.com/uwp/map/getting-started) +- [Syncfusion UWP Maps Product Page](https://www.syncfusion.com/uwp-ui-controls/map) +- [Shapefile Technical Description](http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf)