GeoModel Class

Map and Scene that contains layers and properties and can be displayed in a GeoView."> GeoModel Class | ArcGISQtCpp
  • GeoModel
  • class Esri::ArcGISRuntime::GeoModel

    A base class for Map and Scene that contains layers and properties and can be displayed in a GeoView. More...

    Header: #include <GeoModel.h>
    Since: Esri::ArcGISRuntime 100.12
    Inherits: Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::Loadable
    Inherited By:

    Esri::ArcGISRuntime::Map and Esri::ArcGISRuntime::Scene

    Public Functions

    virtual ~GeoModel() override
    Esri::ArcGISRuntime::Basemap *basemap() const
    Esri::ArcGISRuntime::BasemapStyle basemapStyle() const
    Esri::ArcGISRuntime::BookmarkListModel *bookmarks() const
    Esri::ArcGISRuntime::GeoModel *clone(QObject *parent = nullptr) const
    Esri::ArcGISRuntime::GeoModelFloorDefinition *floorDefinition() const
    Esri::ArcGISRuntime::FloorManager *floorManager() const
    Esri::ArcGISRuntime::GeotriggersInfo *geotriggersInfo() const
    Esri::ArcGISRuntime::Viewpoint initialViewpoint() const
    bool isAutoFetchLegendInfos() const
    Esri::ArcGISRuntime::Item *item() const
    Esri::ArcGISRuntime::LegendInfoListModel *legendInfos() const
    Esri::ArcGISRuntime::LoadSettings *loadSettings() const
    Esri::ArcGISRuntime::LayerListModel *operationalLayers() const
    void setAutoFetchLegendInfos(bool autoFetchLegendInfos)
    void setBasemap(Esri::ArcGISRuntime::Basemap *basemap)
    void setFloorDefinition(Esri::ArcGISRuntime::GeoModelFloorDefinition *floorDefinition)
    void setInitialViewpoint(const Esri::ArcGISRuntime::Viewpoint &initialViewpoint)
    void setItem(Esri::ArcGISRuntime::Item *item)
    void setLoadSettings(Esri::ArcGISRuntime::LoadSettings *loadSettings)
    Esri::ArcGISRuntime::SpatialReference spatialReference() const
    Esri::ArcGISRuntime::FeatureTableListModel *tables() const
    QList<Esri::ArcGISRuntime::TransportationNetworkDataset *> transportationNetworks() const
    QString version() const
    bool operator!=(const Esri::ArcGISRuntime::GeoModel &other) const
    bool operator==(const Esri::ArcGISRuntime::GeoModel &other) const

    Reimplemented Public Functions

    virtual void cancelLoad() override
    virtual void load() override
    virtual Esri::ArcGISRuntime::Error loadError() const override
    virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
    virtual void retryLoad() override


    void basemapChanged(Esri::ArcGISRuntime::Basemap *oldBasemap)
    void doneLoading(const Esri::ArcGISRuntime::Error &loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Detailed Description

    This base class represents the model in a model-view-controller (MVC) architecture, while the GeoView represents the view. To display a map or scene to the user, pass GeoModel to its appropriate GeoView, as follows:

    GeoModel has many properties that are common to both maps and scenes. For example:

    • Each map or scene typically has a basemap to help orient the users.
    • The operationalLayers collection gives you access to the vector data (points, line, polygons), raster data, and attribute information provided by the Map or Scene.
    • The spatialReference determines how spatial data relates to real-world space.

    Member Function Documentation

    [override virtual] GeoModel::~GeoModel()


    Esri::ArcGISRuntime::Basemap *GeoModel::basemap() const

    Returns the basemap for this map or scene.

    A basemap provides a background of geographical context for the content you display in a map or scene. It is an optional set of non-editable layers such as aerial imagery, roads, or landmarks, that help orient the user of the map or scene.

    A basemap is composed of a collection of base layers (Basemap::baseLayers) and reference layers (Basemap::referenceLayers). Base layers are displayed at the bottom of a map or scene, and reference layers are displayed at the top, with the operationalLayers between them.

    You can use ready-to-use basemaps, style your own basemaps with the ArcGIS Vector Tile Style Editor, or create and publish your own with ArcGIS Pro.

    See also setBasemap().

    [signal] void GeoModel::basemapChanged(Esri::ArcGISRuntime::Basemap *oldBasemap)

    The signal emitted when the basemap changes.

    • oldBasemap - The previous basemap.

    The returned Basemap object has the GeoModel as its parent.

    See also Returned QObjects Parenting.

    Esri::ArcGISRuntime::BasemapStyle GeoModel::basemapStyle() const

    Returns the basemap style of the basemap.

    These basemaps are secured and require either an API key or named user to access them.

    Esri::ArcGISRuntime::BookmarkListModel *GeoModel::bookmarks() const

    Returns the bookmarks for the map or scene.

    Bookmarks allow users to quickly navigate to a particular area of interest in a map or scene.

    The Map only supports the ViewpointType::BoundingGeometry viewpoint (declared with an extent). The ViewpointType::CenterAndScale viewpoint (declared around a center point) are not supported in the Map.

    The collection is specific to this GeoModel.

    [override virtual] void GeoModel::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    Cancels loading metadata for the object.

    Cancels loading the metadata if the object is loading and always calls doneLoading.

    [since Esri::ArcGISRuntime 200.2] Esri::ArcGISRuntime::GeoModel *GeoModel::clone(QObject *parent = nullptr) const

    Clones the GeoModel to a new instance with an optional parent.

    Returns a new instance of the current GeoModel.

    This function was introduced in Esri::ArcGISRuntime 200.2.

    [signal] void GeoModel::doneLoading(const Esri::ArcGISRuntime::Error &loadError)

    Signal emitted when this object is done loading.

    • loadError - Details about any error that may have occurred

    Note: If there is a load error, it will also be emitted on the errorOccurred signal.

    See also Loadable and Object.

    Esri::ArcGISRuntime::GeoModelFloorDefinition *GeoModel::floorDefinition() const

    Defines the properties that allow a map or a scene to be floor-aware.

    Floor-aware maps and scenes contain data representing floor plan and indoor features. The data displayed by floor-aware maps and scenes can be filtered based on floor levels using the FloorManager. This property is nullptr for maps or scenes that are not floor-aware.

    Please note that upon setting this property, the floorManager is invalidated.

    See also setFloorDefinition() and GeoModel::floorManager.

    Esri::ArcGISRuntime::FloorManager *GeoModel::floorManager() const

    Manages the data displayed for a floor-aware map or scene, allowing filtering based on floor levels.

    A FloorManager must be loaded before you can access its site, facility, and level properties, and perform floor filtering.

    When a map's floor manager is loaded, floor-aware layers display only data associated with the ground floor by default. When a scene's floor manager is loaded, floor-aware layers display data from all floors by default. You can filter the data displayed by floor-aware layers by toggling the FloorLevel::isVisible property of levels in the floor manager.

    [since Esri::ArcGISRuntime 100.14] Esri::ArcGISRuntime::GeotriggersInfo *GeoModel::geotriggersInfo() const

    Returns information about the set of Geotrigger objects defined for the map or scene.

    You must load the GeotriggersInfo to populate the collection with any geotriggers defined by the author of the map or scene. If no geotriggers are defined this list will remain empty.

    Use a GeotriggerMonitor to check each of the conditions defined in GeotriggersInfo::geotriggers.

    When you save a map, any Geotrigger objects that reference local data (for example, a GraphicsOverlayFenceParameters) will be omitted.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    Esri::ArcGISRuntime::Viewpoint GeoModel::initialViewpoint() const

    Returns the initial viewpoint when the map or scene is first displayed.

    The initial viewpoint value is available when the map or scene is loaded. If you want to change the initial viewpoint, you can do this before you add the map or scene to a GeoView. At this point, the GeoView's viewpoint is set to this initial viewpoint. Any subsequent changes to the initialViewpoint are ignored.

    If you want to change the viewpoint of a displayed map or scene, use methods such as:

    See also setInitialViewpoint().

    bool GeoModel::isAutoFetchLegendInfos() const

    Returns whether legend infos are automatically fetched by the operational layers in the geo model.

    Returns true if legend infos will be fetched automatically when the LegendInfoListModel is instantiated.

    Esri::ArcGISRuntime::Item *GeoModel::item() const

    Returns the ArcGIS item associated with this map or scene.

    This can be a PortalItem (for web maps and web scenes loaded from a portal or saved to a portal), or a LocalItem (for maps in a map package or scenes in a scene package), or nullptr if no Item is associated with this map or scene.

    See also setItem().

    Esri::ArcGISRuntime::LegendInfoListModel *GeoModel::legendInfos() const

    Returns a list model containing legend infos for the geo model's operational layers and any sublayers.

    Returns a LegendInfoListModel representing the legend information for the geo model's operational layers and their sublayers.

    [override virtual] void GeoModel::load()

    Reimplements: Loadable::load().

    Loads the metadata for the object asynchronously.

    Loads the metadata if the object is not loaded and always calls doneLoading.

    [override virtual] Esri::ArcGISRuntime::Error GeoModel::loadError() const

    Reimplements: Loadable::loadError() const.

    Returns the load error.

    See also Error.

    Esri::ArcGISRuntime::LoadSettings *GeoModel::loadSettings() const

    Returns the properties that control the default loading and rendering behavior of feature layers in this map or scene.

    For example, you can specify which tiling mode should be used when feature layers are added, or specify whether feature tables should use advanced symbology.

    See also setLoadSettings(), LoadSettings::featureTilingMode, and LoadSettings::isUseAdvancedSymbology.

    [override virtual] Esri::ArcGISRuntime::LoadStatus GeoModel::loadStatus() const

    Reimplements: Loadable::loadStatus() const.

    Returns the load status.

    See also LoadStatus.

    [signal] void GeoModel::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Signal emitted when the load status changes for this object.

    See also Loadable.

    Esri::ArcGISRuntime::LayerListModel *GeoModel::operationalLayers() const

    Returns a collection of layers that can access geographic data from a file or a service.

    The operational layers collection is used to display geographic data layers on top of a basemap layer in a Map or Scene. For example, you can display a fleet of vehicles being tracked on a map or display a point cloud layer of a tree canopy in a scene.

    This collection of layers is unique to the map or scene, it cannot be used by another GeoModel. You can add and remove layers from the map or scene by adding and removing them from this collection. Ensure that the map has finished loading, otherwise you will replace the map's original operational layers with the newly added layers.

    The first layer in the operationalLayers collection is drawn first (on the bottom) above the basemap layer. Each subsequent layer is drawn on top. Typically, imagery or tile layers are added to the collection first, and then polygon, line, and point layers last. When you pass the GeoModel to the GeoView it combines these layers to create the final display for the user.

    See Data Layers for more information about working with operational layers.

    See also Basemap::baseLayers.

    [override virtual] void GeoModel::retryLoad()

    Reimplements: Loadable::retryLoad().

    Loads or retries loading metadata for the object asynchronously.

    Will retry loading the metadata if the object is failed to load. Will load the object if it is not loaded. Will not retry to load the object if the object is loaded. Will always call the done loading if this is called.

    void GeoModel::setAutoFetchLegendInfos(bool autoFetchLegendInfos)

    Sets whether legend infos are automatically fetched by the operational layers in the geo model.

    Set autoFetchLegendInfos to true to have legend infos fetched automatically when the LegendInfoListModel is instantiated.

    See also isAutoFetchLegendInfos().

    void GeoModel::setBasemap(Esri::ArcGISRuntime::Basemap *basemap)

    Sets the basemap to basemap.

    See also basemap.

    void GeoModel::setFloorDefinition(Esri::ArcGISRuntime::GeoModelFloorDefinition *floorDefinition)

    Sets the floorDefinition to floorDefinition.

    Please note that upon setting floorDefinition, the current FloorManager is invalidated.

    See also floorDefinition.

    void GeoModel::setInitialViewpoint(const Esri::ArcGISRuntime::Viewpoint &initialViewpoint)

    Sets the initialViewpoint to initialViewpoint.

    See also initialViewpoint.

    void GeoModel::setItem(Esri::ArcGISRuntime::Item *item)

    Sets the item to item.

    See also item.

    void GeoModel::setLoadSettings(Esri::ArcGISRuntime::LoadSettings *loadSettings)

    Sets the loadSettings to loadSettings.

    See also loadSettings.

    Esri::ArcGISRuntime::SpatialReference GeoModel::spatialReference() const

    Returns the spatial reference for this map or scene.

    SpatialReference specifies how geometry coordinates relate to real-world space. It ensures that you can accurately view, query, and analyze the layers of a map or scene.

    The spatial reference value is empty until the Map or Scene is loaded. You can set this value explicitly using the Map::Map(const Esri::ArcGISRuntime::SpatialReference&, QObject*) or Scene::Scene(Esri::ArcGISRuntime::SceneViewTilingScheme, QObject*) constructors.

    Esri::ArcGISRuntime::FeatureTableListModel *GeoModel::tables() const

    Returns a collection of feature tables in the map or scene. Unlike operationalLayers, tables are not displayed by the GeoView.

    The collection of feature tables is specific to the map or scene. You can add and remove tables by adding or removing them from the collection.

    By default, the tables are not loaded. You can load them explicitly (FeatureTable::load) or load them by calling methods such as FeatureTable::queryFeaturesAsync(const Esri::ArcGISRuntime::QueryParameters&, QObject*).

    QList<Esri::ArcGISRuntime::TransportationNetworkDataset *> GeoModel::transportationNetworks() const

    Returns a collection of transportation network datasets defined for the map or scene.

    Map and scene authors can use ArcGIS Pro to create mobile map or scene packages that include transportation networks. If the map or scene is created from one of these packages, this collection will be populated with a read-only collection of TransportationNetworkDataset objects.

    A TransportationNetworkDataset from this collection can be used to construct one of the network analysis tasks (such as RouteTask, ServiceAreaTask, and ClosestFacilityTask).

    See also RouteTask and MobileScenePackage.

    QString GeoModel::version() const

    Returns the version of the Map or Scene when it is loaded. The version of a newly created Map or Scene is empty.

    When you load an existing map or scene, the version value is the version that it was created at, according to the ESRI web map specification or ESRI web scene specification, respectively.

    You can make changes to a map (associated with a PortalItem) and save it back to the web map it originated from. Alternatively, you can save a map as a new web map on a specified Portal with a given title and folder. In these cases, the version of the saved map will be the version of the [ESRI web map specification supported by this API. You cannot save changes to maps in mobile map packages.

    Saving changes to scenes is not currently supported.

    [since Esri::ArcGISRuntime 200.2] bool GeoModel::operator!=(const Esri::ArcGISRuntime::GeoModel &other) const

    Inequality operator.

    Returns true if this object and other are not equal.

    This function was introduced in Esri::ArcGISRuntime 200.2.

    See also GeoModel::operator==.

    [since Esri::ArcGISRuntime 200.1] bool GeoModel::operator==(const Esri::ArcGISRuntime::GeoModel &other) const

    Equivalency operator.

    Returns true if this object and other are equivalent.

    This function was introduced in Esri::ArcGISRuntime 200.1.

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