;

ArcGISRuntimeEnvironment QML Type

Contains methods and properties for managing runtime components, configuring your operating environment and licensing your app for deployment. More...

Import Statement: import Esri.ArcGISRuntime 100.12
Since: Esri.ArcGISRuntime 100.0
Inherits:

Object

Properties

Signals

Methods

Detailed Description

Note: You cannot declare or create a component of this type in QML code.

This type contains methods to initialize your app. Your app must perform a few steps at startup.

License your app for deployment.

An app with no deployment license provided is considered to be licensed at a developer level (Enums.LicenseLevelDeveloper). At this level it has access to all available product capabilities and extensions. However, you may not deploy an app until it is licensed at the lite, basic, standard, or advanced level.

For details, refer to the guide topic titled License your app.

Ensure that Runtime components are available.

By default, initialization automatically looks for a folder containing the Runtime components. It first searches for a folder adjacent to your app executable folder, which is where the components are placed when your app deploys. For example, if your app's executable is in the folder /home/myapp, initialization first looks for the Runtime components in /home/arcgisruntime<nnn.n>, where <nnn.n> is the Runtime version number. If that search fails, initialization searches for the location of ArcGIS Runtime SDK installation. If both searches fail, initialize() returns false and emits the errorChanged() signal.

There can be multiple versions of the Runtime installed on the same machine, so it is sometimes useful to change the location of the Runtime components that your app uses. You override the automatic search and choose a specific location by setting the installDirectory property before calling initialize().

Initialize the Runtime components by calling initialize().

This confirms that the license and Runtime deployment folder are valid.

See also License.

Property Documentation

apiKey : string

The default API key to access API key enabled services and resources in ArcGIS Online.

An API key is a unique key used to authorize access to specific services and resources in ArcGIS Online. It is also used to monitor access to those services. An API key is created and managed in the ArcGIS developer dashboard and is tied to a specific ArcGIS account.

In addition to setting an API key at a global level for your application using the ArcGISRuntimeEnvironment::apiKey property, you can set an ApiKeyResource::apiKey property on any ArcGIS Runtime class that implements ApiKeyResource. Setting an individual ApiKeyResource::apiKey property on an ApiKeyResource will override the default key at the global level (ArcGISRuntimeEnvironment::apiKey property), enabling more granular usage and management of the ArcGIS Online resources used by your app.

Classes that expose an API key property by implementing ApiKeyResource include:

This property was introduced in Esri.ArcGISRuntime 100.10.


globalRequestConfiguration : RequestConfiguration

The global network request configuration.

This property was introduced in Esri.ArcGISRuntime 100.1.

See also RequestConfiguration.


installDirectory : string

The current install directory for Runtime components.


installOk : bool

Returns whether the current Runtime component installation location is usable (read-only).

Checks the current Runtime component installation location for the presence of specific required files.


license : License

The current license information about the app (read-only).

This is the current license information, such as the license level, that the environment is using to validate that the app is licensed for certain functionality.

See also License.


loggingEnabled : bool

Whether logging is enabled.

Enables or disables logging for rules specified by setLoggingFilterRules.

By default logging is disabled.


serviceCurveGeometryMode : Enums.ServiceCurveGeometryMode

Determines if curve geometries are fetched from and sent to services that support them.

By default, curve geometries are not fetched from services that support curves, meaning that densified versions of any curve geometries are fetched from the service. To instead fetch original geometries with curve segments (those where Geometry::hasCurves is true), set this property to Enums.ServiceCurveGeometryModeFetchCurves. Ensure that you do this before any calls to services are made, as it cannot be changed after the first request has begun.

By default, Runtime indicates that is it not a true-curve-capable client when sending updates to services that support curves. This means that curve geometries stored in services where ArcGISFeatureServiceInfo::onlyAllowTrueCurveUpdatesByTrueCurveClients is true cannot be updated by default. To update such geometries, ensure your app correctly handles curve segments in geometries throughout the workflow and set this property to Enums.ServiceCurveGeometryModeTrueCurveClient. You must do this before any calls to services are made - it cannot be changed after making the first request.

For details of curve support in services, see ArcGIS REST API documentation.

For services that don't support curves, this value has no effect. It also has no effect on local data sources that may contain curve geometries, such as mobile geodatabases or mobile map packages created using ArcGIS Pro.

Some geometry operations do not support curve geometries; see GeometryEngine for details of curve support. SketchEditor does not support curve geometries.

