advanced topics in developing arcgis apps with qt · 2016. 3. 21. · arcgis apps with qt. with ....
TRANSCRIPT
Advanced Topics in Developing ArcGIS Apps with Qt
with Michael Tims and Lucas Danzinger – Esri
March 8–11, 2016 | Palm Springs, CA
Esri Developer Summit
Agenda
• Security and authentication• Task handling• Disconnected mapping• Advanced visualization• Q & A
Authentication OptionsSecurity and Authentication
• Authentication methods - ArcGIS token authentication- OAuth 2 authentication- PKI security – Quartz
• Identity Manager simplifies authentication management
• More info- Developer's Authentication Page
ArcGIS Token authenticationSecurity and Authentication
• Works for ArcGIS services
• Every resource request includes a valid token
• Use UserCredentials with username and password to automatically generate token
• After successful authentication, UserCredentials is stored in the Identity Manager for reuse
OAuth 2 authenticationSecurity and Authentication
• OAuth 2.0 is a standard way to handle authentication
• OAuth modes- User-based authentication – user has a named-user organization account- App-based authentication – app manages authentication
• Register your app with developers.arcgis.com to get Client ID and Client Secret- Client ID is needed for user-based and app-based authentication - Client secret is needed for app-based authentication, not user-based
OAuth 2 authentication objectsSecurity and Authentication
• UserCredentials- Represents user credentials for accessing secured ArcGIS services and tasks.
• OAuthClientInfo- Contains properties for configuring OAuth info used by UserCredentials
• Qt’s WebView or WebEngineView- Provides a way for your app to display the OAuth login web page
• IdentityManager- Successful authentication is cached here
Identity Manager Security and Authentication
Supports single sign-on:• Manages authentication challenges• Stores a credential cache• Credentials reused for subsequent requests
Identity Manager – credential challengeSecurity and Authentication
QML:
Connections:Used for singletons
Connect to the Identity ManagerHandle the
challenge request signal
Indentity Manager – credential challengeSecurity and Authentication
C++:
Provide credential information when challenged
Qt lambda connection syntax for connecting to the Identity Manager
DemoAuthentication
Handling Asynchronous TasksTask Handling
• C++ API uses signals and slots to communicate when events occur
• QML API has signal handlers, based on signals and slots, for QML types that emit signals (events)
• ArcGIS Runtime SDK leverages these to implement task-based framework
Task-based FrameworkTask handling
1. Construct a task object
2. Provide parameters
3. Connect slots for completion signals
4. Execute task
5. Grab results in slot when task completes
Some Runtime tasks:o Locator (geocoding) o Routing o Geoprocessingo Geodatabase synco Findo Queryo Identify featureso Find closest facilityo Calculate service areao Tile cache generation
Task handlingQML
Declare task:GeodatabaseSyncTask
QueryTask
LocatorTask
Hook up signal handler
Declare parameters with properties
Kick off the task with supplied parameters
Task handlingC++
Kick off the task with supplied parameters
Construct task:GeodatabaseSyncTask
QueryTask
LocatorTaskHook up lambda SLOT connection
Create task parameters
Components of Disconnected MappingDisconnected Mapping
• Basemap- ExportTileCacheTask- Offline data source is a tile cache for a specific extent and level of detail- Tile package consumed by ArcGISLocalTiledLayer
• Feature data- GeodatabaseSyncTask
• Network datasets and geocoding locators- LocalRouteTask- LocalLocator
GeodatabaseSyncTaskDisconnected Mapping
Declare Geodatabase Sync Task
Provide URL to Feature Service
Hook up signal handler
Declare parameters with properties
Kick off the task with supplied parameters
Demo
Disconnected mapping
Aggregated Query ResultsAdvanced Visualization
• Aggregated query results- Aggregate fields in query results using out statistics
• Out Statistics- Definitions for one or more field-based statistics to be
calculated- Types: count, sum, min, max, avg, stddev- Define the field to be calculated
Out Statistics example codeAdvanced Visualization
Query with an array of out statistics
Type of statistic
Calculate statistic on certain field Resulting
output field name
ChartsAdvanced Visualization
• Qt Charts - A set of easy to use chart components- May be used in C++ and QML apps- Great for displaying query results, especially aggregated results
• QChart.js- QML bindings for Charts.js
- HTML5 Charts JavaScript library using the canvas
DemoCharts
Summary
• Security and authentication• Task handling• Disconnected mapping• Advanced visualization
Related sessions
• Cross-platform UI for C++ Apps using QML at Quartz- Thursday 10:30 – 11:30 am in Demo Theater 3 (Oasis 1)
• Cross-platform Native App Development with Qt/QML- Thursday 2:30 – 3:30 pm in Demo Theater 3 (Oasis 1)
• Implementing Offline Editing Workflows with the Runtime SDKs
- Thursday 2:30 – 3:30 pm in Primrose B
• The Road Ahead: ArcGIS Runtime- Thursday 5:30 – 6:30 pm in Primrose A
Questions?