Class MapView

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

    public final class MapView
    extends android.view.SurfaceView
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  MapView.CameraAnimationListener  
      class  MapView.CameraController
      CameraController provides the ability to manage map rotation, tilt and zoom via changing the camera position (heading, tilt and zoom) instantly or animated.
      static interface  MapView.CameraMovementListener  
      static interface  MapView.GeoObjectListener  
      class  MapView.MapProjection  
      static interface  MapView.MapTapListener  
      static class  MapView.PlaceDetailsCallback  
      static interface  MapView.PlaceListener  
      • 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.OnTouchListener, android.view.View.OnUnhandledKeyEventListener
    • Field Summary

      • 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, 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, 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, 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, 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, VISIBLE, X, Y, Z
    • Constructor Summary

      Constructors 
      Constructor Description
      MapView​(android.content.Context context)  
      MapView​(android.content.Context context, android.util.AttributeSet attrs)  
      MapView​(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr)  
      MapView​(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr, int defStyleRes)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addGeoObject​(GeoObject geoObject)
      Renders the specified geo object on the map.
      void addGeoObjectListener​(MapView.GeoObjectListener listener)
      Adds a listener responding to events described in the MapView.GeoObjectListener interface.
      void addGeoObjects​(java.util.List<GeoObject> geoObjects)
      Renders all specified geo objects on the map.
      void addMapTapListener​(MapView.MapTapListener listener)
      Adds a listener responding to events described in the MapView.MapTapListener interface.
      void addPoiListener​(MapView.PlaceListener listener)
      Adds a listener for interaction with points of interest.
      AutoZoomMode getAutoZoomMode()  
      java.util.List<java.lang.String> getAvailableMapSchemes()
      Returns the list of available map color schemes.
      MapView.CameraController getCameraController()
      CameraController provides the ability to manage map rotation, tilt and zoom via changing the camera position (heading, tilt and zoom).
      java.lang.String getCurrentMapScheme()  
      int getDetailLevel()
      The current detail level of map rendering.
      DirectionArrowStyle getDirectionArrowStyle()  
      android.graphics.PointF getGpsPositionAnchorOnScreen()
      Returns the point defining relative position of the GPS arrow on screen.
      float getMaxAutoZoomLevel()  
      float getMaxZoomLevel()  
      float getMinAutoZoomLevel()  
      float getMinZoomLevel()  
      MapView.MapProjection getProjection()
      The current projection used by map renderer.
      boolean isAutoZoomEnabled()  
      boolean isEventsShownOnMap()  
      boolean isFollowGpsDirection()  
      boolean isFollowGpsPosition()  
      boolean isGpsPositionShown()  
      boolean isJamsShownOnMap()  
      boolean isMapPanningGestureEnabled()  
      boolean isMapRotationGestureEnabled()  
      boolean isMapTiltGestureEnabled()  
      boolean isMapZoomGestureEnabled()  
      boolean isMapZoomOnDoubleTapEnabled()  
      boolean isMapZoomOnTwoFingerTapEnabled()  
      boolean isPoiShownOnMap()  
      boolean isSpeedCamerasShownOnMap()  
      boolean isUsersShownOnMap()  
      void loadMapScheme​(java.lang.String schemeId)
      Loads the specified color scheme and applies it to the map view.
      void loadPlaceDetails​(Place place, MapView.PlaceDetailsCallback callback)
      Loads additional information about the specified place (such as address).
      void removeAllGeoObjects()
      Stops rendering of all geo objects on the map.
      void removeGeoObject​(GeoObject geoObject)
      Stops rendering of the specified geo object on the map.
      void removeGeoObjectListener​(MapView.GeoObjectListener listener)
      Removes the specified listener from the list.
      void removeGeoObjects​(java.util.List<GeoObject> geoObjects)
      Stops rendering all specified geo objects on the map.
      void removeMapTapListener​(MapView.MapTapListener listener)
      Removes the specified listener from the list.
      void removePoiListener​(MapView.PlaceListener listener)
      Removes the specified listener from the list.
      void setAutoZoomEnabled​(boolean autoZoomEnabled)
      Enables/disables the automatic zoom.
      void setAutoZoomMode​(AutoZoomMode autoZoomMode)  
      void setDirectionArrowStyle​(DirectionArrowStyle directionArrowStyle)
      Provides the ability to customize the way direction arrows are rendered on map.
      void setEventsShownOnMap​(boolean eventsShownOnMap)
      Enables/disables showing road event icons on map.
      void setFollowGpsDirection​(boolean followGpsDirection)
      Enables/disables the "following GPS direction" mode.
      void setFollowGpsPosition​(boolean followGpsPosition)
      Enables/disables the "following GPS position" mode.
      void setGpsPositionAnchorOnScreen​(android.graphics.PointF anchorOnScreen)
      Sets the point defining relative position of the GPS arrow on screen.
      void setGpsPositionShown​(boolean gpsPositionShown)
      Enables/disables displaying the GPS position icon on map.
      void setJamsShownOnMap​(boolean jamsShownOnMap)
      Enables/disables showing traffic jams on map.
      void setMapPanningGestureEnabled​(boolean mapPanningGestureEnabled)
      Enables/disables the panning gesture, which is used to pan the camera along the map.
      void setMapRotationGestureEnabled​(boolean mapRotationGestureEnabled)
      Enables/disables the rotation gesture, which is used to change the heading of the map.
      void setMapTiltGestureEnabled​(boolean mapTiltGestureEnabled)
      Enables/disables the tilt gesture (moving two fingers up and down the screen).
      void setMapZoomGestureEnabled​(boolean mapZoomGestureEnabled)
      Enables/disables the pinch gesture, which is used to zoom in and zoom out the map.
      void setMapZoomOnDoubleTapEnabled​(boolean zoomOnDoubleTapEnabled)
      Enables/disables the double tap gesture, which is used to zoom in the map.
      void setMapZoomOnTwoFingerTapEnabled​(boolean zoomOnTwoFingerTapEnabled)
      Enables/disables the tapping using two fingers gesture, which is used to zoom out the map.
      void setMaxAutoZoomLevel​(float maxAutoZoomLevel)  
      void setMinAutoZoomLevel​(float minAutoZoomLevel)  
      void setPoiShownOnMap​(boolean poiShownOnMap)
      Enables/disables showing POI icons on map.
      void setSpeedCamerasShownOnMap​(boolean speedCamerasShownOnMap)
      Enables/disables showing speed camera icons on map.
      void setUsersShownOnMap​(boolean usersShownOnMap)
      Enables/disables showing user icons on map.
      • Methods inherited from class android.view.SurfaceView

        draw, gatherTransparentRegion, getHolder, getHostToken, getImportantForAccessibility, getSurfaceControl, setAlpha, setChildSurfacePackage, setClipBounds, setSecure, setVisibility, setZOrderMediaOverlay, setZOrderOnTop
      • Methods inherited from class android.view.View

        addChildrenForAccessibility, addExtraDataToAccessibilityNodeInfo, addFocusables, addFocusables, addKeyboardNavigationClusters, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, addTouchables, animate, announceForAccessibility, autofill, autofill, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, clearFocus, clearViewTranslationCallback, combineMeasuredStates, computeScroll, computeSystemWindowInsets, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchCreateViewTranslationRequest, dispatchDisplayHint, dispatchDragEvent, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPointerCaptureChanged, dispatchPopulateAccessibilityEvent, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchScrollCaptureSearch, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowInsetsAnimationEnd, dispatchWindowInsetsAnimationPrepare, dispatchWindowInsetsAnimationProgress, dispatchWindowInsetsAnimationStart, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableHotspotChanged, findFocus, findOnBackInvokedDispatcher, findViewById, findViewsWithText, findViewWithTag, focusSearch, forceHasOverlappingRendering, forceLayout, generateDisplayHash, generateViewId, getAccessibilityClassName, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, 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, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAutofill, getImportantForContentCapture, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverlay, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getPreferKeepClearRects, getReceiveContentMimeTypes, getResources, getRevealOnFocusHint, getRight, getRootSurfaceControl, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollCaptureHint, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateDescription, getStateListAnimator, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTouchables, getTouchDelegate, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTranslationResponse, getViewTreeObserver, getVisibility, getWidth, getWindowId, getWindowInsetsController, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocus, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOnLongClickListeners, hasOverlappingRendering, hasPointerCapture, hasTransientState, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isAutoHandwritingEnabled, 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, isPaddingRelative, isPivotSet, isPreferKeepClear, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShowingLayoutBounds, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, jumpDrawablesToCurrentState, keyboardNavigationClusterSearch, layout, measure, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onCreateInputConnection, onCreateViewTranslationRequest, onCreateVirtualViewTranslationRequests, onDragEvent, onDrawForeground, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideContentCaptureStructure, onProvideStructure, onProvideVirtualStructure, onReceiveContent, onResolvePointerIcon, onRtlPropertiesChanged, onScreenStateChanged, onScrollCaptureSearch, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onViewTranslationResponse, onVirtualViewTranslationResponses, onVisibilityAggregated, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, 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, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreDefaultFocus, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAllowClickWhenDisabled, setAnimation, setAnimationMatrix, setAutofillHints, setAutofillId, setAutoHandwritingEnabled, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, 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, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnReceiveContentListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPreferKeepClear, setPreferKeepClearRects, 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, setWillNotCacheDrawing, setWillNotDraw, setWindowInsetsAnimationCallback, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, updateDragShadow, willNotCacheDrawing, willNotDraw
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MapView

        public MapView​(android.content.Context context)
      • MapView

        public MapView​(android.content.Context context,
                       android.util.AttributeSet attrs)
      • MapView

        public MapView​(android.content.Context context,
                       android.util.AttributeSet attrs,
                       int defStyleAttr)
      • MapView

        public MapView​(android.content.Context context,
                       android.util.AttributeSet attrs,
                       int defStyleAttr,
                       int defStyleRes)
    • Method Detail

      • isFollowGpsPosition

        public boolean isFollowGpsPosition()
        Returns:
        true if "following GPS position" mode is enabled, false otherwise.
        See Also:
        setFollowGpsPosition(boolean)
      • setFollowGpsPosition

        public void setFollowGpsPosition​(boolean followGpsPosition)
        Enables/disables the "following GPS position" mode.

        When set to true, the camera is always pointed to the current GPS position. When set to false, GPS updates don't affect the camera.

        Parameters:
        followGpsPosition - true if "following GPS position" mode is enabled, false otherwise.
      • isFollowGpsDirection

        public boolean isFollowGpsDirection()
        Returns:
        true if "following GPS direction" mode is enabled, false otherwise.
        See Also:
        setFollowGpsDirection(boolean)
      • setFollowGpsDirection

        public void setFollowGpsDirection​(boolean followGpsDirection)
        Enables/disables the "following GPS direction" mode.

        When set to true, the camera heading always matches the current GPS position. When set to false, GPS updates don't affect the camera.

        Note: This option only has effect when the "following GPS position" mode is enabled.

        Parameters:
        followGpsDirection - true if "following GPS direction" mode is enabled, false otherwise.
        See Also:
        setFollowGpsPosition(boolean)
      • isGpsPositionShown

        public boolean isGpsPositionShown()
        Returns:
        true if GPS position should be shown on map, false otherwise.
      • setGpsPositionShown

        public void setGpsPositionShown​(boolean gpsPositionShown)
        Enables/disables displaying the GPS position icon on map.
        Parameters:
        gpsPositionShown - true if GPS position should be shown on map, false otherwise.
      • getGpsPositionAnchorOnScreen

        public android.graphics.PointF getGpsPositionAnchorOnScreen()
        Returns the point defining relative position of the GPS arrow on screen. Each coordinate of the point should be in the range 0..1. So the top left corner of the screen is (0,0) and the bottom right corner is (1,1).
        Returns:
        The GPS position anchor.
      • setGpsPositionAnchorOnScreen

        public void setGpsPositionAnchorOnScreen​(android.graphics.PointF anchorOnScreen)
        Sets the point defining relative position of the GPS arrow on screen.
        Parameters:
        anchorOnScreen - The GPS position anchor.
        See Also:
        getGpsPositionAnchorOnScreen()
      • getMinZoomLevel

        public float getMinZoomLevel()
        Returns:
        The minimal value of map zoom.
      • getMaxZoomLevel

        public float getMaxZoomLevel()
        Returns:
        The maximal value of map zoom.
      • setMapPanningGestureEnabled

        public void setMapPanningGestureEnabled​(boolean mapPanningGestureEnabled)
        Enables/disables the panning gesture, which is used to pan the camera along the map. This gesture changes the targetLocation parameter of the current camera position.
        Parameters:
        mapPanningGestureEnabled - true if the gesture is enabled, false otherwise.
      • setMapRotationGestureEnabled

        public void setMapRotationGestureEnabled​(boolean mapRotationGestureEnabled)
        Enables/disables the rotation gesture, which is used to change the heading of the map. This gesture changes the heading parameter of the current camera position.
        Parameters:
        mapRotationGestureEnabled - true if the gesture is enabled, false otherwise.
      • isMapZoomGestureEnabled

        public boolean isMapZoomGestureEnabled()
        Returns:
        true if the gesture is enabled, false otherwise.
        See Also:
        setMapZoomGestureEnabled(boolean)
      • setMapZoomGestureEnabled

        public void setMapZoomGestureEnabled​(boolean mapZoomGestureEnabled)
        Enables/disables the pinch gesture, which is used to zoom in and zoom out the map. This gesture changes the zoom parameter of the current camera position.
        Parameters:
        mapZoomGestureEnabled - true if the gesture is enabled, false otherwise.
      • isMapTiltGestureEnabled

        public boolean isMapTiltGestureEnabled()
        Returns:
        true if the gesture is enabled, false otherwise.
        See Also:
        setMapTiltGestureEnabled(boolean)
      • setMapTiltGestureEnabled

        public void setMapTiltGestureEnabled​(boolean mapTiltGestureEnabled)
        Enables/disables the tilt gesture (moving two fingers up and down the screen). This gesture changes the tilt parameter of the current camera position.
        Parameters:
        mapTiltGestureEnabled - true if the gesture is enabled, false otherwise.
      • setMapZoomOnTwoFingerTapEnabled

        public void setMapZoomOnTwoFingerTapEnabled​(boolean zoomOnTwoFingerTapEnabled)
        Enables/disables the tapping using two fingers gesture, which is used to zoom out the map. This gesture changes the zoom parameter of the current camera position.
        Parameters:
        zoomOnTwoFingerTapEnabled - true if the gesture is enabled, false otherwise.
      • setMapZoomOnDoubleTapEnabled

        public void setMapZoomOnDoubleTapEnabled​(boolean zoomOnDoubleTapEnabled)
        Enables/disables the double tap gesture, which is used to zoom in the map. This gesture changes the zoom parameter of the current camera position.
        Parameters:
        zoomOnDoubleTapEnabled - true if the gesture is enabled, false otherwise.
      • getAutoZoomMode

        public AutoZoomMode getAutoZoomMode()
        Returns:
        The current autozoom mode.
      • setAutoZoomMode

        public void setAutoZoomMode​(AutoZoomMode autoZoomMode)
        Parameters:
        autoZoomMode - The autozoom mode.
      • isAutoZoomEnabled

        public boolean isAutoZoomEnabled()
        Returns:
        true if the automatic zoom is enabled, false otherwise.
        See Also:
        setAutoZoomEnabled(boolean)
      • setAutoZoomEnabled

        public void setAutoZoomEnabled​(boolean autoZoomEnabled)
        Enables/disables the automatic zoom. If automatic zoom feature is enabled, the SDK recomputes zoom and tilt parameters of the camera upon GPS position update so that map view could show the map in the most convenient way.
        Parameters:
        autoZoomEnabled - true if the autozoom is enabled, false otherwise.
      • getMinAutoZoomLevel

        public float getMinAutoZoomLevel()
      • setMinAutoZoomLevel

        public void setMinAutoZoomLevel​(float minAutoZoomLevel)
      • getMaxAutoZoomLevel

        public float getMaxAutoZoomLevel()
      • setMaxAutoZoomLevel

        public void setMaxAutoZoomLevel​(float maxAutoZoomLevel)
      • isJamsShownOnMap

        public boolean isJamsShownOnMap()
        Returns:
        true if traffic jams are shown on map, false otherwise.
      • setJamsShownOnMap

        public void setJamsShownOnMap​(boolean jamsShownOnMap)
        Enables/disables showing traffic jams on map.
        Parameters:
        jamsShownOnMap - true if traffic jams are shown, false otherwise.
      • isPoiShownOnMap

        public boolean isPoiShownOnMap()
        Returns:
        true if POI icons are shown, false otherwise.
      • setPoiShownOnMap

        public void setPoiShownOnMap​(boolean poiShownOnMap)
        Enables/disables showing POI icons on map.
        Parameters:
        poiShownOnMap - true if POI icons are shown, false otherwise.
      • isUsersShownOnMap

        public boolean isUsersShownOnMap()
        Returns:
        true if user icons are shown, false otherwise.
      • setUsersShownOnMap

        public void setUsersShownOnMap​(boolean usersShownOnMap)
        Enables/disables showing user icons on map.
        Parameters:
        usersShownOnMap - true if user icons are shown, false otherwise.
      • isEventsShownOnMap

        public boolean isEventsShownOnMap()
        Returns:
        true if road event icons are shown, false otherwise.
      • setEventsShownOnMap

        public void setEventsShownOnMap​(boolean eventsShownOnMap)
        Enables/disables showing road event icons on map.
        Parameters:
        eventsShownOnMap - true if road event icons are shown, false otherwise.
      • isSpeedCamerasShownOnMap

        public boolean isSpeedCamerasShownOnMap()
        Returns:
        true if speed camera icons are shown, false otherwise.
      • setSpeedCamerasShownOnMap

        public void setSpeedCamerasShownOnMap​(boolean speedCamerasShownOnMap)
        Enables/disables showing speed camera icons on map.
        Parameters:
        speedCamerasShownOnMap - true if speed camera icons are shown, false otherwise.
      • getAvailableMapSchemes

        public java.util.List<java.lang.String> getAvailableMapSchemes()
        Returns the list of available map color schemes.
        Returns:
        The list of scheme identifiers.
        See Also:
        loadMapScheme(String)
      • getCurrentMapScheme

        public java.lang.String getCurrentMapScheme()
        Returns:
        The map scheme that is active at the moment.
      • loadMapScheme

        public void loadMapScheme​(java.lang.String schemeId)
        Loads the specified color scheme and applies it to the map view.
        Parameters:
        schemeId - The identifier of the scheme.
        See Also:
        getAvailableMapSchemes()
      • getCameraController

        public MapView.CameraController getCameraController()
        CameraController provides the ability to manage map rotation, tilt and zoom via changing the camera position (heading, tilt and zoom).
        Returns:
        The camera controller.
      • setDirectionArrowStyle

        public void setDirectionArrowStyle​(DirectionArrowStyle directionArrowStyle)
        Provides the ability to customize the way direction arrows are rendered on map.
        Parameters:
        directionArrowStyle - The style of direction arrows.
      • getDetailLevel

        public int getDetailLevel()
        The current detail level of map rendering.
        Returns:
        The detail level.
      • getProjection

        public MapView.MapProjection getProjection()
        The current projection used by map renderer.
        Returns:
        The projection.
      • addMapTapListener

        public void addMapTapListener​(MapView.MapTapListener listener)
        Adds a listener responding to events described in the MapView.MapTapListener interface. You can add multiple listeners using this method.
        Parameters:
        listener - The listener.
      • removeMapTapListener

        public void removeMapTapListener​(MapView.MapTapListener listener)
        Removes the specified listener from the list.
        Parameters:
        listener - The listener.
      • addGeoObjectListener

        public void addGeoObjectListener​(MapView.GeoObjectListener listener)
        Adds a listener responding to events described in the MapView.GeoObjectListener interface. The listeners are being notified when a user interacts with geo objects displayed on the map. You can add multiple listeners using this method.
        Parameters:
        listener - The listener.
        See Also:
        addGeoObject(GeoObject)
      • removeGeoObjectListener

        public void removeGeoObjectListener​(MapView.GeoObjectListener listener)
        Removes the specified listener from the list.
        Parameters:
        listener - The listener.
      • addGeoObject

        public void addGeoObject​(GeoObject geoObject)
        Renders the specified geo object on the map.
        Parameters:
        geoObject - The geo object.
        See Also:
        GeoMarker, GeoPolyline, GeoPolygon
      • addGeoObjects

        public void addGeoObjects​(java.util.List<GeoObject> geoObjects)
        Renders all specified geo objects on the map.
        Parameters:
        geoObjects - The geo objects.
        See Also:
        addGeoObject(GeoObject)
      • removeGeoObject

        public void removeGeoObject​(GeoObject geoObject)
        Stops rendering of the specified geo object on the map.
        Parameters:
        geoObject - The geo object.
      • removeGeoObjects

        public void removeGeoObjects​(java.util.List<GeoObject> geoObjects)
        Stops rendering all specified geo objects on the map.
        Parameters:
        geoObjects - The geo objects.
      • removeAllGeoObjects

        public void removeAllGeoObjects()
        Stops rendering of all geo objects on the map.
      • addPoiListener

        public void addPoiListener​(MapView.PlaceListener listener)
        Adds a listener for interaction with points of interest. The listeners are being notified when a user interacts with points of interest displayed on the map. You can add multiple listeners using this method.
        Parameters:
        listener - The listener.
        See Also:
        removePoiListener(PlaceListener)
      • loadPlaceDetails

        public void loadPlaceDetails​(Place place,
                                     MapView.PlaceDetailsCallback callback)
        Loads additional information about the specified place (such as address).
        Parameters:
        place - The place.
        callback - The callback to notify about completion, which can also be used to cancel the loading process.