Class MapView

  • All Implemented Interfaces:
    android.graphics.drawable.Drawable.Callback, android.view.accessibility.AccessibilityEventSource, android.view.KeyEvent.Callback, android.view.ViewManager, android.view.ViewParent

    public final class MapView
    extends GeoView
    A MapView renders the data from an ArcGISMap in an Android layout, and allows users to interact with the map.

    MapView indirectly inherits from android's ViewGroup; in a Model View Controller (MVC) architecture, use it to represent the MVC view, and the ArcGISMap to represent the MVC model. You can define the size and layout properties of a MapView in layout XML, or create it programmatically. In either case, call setMap to set the content to be displayed. The mapview will automatically load the map, its basemap, operational layers, and display their contents on screen. Refer to the ArcGISMap class for more information.

    MapView inherits from GeoView and adds 2D specific methods for map navigation that set the visible area of the map (the current extent) by setting a Viewpoint. For example, setViewpointGeometryAsync zooms the map to the extent of a geometry, and setViewpointCenterAsync zooms the map to a given scale, centered at the given Point. More setViewpoint methods are available, including overloads where an animation duration can be specified. Geometries passed to these methods will be automatically re-projected if required. Use isNavigating or NavigationChangedListener to determine if navigation is ongoing or completed. Once navigation is complete, get the new viewpoint from getCurrentViewPoint.

    By default, you can pan, zoom, and rotate the map using a set of standard gestures like double-tap and pinch; for more details see DefaultMapViewOnTouchListener. You can also override standard gestures by creating your own touch listener class. To do this, either implement MapView.OnTouchListener, or inherit from DefaultMapViewOnTouchListener, and pass an instance of your touch listener class to setOnTouchListener.

    Since:
    100.0.0
    See Also:
    ArcGISMap, Basemap, Layer, DefaultMapViewOnTouchListener
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MapView.InteractionOptions
      Options to control user interactions with a MapView.
      static interface  MapView.OnTouchListener
      Defines single and multitouch gesture events that can occur on the MapView, such as a multi-pointer tap.
      • Nested classes/interfaces inherited from class android.view.ViewGroup

        android.view.ViewGroup.LayoutParams, android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
      • Nested classes/interfaces inherited from class android.view.View

        android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnCapturedPointerListener, android.view.View.OnClickListener, android.view.View.OnContextClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnScrollChangeListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnUnhandledKeyEventListener
    • Field Summary

      • Fields inherited from class android.view.ViewGroup

        CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
      • Fields inherited from class android.view.View

        ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR, AUTOFILL_HINT_CREDIT_CARD_NUMBER, AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE, AUTOFILL_HINT_EMAIL_ADDRESS, AUTOFILL_HINT_NAME, AUTOFILL_HINT_PASSWORD, AUTOFILL_HINT_PHONE, AUTOFILL_HINT_POSTAL_ADDRESS, AUTOFILL_HINT_POSTAL_CODE, AUTOFILL_HINT_USERNAME, AUTOFILL_TYPE_DATE, AUTOFILL_TYPE_LIST, AUTOFILL_TYPE_NONE, AUTOFILL_TYPE_TEXT, AUTOFILL_TYPE_TOGGLE, DRAG_FLAG_ACCESSIBILITY_ACTION, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLE, FOCUSABLE_AUTO, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, IMPORTANT_FOR_AUTOFILL_AUTO, IMPORTANT_FOR_AUTOFILL_NO, IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_AUTOFILL_YES, IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_CONTENT_CAPTURE_AUTO, IMPORTANT_FOR_CONTENT_CAPTURE_NO, IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_CONTENT_CAPTURE_YES, IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, NOT_FOCUSABLE, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_CAPTURE_HINT_AUTO, SCROLL_CAPTURE_HINT_EXCLUDE, SCROLL_CAPTURE_HINT_EXCLUDE_DESCENDANTS, SCROLL_CAPTURE_HINT_INCLUDE, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z
    • Constructor Summary

      Constructors 
      Constructor Description
      MapView​(android.content.Context context)
      Creates a new MapView using the given Context.
      MapView​(android.content.Context context, android.util.AttributeSet attrs)
      Creates a new MapView using the given Context, called when the MapView is inflated from XML.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated 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.
      boolean canMagnifierPanMap()
      Deprecated.
      void dispose()
      Releases resources.
      BackgroundGrid getBackgroundGrid()
      Gets the BackgroundGrid set on the MapView.
      Callout getCallout()
      Gets the Callout for this MapView.
      Grid getGrid()
      Gets grid set to the MapView.
      MapView.InteractionOptions getInteractionOptions()
      Gets the MapView.InteractionOptions to configure user interactions for the MapView.
      ViewLabelProperties getLabeling()
      Gets the view label properties.
      LocationDisplay getLocationDisplay()
      Returns the MapView's LocationDisplay, used to display the current device location in the MapView.
      ArcGISMap getMap()
      Gets the ArcGISMap shown in this MapView.
      double getMapRotation()
      Returns the current rotation angle of the map, in degrees counter-clockwise from its default orientation.
      double getMapScale()
      Gets the current scale of the map, expressing the relationship between a distance in the MapView and the corresponding distance on the ground.
      android.view.View.OnTouchListener getOnTouchListener()
      Gets the listener that handles touch gestures for this MapView.
      SketchEditor getSketchEditor()
      Gets the current sketch editor.
      SpatialReference getSpatialReference()
      Gets the SpatialReference of this GeoView.
      double getUnitsPerDensityIndependentPixel()
      Gets the number of map units (real world units in the units of the maps spatial reference) per density-independent pixel(dp).
      double getViewInsetBottom()
      Returns the bottom inset specified on the MapView.
      double getViewInsetLeft()
      Returns the left inset specified on the MapView.
      double getViewInsetRight()
      Returns the right inset specified on the MapView.
      double getViewInsetTop()
      Returns the top inset specified on the MapView.
      Polygon getVisibleArea()
      Returns a Polygon representing the area of the ArcGISMap that is currently visible in the MapView.
      WrapAroundMode getWrapAroundMode()
      Gets the current WrapAroundMode that determines if the map is drawn continuously across the 180th meridian.
      boolean isMagnifierEnabled()
      Deprecated.
      boolean isViewInsetsValid()
      Indicates if the configured insets specified on the MapView are currently valid.
      android.graphics.Point locationToScreen​(Point mapPoint)
      Converts a Point in map coordinates to an android.graphics.Point representing device screen coordinates.
      void logFrameRate​(android.widget.TextView textView)
      For debugging purposes only.
      boolean onTouchEvent​(android.view.MotionEvent event)
      Handles touch events on the MapView by delegating them to the currently set OnTouchListener.
      void pause()
      Pauses the drawing of the GeoView.
      boolean removeMapRotationChangedListener​(MapRotationChangedListener listener)
      Removes a map rotation changed listener.
      boolean removeMapScaleChangedListener​(MapScaleChangedListener listener)
      Removes a map scale changed listener.
      void resume()
      Resumes the drawing of the GeoView that has been paused, restarting the display of the contained ArcGISMap.
      Point screenToLocation​(android.graphics.Point screenPoint)
      Converts an android.graphics.Point representing device screen coordinates in pixels to a Point in map coordinates.
      void setBackgroundGrid​(BackgroundGrid backgroundGrid)
      Sets the BackgroundGrid on the MapView.
      void setCanMagnifierPanMap​(boolean canMagnifierPanMap)
      void setGrid​(Grid grid)
      Sets a grid to be displayed on top of the MapView.
      void setInteractionOptions​(MapView.InteractionOptions interactionOptions)
      Sets a MapView.InteractionOptions to configure user interactions for the MapView.
      void setLabeling​(ViewLabelProperties viewLabelProperties)
      Sets the view label properties.
      void setMagnifierEnabled​(boolean magnifierEnabled)
      void setMap​(ArcGISMap map)
      Sets the ArcGISMap to display in this MapView.
      void setOnTouchListener​(android.view.View.OnTouchListener onTouchListener)
      Sets the listener that handles touch gestures for this MapView.
      void setSketchEditor​(SketchEditor sketchEditor)
      Sets a SketchEditor into this MapView.
      void setViewInsets​(double left, double top, double right, double bottom)
      Sets the specified left, top, right, and bottom insets on the MapView.
      ListenableFuture<java.lang.Boolean> setViewpointAsync​(Viewpoint viewpoint, float durationSeconds, AnimationCurve animationCurve)
      Asynchronously updates the MapView to the given Viewpoint, taking the given number of seconds to complete and using the supplied AnimationCurve to define the easing function for the animation.
      ListenableFuture<java.lang.Boolean> setViewpointCenterAsync​(Point point)
      Asynchronously pans the map, with animation, to the given center Point.
      ListenableFuture<java.lang.Boolean> setViewpointCenterAsync​(Point center, double scale)
      Asynchronously zooms and pans the map, with animation, to the given center Point and map scale.
      ListenableFuture<java.lang.Boolean> setViewpointGeometryAsync​(Geometry boundingGeometry)
      Asynchronously zooms the map, with animation, to show the given Geometry.
      ListenableFuture<java.lang.Boolean> setViewpointGeometryAsync​(Geometry boundingGeometry, double padding)
      Asynchronously zooms the map, with animation, to show the given Geometry, with the given padding around the Geometry.
      ListenableFuture<java.lang.Boolean> setViewpointRotationAsync​(double angleDegrees)
      Asynchronously rotates the map, with animation, to the given angle.
      ListenableFuture<java.lang.Boolean> setViewpointScaleAsync​(double scale)
      Asynchronously zooms the map, with animation, to the given scale.
      void setWrapAroundMode​(WrapAroundMode wrapAroundMode)
      Sets the WrapAroundMode to determine if the map should be drawn continuously across the 180th meridian.
      void setZOrderMediaOverlay​(boolean isMediaOverlay)
      Deprecated.
      as of 100.8.0, it is no longer necessary to set z order to support media overlays so this method now does nothing
      • Methods inherited from class android.view.ViewGroup

        addChildrenForAccessibility, addExtraDataToAccessibilityNodeInfo, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, checkLayoutParams, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchCreateViewTranslationRequest, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchScrollCaptureSearch, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowInsetsAnimationEnd, dispatchWindowInsetsAnimationPrepare, dispatchWindowInsetsAnimationProgress, dispatchWindowInsetsAnimationStart, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getAccessibilityClassName, getChildAt, getChildCount, getChildDrawingOrder, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isLayoutSuppressed, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAttachedToWindow, onCreateDrawableState, onDescendantInvalidated, onDetachedFromWindow, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, setWindowInsetsAnimationCallback, shouldDelayChildPressedState, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, suppressLayout, updateViewLayout
      • Methods inherited from class android.view.View

        addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, autofill, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, clearViewTranslationCallback, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateDisplayHash, generateViewId, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getContextMenuInfo, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getImportantForContentCapture, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getReceiveContentMimeTypes, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootSurfaceControl, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollCaptureHint, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateDescription, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTranslationResponse, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowInsetsController, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOnLongClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isImportantForContentCapture, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPivotSet, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShowingLayoutBounds, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onCreateViewTranslationRequest, onCreateVirtualViewTranslationRequests, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideContentCaptureStructure, onProvideStructure, onProvideVirtualStructure, onReceiveContent, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollCaptureSearch, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTrackballEvent, onViewTranslationResponse, onVirtualViewTranslationResponses, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, performReceiveContent, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAllowClickWhenDisabled, setAlpha, setAnimation, setAnimationMatrix, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundGravity, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setImportantForContentCapture, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnReceiveContentListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRenderEffect, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollCaptureCallback, setScrollCaptureHint, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateDescription, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setViewTranslationCallback, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDraw
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface android.view.ViewParent

        canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, keyboardNavigationClusterSearch, requestFitSystemWindows, requestLayout
    • Constructor Detail

      • MapView

        public MapView​(android.content.Context context,
                       android.util.AttributeSet attrs)
        Creates a new MapView using the given Context, called when the MapView is inflated from XML.
        Parameters:
        context - The Context the view is running in, through which it can access the current theme, resources, etc. For example, this may be the instance of the Activity or Fragment that the MapView is inflated into.
        attrs - The attributes of the XML tag that is inflating the view.
      • MapView

        public MapView​(android.content.Context context)
        Creates a new MapView using the given Context. Call this constructor when creating a MapView programmatically.
        Parameters:
        context - The Context the view is running in, through which it can access the current theme, resources, etc.
    • Method Detail

      • dispose

        public void dispose()
        Description copied from class: GeoView
        Releases resources. Call this when you are finished with a view.
        Specified by:
        dispose in class GeoView
      • pause

        public void pause()
        Description copied from class: GeoView
        Pauses the drawing of the GeoView.

        This can be used to save resources when your application is minimized for example. Call this in the parent activity's onPause method. Ensure you have a corresponding call to GeoView.resume().

        Specified by:
        pause in class GeoView
      • resume

        public void resume()
        Description copied from class: GeoView
        Resumes the drawing of the GeoView that has been paused, restarting the display of the contained ArcGISMap. You can call this in the parent activity's onResume method, after a corresponding call to GeoView.pause().
        Specified by:
        resume in class GeoView
      • getMapScale

        public double getMapScale()
        Gets the current scale of the map, expressing the relationship between a distance in the MapView and the corresponding distance on the ground. For example, a map scale of 100,000 indicates that one centimeter on the map equates to one kilometer on the ground.

        To set the MapView to display a particular map scale, call setViewpointScaleAsync(double) or setViewpointCenterAsync(Point, double).

        Returns:
        a double representing the current map scale
        Since:
        100.0.0
      • getMapRotation

        public double getMapRotation()
        Returns the current rotation angle of the map, in degrees counter-clockwise from its default orientation.

        To change the rotation of the map programmatically, use the setViewpointRotationAsync(double) method. Users can interactively rotate the map by using a two-pointer-rotate gesture on the MapView.

        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 BackgroundGrid on the MapView.
        Parameters:
        backgroundGrid - the BackgroundGrid to be applied to the MapView
        Throws:
        java.lang.IllegalArgumentException - if the backgroundGrid is null
        Since:
        100.0.0
      • getUnitsPerDensityIndependentPixel

        public double getUnitsPerDensityIndependentPixel()
        Gets the number of map units (real world units in the units of the maps spatial reference) per density-independent pixel(dp). This is the current spatial resolution of the map on the screen and can be used to calculate map distances on the screen and effective scales.
        Returns:
        the number of map units per density-independent pixel
        Since:
        100.0.0
      • setMagnifierEnabled

        @Deprecated
        public void setMagnifierEnabled​(boolean magnifierEnabled)
        Enables or disables the built-in map magnifier. When enabled, the magnifier is shown when you long-press on the MapView. The current state of the magnifier is returned from isMagnifierEnabled().

        The magnifier allows you to precisely locate a location by centering the crosshairs at the required location, instead of using the location of a tap gesture. Get the exact location of the final magnifier crosshair location by responding to the OnTouchListener.onUp() method, instead of using the motion event received by onLongPress().

        Parameters:
        magnifierEnabled - true to enable the magnifier; false otherwise
        Since:
        100.0.0
        See Also:
        canMagnifierPanMap()
      • setCanMagnifierPanMap

        @Deprecated
        public void setCanMagnifierPanMap​(boolean canMagnifierPanMap)
        Enables or disables the ability of the magnifier to pan the map when it touches the edge of the MapView.

        To use magnifier panning, you must enable the magnifier using setMagnifierEnabled(boolean).

        Parameters:
        canMagnifierPanMap - true to allow the magnifier to pan the map view, default is false
        Since:
        100.0.0
      • canMagnifierPanMap

        @Deprecated
        public boolean canMagnifierPanMap()
        Deprecated.
        Indicates if the magnifier will pan the map when it touches the edge of the MapView. The default is false.

        To use magnifier panning, you must enable the magnifier using setMagnifierEnabled(boolean).

        Returns:
        true if the magnifier can pan the map; false otherwise
        Since:
        100.0.0
      • setViewpointAsync

        public ListenableFuture<java.lang.Boolean> setViewpointAsync​(Viewpoint viewpoint,
                                                                     float durationSeconds,
                                                                     AnimationCurve animationCurve)
        Asynchronously updates the MapView to the given Viewpoint, taking the given number of seconds to complete and using the supplied AnimationCurve to define the easing function for the animation. Alternatively use GeoView.setViewpointAsync(Viewpoint) to use the standard duration and animation curve or GeoView.setViewpointAsync(Viewpoint viewpoint, float durationSeconds) to use the standard animation curve.
        Parameters:
        viewpoint - the viewpoint being animated to
        durationSeconds - the duration of the animation in seconds
        animationCurve - the animation curve to apply
        Returns:
        a ListenableFuture representing the result of the Viewpoint change. Add a listener to the future to be notified when animation is finished. The result of the future indicates if the operation completed successfully.
        Throws:
        java.lang.IllegalArgumentException - if viewpoint is null
        java.lang.IllegalArgumentException - if animationCurve is null
        Since:
        100.1.0
      • setViewpointCenterAsync

        public ListenableFuture<java.lang.Boolean> setViewpointCenterAsync​(Point point)
        Asynchronously pans the map, with animation, to the given center Point.
        Parameters:
        point - the location on which the map should be centered
        Returns:
        a ListenableFuture representing the result of the Viewpoint change. Add a listener to the future to be notified when animation is finished. The result of the future indicates if the operation completed successfully.
        Throws:
        java.lang.IllegalArgumentException - if argument is null
        Since:
        100.0.0
      • setViewpointGeometryAsync

        public ListenableFuture<java.lang.Boolean> setViewpointGeometryAsync​(Geometry boundingGeometry)
        Asynchronously zooms the map, with animation, to show the given Geometry. The map scale and center may both change.
        Parameters:
        boundingGeometry - the geometry to zoom to. If the SpatialReference of the geometry is different to that of the MapView, it will be reprojected appropriately.
        Returns:
        a ListenableFuture representing the result of the Viewpoint change. Add a listener to the future to be notified when animation is finished. The result of the future indicates if the operation completed successfully.
        Throws:
        java.lang.IllegalArgumentException - if the argument is null
        Since:
        100.0.0
      • setViewpointGeometryAsync

        public ListenableFuture<java.lang.Boolean> setViewpointGeometryAsync​(Geometry boundingGeometry,
                                                                             double padding)
        Asynchronously zooms the map, with animation, to show the given Geometry, with the given padding around the Geometry. The map scale and center may both change.
        Parameters:
        boundingGeometry - the geometry to zoom to. If the SpatialReference of the geometry is different to that of the MapView, it will be reprojected appropriately.
        padding - a distance around the geometry to include in the Viewpoint when zooming, in density-independent pixels
        Returns:
        a ListenableFuture representing the result of the Viewpoint change. Add a listener to the future to be notified when animation is finished. The result of the future indicates if the operation completed successfully.
        Throws:
        java.lang.IllegalArgumentException - if boundingGeometry is null
        Since:
        100.0.0
      • setViewpointRotationAsync

        public ListenableFuture<java.lang.Boolean> setViewpointRotationAsync​(double angleDegrees)
        Asynchronously rotates the map, with animation, to the given angle.
        Parameters:
        angleDegrees - the new map rotation angle, in degrees counter-clockwise.
        Returns:
        a ListenableFuture representing the result of the Viewpoint change. Add a listener to the future to be notified when animation is finished. The result of the future indicates if the operation completed successfully.
        Since:
        100.0.0
      • setViewpointScaleAsync

        public ListenableFuture<java.lang.Boolean> setViewpointScaleAsync​(double scale)
        Asynchronously zooms the map, with animation, to the given scale. The map center point does not change. The map scale is the number of map units per unit of physical device size. It expresses the relationship between a distance in the MapView and the corresponding distance on the ground. A smaller value will zoom the map in and produce a larger map display area (features appear larger). A larger value will zoom the map out and produce a smaller map display area (features appear smaller).

        Alternatively, use getUnitsPerDensityIndependentPixel() to find the number of map units per density-independent pixels.

        Parameters:
        scale - the new map scale
        Returns:
        a ListenableFuture representing the result of the Viewpoint change. Add a listener to the future to be notified when animation is finished. The result of the future indicates if the operation completed successfully.
        Since:
        100.0.0
        See Also:
        getMapScale()
      • setViewpointCenterAsync

        public ListenableFuture<java.lang.Boolean> setViewpointCenterAsync​(Point center,
                                                                           double scale)
        Asynchronously zooms and pans the map, with animation, to the given center Point and map scale.
        Parameters:
        center - the location on which the map should be centered
        scale - the new map scale
        Returns:
        a ListenableFuture representing the result of the Viewpoint change. Add a listener to the future to be notified when animation is finished. The result of the future indicates if the operation completed successfully.
        Throws:
        java.lang.IllegalArgumentException - if center is null
        Since:
        100.0.0
        See Also:
        getMapScale()
      • setZOrderMediaOverlay

        @Deprecated
        public void setZOrderMediaOverlay​(boolean isMediaOverlay)
        Deprecated.
        as of 100.8.0, it is no longer necessary to set z order to support media overlays so this method now does nothing
        Controls whether the MapView is placed on top of another MapView, SceneView, or SurfaceView in the window (but still behind the window itself). This could be typically used to place an overview MapView on top of a SceneView. Note that this must be set before the MapView's containing window is attached to the window manager.
        Parameters:
        isMediaOverlay - true if this MapView is placed on top of another regular surface view, otherwise false
        Since:
        100.2.0
      • getMap

        public ArcGISMap getMap()
        Gets the ArcGISMap shown in this MapView. By default, the ArcGISMap is null, and must be set by calling setMap(ArcGISMap).

        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 ArcGISMap displayed in this MapView. Default is null.
        Since:
        100.0.0
      • getCallout

        public Callout getCallout()
        Gets the Callout for this MapView. A callout displays an Android View that contains text and/or other content. A MapView has only one Callout.
        Returns:
        the Callout object for this MapView
        Since:
        100.0.0
      • locationToScreen

        public android.graphics.Point locationToScreen​(Point mapPoint)
        Converts a Point in map coordinates to an android.graphics.Point representing device screen 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 Views, 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 necessary, you can use android.util.DisplayMetrics to check the screen coordinate bounds.

        If GeoView.isWrapAroundEnabled() is true, then 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.

        Parameters:
        mapPoint - the Point representing map coordinates to convert
        Returns:
        an android.graphics.Point representing screen coordinates in pixels. The x and y fields of this point will be set to NaN if an error occurs.
        Throws:
        java.lang.IllegalArgumentException - if mapPoint is null
        Since:
        100.0.0
        See Also:
        screenToLocation(android.graphics.Point)
      • screenToLocation

        public Point screenToLocation​(android.graphics.Point screenPoint)
        Converts an android.graphics.Point representing device screen coordinates in pixels to a Point in map coordinates.

        Use this method to convert MotionEvent coordinates from touch events on the view into corresponding locations on the map; for example, converting screen coordinates passed to the onSingleTapConfirmed method on android.view.GestureDetector.OnDoubleTapListener into map coordinates to use as the location of a Callout.

        Parameters:
        screenPoint - the android.graphics.Point representing screen coordinates, in pixels, to convert
        Returns:
        the Point representing map coordinates
        Throws:
        java.lang.IllegalArgumentException - if the argument is null
        Since:
        100.0.0
      • setViewInsets

        public void setViewInsets​(double left,
                                  double top,
                                  double right,
                                  double bottom)
        Sets the specified left, top, right, and bottom insets on the MapView. Insets controls the active visible area, instructing the MapView to ignore parts that may be obstructed by overlaid UI elements and affecting the MapView's logical center, the reported visible area and the location display. Units for left, top, right, and bottom are specified in density-independent pixels (dp). The Insets may be invalidated if the MapView is resized without the Insets being updated. Invalid Inset values are ignored.
        Parameters:
        left - the inset on the left edge of the view
        top - the inset on the top edge of the view
        right - the inset on the right edge of the view
        bottom - the inset on the bottom edge of the view
        Since:
        100.1.0
      • getViewInsetLeft

        public double getViewInsetLeft()
        Returns the left inset specified on the MapView.
        Returns:
        the inset set on the left edge of the MapView in density-independent pixels (dp)
        Since:
        100.1.0
      • getViewInsetRight

        public double getViewInsetRight()
        Returns the right inset specified on the MapView.
        Returns:
        the inset set on the right edge of the MapView in density-independent pixels (dp)
        Since:
        100.1.0
      • getViewInsetTop

        public double getViewInsetTop()
        Returns the top inset specified on the MapView.
        Returns:
        the inset set on the top edge of the MapView in density-independent pixels (dp)
        Since:
        100.1.0
      • getViewInsetBottom

        public double getViewInsetBottom()
        Returns the bottom inset specified on the MapView.
        Returns:
        the inset set on the bottom edge of the MapView in density-independent pixels (dp)
        Since:
        100.1.0
      • isViewInsetsValid

        public boolean isViewInsetsValid()
        Indicates if the configured insets specified on the MapView are currently valid. Can be used to find out the validity of insets when MapView 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
      • getLocationDisplay

        public LocationDisplay getLocationDisplay()
        Returns the MapView's LocationDisplay, used to display the current device location in the MapView. A MapView only has one LocationDisplay.
        Returns:
        the LocationDisplay object
        Since:
        100.0.0
      • setOnTouchListener

        public void setOnTouchListener​(android.view.View.OnTouchListener onTouchListener)
        Sets the listener that handles touch gestures for this MapView. For more information about the default gestures, see DefaultMapViewOnTouchListener.

        To change the way that the MapView responds to default gestures, for example by performing an identify on a single-tap, or disabling interactive panning, use this method to set a custom touch listener onto the MapView.

        The easiest way to change only some of the default gestures is to create a custom touch listener that inherits DefaultMapViewOnTouchListener, and override only the methods you want to change. Alternatively, directly implement the MapView.OnTouchListener or android.view.View.OnTouchListener interface, and provide the behaviour for all touch events. Then pass an instance to this method to replace the default listener with your custom listener.

        Overrides:
        setOnTouchListener in class android.view.View
        Parameters:
        onTouchListener - the new listener that will handle touch events for this MapView
        Throws:
        java.lang.IllegalArgumentException - if the listener is null
        Since:
        100.0.0
      • addMapRotationChangedListener

        public void addMapRotationChangedListener​(MapRotationChangedListener listener)
        Adds a listener for when map rotation has changed.
        Parameters:
        listener - the listener
        Throws:
        java.lang.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:
        java.lang.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
      • getOnTouchListener

        public android.view.View.OnTouchListener getOnTouchListener()
        Gets the listener that handles touch gestures for this MapView. The default value is an instance of DefaultMapViewOnTouchListener, which implements the default gestures for a MapView. To customize the gestures this MapView responds to, use setOnTouchListener(View.OnTouchListener).
        Returns:
        the current OnTouchListener
        Since:
        100.0.0
      • onTouchEvent

        public boolean onTouchEvent​(android.view.MotionEvent event)
        Handles touch events on the MapView by delegating them to the currently set OnTouchListener.
        Overrides:
        onTouchEvent in class android.view.View
        Parameters:
        event - the MotionEvent to handle
        Returns:
        true if the listener has consumed the event; false otherwise
        Since:
        100.0.0
      • setSketchEditor

        public void setSketchEditor​(SketchEditor sketchEditor)
        Sets a SketchEditor into this MapView. If another SketchEditor instance is currently set it will be stopped and replaced by the given SketchEditor.
        Parameters:
        sketchEditor - a SketchEditor object
        Since:
        100.1.0
        See Also:
        SketchEditor
      • getSketchEditor

        public SketchEditor getSketchEditor()
        Gets the current sketch editor.
        Returns:
        the current sketch editor, or null if it is not set
        Since:
        100.1.0
        See Also:
        setSketchEditor(SketchEditor)
      • 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.2.0
        See Also:
        getGrid(), Grid.setVisible(boolean), 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 class GeoView
        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 class GeoView
        Parameters:
        viewLabelProperties - the view label properties
        Since:
        100.4.0
      • logFrameRate

        public void logFrameRate​(android.widget.TextView textView)
        For debugging purposes only. Logs the MapView's frame rate to the specified TextView.

        The value logged is the average number of frames drawn per second. Note that this is an estimate and not precisely accurate. Passing null disables frame rate logging.

        Note that when the map is stationary there is no render pulse and the frame rate cannot be measured properly. This may result in very low frame rates being displayed in the TextView, especially after initial map start-up and initial navigation. You should navigate the map for a few seconds to see realistic frame rates.

        The maximum frame rate is 60 frames per second.

        Parameters:
        textView - a TextView to which the frame rate is written, or null to stop logging the frame rate
        Since:
        100.0.0
      • getInteractionOptions

        public MapView.InteractionOptions getInteractionOptions()
        Gets the MapView.InteractionOptions to configure user interactions for the MapView.
        Returns:
        a MapView.InteractionOptions
        Since:
        100.9.0
      • setInteractionOptions

        public void setInteractionOptions​(MapView.InteractionOptions interactionOptions)
        Sets a MapView.InteractionOptions to configure user interactions for the MapView.
        Parameters:
        interactionOptions - an InteractionOptions, or null to reset to the default InteractionOptions
        Since:
        100.9.0