Class MapView
- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.control.Control
-
- com.esri.arcgisruntime.mapping.view.GeoView
-
- com.esri.arcgisruntime.mapping.view.MapView
-
- All Implemented Interfaces:
Styleable
,EventTarget
,Skinnable
public final class MapView extends GeoView
A MapView renders data from an ArcGISMap and allows users to interact with the map. In an MVC architecture, a MapView represents the view and an ArcGISMap represents the model. 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:
ArcGISMap
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MapView.DefaultInteractionListener
Default listener to handle input events on the map view.
-
Field Summary
-
Fields inherited from class com.esri.arcgisruntime.mapping.view.GeoView
mCallout, mGeoViewImpl
-
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
Constructors Constructor Description MapView()
Creates a new MapView instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMapRotationChangedListener(MapRotationChangedListener listener)
Adds a listener for when map rotation has changed.void
addMapScaleChangedListener(MapScaleChangedListener listener)
Adds a listener for when map scale has changed.BackgroundGrid
getBackgroundGrid()
Gets the BackgroundGrid set on the MapView.Grid
getGrid()
Gets grid set to the MapView.ViewLabelProperties
getLabeling()
Gets the view label properties.LocationDisplay
getLocationDisplay()
Returns the MapView'sLocationDisplay
, used to display the current location from a location data source in the MapView.ArcGISMap
getMap()
Gets theArcGISMap
shown in this MapView.double
getMapRotation()
Gets the map rotation.double
getMapScale()
Gets the scale.SketchEditor
getSketchEditor()
Gets the current sketch editor, or null if not set.SpatialReference
getSpatialReference()
Gets the spatial reference.double
getUnitsPerDensityIndependentPixel()
Gets the map units per density-independent pixel(dp).Insets
getViewInsets()
Gets the insets on the view.Polygon
getVisibleArea()
Gets the visible area of the map view.WrapAroundMode
getWrapAroundMode()
Gets the wrap around mode.boolean
isViewInsetsValid()
Indicates whether the insets specified on the view are currently valid.Point2D
locationToScreen(Point mapPoint)
Converts aPoint
in map coordinates to a javafx.geometry.Point2D representing JavaFX local coordinates.boolean
removeMapRotationChangedListener(MapRotationChangedListener listener)
Removes a map rotation changed listener.boolean
removeMapScaleChangedListener(MapScaleChangedListener listener)
Removes a map scale changed listener.Point
screenToLocation(Point2D screenPoint)
Converts a point in JavaFX local coordinates to a map point.void
setBackgroundGrid(BackgroundGrid backgroundGrid)
Sets the desired BackgroundGrid on the MapView.void
setGrid(Grid grid)
Sets a grid to be displayed on top of the MapView.void
setLabeling(ViewLabelProperties viewLabelProperties)
Sets the view label properties.void
setMap(ArcGISMap map)
Sets theArcGISMap
to be displayed in this view.void
setSketchEditor(SketchEditor sketchEditor)
Sets the sketch editor, which allows users to interactively sketch geometries on the view.void
setViewInsets(Insets viewInsets)
Sets the specified insets on the view.ListenableFuture<Boolean>
setViewpointAsync(Viewpoint viewpoint, float durationSeconds, AnimationCurve animationCurve)
Set viewpoint asynchronously taking the given number of seconds to complete and using the suppliedAnimationCurve
to define the easing function for the animation.ListenableFuture<Boolean>
setViewpointCenterAsync(Point point)
Sets the viewpoint center asynchronously.ListenableFuture<Boolean>
setViewpointCenterAsync(Point center, double scale)
Set viewpoint center with scale asynchronously.ListenableFuture<Boolean>
setViewpointGeometryAsync(Geometry boundingGeometry)
Sets the viewpoint geometry asynchronously.ListenableFuture<Boolean>
setViewpointGeometryAsync(Geometry boundingGeometry, double padding)
Set viewpoint geometry with padding asynchronously.ListenableFuture<Boolean>
setViewpointRotationAsync(double angleDegrees)
Sets the viewpoint rotation asynchronously.ListenableFuture<Boolean>
setViewpointScaleAsync(double scale)
Sets the viewpoint scale asynchronously.void
setWrapAroundMode(WrapAroundMode wrapAroundMode)
Sets the wrap around mode.ObjectProperty<Insets>
viewInsetsProperty()
Returns the insets on the view.-
Methods inherited from class com.esri.arcgisruntime.mapping.view.GeoView
addAttributionTextChangedListener, addDrawStatusChangedListener, addLayerViewStateChangedListener, addNavigationChangedListener, addSpatialReferenceChangedListener, addTimeExtentChangedListener, addViewpointChangedListener, attributionTextVisibleProperty, attributionTopProperty, createDefaultSkin, dispose, enableKeyboardNavigationProperty, enableMousePanProperty, enableMouseZoomProperty, enableTouchPanProperty, enableTouchRotateProperty, enableTouchZoomProperty, exportImageAsync, getAttributionText, getAttributionTop, getCallout, getCurrentViewpoint, getDrawStatus, getGraphicsOverlays, getInteractionListener, getLayerViewState, getSelectionProperties, getTimeExtent, getViewStateForLayer, identifyGraphicsOverlayAsync, identifyGraphicsOverlayAsync, identifyGraphicsOverlaysAsync, identifyGraphicsOverlaysAsync, identifyLayerAsync, identifyLayerAsync, identifyLayersAsync, identifyLayersAsync, isAttributionTextVisible, isEnableKeyboardNavigation, isEnableMousePan, isEnableMouseZoom, isEnableTouchPan, isEnableTouchRotate, isEnableTouchZoom, isLogoVisible, isNavigating, isResizable, isWrapAroundEnabled, removeAttributionTextChangedListener, removeDrawStatusChangedListener, removeLayerViewStateChangedListener, removeNavigationChangedListener, removeSpatialReferenceChangedListener, removeTimeExtentChangedListener, removeViewpointChangedListener, setAttributionTextVisible, setBookmarkAsync, setEnableKeyboardNavigation, setEnableMousePan, setEnableMouseZoom, setEnableTouchPan, setEnableTouchRotate, setEnableTouchZoom, setInteractionListener, setLogoVisible, setTimeExtent, setViewpoint, setViewpointAsync, setViewpointAsync
-
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
-
-
-
-
Method Detail
-
getSpatialReference
public SpatialReference getSpatialReference()
Gets the spatial reference.- Specified by:
getSpatialReference
in classGeoView
- Returns:
- the spatial reference, null if the ArcGISMap is null
- Since:
- 100.0.0
-
getWrapAroundMode
public WrapAroundMode 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
public void setWrapAroundMode(WrapAroundMode wrapAroundMode)
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- Since:
- 100.0.0
-
getMapScale
public double getMapScale()
Gets the scale.- Returns:
- the scale
- Since:
- 100.0.0
-
getMapRotation
public double getMapRotation()
Gets the map rotation.- Returns:
- the map rotation in degrees.
- Since:
- 100.0.0
-
getBackgroundGrid
public BackgroundGrid getBackgroundGrid()
Gets the BackgroundGrid set on the MapView.- Returns:
- the BackgroundGrid currently set on the MapView
- Since:
- 100.0.0
-
setBackgroundGrid
public void setBackgroundGrid(BackgroundGrid backgroundGrid)
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
-
getUnitsPerDensityIndependentPixel
public double getUnitsPerDensityIndependentPixel()
Gets the map units per density-independent pixel(dp).- Returns:
- the map units per density-independent pixel(dp)
- Since:
- 100.0.0
-
getVisibleArea
public Polygon getVisibleArea()
Gets the visible area of the map view.- Returns:
- the visible area
- Since:
- 100.0.0
-
setViewpointAsync
public ListenableFuture<Boolean> setViewpointAsync(Viewpoint viewpoint, float durationSeconds, AnimationCurve animationCurve)
Set viewpoint asynchronously taking the given number of seconds to complete and using the suppliedAnimationCurve
to define the easing function for the animation.- Parameters:
viewpoint
- the viewpoint being animated todurationSeconds
- the duration of the animation in secondsanimationCurve
- the animation curve to apply- 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
public ListenableFuture<Boolean> setViewpointCenterAsync(Point point)
Sets the viewpoint center asynchronously.- Parameters:
point
- the new viewpoint center- 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
public ListenableFuture<Boolean> setViewpointGeometryAsync(Geometry boundingGeometry)
Sets the viewpoint geometry asynchronously.- Parameters:
boundingGeometry
- the new viewpoint geometry- 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)
Set viewpoint geometry with padding asynchronously.- Parameters:
boundingGeometry
- the bounding geometrypadding
- the padding- 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
public ListenableFuture<Boolean> setViewpointRotationAsync(double angleDegrees)
Sets the viewpoint rotation asynchronously.- Parameters:
angleDegrees
- the new viewpoint rotation- 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
public ListenableFuture<Boolean> setViewpointScaleAsync(double scale)
Sets the viewpoint scale asynchronously.- Parameters:
scale
- the new viewpoint scale- 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
public ListenableFuture<Boolean> setViewpointCenterAsync(Point center, double scale)
Set viewpoint center with scale asynchronously.- Parameters:
center
- the centerscale
- the scale- 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
-
getMap
public ArcGISMap getMap()
Gets theArcGISMap
shown in this MapView.- Returns:
- the ArcGISMap
- Since:
- 100.0.0
-
setMap
public void setMap(ArcGISMap map)
Sets theArcGISMap
to be displayed in this view. Null is allowed.- Parameters:
map
- the new ArcGISMap- Since:
- 100.0.0
-
locationToScreen
public Point2D locationToScreen(Point mapPoint)
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.
This method will attempt to convert any coordinates within the MapView's
SpatialReference
, and therefore can result in coordinates outside the actual screen 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 point off screen.If wrap around is enabled, then the map is drawn as continuous horizontal repeats, allowing you to pan continuously - this means that one map location could relate to multiple potential screen locations. In this case, if the map location lies within the screen bounds then that location is used; otherwise the location closest to the center of the view is used.
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.
This method can't be called until a map has been set to the map view by calling
setMap(ArcGISMap)
.- 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
public Point screenToLocation(Point2D screenPoint)
Converts a point in JavaFX local coordinates to a map point.- Parameters:
screenPoint
- the point in JavaFX local coordinates- Returns:
- the map point
- Throws:
IllegalArgumentException
- if screenPoint is null- Since:
- 100.0.0
-
setViewInsets
public void setViewInsets(Insets viewInsets)
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()
-
viewInsetsProperty
public ObjectProperty<Insets> viewInsetsProperty()
Returns the insets on the view.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 effects 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:
isViewInsetsValid()
-
getViewInsets
public Insets getViewInsets()
Gets the insets on the view.- Returns:
- the insets
- Since:
- 100.1.0
-
isViewInsetsValid
public boolean isViewInsetsValid()
Indicates whether the insets specified on the view are currently valid. It can be used to check whether the insets are valid after the view is resized.- Returns:
- true if the insets are smaller than the current view size; false if they are equal to or larger
- Since:
- 100.1.0
-
addMapRotationChangedListener
public void addMapRotationChangedListener(MapRotationChangedListener listener)
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
public boolean removeMapRotationChangedListener(MapRotationChangedListener listener)
Removes a map rotation changed listener.- Parameters:
listener
- the listener- Returns:
- true, if successful
- Since:
- 100.0.0
-
addMapScaleChangedListener
public void addMapScaleChangedListener(MapScaleChangedListener listener)
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
public boolean removeMapScaleChangedListener(MapScaleChangedListener listener)
Removes a map scale changed listener.- Parameters:
listener
- the listener- Returns:
- true, if successful
- Since:
- 100.0.0
-
setSketchEditor
public void setSketchEditor(SketchEditor sketchEditor)
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:
SketchEditor
-
getSketchEditor
public SketchEditor getSketchEditor()
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
-
setGrid
public void setGrid(Grid grid)
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()
,Grid.setVisible(boolean)
,LatitudeLongitudeGrid
,MgrsGrid
,UsngGrid
,UtmGrid
-
getGrid
public Grid getGrid()
Gets grid set to the MapView.- Returns:
- grid set to the MapView, null if not set
- Since:
- 100.0.0
- See Also:
setGrid(Grid)
,LatitudeLongitudeGrid
,MgrsGrid
,UsngGrid
,UtmGrid
-
getLabeling
public ViewLabelProperties getLabeling()
Gets the view label properties.The view label properties are an overall control for whether labels will be created and displayed for layers added to the view. Individual layers can also control whether labels should be displayed for their features. Labels need to be enabled both in the view and in the layer. By default the labeling for a view is enabled. The view label properties also control global aspects of the label appearance, for example animation effects.
- Overrides:
getLabeling
in classGeoView
- Returns:
- the view label properties
- Since:
- 100.4.0
-
setLabeling
public void setLabeling(ViewLabelProperties viewLabelProperties)
Sets the view label properties.The view label properties are an overall control for whether labels will be created and displayed for layers added to the view. Individual layers can also control whether labels should be displayed for their features. Labels need to be enabled both in the view and in the layer. By default the labeling for a view is enabled. The view label properties also control global aspects of the label appearance, for example animation effects.
- Overrides:
setLabeling
in classGeoView
- Parameters:
viewLabelProperties
- the view label properties- Since:
- 100.4.0
-
getLocationDisplay
public LocationDisplay 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
-
-