ArcGISRuntimeEnvironment QML Type

  • Esri.ArcGISRuntime
  • ArcGISRuntimeEnvironment
  • Provides access to and manipulation of environment settings, such as configurations for the operating environment and licenses for deployment. More...

    Import Statement: import Esri.ArcGISRuntime
    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 ArcGIS Maps SDK components are available.

    By default, initialization automatically looks for a folder containing the Maps SDK 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 ArcGIS Maps SDK components in /home/arcgisruntime<nnn.n>, where <nnn.n> is the SDK version number. If that search fails, initialization searches for the location of ArcGIS Maps SDK installation. If both searches fail, initialize() returns false and emits the errorChanged() signal.

    There can be multiple versions of the ArcGIS Maps SDK installed on the same machine, so it is sometimes useful to change the location of the SDK 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 ArcGIS Maps SDK components by calling initialize().

    This confirms that the license and ArcGIS Maps SDK deployment folder are valid.

    See also License.

    Property Documentation

    [since Esri.ArcGISRuntime 100.10] 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 ArcGISRuntimeEnvironment::apiKey at a global level for your application, you can set it on any class that implements ApiKeyResource. This overrides the ArcGISRuntimeEnvironment::apiKey and enables more granular usage telemetry and management of ArcGIS location 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.

    [since Esri.ArcGISRuntime 100.1] 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 ArcGIS Maps SDK components.

    [read-only] installOk : bool

    Returns whether the current ArcGIS Maps SDK component installation location is usable (read-only).

    Checks the current ArcGIS Maps SDK component installation location for the presence of specific required files.

    [read-only] 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.

    [since Esri.ArcGISRuntime 100.15] logDeprecationWarnings : bool

    Whether logging is enabled for accessing deprecated functionality.

    This API will log a console warning message whenever deprecated methods, properties, QML types, or signals are accessed. Log messages will contain the source file path and line number when possible. Not all messages will contain detailed information about where the access occurred.

    This will help identify deprecated functionality used in apps. Consult the API reference documentation for details on the replacement pattern. Apps should migrate to the new patterns to avoid breaking changes.

    Here is an example of a log message:

    file:///Users/RuntimeUser/RuntimeApp/main.qml:26:5: QML PopupDefinition: The showRelatedRecords property is deprecated

    logDeprecationWarnings is enabled by default.

    Note: These are runtime warnings as opposed to build-time warnings. The log messages only appear at runtime as deprecated functionality is executed. As such, these messages are an aid but may not be an exhaustive and definitive source of all usages of deprecated functionality in your ArcGIS Maps SDK app.

    This property was introduced in Esri.ArcGISRuntime 100.15.

    loggingEnabled : bool

    Whether logging is enabled.

    Enables or disables logging for rules specified by setLoggingFilterRules.

    By default logging is disabled.

    [since Esri.ArcGISRuntime 100.12] serviceCurveGeometryMode : Enums.ServiceCurveGeometryMode

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

    By default, this API does not fetch curves in geometries or act as a true curve client, which means:

    If your application preserves curve segments throughout all workflows, set this property to ServiceCurveGeometryModeTrueCurveClient, which means:

    Ensure that you you change this property before any calls to services are made, as it cannot be changed after the first request has begun. Note that some geometry operations do not support curve geometries; see GeometryEngine for details of curve support. GeometryEditor and SketchEditor do not support curve geometries. It is your responsibility to ensure data integrity by correctly preserving any curve segments throughout your application when using serviceCurveGeometryMode.

    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.

    This property was introduced in Esri.ArcGISRuntime 100.12.

    See also Geometry::hasCurves.

    [read-only] version : string

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

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

    Signal Documentation

    [since Esri.ArcGISRuntime 100.10] apiKeyChanged()

    Emitted when the apiKey property changes.

    Note: The corresponding handler is onApiKeyChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.10.

    [since Esri.ArcGISRuntime 100.14] arcadeConsoleMessageNotification(ArcadeConsoleMessageContext context, string message)

    Emitted when a console message is sent from any Arcade script, with the context and the message.

    This signal allows clients to retrieve messages from evaluating an Arcade script expression in an attribute rule, labeling, popup, dictionary renderer, geotrigger, and more.

    Note: The corresponding handler is onArcadeConsoleMessageNotification.

    This signal was introduced in Esri.ArcGISRuntime 100.14.

    See also ArcadeConsoleMessageContext.

    [since Esri.ArcGISRuntime 100.1] globalRequestConfigurationChanged()

    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.

    [since Esri.ArcGISRuntime 100.15] logDeprecationWarningsChanged()

    Emitted when the logDeprecationWarnings property changes.

    Note: The corresponding handler is onLogDeprecationWarningsChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.15.


    Emitted when the loggingEnabled property changes.

    Note: The corresponding handler is onLoggingEnabledChanged.

    [since Esri.ArcGISRuntime 100.12] 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 ArcGIS Maps SDK 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:

    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.

    [since Esri.ArcGISRuntime 100.2] 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 ArcGIS Maps SDK 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.