- All Implemented Interfaces:
Styleable
,EventTarget
,Skinnable
ArcGISMap
.
A MapView is a user interface that displays ArcGISMap
layers and graphics in 2D. It controls the area (extent)
of the ArcGISMap
that is visible and supports user interactions such as pan and zoom. A map view also provides
access to the underlying layer data in a map.
To display an ArcGISMap
, add a MapView control to your app and assign the map to it. This loads the map and
its content, such as a Basemap
and collection of operational layers, and
displays this content on screen.
User interactions such as pan, zoom, rotate, and identify or selection are supported in the MapView using touch, mouse, keyboard or pen/pencil. If required, you can override keys, clicks, and gestures to provide a specific user experience.
The visible area (Viewpoint
) of the MapView is defined by the visible extent the map. To determine the
current visible area or the center point and scale of a MapView, call GeoView.getCurrentViewpoint(Viewpoint.Type)
.
Make sure that any user-initiated or programmatic navigation is complete before getting the current
Viewpoint
by calling GeoView.navigatingProperty()
.
You can programmatically set the visible area by specifying a viewpoint. For
example, setViewpointGeometryAsync(Geometry)
sets the visible area to the extent of a provided
geometry, and setViewpointCenterAsync(Point)
centers the map view at a given point. Any
geometries passed to these methods are automatically projected to match the SpatialReference
of the map
view's ArcGISMap
, if required.
In an MVC architecture, the MapView represents the View tier. The Model tier is represented by the ArcGISMap
object which can provide a collection of operational layers and a Basemap
. You can only set one ArcGISMap
per
MapView, but you can swap the mapProperty()
with another when the application is running.
See Map view for more information.
This class must only be created and used on the UI thread. A MapView cannot be used after it has been disposed.
- Since:
- 100.0.0
- See Also:
-
Property Summary
TypePropertyDescriptionThe background grid that anArcGISMap
is displayed on top of.TheGeometryEditor
that allows users to interactively create and edit geometries by interacting with the view.A coordinate system grid to display on top of the MapView.The location display manages and renders the device's current location on a MapView using a data source, such as a GPS sensor.The map that is currently set to the map view.The map view's current rotation.The map view's current scale.The insets on the MapView in device-independent pixels (DIP).Indicates whether continuous panning across the international date line is enabled.Properties inherited from class com.esri.arcgisruntime.mapping.view.GeoView
attributionText, attributionTextVisible, attributionTop, drawStatus, enableKeyboardNavigation, enableMousePan, enableMouseZoom, enableTouchPan, enableTouchRotate, enableTouchZoom, labeling, navigating, selectionProperties, spatialReference, timeExtent
Properties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltip
Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
Properties inherited from class javafx.scene.Parent
needsLayout
Properties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Default listener to handle input events on the map view. -
Field Summary
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated, for removal: This API element is subject to removal in a future version.void
Deprecated, for removal: This API element is subject to removal in a future version.As of 200.0.0, useObservableValue.addListener(ChangeListener)
onmapScaleProperty()
.The background grid that anArcGISMap
is displayed on top of.TheGeometryEditor
that allows users to interactively create and edit geometries by interacting with the view.Gets the BackgroundGrid set on the MapView.Gets the value of thegeometryEditor
property.getGrid()
Gets grid set to the MapView.Gets the view label properties.Returns the MapView'sLocationDisplay
, used to display the current location from a location data source in the MapView.getMap()
Gets the map that the MapView is displaying.double
Gets the rotation angle of theArcGISMap
in degrees from its north-south direction.double
Gets the scale of the MapView.Deprecated, for removal: This API element is subject to removal in a future version.As of 200.2.0,SketchEditor
and associated types are deprecated.Gets the spatial reference.double
Gets the size of each device-independent pixel (DIP) in map units.Gets the insets on the view.Gets the map view's visible area.Gets the wrap around mode.A coordinate system grid to display on top of the MapView.The location display manages and renders the device's current location on a MapView using a data source, such as a GPS sensor.locationToScreen
(Point mapPoint) Converts aPoint
in map coordinates to a javafx.geometry.Point2D representing JavaFX local coordinates.The map that is currently set to the map view.The map view's current rotation.The map view's current scale.boolean
Deprecated, for removal: This API element is subject to removal in a future version.As of 200.0.0, useObservableValue.addListener(ChangeListener)
onmapRotationProperty()
.boolean
Deprecated, for removal: This API element is subject to removal in a future version.As of 200.0.0, useObservableValue.addListener(ChangeListener)
onmapScaleProperty()
.screenToLocation
(Point2D screenPoint) Converts a point in JavaFX local coordinates to a location in map coordinates.void
setBackgroundGrid
(BackgroundGrid backgroundGrid) Sets the desired BackgroundGrid on the MapView.void
setGeometryEditor
(GeometryEditor geometryEditor) Sets the value of thegeometryEditor
property.void
Sets a grid to be displayed on top of the MapView.void
setLabeling
(ViewLabelProperties viewLabelProperties) Sets the view label properties.void
Sets the map that the MapView is displaying.void
setSketchEditor
(SketchEditor sketchEditor) Deprecated, for removal: This API element is subject to removal in a future version.As of 200.2.0,SketchEditor
and associated types are deprecated.void
setViewInsets
(Insets viewInsets) Sets the specified insets on the view.setViewpointAsync
(Viewpoint viewpoint, float durationSeconds, AnimationCurve animationCurve) Animates the display to the new viewpoint using the provided animation curve.setViewpointCenterAsync
(Point point) Centers the map view at the provided center point.setViewpointCenterAsync
(Point center, double scale) Centers the map view at the provided center point and zooms to the given scale.setViewpointGeometryAsync
(Geometry boundingGeometry) Zooms and pans the map view to the extent of the provided geometry.setViewpointGeometryAsync
(Geometry boundingGeometry, double padding) Zooms and pans the map view to the extent of the provided geometry with additional padding.setViewpointRotationAsync
(double angleDegrees) Rotates the map view to the provided angle.setViewpointScaleAsync
(double scale) Zooms the map view to the provided scale around its current center point.void
setWrapAroundMode
(WrapAroundMode wrapAroundMode) Sets the wrap around mode.The insets on the MapView in device-independent pixels (DIP).Indicates whether continuous panning across the international date line is enabled.Methods inherited from class com.esri.arcgisruntime.mapping.view.GeoView
addAttributionTextChangedListener, addDrawStatusChangedListener, addLayerViewStateChangedListener, addNavigationChangedListener, addSpatialReferenceChangedListener, addTimeExtentChangedListener, addViewpointChangedListener, attributionTextProperty, attributionTextVisibleProperty, attributionTopProperty, createDefaultSkin, dispose, drawStatusProperty, enableKeyboardNavigationProperty, enableMousePanProperty, enableMouseZoomProperty, enableTouchPanProperty, enableTouchRotateProperty, enableTouchZoomProperty, exportImageAsync, getAttributionText, getAttributionTop, getCallout, getCurrentViewpoint, getDrawStatus, getGraphicsOverlays, getInteractionListener, getSelectionProperties, getTimeExtent, getViewStateForLayer, identifyGraphicsOverlayAsync, identifyGraphicsOverlayAsync, identifyGraphicsOverlaysAsync, identifyGraphicsOverlaysAsync, identifyLayerAsync, identifyLayerAsync, identifyLayersAsync, identifyLayersAsync, isAttributionTextVisible, isEnableKeyboardNavigation, isEnableMousePan, isEnableMouseZoom, isEnableTouchPan, isEnableTouchRotate, isEnableTouchZoom, isNavigating, isResizable, isWrapAroundEnabled, labelingProperty, navigatingProperty, removeAttributionTextChangedListener, removeDrawStatusChangedListener, removeLayerViewStateChangedListener, removeNavigationChangedListener, removeSpatialReferenceChangedListener, removeTimeExtentChangedListener, removeViewpointChangedListener, selectionPropertiesProperty, setAttributionTextVisible, setBookmarkAsync, setEnableKeyboardNavigation, setEnableMousePan, setEnableMouseZoom, setEnableTouchPan, setEnableTouchRotate, setEnableTouchZoom, setInteractionListener, setTimeExtent, setViewpoint, setViewpointAsync, setViewpointAsync, spatialReferenceProperty, timeExtentProperty
Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
Methods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
Methods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
wrapAroundMode
Indicates whether continuous panning across the international date line is enabled.By default, the MapView attempts to wrap the
ArcGISMap
across the international date line for a continuous panning user experience. The eastern and western hemispheres wrap to form a continuous map, giving the impression that the map is endless.You can apply wraparound to a MapView if certain conditions are met, as described in
WrapAroundMode.ENABLE_WHEN_SUPPORTED
. To remove the wraparound behavior set the value toWrapAroundMode.DISABLED
.If wraparound is enabled, geometries returned from
getVisibleArea()
may have coordinates outside the domain of the spatial reference of the map. Before using such geometries to perform spatial queries, address finding, or as feature geometries in a geodatabase, normalize them to lie within the spatial reference domain usingGeometryEngine.normalizeCentralMeridian(Geometry)
.The default value is
WrapAroundMode.ENABLE_WHEN_SUPPORTED
.- Since:
- 200.0.0
- See Also:
-
mapScale
The map view's current scale.- Since:
- 200.0.0
- See Also:
-
mapRotation
The map view's current rotation.- Since:
- 200.0.0
- See Also:
-
backgroundGrid
The background grid that anArcGISMap
is displayed on top of.BackgroundGrid
defines the color and context grid displayed in the MapView. If agetMap()
has been assigned, theArcGISMap
displays on top of this background grid.If the
ArcGISMap
contains transparent areas, theBackgroundGrid
may be visible within theArcGISMap.getMaxExtent()
and you may wish to define aBackgroundGrid.getColor()
appropriate to your map's symbology. If anArcGISMap
has anArcGISMap.getBackgroundColor()
, thegetBackgroundGrid()
is ignored.The default
BackgroundGrid
color is gray with black grid lines.This property must not be set to null.
- Since:
- 200.0.0
- See Also:
-
geometryEditor
TheGeometryEditor
that allows users to interactively create and edit geometries by interacting with the view.- Since:
- 200.1.0
- See Also:
-
map
The map that is currently set to the map view.Setting a non-loaded map to a view starts the load process of the map so the map can be displayed once loaded.
- Since:
- 200.0.0
- See Also:
-
viewInsets
The insets on the MapView in device-independent pixels (DIP).ViewInsets
define the edges of the MapView that may be obscured by other UI elements.Insets are useful to shift UI controls (such as license string, callout, etc) which are overlaid on the view. An application may need to do this shift to make room for application specific controls.
It also affects the reported visible area, which will now be the area of the view minus the area of the insets.
Insets may be invalidated when the view is resized. If the insets are bigger than the view size, they are ignored.
- Since:
- 100.1.0
- See Also:
-
grid
A coordinate system grid to display on top of the MapView.The
Grid
is a collection of horizontal and vertical lines which can be rendered over the top of a MapView to help show the location of the currentViewpoint
. Supported grids include Military Grid Reference System (MgrsGrid
), United States National Grid (UsngGrid
), Universal Transverse Mercator (UtmGrid
), and a grid of latitude and longitude lines (LatitudeLongitudeGrid
). You can configure these grids by toggling their visibility and modifying their default layout and appearance. A grid will not display in the MapView until agetMap()
has been loaded.The default value is null.
- Since:
- 200.0.0
- See Also:
-
locationDisplay
The location display manages and renders the device's current location on a MapView using a data source, such as a GPS sensor.The device location is displayed as a blue, round symbol that is automatically refreshed by regular updates from the
LocationDisplay.getLocationDataSource()
. Although theLocationDisplay.getLocationDataSource()
uses the device's location data source by default, you can configure it to use data sources such as NMEA, route tracker, indoors, and simulated data sources. For more information, seeLocationDataSource
.Once the
getMap()
has been assigned and loaded, callLocationDisplay.startAsync()
to initiate location updates from theLocationDataSource
.Use the
LocationDisplay.getAutoPanMode()
enumerations to build navigation or compass style apps. For example, adoptLocationDisplay.AutoPanMode.NAVIGATION
to build an app that pans the MapView so that the current location symbol is shown near the bottom of the screen and the MapView is aligned with the direction of travel. You can also customize the symbols that display the device's location, its heading, the accuracy of the signal and the acquiring signal.- Since:
- 200.0.0
- See Also:
-
-
Constructor Details
-
MapView
public MapView()Creates a new MapView instance.- Since:
- 100.0.0
-
-
Method Details
-
getSpatialReference
Gets the spatial reference.- Specified by:
getSpatialReference
in classGeoView
- Returns:
- the spatial reference, null if the ArcGISMap is null
- Since:
- 100.0.0
-
wrapAroundModeProperty
Indicates whether continuous panning across the international date line is enabled.By default, the MapView attempts to wrap the
ArcGISMap
across the international date line for a continuous panning user experience. The eastern and western hemispheres wrap to form a continuous map, giving the impression that the map is endless.You can apply wraparound to a MapView if certain conditions are met, as described in
WrapAroundMode.ENABLE_WHEN_SUPPORTED
. To remove the wraparound behavior set the value toWrapAroundMode.DISABLED
.If wraparound is enabled, geometries returned from
getVisibleArea()
may have coordinates outside the domain of the spatial reference of the map. Before using such geometries to perform spatial queries, address finding, or as feature geometries in a geodatabase, normalize them to lie within the spatial reference domain usingGeometryEngine.normalizeCentralMeridian(Geometry)
.The default value is
WrapAroundMode.ENABLE_WHEN_SUPPORTED
.- Returns:
- the
wrapAroundMode
property - Since:
- 200.0.0
- See Also:
-
getWrapAroundMode
Gets the wrap around mode.If a map is in wrap around mode then you can pan across the international date line if your BaseMap is in a suitable
SpatialReference
.- Returns:
- the wrap around mode
- Since:
- 100.0.0
-
setWrapAroundMode
Sets the wrap around mode.If a map is in wrap around mode then you can pan across the international date line if your BaseMap is in a suitable
SpatialReference
.- Parameters:
wrapAroundMode
- the new wrap around mode- Throws:
IllegalArgumentException
- if wrapAroundMode is null- Since:
- 100.0.0
-
mapScaleProperty
The map view's current scale.- Returns:
- the
mapScale
property - Since:
- 200.0.0
- See Also:
-
getMapScale
public double getMapScale()Gets the scale of the MapView.The scale represents the relationship between a distance in the MapView (on the screen) and the corresponding distance on the ground. For example, a scale of 100,000 indicates that one centimeter on the MapView display equates to one kilometer on the ground.
Users can interactively change the scale using the map view's zooming gestures. You can set the scale programmatically using methods that set the
Viewpoint
, such assetViewpointScaleAsync(double)
.The value is NAN until the load status of the
ArcGISMap
isLoadStatus.LOADED
and the draw status of theGeoView
isDrawStatus.COMPLETED
.- Returns:
- the scale of the MapView
- Since:
- 100.0.0
-
mapRotationProperty
The map view's current rotation.- Returns:
- the
mapRotation
property - Since:
- 200.0.0
- See Also:
-
getMapRotation
public double getMapRotation()Gets the rotation angle of theArcGISMap
in degrees from its north-south direction.If the map has been rotated in a clockwise direction the rotation value is negative. If it has been rotated in a counterclockwise direction the value is positive. For example, if the rotation value is -90 the top of the MapView will display an eastern part of the
ArcGISMap
.Users can interactively rotate the map using the map view's keyboard, mouse or touch rotation gestures. You can rotate the map programmatically using methods that set the
Viewpoint
, such assetViewpointRotationAsync(double)
orGeoView.setViewpoint(Viewpoint)
.- Returns:
- the rotation angle of the
ArcGISMap
in degrees from its north-south direction - Since:
- 100.0.0
- See Also:
-
backgroundGridProperty
The background grid that anArcGISMap
is displayed on top of.BackgroundGrid
defines the color and context grid displayed in the MapView. If agetMap()
has been assigned, theArcGISMap
displays on top of this background grid.If the
ArcGISMap
contains transparent areas, theBackgroundGrid
may be visible within theArcGISMap.getMaxExtent()
and you may wish to define aBackgroundGrid.getColor()
appropriate to your map's symbology. If anArcGISMap
has anArcGISMap.getBackgroundColor()
, thegetBackgroundGrid()
is ignored.The default
BackgroundGrid
color is gray with black grid lines.This property must not be set to null.
- Returns:
- the
backgroundGrid
property - Since:
- 200.0.0
- See Also:
-
getBackgroundGrid
Gets the BackgroundGrid set on the MapView.- Returns:
- the BackgroundGrid currently set on the MapView
- Since:
- 100.0.0
-
setBackgroundGrid
Sets the desired BackgroundGrid on the MapView.- Parameters:
backgroundGrid
- theBackgroundGrid
to be applied to the MapView- Throws:
IllegalArgumentException
- if the backgroundGrid is null- Since:
- 100.0.0
-
geometryEditorProperty
TheGeometryEditor
that allows users to interactively create and edit geometries by interacting with the view.- Returns:
- the
geometryEditor
property - Since:
- 200.1.0
- See Also:
-
getGeometryEditor
Gets the value of thegeometryEditor
property.- Property description:
- The
GeometryEditor
that allows users to interactively create and edit geometries by interacting with the view. - Returns:
- the value of the
geometryEditor
property - Since:
- 200.1.0
- See Also:
-
setGeometryEditor
Sets the value of thegeometryEditor
property.- Property description:
- The
GeometryEditor
that allows users to interactively create and edit geometries by interacting with the view. - Parameters:
geometryEditor
- the value for thegeometryEditor
property- Since:
- 200.1.0
- See Also:
-
getUnitsPerDensityIndependentPixel
public double getUnitsPerDensityIndependentPixel()Gets the size of each device-independent pixel (DIP) in map units.The represents the spatial resolution of the MapView. The value changes according to the
getMapScale()
(it decreases as the user zooms in, for example).The value is NAN until the load status of the
ArcGISMap
isLoadStatus.LOADED
and the draw status of theGeoView
isDrawStatus.COMPLETED
.- Returns:
- the size of each device-independent pixel (DIP) in map units
- Since:
- 100.0.0
-
getVisibleArea
Gets the map view's visible area.The visible area represents the portion of the
ArcGISMap
that is visible in the MapView. When a newArcGISMap
is assigned to a MapView, the default value of the visible area is set from theGeoModel.getInitialViewpoint()
.Users can interactively navigate the map to change the visible area, or you can programmatically change this using methods that set the
Viewpoint
, such asGeoView.setViewpoint(Viewpoint)
.The visible area polygon always contains one ring with four vertices, each representing a corner of the map. It is a
Polygon
and not anEnvelope
because the map may be rotated and each corner of the map may contain unique x-y coordinates. Note that the visible area excludes the portion of the map obscured by the map view's attribution bar. As a result, the edges and center of the visible area may not coincide with the bounds and center of the MapView.- Returns:
- the visible area
- Since:
- 100.0.0
-
setViewpointAsync
public ListenableFuture<Boolean> setViewpointAsync(Viewpoint viewpoint, float durationSeconds, AnimationCurve animationCurve) Animates the display to the new viewpoint using the provided animation curve. TheAnimationCurve
defines the animation easing function.- Parameters:
viewpoint
- the visible area to display in the viewdurationSeconds
- the time for the transition animation to complete, in secondsanimationCurve
- the type of animation curve- Returns:
- a ListenableFuture. Add a listener to this to know when the viewpoint has finished animating. The result of the future indicates if the operation completed successfully or not.
- Throws:
IllegalArgumentException
- if viewpoint is nullIllegalArgumentException
- if animationCurve is null- Since:
- 100.1.0
-
setViewpointCenterAsync
Centers the map view at the provided center point.- Parameters:
point
- the location at which to center the map view- Returns:
- a ListenableFuture. Add a listener to this to know when the viewpoint has finished animating. The result of the future indicates if the operation completed successfully or not.
- Throws:
NullPointerException
- if argument is null- Since:
- 100.0.0
-
setViewpointGeometryAsync
Zooms and pans the map view to the extent of the provided geometry.- Parameters:
boundingGeometry
- the geometry to zoom to- Returns:
- a ListenableFuture. Add a listener to this to know when the viewpoint has finished animating. The result of the future indicates if the operation completed successfully or not.
- Throws:
NullPointerException
- if the argument is null- Since:
- 100.0.0
-
setViewpointGeometryAsync
public ListenableFuture<Boolean> setViewpointGeometryAsync(Geometry boundingGeometry, double padding) Zooms and pans the map view to the extent of the provided geometry with additional padding.- Parameters:
boundingGeometry
- the geometry to zoom topadding
- the minimum amount of padding around the bounding geometry in pixels- Returns:
- a ListenableFuture. Add a listener to this to know when the viewpoint has finished animating. The result of the future indicates if the operation completed successfully or not.
- Throws:
NullPointerException
- if the bounding geometry is null- Since:
- 100.0.0
-
setViewpointRotationAsync
Rotates the map view to the provided angle.The angle will be normalized between 0 and 360 degrees.
- Parameters:
angleDegrees
- the degrees to rotate to (in counterclockwise direction)- Returns:
- a ListenableFuture. Add a listener to this to know when the viewpoint has finished animating. The result of the future indicates if the operation completed successfully or not.
- Since:
- 100.0.0
-
setViewpointScaleAsync
Zooms the map view to the provided scale around its current center point.- Parameters:
scale
- the scale to zoom to. For example, 50000 is a scale of 1:50,000.- Returns:
- a ListenableFuture. Add a listener to this to know when the viewpoint has finished animating. The result of the future indicates if the operation completed successfully or not.
- Since:
- 100.0.0
-
setViewpointCenterAsync
Centers the map view at the provided center point and zooms to the given scale.- Parameters:
center
- the location at which to center the map viewscale
- the scale at which the map is displayed- Returns:
- a ListenableFuture. Add a listener to this to know when the viewpoint has finished animating. The result of the future indicates if the operation completed successfully or not.
- Throws:
NullPointerException
- if the center is null- Since:
- 100.0.0
-
mapProperty
The map that is currently set to the map view.Setting a non-loaded map to a view starts the load process of the map so the map can be displayed once loaded.
- Returns:
- the
map
property - Since:
- 200.0.0
- See Also:
-
getMap
Gets the map that the MapView is displaying.- Returns:
- the ArcGISMap
- Since:
- 100.0.0
-
setMap
Sets the map that the MapView is displaying.If you assign an
ArcGISMap
to a MapView, the map, itsBasemap
, and collection of operational layers automatically start to load. When loading completes, the layers and basemap are rendered in the map view.To validate the content of a map before you display it, call
GeoModel.loadAsync()
to load theArcGISMap
into your app before you assign it to a MapView.- Parameters:
map
- the new ArcGISMap- Since:
- 100.0.0
-
locationToScreen
Converts aPoint
in map coordinates to a javafx.geometry.Point2D representing JavaFX local coordinates. Coordinate values are in pixels, relative to the top-left corner of the MapView's screen location.Use this method to help perform custom drawing, or to locate other user interface components, relative to specific map coordinates. For example, calculate the screen coordinates at which to show a button so that it displays adjacent to a specific feature or raster cell in the map.
The screen coordinates are in device-independent pixels (DIP) relative to the upper-left corner at position 0,0. The screen coordinates returned may lie outside the current map view bounds. For example, if a map of the world is zoomed in to the extent of Africa, a map location within South America would result in a screen coordinate that is outside the screens bounds.
If the
WrapAroundMode
is enabled on the map view, this method returns the closest screen location matching the specified map location. If the map coordinate is in the visible area the method will return that screen coordinate, otherwise it will return the screen coordinate from the frame closest to the visible area.If the wraparound mode is active, this method returns the closest screen location matching the specified map location. 'Closest' meaning: If it's in view, return that location, otherwise return for the frame where the location is the closest to the center of the view.
To call this method, assign a map to the map view, ensure that it is loaded and the draw status is
DrawStatus.COMPLETED
.- Parameters:
mapPoint
- the map point- Returns:
- an javafx.geometry.Point2D representing the JavaFX local coordinates.
- Throws:
IllegalArgumentException
- if mapPoint is null- Since:
- 100.0.0
-
screenToLocation
Converts a point in JavaFX local coordinates to a location in map coordinates.To call this method, assign a map to the map view, ensure that it is loaded and the draw status is
DrawStatus.COMPLETED
.- Parameters:
screenPoint
- the point in JavaFX local coordinates- Returns:
- a point object. Null is returned if the map view's spatial reference is not yet known, for example, before the viewed map is loaded.
- Throws:
IllegalArgumentException
- if screenPoint is null- Since:
- 100.0.0
-
setViewInsets
Sets the specified insets on the view.Units are specified in density-independent pixels (DIPs)
- Parameters:
viewInsets
- insets to be set on the view, can be null. If null, the insets will be set to empty.- Since:
- 100.1.0
- See Also:
-
viewInsetsProperty
The insets on the MapView in device-independent pixels (DIP).ViewInsets
define the edges of the MapView that may be obscured by other UI elements.Insets are useful to shift UI controls (such as license string, callout, etc) which are overlaid on the view. An application may need to do this shift to make room for application specific controls.
It also affects the reported visible area, which will now be the area of the view minus the area of the insets.
Insets may be invalidated when the view is resized. If the insets are bigger than the view size, they are ignored.
- Returns:
- the
viewInsets
property - Since:
- 100.1.0
- See Also:
-
getViewInsets
Gets the insets on the view.- Returns:
- the insets
- Since:
- 100.1.0
-
addMapRotationChangedListener
@Deprecated(since="200.0.0", forRemoval=true) public void addMapRotationChangedListener(MapRotationChangedListener listener) Deprecated, for removal: This API element is subject to removal in a future version.As of 200.0.0, useObservableValue.addListener(ChangeListener)
onmapRotationProperty()
.Adds a listener for when map rotation has changed.- Parameters:
listener
- the listener- Throws:
IllegalArgumentException
- if the listener is null- Since:
- 100.0.0
-
removeMapRotationChangedListener
@Deprecated(since="200.0.0", forRemoval=true) public boolean removeMapRotationChangedListener(MapRotationChangedListener listener) Deprecated, for removal: This API element is subject to removal in a future version.As of 200.0.0, useObservableValue.addListener(ChangeListener)
onmapRotationProperty()
.Removes a map rotation changed listener.- Parameters:
listener
- the listener- Returns:
- true, if successful
- Since:
- 100.0.0
-
addMapScaleChangedListener
@Deprecated(since="200.0.0", forRemoval=true) public void addMapScaleChangedListener(MapScaleChangedListener listener) Deprecated, for removal: This API element is subject to removal in a future version.As of 200.0.0, useObservableValue.addListener(ChangeListener)
onmapScaleProperty()
.Adds a listener for when map scale has changed.- Parameters:
listener
- the listener- Throws:
IllegalArgumentException
- if the listener is null- Since:
- 100.0.0
-
removeMapScaleChangedListener
@Deprecated(since="200.0.0", forRemoval=true) public boolean removeMapScaleChangedListener(MapScaleChangedListener listener) Deprecated, for removal: This API element is subject to removal in a future version.As of 200.0.0, useObservableValue.addListener(ChangeListener)
onmapScaleProperty()
.Removes a map scale changed listener.- Parameters:
listener
- the listener- Returns:
- true, if successful
- Since:
- 100.0.0
-
setSketchEditor
@Deprecated(since="200.2.0", forRemoval=true) public void setSketchEditor(SketchEditor sketchEditor) Deprecated, for removal: This API element is subject to removal in a future version.As of 200.2.0,SketchEditor
and associated types are deprecated. UseGeometryEditor
instead.Sets the sketch editor, which allows users to interactively sketch geometries on the view.- Parameters:
sketchEditor
- a sketch editor, can be null- Since:
- 100.1.0
- See Also:
-
getSketchEditor
Deprecated, for removal: This API element is subject to removal in a future version.As of 200.2.0,SketchEditor
and associated types are deprecated. UseGeometryEditor
instead.Gets the current sketch editor, or null if not set. A sketch editor allows users to interactively sketch geometries on the view- Returns:
- the current sketch editor, or null if not set
- Since:
- 100.1.0
-
gridProperty
A coordinate system grid to display on top of the MapView.The
Grid
is a collection of horizontal and vertical lines which can be rendered over the top of a MapView to help show the location of the currentViewpoint
. Supported grids include Military Grid Reference System (MgrsGrid
), United States National Grid (UsngGrid
), Universal Transverse Mercator (UtmGrid
), and a grid of latitude and longitude lines (LatitudeLongitudeGrid
). You can configure these grids by toggling their visibility and modifying their default layout and appearance. A grid will not display in the MapView until agetMap()
has been loaded.The default value is null.
- Returns:
- the
grid
property - Since:
- 200.0.0
- See Also:
-
setGrid
Sets a grid to be displayed on top of the MapView.If a developer wants to temporarily hide the grid, they can change the grid's visibility. Setting a grid to not visible will hide the grid and its labels. This method should be used in preference to setting the grid to null, which is an expensive operation.
- Parameters:
grid
- grid to display on top of the MapView, can be null- Since:
- 100.0.0
- See Also:
-
getGrid
Gets grid set to the MapView.- Returns:
- grid set to the MapView, null if not set
- Since:
- 100.0.0
- See Also:
-
getLabeling
Gets the view label properties.This property determines whether labels are created, added and animated for all of the layers and graphic overlays in the view. For example, you can prevent labels displaying in the GeoView if you set
ViewLabelProperties.isLabelingEnabled()
to false. This overrides the labelsEnabled properties set on all layers and graphic overlays in the view. The default value ofViewLabelProperties.isLabelingEnabled()
is true.- Overrides:
getLabeling
in classGeoView
- Returns:
- the view label properties
- Since:
- 100.4.0
-
setLabeling
Sets the view label properties.This property determines whether labels are created, added and animated for all of the layers and graphic overlays in the view. For example, you can prevent labels displaying in the GeoView if you set
ViewLabelProperties.isLabelingEnabled()
to false. This overrides the labelsEnabled properties set on all layers and graphic overlays in the view.- Overrides:
setLabeling
in classGeoView
- Parameters:
viewLabelProperties
- the view label properties- Since:
- 100.4.0
-
locationDisplayProperty
The location display manages and renders the device's current location on a MapView using a data source, such as a GPS sensor.The device location is displayed as a blue, round symbol that is automatically refreshed by regular updates from the
LocationDisplay.getLocationDataSource()
. Although theLocationDisplay.getLocationDataSource()
uses the device's location data source by default, you can configure it to use data sources such as NMEA, route tracker, indoors, and simulated data sources. For more information, seeLocationDataSource
.Once the
getMap()
has been assigned and loaded, callLocationDisplay.startAsync()
to initiate location updates from theLocationDataSource
.Use the
LocationDisplay.getAutoPanMode()
enumerations to build navigation or compass style apps. For example, adoptLocationDisplay.AutoPanMode.NAVIGATION
to build an app that pans the MapView so that the current location symbol is shown near the bottom of the screen and the MapView is aligned with the direction of travel. You can also customize the symbols that display the device's location, its heading, the accuracy of the signal and the acquiring signal.- Returns:
- the
locationDisplay
property - Since:
- 200.0.0
- See Also:
-
getLocationDisplay
Returns the MapView'sLocationDisplay
, used to display the current location from a location data source in the MapView. A MapView only has one LocationDisplay.- Returns:
- the LocationDisplay object
- Since:
- 100.9.0
-
ObservableValue.addListener(ChangeListener)
onmapRotationProperty()
.