Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 806 Bytes

getting-started-winui.md

File metadata and controls

51 lines (33 loc) · 806 Bytes

Mapsui WinUI Getting Started

Step 1

Create new 'Blank App. Packaged (WinUI 3 in Desktop)' in Visual Studio

Step 2

In the package manager console type:

PM> Install-Package Mapsui.WinUI -pre

Step 3

Open MainPage.xaml and add namespace:

xmlns:winui="using:Mapsui.UI.WinUI"

Add MapControl to the Grid:

<Grid>
  <winui:MapControl x:Name="MyMap" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
</Grid>

In MainPage.xaml.cs, add namespace:

using Mapsui.Utilities;

Add code to the constructor:

        public MainPage()
        {
            this.InitializeComponent();

            MyMap.Map.Layers.Add(OpenStreetMap.CreateTileLayer());
        }

Step 4

Run it and you should see a map of the world.