com.supermap.ar.arlayer

类 ARLayerView

  • java.lang.Object
    • android.view.View
      • android.view.ViewGroup
        • android.widget.RelativeLayout
          • com.supermap.ar.arlayer.ARLayerView
  • 所有已实现的接口:
    android.graphics.drawable.Drawable.Callback, android.view.accessibility.AccessibilityEventSource, android.view.KeyEvent.Callback, android.view.ViewManager, android.view.ViewParent


    public class ARLayerView
    extends android.widget.RelativeLayout
    AR导航指引视图类 该类实现了在真实场景中导航,通过设置起点、终止点的真实坐标和规划路线上的节点,从而在场景中显示出指引点 AR导航过程中,可通过设置固定姿态,提高AR导航精度
    • 嵌套类概要

      • 从类继承的嵌套类/接口 android.widget.RelativeLayout

        android.widget.RelativeLayout.LayoutParams
      • 从类继承的嵌套类/接口 android.view.ViewGroup

        android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
      • 从类继承的嵌套类/接口 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.OnClickListener, 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.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener
    • 字段概要

      • 从类继承的字段 android.widget.RelativeLayout

        ABOVE, ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_END, ALIGN_LEFT, ALIGN_PARENT_BOTTOM, ALIGN_PARENT_END, ALIGN_PARENT_LEFT, ALIGN_PARENT_RIGHT, ALIGN_PARENT_START, ALIGN_PARENT_TOP, ALIGN_RIGHT, ALIGN_START, ALIGN_TOP, BELOW, CENTER_HORIZONTAL, CENTER_IN_PARENT, CENTER_VERTICAL, END_OF, LEFT_OF, RIGHT_OF, START_OF, TRUE
      • 从类继承的字段 android.view.ViewGroup

        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
      • 从类继承的字段 android.view.View

        ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, 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, 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, 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, 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, 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_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_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, VISIBLE, X, Y
    • 构造器概要

      构造器 
      构造器和说明
      ARLayerView(android.content.Context context)
      构造函数,创建AR导航指引视图
      ARLayerView(android.content.Context context, android.util.AttributeSet attrs)
      构造函数,创建AR导航指引视图
      ARLayerView(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr)
      构造函数,创建AR导航指引视图
      ARLayerView(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr, int defStyleRes)
      构造函数,创建AR导航指引视图
    • 方法概要

      所有方法 实例方法 具体方法 
      限定符和类型 方法和说明
      void drawNaviRoutes(java.util.ArrayList<Point3D> routesPoints, ModelRenderable arrow, ModelRenderable destination)
      绘制导航轨迹
      int getBearingAdjustment()
      获取传感器磁北与地理北偏差角度
      Point2D getCurrentPosition()
      获取当前位置
      int getRefreshInterval()
      获取场景刷新的时间间隔
      boolean isNorthStart()
      获取用户导航时是否正北启动
      boolean isUserPosition()
      获取是否接受第三方坐标值
      void onPause()
      暂停
      void onResume()
      恢复
      void setBearingAdjustment(int bearingAdjust)
      设置传感器磁北与地理北偏差角度值
      void setCurrentPosition(Point2D position)
      设置当前位置
      void setNorthStart(boolean isRequire)
      设置用户导航时是否正北启动
      void setRefreshInterval(int refreshInterval)
      设置场景刷新的时间间隔
      void setUserPosition(boolean isRequire)
      设置是否接受第三方坐标值
      • 从类继承的方法 android.widget.RelativeLayout

        dispatchPopulateAccessibilityEvent, generateLayoutParams, getBaseline, getGravity, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, requestLayout, setGravity, setHorizontalGravity, setIgnoreGravity, setVerticalGravity, shouldDelayChildPressedState
      • 从类继承的方法 android.view.ViewGroup

        addChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, bringChildToFront, childDrawableStateChanged, childHasTransientStateChanged, clearChildFocus, clearDisappearingChildren, clearFocus, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchSetActivated, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildMeasureSpec, getChildVisibleRect, getClipChildren, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getOverlay, getPersistentDrawingCache, hasFocus, hasFocusable, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isMotionEventSplittingEnabled, jumpDrawablesToCurrentState, layout, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onInterceptHoverEvent, onInterceptTouchEvent, onRequestSendAccessibilityEvent, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
      • 从类继承的方法 android.view.View

        addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeScroll, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, draw, findViewById, findViewWithTag, focusSearch, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBottom, getCameraDistance, getClipBounds, getContentDescription, getContext, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasOnClickListeners, hasOverlappingRendering, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, isActivated, isAttachedToWindow, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInLayout, isInTouchMode, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isOpaque, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onCreateInputConnection, onDragEvent, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onGenericMotionEvent, onHoverChanged, onHoverEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPopulateAccessibilityEvent, onRtlPropertiesChanged, onScreenStateChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setClipBounds, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, toString, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
      • 从类继承的方法 java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • 从接口继承的方法 android.view.ViewParent

        canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, requestFitSystemWindows
    • 构造器详细资料

      • ARLayerView

        public ARLayerView(android.content.Context context)
        构造函数,创建AR导航指引视图
        参数:
        context - 上下文
      • ARLayerView

        public ARLayerView(android.content.Context context,
                           android.util.AttributeSet attrs)
        构造函数,创建AR导航指引视图
        参数:
        context - 上下文
        attrs - 与标记相关联的属性集合
      • ARLayerView

        public ARLayerView(android.content.Context context,
                           android.util.AttributeSet attrs,
                           int defStyleAttr)
        构造函数,创建AR导航指引视图
        参数:
        context - 上下文
        attrs - 与标记相关联的属性集合
        defStyleAttr - 默认类型,即它在当前Application或Activity所用的Theme中的默认Style
      • ARLayerView

        public ARLayerView(android.content.Context context,
                           android.util.AttributeSet attrs,
                           int defStyleAttr,
                           int defStyleRes)
        构造函数,创建AR导航指引视图
        参数:
        context - 上下文
        attrs - 与标记相关联的属性集合
        defStyleAttr - 默认类型,即它在当前Application或Activity所用的Theme中的默认Style
        defStyleRes - 属性赋值优先级
    • 方法详细资料

      • drawNaviRoutes

        public void drawNaviRoutes(java.util.ArrayList<Point3D> routesPoints,
                                   ModelRenderable arrow,
                                   ModelRenderable destination)
        绘制导航轨迹
        参数:
        routesPoints - 用于轨迹绘制的点串,默认第一个点为起点,最后一个点为目的地
        arrow - 用于展示轨迹方向的箭头模型,支持的模型格式有OBJ、FBX、glTF
        destination - 用于展示目的地模型,支持的模型格式有OBJ、FBX、glTF
      • getBearingAdjustment

        public int getBearingAdjustment()
        获取传感器磁北与地理北偏差角度
        返回:
        传感器磁北与地理北偏差角度,单位度
      • getCurrentPosition

        public Point2D getCurrentPosition()
        获取当前位置
        返回:
        当前位置点
      • getRefreshInterval

        public int getRefreshInterval()
        获取场景刷新的时间间隔
        返回:
        场景刷新的时间间隔,单位毫秒(ms)
      • isNorthStart

        public boolean isNorthStart()
        获取用户导航时是否正北启动
        返回:
        布尔值,true表示正北启动,false表示任意方向启动
      • isUserPosition

        public boolean isUserPosition()
        获取是否接受第三方坐标值
        返回:
        布尔值,true表示接受第三方坐标值,false表示不接受第三方坐标值
      • onPause

        public void onPause()
        暂停
      • onResume

        public void onResume()
        恢复
      • setBearingAdjustment

        public void setBearingAdjustment(int bearingAdjust)
        设置传感器磁北与地理北偏差角度值
        参数:
        bearingAdjust - 传感器磁北与地理北偏差角度

        该值可以通过监听磁场传感器获取磁北指向,然后与地理北方向计算差值获得。该设置在@link setRequireNorthStart(boolean isRequire) 参数为true时有效

      • setCurrentPosition

        public void setCurrentPosition(Point2D position)
        设置当前位置
        参数:
        position - 当前位置点,即从第三方获取的坐标,例如GPS,蓝牙等

        当@link isUserPosition返回值为true时,该设置有效

      • setNorthStart

        public void setNorthStart(boolean isRequire)
        设置用户导航时是否正北启动
        参数:
        isRequire - 是否正北启动

        如果为true,表示正北启动,系统不考虑传感器磁北与地理北之间的偏差。如果为false,表示可以任意方向启动,此时需要设置修正角度@link getBearingAdjustment,若不设置修正角度,会导致系统异常

      • setRefreshInterval

        public void setRefreshInterval(int refreshInterval)
        设置场景刷新的时间间隔
        参数:
        refreshInterval - 场景刷新的时间间隔,单位毫秒(ms)
      • setUserPosition

        public void setUserPosition(boolean isRequire)
        设置是否接受第三方坐标值
        参数:
        isRequire - 是否接受第三方坐标值

        设置为true,表示接受第三方坐标值,setCurrentPosition设置有效。设置为false,表示不接受第三方坐标值