Developing Mapping Applications with ArcGIS Runtime SDK for WPF Mike Branscomb & Chris Davies Offering ID: 212
ArcGIS Runtime SDK for WPF •
Build native apps for Windows Desktop -
•
.NET 4.0 WPF XAML, C#, VB.NET VS 2010 / 2012 or Blend 4
X86 & x64 -
XP Vista Windows 7 Windows 8 Desktop
ArcGIS Runtime
•
Family of SDKs for multiple platforms -
•
Consistent capabilities
Native to the platform -
For building great apps
•
Lightweight and fast
•
Powerful
•
Easy
Part of the ArcGIS platform •
ArcGIS Online / Portal -
Maps, services, content and Organization branding
•
ArcGIS for Server -
•
ArcGIS for Desktop -
Packages
Services
Agenda • Map • Layers • Layer
Initialization
• Symbology • Geocoding • Routing • Security
Map
Map •
Visual control
•
Container for layers
•
Single spatial reference
•
Handles user interaction -
•
Mouse, keyboard, touch events
Choice of display mechanism -
Standard WPF (default) Hardware accelerated display optimized for GIS
Map – Hardware Accelerated Display •
DirectX map rendering engine -
Uses graphics card Enable via Map.UseAcceleratedDisplay property
•
Same map rendering engine used by all Runtime SDKs
•
Supports all Tiled and Dynamic layer types
•
Supports Feature & Graphics Layers -
With ESRI Symbols only No custom symbols defined via XAML control templates
Map – Hardware Accelerated Display •
Enable for all layers via property on Map
•
Best practice: Always enable the accelerated display
•
Default for Samples and VS Project Template at 10.2
Map Layers
Layers •
Live Data -
•
Operational Data -
•
GraphicsLayer
DynamicLayers / FeatureLayers
Basemap -
TiledLayers
• Map
Demo
Adding Layers Chris Davies
Demo Summary – Layers •
Sample App included with SDK -
250+ samples
•
VS Project Templates provide starting point
•
Add layers in XAML or code
•
Different layer types for different purposes
•
Register handler(s) for initialization failed event
•
Register handler(s) for initialized event -
If other functionality is dependent on the layer
Layers – Layer Order <esri:Map> <esri:Map.Layers>
2
1
0
Layers – Basemaps •
Online tiled layer:
•
Provides continuous background context
•
Choose basemap to suit workflow
•
Comprises many small pre-rendered images
•
Will determine Spatial Reference for Map if not explicitly defined
•
Typically at the bottom (layer index 0)
Layers – Tiled
Layers – Operational •
Online ArcGISDynamicMapServiceLayer
•
Image for entire map extent rendered dynamically from source data
•
Supports mapping, identify, query, selections
Layers – Dynamic
Layers – Operational •
Online ArcGISFeatureLayer
•
References sub-layer within service / map package
•
Geometries, attributes, symbols returned to client
•
Greater interactivity on client -
•
e.g. editing
Based on GraphicsLayer
Layers – Feature
Layers – Graphics •
Created by your app -
•
•
GraphicsLayer is collection of Graphic objects -
Geometry
-
Symbol
-
Attributes
Recommend using single geometry type per GraphicsLayer -
•
Results of queries, routes, etc Business data
Mandatory if you are serializing to JSON
Graphics & Feature Layers benefit most from hardware accelerated display
Demo
Graphics Chris Davies
Demo Summary – Graphics •
When adding many graphics use AddRange
•
Use Renderers to apply symbols to Graphics -
•
Avoids creating individual symbol instances
Best way to move a Point Graphic is the MapPoint.MoveTo() method -
Can be used on a background thread Other geometry / symbol changes must be performed on UI thread
Map – Accelerated Group Layer •
Hybrid rendering
•
Helps you migrate
•
Standard WPF -
•
E.g. Graphics Clusterer E.g. Custom symbols E.g. Media layers
<Map>
Accelerated -
Graphics, Feature, Dynamic & Tiled Layers
Map – Accelerated Group Layer •
Register a handler for Initialization failed -
Catch exceptions when layers fail to be rendered by accelerated display
Layers – Initialization Server
Client HTTP Requests Layers Initialized
Layer Metadata JSON
Requests
Tiles, Features, Images
Service Service Services
Defining how layers are displayed
Graphics Layers
Symbols defined by ArcMap, Server & Online
Feature Layers
Dynamic Map Layers
Tiled Basemap Layers
Symbols defined by you in code/XAML
Webmaps
WebMaps •
Map definitions -
Basemap Operational data layers Feature collections Spatial Reference Extent Symbology Bookmarks Pop-up windows Helper services (place finding, directions)
Demo
Opening a Webmap Chris Davies
Demo Summary – WebMaps •
Use ESRI.ArcGIS.Client.Portal assembly to access ArcGIS Online
•
Webmap namespace
•
Document class represents a Webmap document
•
Request WebMaps async
•
Once downloaded provides an initialized Map
•
Set “UseAcceleratedDisplay” to true manually -
Handle initialization failed events if you are not in control of the contents
Finding places & Geocoding
Geocoding •
Geosearch -
•
Geocoding -
•
Free text style search Searching for and navigating to locations, places, businesses Use a Locator Service Free with World Geocoding Service on ArcGIS Online Convert address to XY location and append to database records Use a Locator Service Requires subscription for World Geocoding Service
Exposed via LocatorTask class
Geocoding – Locator Task •
In the Tasks namespace ( ESRI.ArcGIS.Client.dll )
•
Address To Locations -
•
Addresses To Locations -
•
Takes List of address strings Batch Geocode
Location To Address -
•
Takes Address To Locations Parameters
Takes MapPoint
Find -
Takes Locator Find Parameters Works with the World Geocoding Service New at 10.1.1
Routing
Routing •
Routing and directions -
•
Service areas -
•
Calculate optimal route between locations
Drive time around location(s)
Closest facility -
Nearest of several resources
Routing – RouteTask •
In the Tasks namespace (ESRI.ArcGIS.Client.dll)
•
Solve Route -
•
Solve Closest Facility -
•
Takes Route Parameters object Taskes Route Closest Facility Parameters object
Solve Service Area -
Takes Route Service Area Parameters object
Demo
Finding Places & Routing Chris Davies
Security
Security •
Use secure content -
ArcGIS Online Portal for ArcGIS (on-premise) ArcGIS for Server
•
User Logins: Use specific credentials
•
IdentityManager helps you handle authentication
•
ArcGIS Online March 2013 release: OAuth 2 - App Logins: Applications that target end users who -
are unknown to the ArcGIS platform Integrated into Identity Manager at 10.2 Interim sample available on ArcGIS.com
Demo
Security: Identity Manager Chris Davies
Wrapup
This session – Mapping •
Map Layers
•
Layer Initialization
•
Symbology
•
Map
•
Geocoding
•
Routing
•
Security
Next session… • Implementing Analysis, Editing, and Offline Apps •
Wed 1:00pm Pasadena/Ventura/Sierra
Where next… •
Best Development Practices and Patterns -
•
Software Development and Design Using MVVM -
•
Thu 10:00am Primrose C/D
Road Ahead for ArcGIS Runtime SDKs -
•
Thu 8:30am Catalina/Madera (Renaissance Hotel)
Extending the Operations Dashboard -
•
Wed 10:30am Primrose C/D
Developing Mapping Applications for the Windows 8 Store -
•
Wed 2:30pm Demo Theater 2 - Oasis 1
Thu 10:00am Primrose B
Developing Apps on the ArcGIS Platform – The Security Model -
Wed 2:30pm Primrose B (Palm Springs Convention Center)
-
Thu 2:45pm Pasadena/Ventura/Sierra (Renaissance Hotel)
Questions? Please complete a survey http://esriurl.com/survey Offering ID: 212
[email protected] Demo code available GitHub: https://github.com/ArcGIS/tips-and-tricks-wpf