Visually Located

XAML and GIS

Building a map app with the ArcGIS Runtime Map

This is the first in a series of posts that will go over the new ArcGIS Runtime SDK. This first post will discuss how to get started and create an app that has the ArcGIS Runtime Map. This first step is to download the SDK. The SDK is currently in beta so you will need to sign up for the beta program. It’s important to note that you will not be able to get the SDK from nuget.

Esri packages their installers a little differently than you might be used it. The exe that you download is a zip of the actual installer. Run the ArcGIS_Runtime_SDK_for_DotNet_1022_536.exe (as of writing this the file is missing the exe extension, so you’ll need to add it) and you will be prompted for a location to unpackage the installer.

image

Give it a location, once it completes it will run the actual Setup.exe.

image

image

We’ll be building a Windows Store app with the SDK so you’ll need Visual Studio 2013. The SDK does not support Windows 8 apps, only Windows 8.1 apps. For Windows Phone and WPF you can use Visual Studio 2012. Open up Visual Studio and create a new Windows Store project.

image

The core of the ArcGIS Runtime is built with C++. Because of this, you’ll need to change the platform of the application from Any CPU. Any CPU is a .NET only thing, so we’ll need to specify either x86, x64 or ARM. To change the platform right click on the solution and select Configuration Manager. You may also want to add the platform target dropdown to a toolbar..

image

Make sure that debug and release are set to something other than Any CPU. If you like using the designer, you need to pick x86. When you ship your app, you’ll package it up with x86, x64 and ARMso it will work on any Windows 8.1 device.

image

Next add a reference to the new ArcGIS Runtime assembly. The assembly is under the Windows –> Extensions group.

image

Open the XAML of your MainPage. For this example we’ll create a fully emersive mapping application. We’ll need to add two namespaces to our xaml.

<Page
    x:Class="App1.MainPage"
    ...
    xmlns:esri="using:Esri.ArcGISRuntime.Controls"
    xmlns:layers="using:Esri.ArcGISRuntime.Layers">

If you are using Windows Phone, make sure you define the namespaces properly

<phone:PhoneApplicationPage
    xmlns:esri="clr-namespace:Esri.ArcGISRuntime.Controls;assembly=Esri.ArcGISRuntime"
    xmlns:layers="clr-namespace:Esri.ArcGISRuntime.Layers;assembly=Esri.ArcGISRuntime">

The esri namespace is where the controls live. This is where we will find the new MapView control.  In the past, we have worked with Map control. Now the Map is a property of the MapView. This does seem odd as they have only pulled out the InitialExtent property and the Layers property. The rest of the map functionality still resides on the MapView.

The layers namespace is where we will find the different types of layers we can  to the map. The next post will have more information on the different layers. For this post we’ll use the ArcGISTilesMapServiceLayer using Esri’s free tiled map services.

With the name spaces defined, add the following XAML your page.

<esri:MapView>
    <esri:MapView.Map>
        <esri:Map>
            <layers:ArcGISTiledMapServiceLayer 
                    ServiceUri="http://services.arcgisonline.com/arcgis/rest/services/ESRI_Imagery_World_2D/MapServer"/>
        </esri:Map>
    </esri:MapView.Map>
</esri:MapView>

Run the application and you’ll have a map app! Pan, zoom around. Find your home, have fun!

image

As you can see it is pretty simple to get started with the ArcGIS Runtime SDK. In the next post I’ll cover the different layers in the SDK.

Notice the legal notice in the corner? We are currently using the developer license (or no license) on the SDK. The SDK is still in beta, so you cannot use it in a production app (without asking). When the SDK is final, you can use a basic license for free. This license will get you pretty much everything you need to build an app. I’ll walk through registering for a license when it’s all working properly


You can download this solution that also contains a Windows Phone 8 app as well!

Read Part 2: Working with Basic Mapping Layers in the ArcGIS Runtime 

blog comments powered by Disqus