- All Implemented Interfaces:
Loadable
- Direct Known Subclasses:
ArcGISMap
,ArcGISScene
ArcGISMap
and ArcGISScene
that contains layers and properties and can be displayed in a GeoView
.
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
getBasemap()
to help orient the users. - The
getOperationalLayers()
collection gives you access to the vector data (points, line, polygons), raster data, and attribute information provided by theArcGISMap
orArcGISScene
. - The
getSpatialReference()
determines how spatial data relates to real-world space.
- Since:
- 100.12.0
-
Property Summary
TypePropertyDescriptionThe load error.The load status. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDoneLoadingListener
(Runnable runner) Adds a listener to the loadable resource that is invoked when loading has completed.void
Adds aLoadStatusChangedListener
to the loadable resource that is invoked whenever the load status changes.void
Cancels loading metadata for the object.Gets the basemap for this map or scene.Gets the collection of bookmarks defined for this map or scene.Gets the floor definition that defines the properties that allow a map or a scene to be floor-aware.Gets the FloorManager, which manages the data displayed for a floor-aware map or scene, allowing filtering based on floor levels.Gets the information about the set ofGeotrigger
objects defined for the map or scene.Gets the initial viewpoint, when the map or scene is first displayed.getItem()
Gets the ArcGIS item associated with this map or scene.Gets the value of theloadError
property.Gets the properties that control the default loading and rendering behavior of feature layers in this map or scene.Gets the value of theloadStatus
property.Gets a collection of layers that can access geographic data from a file or a service.Gets the spatial reference for this map or scene.Gets a collection of feature tables in the map or scene.Gets an unmodifiable list of transportation network datasets defined for the map or scene.Gets the version of theArcGISMap
orArcGISScene
when it is loaded.void
Loads the metadata of the loadable resource asynchronously.The load error.The load status.boolean
removeDoneLoadingListener
(Runnable runner) Removes a done loading listener from the loadable resource.boolean
Removes aLoadStatusChangedListener
from the loadable resource.void
Loads or retries loading metadata for the object asynchronously.void
setBasemap
(Basemap basemap) Sets the basemap for this map or scene.void
setFloorDefinition
(GeoModelFloorDefinition floorDefinition) Sets the floor definition that defines the properties that allow a map or a scene to be floor-aware.void
setInitialViewpoint
(Viewpoint initialViewpoint) Sets the initial viewpoint, when the map or scene is first displayed.void
Sets the ArcGIS item associated with this map or scene.void
setLoadSettings
(LoadSettings loadSettings) Sets the properties that control the default loading and rendering behavior of feature layers in this map or scene.
-
Property Details
-
loadStatus
- Specified by:
loadStatusProperty
in interfaceLoadable
- See Also:
-
loadError
- Specified by:
loadErrorProperty
in interfaceLoadable
- See Also:
-
-
Method Details
-
getBasemap
Gets 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.getBaseLayers()
) and reference layers (Basemap.getReferenceLayers()
). Base layers are displayed at the bottom of a map or scene, and reference layers are displayed at the top, with thegetOperationalLayers()
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.
- Returns:
- optional layers in a map or scene that show background information — roads, landmarks, and so on — to help orient the user of the map or scene. Typically image tile or vector tile layer types. Returns null if none.
- Since:
- 100.0.0
-
setBasemap
Sets 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.getBaseLayers()
) and reference layers (Basemap.getReferenceLayers()
). Base layers are displayed at the bottom of a map or scene, and reference layers are displayed at the top, with thegetOperationalLayers()
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.
- Parameters:
basemap
- optional layers in a map or scene that show background information — roads, landmarks, and so on — to help orient the user of the map or scene. Typically image tile or vector tile layer types.- Since:
- 100.0.0
- See Also:
-
getBookmarks
Gets the collection of bookmarks defined for this map or scene.Bookmarks allow users to quickly navigate to a particular area of interest in a map or scene.
- Returns:
- the collection of bookmarks defined for this map or scene
- Since:
- 100.0.0
-
getFloorDefinition
Gets the floor definition that 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 null for maps or scenes that are not floor-aware.- Returns:
- the floor definition that defines the properties that allow a map or a scene to be floor-aware, or null if none
- Since:
- 100.12.0
- See Also:
-
setFloorDefinition
Sets the floor definition that 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 null for maps or scenes that are not floor-aware.Upon setting the floor definition, the current
getFloorManager()
instance is invalidated. You should get a new unloaded FloorManager instance to perform floor filtering.- Parameters:
floorDefinition
- defines the properties that allow a map or a scene to be floor-aware- Since:
- 100.12.0
-
getFloorManager
Gets the FloorManager, which 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.- Returns:
- the FloorManager instance for working with floor filtering, or null if none
- Since:
- 100.12.0
-
getGeotriggersInfo
Gets the information about the set ofGeotrigger
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 inGeotriggersInfo.getGeotriggers()
.When you save a map, any
Geotrigger
objects that reference local data (for example, aGraphicsOverlayFenceParameters
) will be omitted.- Returns:
- an object that presents information on the set of
Geotrigger
objects defined for the map or scene - Since:
- 100.14.0
-
getInitialViewpoint
Gets 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, theGeoView
's viewpoint is set to this initial viewpoint. Any subsequent changes to thegetInitialViewpoint()
are ignored.If you want to change the viewpoint of a displayed map or scene, use methods such as:
-
GeoView.setViewpoint(Viewpoint)
for instantly changing the visible area with no animation. -
SceneView.setViewpointCamera(Camera)
for instantly moving the perspective in 3D scenes. -
MapView.setViewpointAsync(Viewpoint, float, AnimationCurve)
for smooth animated viewpoint changes in 2D maps.
- Returns:
- the initial viewpoint for the map or scene, or null if none
- Since:
- 100.0.0
-
-
setInitialViewpoint
Sets 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, theGeoView
's viewpoint is set to this initial viewpoint. Any subsequent changes to thegetInitialViewpoint()
are ignored.If you want to change the viewpoint of a displayed map or scene, use methods such as:
-
GeoView.setViewpoint(Viewpoint)
for instantly changing the visible area with no animation. -
SceneView.setViewpointCamera(Camera)
for instantly moving the perspective in 3D scenes. -
MapView.setViewpointAsync(Viewpoint, float, AnimationCurve)
for smooth animated viewpoint changes in 2D maps.
- Parameters:
initialViewpoint
- the initial viewpoint for the map or scene- Throws:
IllegalArgumentException
- if initialViewpoint is null- Since:
- 100.0.0
-
-
getItem
Gets 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 aLocalItem
(for maps in a map package or scenes in a scene package), or null if noItem
is associated with this map or scene.- Returns:
- the item for the map or scene, or null if none
- Since:
- 100.3.0
-
setItem
Sets 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 aLocalItem
(for maps in a map package or scenes in a scene package), or null if noItem
is associated with this map or scene.- Parameters:
item
- the item for the map or scene- Since:
- 100.3.0
-
getLoadSettings
Gets 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.
- Returns:
- the current default behaviors (preferences) that control the rendering behaviors for maps and scenes as they load
- Since:
- 100.2.0
- See Also:
-
setLoadSettings
Sets 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.
- Parameters:
loadSettings
- default behaviors (preferences) that control the rendering behaviors for maps and scenes as they load- Throws:
IllegalArgumentException
- if loadSettings is null- Since:
- 100.2.0
- See Also:
-
getOperationalLayers
Gets 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 an
ArcGISMap
orArcGISScene
. 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
getOperationalLayers()
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 theGeoView
it combines these layers to create the final display for the user.See Data Layers for more information about working with operational layers.
- Returns:
- a collection of layers that can access geographic data from a file or a service
- Since:
- 100.0.0
- See Also:
-
getSpatialReference
Gets 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 null until the
ArcGISMap
orArcGISScene
is loaded. You can set this value explicitly using theArcGISMap(SpatialReference)
orArcGISScene(ArcGISScene.SceneViewTilingScheme)
constructors.- Returns:
- a well-known ID (WKID) integer value or a text string definition referred to as a well-known text (WKT) representation that identifies how a geometry's coordinates relate to real-world space. Returns null if none.
- Since:
- 100.0.0
-
getTables
Gets a collection of feature tables in the map or scene. UnlikegetOperationalLayers()
, tables are not displayed by theGeoView
.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.loadAsync()
) or load them by calling methods such asFeatureTable.queryFeaturesAsync(QueryParameters)
.- Returns:
- a collection of feature tables in the map or scene
- Since:
- 100.3.0
-
getTransportationNetworks
Gets an unmodifiable list 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 asRouteTask
,ServiceAreaTask
, andClosestFacilityTask
).- Returns:
- a list of transportation network datasets defined for the map or scene
- Since:
- 100.7.0
- See Also:
-
getVersion
Gets the version of theArcGISMap
orArcGISScene
when it is loaded. The version of a newly createdArcGISMap
orArcGISScene
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 specifiedPortal
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.
- Returns:
- the version for the map or scene
- Since:
- 100.3.0
-
getLoadError
Gets the value of theloadError
property.- Specified by:
getLoadError
in interfaceLoadable
- Property description:
- Returns:
- the value of the
loadError
property - See Also:
-
getLoadStatus
Gets the value of theloadStatus
property.- Specified by:
getLoadStatus
in interfaceLoadable
- Property description:
- Returns:
- the value of the
loadStatus
property - See Also:
-
cancelLoad
public void cancelLoad()Description copied from interface:Loadable
Cancels loading metadata for the object.Cancels loading the metadata if the object is loading, and always invokes the done loading listener.
A load operation that is in progress (
LoadStatus.LOADING
state) can be cancelled by calling this method and the resource will transition fromLoadStatus.LOADING
toLoadStatus.FAILED_TO_LOAD
state. If the load operation was successfully cancelled, a CancellationException will be returned fromLoadable.getLoadError()
.Cancellation should be used carefully because all enqueued done loading listeners for that resource instance will get invoked with an error stating that the operation was cancelled. Thus, one component in the application can cancel the load operation initiated by other components.
This method does nothing if the resource is not in
LoadStatus.LOADING
state.- Specified by:
cancelLoad
in interfaceLoadable
-
loadAsync
public void loadAsync()Description copied from interface:Loadable
Loads the metadata of the loadable resource asynchronously.The load status changes from
LoadStatus.NOT_LOADED
toLoadStatus.LOADING
. A listener can be added viaLoadable.addDoneLoadingListener(java.lang.Runnable)
that is invoked upon completion of the asynchronous load operation.If the load operation completes successfully, the load status will be
LoadStatus.LOADED
, which means the resource has loaded its metadata.If the load operation failed, the load status will be
LoadStatus.FAILED_TO_LOAD
and the error can be retrieved by callingLoadable.getLoadError()
.This method can be called concurrently and repeatedly, but only one attempt is ever made to perform the load operation. If a load operation is already in progress (
LoadStatus.LOADING
state) whenloadAsync
is called, it simply piggy-backs on the outstanding operation and the done loading listener added to the loadable resource is enqueued to be invoked when that operation completes. If the operation has already completed (LoadStatus.LOADED
orLoadStatus.FAILED_TO_LOAD
state) whenloadAsync
is called, the done loading listener is immediately invoked when added to the loadable resource.If a loadable resource has failed to load, calling
loadAsync
on it subsequently will not change its state. The done loading listener will be invoked immediately when added to the loadable resource. In order to retry loading the resource,Loadable.retryLoadAsync()
needs to be used.A load operation that is in progress (
LoadStatus.LOADING
state) can be cancelled by callingLoadable.cancelLoad()
. -
retryLoadAsync
public void retryLoadAsync()Description copied from interface:Loadable
Loads or retries loading metadata for the object asynchronously.Will retry loading the metadata if the object's load status is
LoadStatus.FAILED_TO_LOAD
. Will load the object if it is not loaded. Will not retry to load the object if the object is loaded.For more details on the load process see
Loadable.loadAsync()
.- Specified by:
retryLoadAsync
in interfaceLoadable
-
addDoneLoadingListener
Description copied from interface:Loadable
Adds a listener to the loadable resource that is invoked when loading has completed.The listener may be added at any point, whether the loadable resource has already completed loading or not.
- For resources that are not loaded when the listener is added (LoadStatus is NOT_LOADED or LOADING): When the resource completes loading, the listener will be invoked on the UI thread if it is added from the UI thread, otherwise it is not guaranteed on which thread the listener is invoked.
- For resources that are already loaded when the listener is added (LoadStatus is LOADED or FAILED_TO_LOAD): The listener will be called immediately, on the current thread.
Alternatively, to be notified when there is any change in the load status, add a listener to the
Loadable.loadStatusProperty()
instead.- Specified by:
addDoneLoadingListener
in interfaceLoadable
- Parameters:
runner
- a Runnable that is invoked upon completion of the load operation
-
removeDoneLoadingListener
Description copied from interface:Loadable
Removes a done loading listener from the loadable resource.- Specified by:
removeDoneLoadingListener
in interfaceLoadable
- Parameters:
runner
- the listener to be removed- Returns:
- true if the listener was removed, otherwise false
-
addLoadStatusChangedListener
Description copied from interface:Loadable
Adds aLoadStatusChangedListener
to the loadable resource that is invoked whenever the load status changes.Adding this listener on the UI thread will cause it to be invoked on the UI thread, otherwise it is not guaranteed on which thread the listener is invoked.
The listener will not be called if added to a loadable resource that has already completed loading. To be notified when a loadable resource has completed loading, including if the resource is already loaded when the listener is added, use the
Loadable.addDoneLoadingListener(Runnable)
method.- Specified by:
addLoadStatusChangedListener
in interfaceLoadable
- Parameters:
listener
- theLoadStatusChangedListener
to be added
-
removeLoadStatusChangedListener
Description copied from interface:Loadable
Removes aLoadStatusChangedListener
from the loadable resource.- Specified by:
removeLoadStatusChangedListener
in interfaceLoadable
- Parameters:
listener
- theLoadStatusChangedListener
to be removed- Returns:
- true if the listener was removed, otherwise false
-
loadStatusProperty
Description copied from interface:Loadable
The load status.- Specified by:
loadStatusProperty
in interfaceLoadable
- Returns:
- the
loadStatus
property - See Also:
-
loadErrorProperty
Description copied from interface:Loadable
The load error.- Specified by:
loadErrorProperty
in interfaceLoadable
- Returns:
- the
loadError
property - See Also:
-