public class MapControl
extends android.view.View
该类是用于为地图的显示提供界面的,同时为地图与数据的互操作提供了途径。
地图控件是一个对地图进行显示的控件。通过地图控件,不仅可以对地图进行显示,而且可以通过对地图的可视化编辑,从而对地图所引用的数据进行编辑。 当一个地图对象与一个地图控件相关联,该地图控件即可以对该地图对象进行显示,地图的显示属性以及显示操作都将在该地图对象中设置。然而对地图的可视化编辑的设置和操作将在 MapControl 对象中设置。
注意:当用户使用该工作空间对象进行编程时,如果将 Workspace 与 MapControl 建立了关联,那么在进行对象的关闭时,一定需要注意关闭的顺序,如下:
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
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
构造器和说明 |
---|
MapControl(android.content.Context context)
构造一个新的
MapControl 对象。 |
MapControl(android.content.Context context, android.util.AttributeSet attrs)
根据指定参数构造一个新的
MapControl 对象。 |
MapControl(android.content.Context context, android.util.AttributeSet attrs, int defStyle)
根据指定参数构造一个新的
MapControl 对象。 |
MapControl(android.content.Context context, android.util.AttributeSet attrs, int defStyle, Workspace workspace)
根据指定参数构造一个新的
MapControl 对象。 |
MapControl(android.content.Context context, android.util.AttributeSet attrs, Workspace workspace)
根据指定参数构造一个新的
MapControl 对象。 |
MapControl(android.content.Context context, Workspace workspace)
构造一个新的
MapControl 对象,并将其中的 Map 对象关联到指定的工作空间。 |
限定符和类型 | 方法和说明 |
---|---|
void |
addActionChangedListener(ActionChangedListener actionChangedListener)
设置动作变更监听器。
|
void |
addGeometryAddedListener(GeometryAddedListener listener)
添加对象添加监听器。
|
void |
addGeometryDeletedListener(GeometryDeletedListener listener)
添加对象删除完成监听器。
|
void |
addGeometryDeletingListener(GeometryDeletingListener listener)
添加对象删除完成前监听器。
|
void |
addGeometryIsSelectedListener(GeometryIsSelectedListener listener)
添加是否选中监听,单击后选中不选中都会触发
|
void |
addGeometryModifiedListener(GeometryModifiedListener listener)
添加对象修改完成监听器。
|
void |
addGeometryModifyingListener(GeometryModifyingListener listener)
添加对象修改前监听器。
|
void |
addGeometrySelectedListener(GeometrySelectedListener listener)
添加对象选中监听器。
|
void |
addMeasureListener(MeasureListener measureListener)
设置量算监听器。
|
void |
addMeasureStateListener(MeasureStateListener listener)
设置量算状态监听器
|
long |
addPlotLibrary(java.lang.String libraryPath)
添加态势标绘符号库, 若不添加符号库, 将不能正常显示地图中已有的标绘符号或需要绘制的符号。
|
void |
addPlotObject(long libID, long symbolCode, Point2Ds pts)
根据给定的军标符号和坐标构建一个军标符号对象,并自动提交到数据集
|
void |
addTouchPoint(Point pntTouch)
添加模拟手势点
|
void |
addUndoStateChangeListener(UndoStateChangeListener listener)
设置Undo监听器。
|
boolean |
appointEditGeometry(int GeoID, Layer layer)
指定编辑几何对象
|
boolean |
cancel()
取消操作,对于采集而言,新建的未提交的数据将被清除,对于编辑,将回到上一次提交保存的状态。
|
boolean |
cancelAnimation()
取消平移和缩放的动画。
|
boolean |
deleteCurrentGeometry()
删除当前绘制出来的几何对象。
|
void |
deleteGestureDetector()
清除用户手势监听器。
|
void |
dispose()
释放显示控件
|
void |
enableRotateTouch(boolean value)
设置地图手势旋转是否可用
|
void |
enableSlantTouch(boolean value)
设置地图手势俯仰是否可用
|
Action |
getAction()
返回地图控件中地图的当前操作状态。
|
Collector |
getCollector()
数据采集
|
Geometry |
getCurrentGeometry()
获取当前绘制的对象。
|
Layer |
getEditLayer()
获取当前编辑图层
|
android.view.GestureDetector |
getGestureDetector()
获取当前用户自定义的操作手势识别器。
|
Color |
getMagnifierCrossColor()
返回放大镜十字丝颜色
|
int |
getMagnifierRadius()
获取放大镜的半径
|
Map |
getMap()
返回在地图控件中显示的地图对象。
|
int |
getMapHeight()
用户设置的控件高度。
|
int |
getMapWidth()
获取用户设置的控件宽度。
|
Navigation |
getNavigation()
获取导航模块。
|
int |
getNodeColor()
获取节点的颜色。
|
double |
getNodeSize()
获取节点的大小。
|
int |
getObjectColor()
获取对象编辑的颜色。
|
double |
getObjectWidth()
获取对象编辑的宽度大小。
|
SelectionMode |
getSelectionMode()
返回对象的选择模式。
|
double |
getSelectionTolerance()
返回选择空间对象的容限。
|
SnapSetting |
getSnapSetting()
获取地图控件的捕捉设置
|
int |
getStrokeColor()
获取绘制对象时画笔的颜色。
|
int |
getStrokeFillColor()
获取绘制对象时画笔的填充颜色。
|
double |
getStrokeWidth()
获取绘制对象时画笔的宽度。
|
Action |
getUserAction()
获取用户设置的动作。
|
boolean |
isMagnifierEnabled()
获取放大镜是否启用。
|
boolean |
isSnapCreatPointEnable()
获取是否只有捕捉到点才在屏幕打点
|
boolean |
onMultiTouch(android.view.MotionEvent event)
返回一个布尔值指定当前操作手势是否被View控件接收。
|
boolean |
onSelect(int x, int y)
几何对象选择事件。
|
boolean |
outputMap(android.graphics.Bitmap drawing)
将当前显示内容绘制到指定位图上。
|
boolean |
outputMap(android.graphics.Bitmap drawing, int nSrc_x, int nSrc_y)
将当前显示内容绘制到指定位图上
|
boolean |
panTo(Point2D desPoint, int duration)
在指定的时间内平移地图到指定的点。
|
boolean |
redo()
地图窗口上恢复上一步的操作。
|
boolean |
removeActionChangedListener(ActionChangedListener listener)
移除动作变更监听器。
|
boolean |
removeConfigurationChangedListener(ConfigurationChangedListener listener)
移除横竖屏切换监听器。
|
boolean |
removeEditStatusListener(EditStatusListener listener)
移除编辑状态监听器。
|
void |
removeGeometryAddedListener(GeometryAddedListener listener)
移除对象添加监听器。
|
void |
removeGeometryDeletedListener(GeometryDeletedListener listener)
移除对象删除完成监听器。
|
void |
removeGeometryDeletingListener(GeometryDeletingListener listener)
移除对象删除完成前监听器。
|
void |
removeGeometryIsSelectedListener(GeometryIsSelectedListener listener)
删除是否选中监听,单击后选中不选中都会触发
|
void |
removeGeometryModifiedListener(GeometryModifiedListener l)
移除对象修改完成监听器。
|
void |
removeGeometryModifyingListener(GeometryModifyingListener listener)
移除对象修改前监听器。
|
void |
removeGeometrySelectedListener(GeometrySelectedListener listener)
移除对象选中监听器。
|
boolean |
removeMapInertiaListener(MapInertiaListener listener)
移除地图惯性监听器。
|
boolean |
removeMapParamChangedListener(MapParameterChangedListener listener)
移除地图参数变化监听器。
|
boolean |
removeMeasureListener(MeasureListener measureListener)
移除量算监听器。
|
boolean |
removeMeasureStateListener(MeasureStateListener listener)
移除量算状态监听器
|
void |
removePlotLibrary(long libraryID)
根据符号库的ID, 移除已经添加的态势标绘符号库。
|
boolean |
removeUndoStateChangeListener(UndoStateChangeListener listener)
移除Undo监听器。
|
void |
setAction(Action action)
设置地图控件中地图的当前操作状态。
|
void |
setConfigurationChangedListener(ConfigurationChangedListener listener)
设置横竖屏切换监听器。
|
void |
setEditStatusListener(EditStatusListener listener)
设置编辑状态监听器。
|
void |
setGestureDetector(android.view.GestureDetector gsDetector)
设置用户手势识别器。
|
void |
setMagnifierCrossColor(Color color)
设置放大镜十字丝颜色
|
void |
setMagnifierEnabled(boolean enabled)
设置是否启用放大镜,放大镜用于放大显示手指所按的小块区域,以方便看清细节。
|
void |
setMagnifierRadius(int radius)
设置放大镜半径
|
void |
setMapInertiaListener(MapInertiaListener listener)
设置地图惯性监听器。
|
void |
setMapOverlay(boolean bIsMapOverlay)
设置地图是否是叠加层
|
void |
setMapParamChangedListener(MapParameterChangedListener listener)
设置地图参数变化监听器。
|
void |
setNodeColor(int color)
设置节点的颜色。
|
void |
setNodeSize(double size)
设置节点的大小。
|
void |
setNodeStyle(GeoStyle style)
设置节点的样式
|
void |
setObjectColor(int color)
设置对象编辑的颜色。
|
void |
setObjectWidth(double width)
设置对象编辑的宽度大小。
|
void |
setPaintProfileListener(PaintProfileListener listener)
设置绘制耗时监听器,地图渲染一次完成时回调,单位是ms。
|
void |
setPlotSymbol(long libraryID, long symbolCode)
设置需要绘制的态势标绘符号。
|
boolean |
setRefreshListener(RefreshListener listener)
设置刷新监听器。
|
void |
setSelectionMode(SelectionMode selectionMode)
设置对象的选择模式。
|
void |
setSelectionTolerance(double value)
设置选择空间对象的容限。
|
void |
setSnapCreatPointEnable(boolean value)
当开启捕捉时(节点,端点,线上点捕捉),设置为true表示只有捕捉到点才在屏幕打点,设置false则为默认状态 当关闭捕捉时,此接口不起作用
|
void |
setSnapSetting(SnapSetting value)
设置地图控件的捕捉设置
|
void |
setStaticGeometrySelectedListener(GeometrySelectedListener listener)
设置静态的对象选中监听,同步响应对象选择操作
|
void |
setStrokeColor(int color)
设置绘制对象时画笔的颜色。
|
void |
setStrokeFillColor(int color)
设置绘制对象时画笔的填充颜色。
|
void |
setStrokeWidth(double width)
设置绘制画笔的宽度。
|
boolean |
submit()
提交操作,对于采集而言,该接口将把采集的新几何对象写入到数据集,对于编辑,则是更新数据集中的正在编辑的对象。
|
boolean |
undo()
地图控件上撤消上一次的操作。
|
boolean |
zoomTo(double scale, int duration)
在指定的时间内将地图缩放到指定的比例尺。
|
addChildrenForAccessibility, addFocusables, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addTouchables, animate, announceForAccessibility, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, clearFocus, combineMeasuredStates, computeScroll, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, draw, findFocus, findViewById, findViewsWithText, findViewWithTag, focusSearch, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, 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, getOverlay, 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, hasFocus, hasFocusable, hasOnClickListeners, hasOverlappingRendering, hasTransientState, 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, jumpDrawablesToCurrentState, layout, measure, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onCreateInputConnection, onDragEvent, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, 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, requestFocus, requestFocusFromTouch, requestLayout, 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
public MapControl(android.content.Context context)
MapControl
对象。context
- The Context the view is running in, through which it can access the current theme, resources, etc。public MapControl(android.content.Context context, Workspace workspace)
MapControl
对象,并将其中的 Map
对象关联到指定的工作空间。context
- The Context the view is running in, through which it can access the current theme, resources, etc。workspace
- 指定的工作空间。public MapControl(android.content.Context context, android.util.AttributeSet attrs)
MapControl
对象。context
- The Context the view is running in, through which it can access the current theme, resources, etc。attrs
- The attributes of the XML tag that is inflating the view。public MapControl(android.content.Context context, android.util.AttributeSet attrs, Workspace workspace)
MapControl
对象。context
- The Context the view is running in, through which it can access the current theme, resources, etc。attrs
- The attributes of the XML tag that is inflating the view。workspace
- 指定的工作空间。public MapControl(android.content.Context context, android.util.AttributeSet attrs, int defStyle)
MapControl
对象。context
- The Context the view is running in, through which it can access the current theme, resources, etc。attrs
- The attributes of the XML tag that is inflating the view。defStyle
- The default style to apply to this view。 If 0, no style will be applied (beyond what is included in the theme)。This may either be an attribute resource, whose value will be retrieved from the current theme, or an explicit style resource。public MapControl(android.content.Context context, android.util.AttributeSet attrs, int defStyle, Workspace workspace)
MapControl
对象。context
- The Context the view is running in, through which it can access the current theme, resources, etc。attrs
- The attributes of the XML tag that is inflating the view。defStyle
- The default style to apply to this view. If 0, no style will be applied (beyond what is included in the theme)。 This may either be an attribute resource, whose value will be retrieved from the current theme, or an explicit style resource。workspace
- 指定的工作空间。public android.view.GestureDetector getGestureDetector()
public boolean outputMap(android.graphics.Bitmap drawing)
drawing
- 需要被绘制的位图。public Navigation getNavigation()
public void setMapInertiaListener(MapInertiaListener listener)
listener
- 一个用于设置地图惯性事件的监听器。public boolean removeMapInertiaListener(MapInertiaListener listener)
listener
- 一个用于接收地图惯性事件的监听器。public void setEditStatusListener(EditStatusListener listener)
listener
- 一个用于设置编辑动作事件的监听器。public boolean removeEditStatusListener(EditStatusListener listener)
listener
- 一个用于编辑状态事件的监听器。public void addActionChangedListener(ActionChangedListener actionChangedListener)
actionChangedListener
- 一个用于接收动作变更事件的监听器。public boolean removeActionChangedListener(ActionChangedListener listener)
listener
- 一个用于接收动作变更事件的监听器。public void addMeasureListener(MeasureListener measureListener)
measureListener
- 量算监听器。public boolean removeMeasureListener(MeasureListener measureListener)
measureListener
- 量算监听器。public void addUndoStateChangeListener(UndoStateChangeListener listener)
listener
- Undo监听器。public boolean removeUndoStateChangeListener(UndoStateChangeListener listener)
listener
- Undo监听器。public void setMapParamChangedListener(MapParameterChangedListener listener)
listener
- 地图参数变化监听器。public boolean removeMapParamChangedListener(MapParameterChangedListener listener)
listener
- 地图参数变化监听器。public void setConfigurationChangedListener(ConfigurationChangedListener listener)
listener
- 横竖屏切换监听器。public boolean onSelect(int x, int y)
x
- 选择点的x坐标y
- 选择点的y坐标public boolean appointEditGeometry(int GeoID, Layer layer)
GeoID
- 要编辑的几何对象。layer
- 要编辑的几何对象所属的图层。public boolean removeConfigurationChangedListener(ConfigurationChangedListener listener)
listener
- 横竖屏切换监听器。public boolean setRefreshListener(RefreshListener listener)
listener
- 刷新监听器。public void setGestureDetector(android.view.GestureDetector gsDetector)
gsDetector
- 用户手势识别器。public void deleteGestureDetector()
public Action getAction()
Action
类中定义了目前支持的所有的对地图的操作模式。java.lang.EnumConstantNotPresentException
- 当取出的值错误时。public Action getUserAction()
public boolean submit()
public boolean cancel()
public void setAction(Action action)
Action
类中定义了目前支持的所有的对地图的操作模式。action
- 用户设置的地图操作状态public double getSelectionTolerance()
public void setSelectionTolerance(double value)
value
- 指定选择空间对象的容限。public SelectionMode getSelectionMode()
SelectionMode
常量。针对除点选之外的区域选择方式。SelectionMode.CONTAIN_INNER_POINT
,即对象的内点在选择范围内的就选中。public void setSelectionMode(SelectionMode selectionMode)
SelectionMode
常量。针对除点选之外的区域选择方式。selectionMode
- 指定对象的选择模式。public Map getMap()
public int getMapHeight()
public int getMapWidth()
public void dispose()
public boolean onMultiTouch(android.view.MotionEvent event)
event
- 操作手势事件。public boolean undo()
public boolean redo()
public boolean panTo(Point2D desPoint, int duration)
desPoint
- 目标点。duration
- 动画持续时间。public boolean zoomTo(double scale, int duration)
scale
- 目标比例尺。duration
- 动画持续时间public boolean cancelAnimation()
public Layer getEditLayer()
public boolean deleteCurrentGeometry()
public Geometry getCurrentGeometry()
获得的Geometry需要由调用者进行disose(),如需让地图上显示的该对象释放,需要调用deleteCurrentGeometry()
。
public void addGeometrySelectedListener(GeometrySelectedListener listener)
listener
- 对象选中监听器。public void removeGeometrySelectedListener(GeometrySelectedListener listener)
listener
- 对象选中监听器。public void addGeometryDeletingListener(GeometryDeletingListener listener)
listener
- 对象删除完成前监听器。public void removeGeometryDeletingListener(GeometryDeletingListener listener)
listener
- 对象删除完成前监听器。public void addGeometryDeletedListener(GeometryDeletedListener listener)
listener
- 对象删除完成监听器。public void removeGeometryDeletedListener(GeometryDeletedListener listener)
listener
- 对象删除完成监听器。public void addGeometryAddedListener(GeometryAddedListener listener)
listener
- 对象添加监听器。public void removeGeometryAddedListener(GeometryAddedListener listener)
listener
- 对象添加监听器。public void addGeometryModifyingListener(GeometryModifyingListener listener)
listener
- 对象修改前监听器。public void setStrokeWidth(double width)
width
- 画笔的宽度,单位为毫米,精确到0.1。public double getStrokeWidth()
public void setStrokeColor(int color)
color
- 绘制对象时画笔的颜色。public int getStrokeColor()
public void setStrokeFillColor(int color)
color
- 绘制对象时画笔的填充颜色。public int getStrokeFillColor()
public void setNodeColor(int color)
color
- 节点的颜色。public int getNodeColor()
public void setNodeSize(double size)
size
- 节点的大小。public double getNodeSize()
public void removeGeometryModifyingListener(GeometryModifyingListener listener)
listener
- 对象修改前监听器。public void setMagnifierEnabled(boolean enabled)
enabled
- 是否启用放大镜,true 表示启用放大镜,false 表示不启用放大镜。public boolean isMagnifierEnabled()
public void addGeometryModifiedListener(GeometryModifiedListener listener)
listener
- 对象修改完成监听器。public void removeGeometryModifiedListener(GeometryModifiedListener l)
l
- 对象修改完成监听器。public void setPlotSymbol(long libraryID, long symbolCode)
根据指定的符号库ID和符号的code, 设置需要绘制的符号.
libraryID
- 符号库ID, 即addPlotLibrary()的返回值symbolCode
- 符号Codepublic long addPlotLibrary(java.lang.String libraryPath)
libraryPath
- 符号库在设备中的绝对路径public void removePlotLibrary(long libraryID)
libraryID
- 符号库ID, 即addPlotLibrary()的返回值public void setSnapSetting(SnapSetting value)
value
- 捕捉设置public SnapSetting getSnapSetting()
public void addTouchPoint(Point pntTouch)
pntTouch
- 手势点public void addMeasureStateListener(MeasureStateListener listener)
listener
- 量算状态监听器public boolean removeMeasureStateListener(MeasureStateListener listener)
listener
- 量算状态监听器public void enableRotateTouch(boolean value)
value
- 是否可用public void enableSlantTouch(boolean value)
value
- 是否可用public void setMagnifierRadius(int radius)
radius
- 放大镜半径public int getMagnifierRadius()
public Color getMagnifierCrossColor()
public void setMagnifierCrossColor(Color color)
color
- 放大镜十字丝颜色public void setObjectColor(int color)
Action
中的功能)color
- 节点的颜色public int getObjectColor()
Action
中的功能)public void setObjectWidth(double width)
Action
中的功能)width
- 节点的大小public double getObjectWidth()
Action
中的功能)public void setStaticGeometrySelectedListener(GeometrySelectedListener listener)
listener
- 对象选中监听public void setPaintProfileListener(PaintProfileListener listener)
listener
- 绘制耗时监听器。public void setNodeStyle(GeoStyle style)
style
- 节点的样式public void addGeometryIsSelectedListener(GeometryIsSelectedListener listener)
listener
- 是否选中监听,单击后选中不选中都会触发public void removeGeometryIsSelectedListener(GeometryIsSelectedListener listener)
listener
- 是否选中监听,单击后选中不选中都会触发public void addPlotObject(long libID, long symbolCode, Point2Ds pts)
libID
- 标绘库IDsymbolCode
- 符号代码pts
- 标绘符号坐标点串,其中点标绘符号只有一个坐标点public Collector getCollector()
public boolean outputMap(android.graphics.Bitmap drawing, int nSrc_x, int nSrc_y)
drawing
- 需要被绘制的位图nSrc_x
- 需要截图起始位置xnSrc_y
- 需要截图起始位置ypublic void setMapOverlay(boolean bIsMapOverlay)
bIsMapOverlay
- 设置地图是否是叠加层public boolean isSnapCreatPointEnable()
public void setSnapCreatPointEnable(boolean value)
value
- 开启捕捉