LocalServer Class

  • LocalServer
  • class Esri::ArcGISRuntime::LocalServer

    A local server instance. More...

    Header: #include <LocalServer.h>
    Inherits: Esri::ArcGISRuntime::Object

    Public Functions

    virtual ~LocalServer() override

    Signals

    void statusChanged()

    Static Public Members

    QString appDataPath()
    QString installPath()
    Esri::ArcGISRuntime::LocalServer *instance()
    bool isFilterWebContent()
    bool isInstallValid()
    QList<Esri::ArcGISRuntime::LocalService *> services()
    void setAppDataPath(const QString &appDataPath)
    void setFilterWebContent(bool enableFilterWebContent)
    void setInstallPath(const QString &installPath)
    void setTempDataPath(const QString &tempDataPath)
    void start()
    Esri::ArcGISRuntime::LocalServerStatus status()
    void stop()
    QString tempDataPath()
    QUrl url()

    Detailed Description

    Note: Local server is only available on Windows and Linux.

    The local server is an optional component of the ArcGIS Maps SDKs which can be downloaded for Windows and Linux platforms. The local server component is not supported on other platforms.

    The local server is used for executing offline geoprocessing tasks in your apps via a geoprocessing package (.gpkx) file. Local server also allows developers to consume map image layers or feature layers which require a map package (.mpkx) file.

    Before any services can be used on local server, the local server process must be started. Only one instance of the local server can be running at any time.

    Once the local server is started, local services can be started which will use packages generated from ArcGIS Pro.

    Your app can call isInstallValid to check whether the local server installation is detected. If the local server is installed at a custom directory, use setInstallPath to specify the custom directory before starting the local server.

    Start the local server by calling the asynchronous start method and monitoring the statusChanged signal. Alternatively, starting a local service on a local server that is stopped will start the local server.

    To determine whether the local server is running, use the status method. When the local server is no longer required, your app may shut it down by calling stop. The local server will shut down by itself when the app exits.

    Your app cannot change the local server's properties if the local server status is starting, started, or stopping.

    Relevant samples:

    • Local Server feature layer: Start a local feature service and display its features in a map.
    • Local server geoprocessing: Create contour lines from local raster data using a local geoprocessing package `.gpkx` and the contour geoprocessing tool.
    • Local Server map image layer: Start the Local Server and Local Map Service, create an ArcGIS Map Image Layer from the Local Map Service, and add it to a map.
    • Local server services: Demonstrates how to start and stop the Local Server and start and stop a local map, feature, and geoprocessing service running on the Local Server.

    Member Function Documentation

    [override virtual] LocalServer::~LocalServer()

    Destructor.

    [static] QString LocalServer::appDataPath()

    Returns a path to a directory to be used for local app data.

    See also setAppDataPath().

    [static] QString LocalServer::installPath()

    Returns the installation path.

    This method returns the value that was set with setInstallPath until either isInstallValid or start is called. After one of those methods is called, this method returns the actual installation path found.

    See also setInstallPath().

    [static] Esri::ArcGISRuntime::LocalServer *LocalServer::instance()

    Returns the instance of the local server.

    The instance of LocalServer is a singleton.

    [static] bool LocalServer::isFilterWebContent()

    Returns true if web content filtering is enabled.

    [static] bool LocalServer::isInstallValid()

    Returns true if a local server installation was found.

    This method searches for the installation directory in this order:

    • If installPath is set, the method looks there and if the installation is not found, the search ends.
    • If installPath is not set, the method looks in the directory that contains the app for the versioned local server folder.

    [static] QList<Esri::ArcGISRuntime::LocalService *> LocalServer::services()

    Returns a list of local services hosted by the local server.

    [static] void LocalServer::setAppDataPath(const QString &appDataPath)

    Sets a path to a directory to be used for local app data.

    • appDataPath - The path where local app data is stored.

    This method may be called when the local server is not started and is not starting.

    See also appDataPath().

    [static] void LocalServer::setFilterWebContent(bool enableFilterWebContent)

    Sets web content filtering to enableFilterWebContent.

    Turns on filtering of HTML content for feature service text fields. By default this is enabled. When this is enabled only a small subset of HTML is accepted and an error will occur if unsupported HTML is used. Filter web content should be set to disabled if you want to use unfiltered HTML.

    This method may be called when the local server is not started and is not starting.

    See also isFilterWebContent().

    [static] void LocalServer::setInstallPath(const QString &installPath)

    Sets the local server installation path to installPath.

    This method may be called when the local server is not started and is not starting.

    This should be set to the local server versioned folder.

    For example with local server 100.3, you would set this to the LocalServer100.3 folder.

    See also installPath().

    [static] void LocalServer::setTempDataPath(const QString &tempDataPath)

    Sets a path to a directory to be used for temporary data to tempDataPath.

    This method may be called when the local server is not started and is not starting.

    See also tempDataPath().

    [static] void LocalServer::start()

    Starts the local server asynchronously.

    Use the statusChanged signal and the status property to monitor when the service has started. Calling this method on a server that is running has no effect.

    [static] Esri::ArcGISRuntime::LocalServerStatus LocalServer::status()

    Returns the status of the local server.

    [signal] void LocalServer::statusChanged()

    Signal emitted when the status property changes.

    [static] void LocalServer::stop()

    Shuts down the local server asynchronously.

    Use the statusChanged signal and the status property to monitor when the service has stopped. Calling this method on a server that is stopping or stopped has no effect.

    [static] QString LocalServer::tempDataPath()

    Returns a path to a directory to be used for temporary data.

    See also setTempDataPath().

    [static] QUrl LocalServer::url()

    Returns the URL for the local server.

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