Skip To Content ArcGIS for Developers Sign In Dashboard

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.9
Since: Esri.ArcGISRuntime 100.0





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

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.

version : string

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

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

Signal Documentation


Emitted when the globalRequestConfiguration property changes.

Note: The corresponding handler is onGlobalRequestConfigurationChanged.

This signal was introduced in Esri.ArcGISRuntime 100.1.


Emitted when the installDirectory property changes.

Note: The corresponding handler is onInstallDirectoryChanged.


Emitted when the loggingEnabled property changes.

Note: The corresponding handler is onLoggingEnabledChanged.

Method Documentation

object createObject(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(license)

Sets the license to license an app for Lite, Basic, Standard, or Advanced-level functionality and returns a license result.

The provided license parameter can be one:

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(licenseKey, list<string> extensions)

Sets a licenseKey to license an app for Lite, Basic, Standard, or Advanced-level functionality, and to license provided extensions, and returns a license result.

This method returns a LicenseResult which contains a license status of either Invalid, Expired, or Valid for the Runtime license. And also a map of extension license statuses for each extension license provided.

This method was introduced in Esri.ArcGISRuntime 100.2.

See also LicenseResult.


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.

Feedback on this topic?