logo资料库

ArcGIS_Runtime_SDK_Qt Guide.pdf

第1页 / 共315页
第2页 / 共315页
第3页 / 共315页
第4页 / 共315页
第5页 / 共315页
第6页 / 共315页
第7页 / 共315页
第8页 / 共315页
资料共315页,剩余部分请下载后查看
Table of Contents
ArcGIS Runtime SDK 100.0 for Qt (C++ API)
Get started
Install and set up on Windows
Install and set up on macOS
Install and set up on Linux
Develop your first map app
Fundamentals
Loadable pattern for asynchronous resources
Maps (2D)
Layers
Features and graphics
Symbols and renderers
Geometries
Spatial references
Local Server
Work with maps
Display a map
Open an existing map
Build a new map
Add raster data
Wraparound maps
Navigate the map
Save a map
Create an offline map
Mobile map package
Work with 3D
Display a scene
Display information
Add graphics overlays to your app
Add graphics and text to graphics overlays
Show device location
Display military symbols with a dictionary renderer
Display a grid
Route and get directions
Find a route
Search
Identify features
Search for places (geocoding)
Edit features
Editing
Edit features
Edit geometries
Sync offline edits
Use the cloud and servers
Access the ArcGIS platform
Search for content
Perform analysis
Run a geoprocessing task
Release your app
Deploy your app
License your app
Design considerations
Qt SDK best practices
Reference
Release notes for 100.0
Release notes for 10.2.6
System requirements
System requirements (10.2.6)
Essential vocabulary
Geographic coordinate systems
Projected coordinate systems—Part 1
Projected coordinate systems—Part 2
Datum transformations
Supported geodatabase formats
Local Server geoprocessing tools support
Platform error codes
Legal
ArcGIS Runtime SDK for Qt 1
ArcGIS Runtime SDK for Qt ArcGIS Runtime SDK 100.0 for Qt (C++ API) Get started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Install and set up on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Install and set up on macOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Install and set up on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Develop your first map app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Fundamentals Loadable pattern for asynchronous resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Maps (2D) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Features and graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Symbols and renderers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Geometries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Spatial references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Local Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Work with maps Display a map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Open an existing map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Build a new map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Add raster data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Wraparound maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Navigate the map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Save a map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Create an offline map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Work with 3D Display a scene . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Display information Add graphics overlays to your app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Add graphics and text to graphics overlays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Show device location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Display military symbols with a dictionary renderer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Display a grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Route and get directions Find a route . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Search Identify features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Search for places (geocoding) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Edit features Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Edit features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Edit geometries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Sync offline edits 2
ArcGIS Runtime SDK for Qt Use the cloud and servers Access the ArcGIS platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Search for content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Perform analysis Run a geoprocessing task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Release your app Deploy your app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 License your app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Design considerations Qt SDK best practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Reference Release notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Geographic coordinate systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Projected coordinate systems—Part 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Projected coordinate systems—Part 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 Datum transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 Supported geodatabase formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 Local Server geoprocessing tools support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 Platform error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 Legal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 3
ArcGIS Runtime SDK for Qt ArcGIS Runtime SDK 100.0 for Qt (C++ API) This guide describes how to build apps that incorporate powerful ArcGIS Runtime SDK for Qt capabilities such as mapping, analysis, routing, and custom capabilities for use with the ArcGIS Platform. After you've installed the SDK on Windows, macOS, or Linux, a great place to get ideas and start developing your own apps is to read the tutorial Develop your first map app and to browse the samples hosted on GitHub. With ArcGIS Runtime SDK for Qt, you can: • Create focused, high-performance mobile apps with small memory and local storage requirements for phones, tablets, and other mobile devices • Let mobile users take their work with them, provisioning them with the offline processing and data that they need in the field • Build sophisticated and powerful desktop apps • Leverage the power of the popular Qt Framework for native apps to write your code once and deploy it on Windows, macOS, Linux, Android, and iOS • Consume content and services from ArcGIS Online, Portal for ArcGIS, and ArcGIS Server • Efficiently display and animate large numbers of features and graphics • Perform blazing-fast geocoding and reverse geocoding and calculate routes, with or without a connection to an online service • Search for features or attributes in your GIS data and display the results • Allow users to add graphics and markup to a map interactively • Take advantage of advanced symbology in your military and oceanographic maps • Develop and deploy apps from different SDK versions and run them side-by-side What you get • High performance API for mapping and geographic analysis • This developers guide with: ▪ Getting started information such as install guides for Windows, macOS, and Linux, release notes and system requirements ▪ ▪ Tutorials In-depth concept documentation Interactive C++ and QML sample apps Integration with Qt Creator, with project templates and integrated help • API references for C++ and QML • • • SDK developer forum and ArcGIS blog • Additional controls and utilities with the ArcGIS Runtime API Toolkit on GitHub • Additional QML types in the ArcGIS Extras API that make it easier to write complete cross-platform apps in QML To see what's new in this release of the ArcGIS Runtime SDK for Qt, see the release notes. 4
ArcGIS Runtime SDK for Qt Install and set up on Windows This topic describes how to set up the following: • ArcGIS Runtime SDK for Qt for Windows. • The Qt Framework for Windows—This framework is available from The Qt Company for developing cross-platform applications. This is not an Esri product. • The Qt Framework for Android—This framework is available from The Qt Company for developing Android applications. This is not an Esri product. • Qt Creator—The IDE for Qt application development available from The Qt Company. This is not an Esri product. See ArcGIS Runtime SDK for Qt System Requirements for detailed software requirements. Install Visual Studio The Microsoft Visual Studio compiler is used to build apps with the ArcGIS Runtime SDK for Qt. It is recommended that you uninstall previous versions of Visual Studio and any previous Visual Studio redistributables before installing Visual Studio, or conflicts can occur during installation. Be sure to install the C++ compiler. One way to do this is to select the Visual Studio installation option to use the C++ programming language as your default development environment. Install Microsoft WinDbg To debug using Qt Creator with Visual Studio, download and install WinDbg, the stand-alone debugging tool for Windows. Be sure to download the version that matches your operating system. Download the Qt Framework for Windows To build an application using the ArcGIS Runtime SDK for Qt, you need the Qt Framework designed to work with your compiler. You can install Qt Frameworks for multiple target platforms on your development machine, side-by-side. 1. Download and install the appropriate Qt Framework for Windows from The Qt Company. This download will include Qt Creator. 2. Open SSL support is required. Open SSL allows access to secure services that need user credentials. It is not delivered with the Qt Framework. For more information, see the Qt documentation about adding SSL support to your Qt application. Install prerequisites for Android development If you plan to develop applications for the Android platform, you will need to install Android SDK Tools, Android NDK, Apache Ant, and the Java SE Development Kit. See Qt for Android for more information on Qt for Android. If you are not planning to develop for Android, proceed to the section of this topic titled Tell Qt Creator where to find Qt. 1. Create a new staging folder to store all the prerequisites, such as C:\Android. This folder is referred to in these instructions as . 2. Browse to Getting Started with Qt for Android. 3. Click The Android SDK Tools. 4. Download the Android Tools SDK Bundle, the Android NDK, Apache Ant, and the Java SE Development Kit. 5. Extract the Android SDK to the staging folder. 6. Extract the Android NDK to the staging folder. 7. Extract and install Apache Ant to the staging folder. 8. 9. Click Control Panel > System> Advanced System Settings > Environment variables. 10. Create an environment variable called JAVA_HOME, and set it to the install location of the JDK folder, such as C:\Program Install the Java SE Development Kit by double-clicking the .exe file and accepting all the defaults. Files\Java\jdk. 11. Create an environment variable called ANDROID_NDK_ROOT, and set it to your NDK folder \android-ndk- . If you are developing using a Google device, download the ZIP file for Google USB Driver. For developing using other Android devices, you may need an OEM USB Driver. 12. 13. Extract the Android Debug Bridge Google USB Driver ZIP file to your staging folder. 5
ArcGIS Runtime SDK for Qt 14. Verify the ADB works. Open the command prompt and type the following commands: cd \adt-bundle-windows--\sdk\platform-tools adb.exe 15. Make sure the help message displays. If it does not display, the Android SDK was not installed correctly. 16. Start the Android SDK Manager, and install all of the tools for Android (see ArcGIS Runtime SDK for Qt System Requirements for version information) plus the Build Tools. 17. Download the Qt Framework for Android (on Windows) from The Qt Company. 18. Run the Qt for Android installer, accepting all the defaults. 19. OpenSSL libraries for Android are included with the SDK for testing purposes only. Apps you build that use prf files included with this SDK, including the ArcGIS Runtime app templates and sample apps, use these OpenSSL libraries. These libraries are not intended to be deployed to end users. Before deploying your app to end users, please obtain the latest OpenSSL libraries and deploy those with your app. For more information, see the Qt documentation about adding SSL support to your Qt application. In Qt Creator, click Tools > Options > Android and fill in the paths. Paths will be similar to the following: 20. JDK Location: C:\Program Files\Java\jdk • • Android SDK Location: \adt-bundle-windows--\sdk • Android NDK Location: \android-ndk- • Ant Location: \apache-ant-\bin\ant.bat Tell Qt Creator where to find the Qt Framework It is typical to use one Qt Creator IDE with multiple Qt Frameworks, such as one Framework for desktop development and another to build and deploy to a mobile device. Qt Creator needs to know where to find the Qt Frameworks you want to use. It looks for Qt Frameworks on your development machine but may not detect all the Qt Frameworks you want to use. This can happen when you have multiple Qt Frameworks on your development machine, or if you later install another Qt Framework. Follow these steps to tell Qt Creator about additional Qt Frameworks: 1. Click Tools > Options > Build & Run > Qt Versions, and click Add. 2. Browse to find the qmake.exe file in the installation location. 3. Provide a suitable name for this Qt Framework. 4. Click Apply. After completing these steps, the Qt Framework you specified will appear under the heading Manual. You can now use these Qt Frameworks to configure kits and projects. Install ArcGIS Runtime SDK for Qt 1. Make sure you have read/write access to your desired download location. 2. Click the product's download link. 3. Run the extraction wizard, which asks you to choose the extraction location. 4. Run setup.exe from the extraction location. Installing ArcGIS Runtime SDK for Qt on Windows requires administrative privileges. 5. After the setup program finishes, the post-installer starts. The post-installer integrates the ArcGIS Runtime SDK for Qt with your installation of the Qt Framework and Qt Creator by copying files to locations within those install locations. Choose the Qt components you want to configure. Choose only components that are installed on your development machine. For each component you choose, provide a path to the component. For Qt Creator, use the path to the Qt Creator app. For Qt Frameworks, use the path to qmake.exe in the Framework's install location. Please note that the post-installer needs read/write access to the User Profile's AppData folder. Configure kits and projects In Qt Creator, a kit defines how to build an app for a target device. A kit includes references to the compiler, the Qt Framework, and the debugger. 1. Click Tools > Options > Build & Run > Kits. 2. Examine the existing kits. If no existing kit has the settings you want, click Add to create a new kit. 6
ArcGIS Runtime SDK for Qt 3. Give the kit an appropriate name. 4. Set Device type to Desktop. 5. Choose the appropriate compiler. 6. Choose the CDB Engine debugger. If the debugger you want does not appear in the list of options, make sure that you have installed the WinDbg debugger, as mentioned in a previous step. 7. Choose the Qt Version. 8. Click OK or Apply to finish creating the kit. 9. Repeat the previous steps to add Android kits if you installed the Qt Framework for Android. 10. Create a project in Qt Creator for your ArcGIS Runtime SDK for Qt app. You can use a provided project template to create a new project. See Develop your first map app for more information about using a project template. 11. When you open a Qt Creator project file for the first time, Qt Creator prompts you to configure the project. This means choosing the kits you want to use with the project. Choose the kit you created in the earlier step, and click Configure Project. You can now build your project in Qt Creator. Related topics System requirements Release notes for 100.0 Install and set up on macOS Install and set up on Linux 7
ArcGIS Runtime SDK for Qt Install and set up on macOS This topic describes how to set up the following: • ArcGIS Runtime SDK for Qt for macOS. • The Qt Framework for macOS—This framework is available from The Qt Company for developing cross-platform applications. This is not an Esri product. • The Qt Framework for Android—This framework is available from The Qt Company for developing Android applications. This is not an Esri product. • The Qt Framework for iOS—This framework is available from The Qt Company for developing iOS applications. This is not an Esri product. • Qt Creator—The IDE for Qt application development available from The Qt Company. This is not an Esri product. See ArcGIS Runtime SDK for Qt System Requirements for detailed software requirements. Install Xcode Install Xcode and the Xcode command line tools from https://developer.apple.com/downloads/index.action. You will need a developer account to log in. Follow the documentation at Apple's Web site. Download the Qt Framework for macOS To build an application using the ArcGIS Runtime SDK for Qt, you need the Qt Framework designed to work with your compiler. You can install Qt Frameworks for multiple target platforms on your development machine, side-by-side. 1. Download and install the Qt Framework for macOS from The Qt Company. Be sure to install Qt Creator along with the Qt Framework. 2. Open SSL support is required. Open SSL allows access to secure services that need user credentials. It is not delivered with the Qt Framework. For more information, see the Qt documentation about adding SSL support to your Qt application. Install prerequisites for Android development If you plan to develop applications for the Android platform, you will need to install Android SDK Tools, Android NDK, Apache Ant, and Java SE Development Kit. See Qt for Android for more information on Qt for Android. If you are not planning to develop for Android, proceed to the section of this topic titled Install prerequisites for iOS development. 1. Create a new staging folder to store all the prerequisites, such as ~/Android. This folder is referred to in these instructions as . 2. Browse to Getting Started with Qt for Android. 3. Click The Android SDK Tools. 4. Download the Android Tools SDK Bundle (Mac 64-bit), the Android NDK (Mac 64-bit), Apache Ant, and the Java SE Development Kit (dmg for Mac). Be sure to get these Android tools. Android Studio is not required. 5. Extract the Android SDK to the staging folder. 6. Start the Android SDK Manager, and install all of the tools for Android (see ArcGIS Runtime SDK for Qt System Requirements for version information) plus the Build Tools. Install the Java SE Development Kit. 7. Extract the Android NDK to the staging folder. 8. Extract and install Apache Ant in the staging folder. 9. 10. Download the Qt Framework for Android (on Mac) from The Qt Company. 11. Run the Qt Framework for Android installer, accepting all the defaults. 12. OpenSSL libraries for Android are included with the SDK for testing purposes only. Apps you build that use prf files included with this SDK, including the ArcGIS Runtime app templates and sample apps, use these OpenSSL libraries. These libraries are not intended to be deployed to end users. Before deploying your app to end users, please obtain the latest OpenSSL libraries and deploy those with your app. For more information, see the Qt documentation about adding SSL support to your Qt application. In Qt Creator, click Qt Creator > Preferences > Android, and fill in the paths. Paths will be similar to the following: • JDK Location: /CurrentJDK/Home 13. 8
分享到:
收藏