Enable ArcGIS Earth Automation API
To enable ArcGIS Earth Automation API and communicate with ArcGIS Earth, check Enable Automation API in the Advanced application settings. Once it is enabled, the ArcGIS Earth Automation API sample page and help page links are available and listed below.
Configuration
You can configure ArcGIS Earth Automation API using the settings.json configuration file. The settings.json configuration file is typically located in the C:\Program Files\ArcGIS\Earth\bin\automation folder and is copied automatically to the user's Documents/ArcGISEarth/automation folder when ArcGIS Earth starts. In this way, users can configure ArcGIS Earth Automation API using the settings.json configuration file.
The autoStart function automatically enables ArcGIS Earth Automation API when ArcGIS Earth starts. The default is false. When autoStart=true, ArcGIS Earth creates a .NET Generic Host and starts a web service with an HTTP server implementation on your local machine at startup. Check the ArcGIS Earth Automation API status from the Advanced application settings.
For the first-time user, you can use the autoStart parameter of the imported configuration file to control the API switch in the Advanced application settings.
注:
- ArcGIS Earth Automation API uses the settings.json configuration file in your directory first.
- The autoStart parameter of the configuration file only works for the first ArcGIS Earth installation.
Configurable Automation API parameters
ArcGIS Earth Automation API works out of the box without special configuration. However, if you need to change the defaults, an understanding of the various configuration parameters is required.
Parameter | Description |
---|---|
autoStart | Enables ArcGIS Earth Automation API when ArcGIS Earth starts. The default is false. |
baseUrl | Sets the URL that ArcGIS Earth Automation API will listen to. The default is http://localhost:8000. 提示:
|
webRoot | Specifies the web root directory used by ArcGIS Earth Automation API. This is optional. The default web root directory is in your Documents/ArcGISEarth/automation folder. 提示:
|
Connecting to ArcGIS Earth
Once the ArcGIS Earth Automation API is started, the client app can start communication with ArcGIS Earth via the RESTful Automation API.
To work with ArcGIS Earth Automation API, you need to understand how to construct a URL and interpret the response. All operations exposed by ArcGIS Earth Automation API are accessible through a hierarchy of endpoints.
When using the Automation API, you need a specific endpoint address for sending requests. The default endpoint is http://localhost:8000/arcgisearth/<controller>. For example, to get the camera information of ArcGIS Earth, the URL is as follows:
http://localhost/arcgisearth/camera
Check the ArcGIS Earth Automation API status from the Advanced application settings and use the sample page in your browser, or visit ArcGIS Earth Automation API GitHub for more details.