This property was introduced in Esri.ArcGISRuntime 100.12.

See also Geometry::hasCurves.


version : string

Returns the version of ArcGIS Runtime SDK (read-only).

The string returned has the format "<major>.<minor>.<bugfix>.<build>".


Signal Documentation

void apiKeyChanged()

Emitted when the apiKey property changes.

Note: The corresponding handler is onApiKeyChanged.

This signal was introduced in Esri.ArcGISRuntime 100.10.


globalRequestConfigurationChanged()

Emitted when the globalRequestConfiguration property changes.

Note: The corresponding handler is onGlobalRequestConfigurationChanged.

This signal was introduced in Esri.ArcGISRuntime 100.1.


installDirectoryChanged()

Emitted when the installDirectory property changes.

Note: The corresponding handler is onInstallDirectoryChanged.


loggingEnabledChanged()

Emitted when the loggingEnabled property changes.

Note: The corresponding handler is onLoggingEnabledChanged.


serviceCurveGeometryModeChanged()

Emitted when the serviceCurveGeometryMode property changes.

Note: The corresponding handler is onServiceCurveGeometryModeChanged.

This signal was introduced in Esri.ArcGISRuntime 100.12.


Method Documentation

object createObject(string typeName, jsobject parameters, object parent)

Dynamically creates a ArcGISRuntime QML object of a specified type.

Use this method to dynamically create an ArcGISRuntime object in JavaScript, as an alternative to declaring the object in QML.

  • typeName - The name of the object type.
  • parameters - Properties to set on the new object, expressed as key/value pairs.
  • parent - The object that will become the parent for the created object (optional).

Through parameters, specify properties to set on the new object, as if declaring the object using a QML declaration. For new objects declared in the function, use the var type. Here are examples of using this method to create various objects.

var textSymbol = ArcGISRuntimeEnvironment.createObject("TextSymbol", {
                                                           color: "black",
                                                           text: "Redlands",
                                                           size: 12.0,
                                                           horizontalAlignment: Enums.HorizontalAlignmentRight,
                                                           verticalAlignment: Enums.VerticalAlignmentMiddle
                                                       });
var point = ArcGISRuntimeEnvironment.createObject("Point", {x: -117, y: 34});
var graphic = ArcGISRuntimeEnvironment.createObject("Graphic", {geometry: point, symbol: textSymbol});

The lifetime of the object is determined by its parent object.

  • You can specify a parent object.
  • You can choose not to specify a parent. In this case, JavaScript is the object's parent. QML tracks the object and deletes it when there are no remaining JavaScript references to the object (the object goes out of scope.)
  • The object can be declared as a property within another object, and then created with createObject. The class with the property becomes the parent. Declare the property as the same type as you are creating.

For additional details and examples, see the Guide topic titled QML API best practices.


bool initialize()

Initializes the Runtime app with the provided license and returns true if the initialization was successful.


LicenseResult setLicense(jsobject license)

License an application for deployment using an ESRI license string and returns a license result.

The provided license parameter can be one:

ValueDescription
LicenseInfoA LicenseInfo object for licensing an app for Lite or Basic-level functionality from a portal instance.
stringA license string for licensing an app for Lite, Basic, Standard, or Advanced-level functionality (since Esri.ArcGISRuntime 100.2).

A LicenseInfo is obtained from a portal for the current logged-in user by calling PortalInfo::licenseInfo(). The LicenseInfo instance is only valid for 30 days, so the user is required to log in to the portal again when this expires.

This method returns a LicenseResult that contains a license status which indicates whether a license is Valid, Invalid, Expired (if the user's subscription on the portal has expired), or LoginRequired (if the LicenseInfo has expired and the user is required to log in to portal again.)

See also LicenseResult.


LicenseResult setLicenseWithExtensions(string licenseKey, list<string> extensions)

License an application for deployment using an ESRI license string and one or more extension license strings.

This method returns a LicenseResult that contains a license status of Invalid, Expired, or Valid for the Runtime licenseKey. It also provides, with extensions, a map of extension license statuses for each extension license provided.

This method was introduced in Esri.ArcGISRuntime 100.2.

See also LicenseResult.


setLoggingFilterRules(string rules)

Set logging filter rules.

Configure the types of categories and messages to log. Rules are supplied as text strings. For details about how to specify these rules, see the documentation for Qt's QLoggingCategory class.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.