Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with ....
Transcript of Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with ....
![Page 1: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/1.jpg)
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
![Page 2: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/2.jpg)
Agenda
• Security and authentication• Task handling• Disconnected mapping• Advanced visualization• Q & A
![Page 3: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/3.jpg)
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
![Page 4: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/4.jpg)
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
![Page 5: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/5.jpg)
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
![Page 6: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/6.jpg)
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
![Page 7: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/7.jpg)
Identity Manager Security and Authentication
Supports single sign-on:• Manages authentication challenges• Stores a credential cache• Credentials reused for subsequent requests
![Page 8: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/8.jpg)
Identity Manager – credential challengeSecurity and Authentication
QML:
Connections:Used for singletons
Connect to the Identity ManagerHandle the
challenge request signal
![Page 9: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/9.jpg)
Indentity Manager – credential challengeSecurity and Authentication
C++:
Provide credential information when challenged
Qt lambda connection syntax for connecting to the Identity Manager
![Page 10: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/10.jpg)
DemoAuthentication
![Page 11: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/11.jpg)
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
![Page 12: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/12.jpg)
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
![Page 13: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/13.jpg)
Task handlingQML
Declare task:GeodatabaseSyncTask
QueryTask
LocatorTask
Hook up signal handler
Declare parameters with properties
Kick off the task with supplied parameters
![Page 14: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/14.jpg)
Task handlingC++
Kick off the task with supplied parameters
Construct task:GeodatabaseSyncTask
QueryTask
LocatorTaskHook up lambda SLOT connection
Create task parameters
![Page 15: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/15.jpg)
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
![Page 16: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/16.jpg)
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
![Page 17: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/17.jpg)
Demo
Disconnected mapping
![Page 18: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/18.jpg)
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
![Page 19: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/19.jpg)
Out Statistics example codeAdvanced Visualization
Query with an array of out statistics
Type of statistic
Calculate statistic on certain field Resulting
output field name
![Page 20: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/20.jpg)
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
![Page 21: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/21.jpg)
DemoCharts
![Page 22: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/22.jpg)
Summary
• Security and authentication• Task handling• Disconnected mapping• Advanced visualization
![Page 23: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/23.jpg)
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
![Page 24: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/24.jpg)
Questions?
![Page 25: Advanced Topics in Developing ArcGIS Apps with Qt · 2016. 3. 21. · ArcGIS Apps with Qt. with . Michael Tims and Lucas Danzinger – Esri. ... -Offline data source is a tile cache](https://reader031.fdocuments.net/reader031/viewer/2022011921/602b268156f80f74c4385851/html5/thumbnails/25.jpg)