public class UiSettings
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
UiSettings()
仅为滴滴兼容其它sdk提供此接口(临时方案) 后续需要去掉
|
protected |
UiSettings(com.tencent.map.sdk.basemap.controllers.UiSettingControl iuisettingsdelegate) |
Modifier and Type | Method and Description |
---|---|
boolean |
isCompassEnabled()
获取当前是否开启罗盘控件
|
boolean |
isIndoorLevelPickerEnabled()
获取室内图楼层切换控件是否可见
|
boolean |
isMyLocationButtonEnabled()
获取当前是否显示定位控件
|
boolean |
isRotateGesturesEnabled()
获取当前是否支持旋转手势
|
boolean |
isScaleViewEnabled()
获取当前是否显示比例尺
修改内容:isScaleVisable==>isScaleVisible
|
boolean |
isScrollGesturesEnabled()
获取当前是否支持滚动手势
|
boolean |
isTiltGesturesEnabled()
获取当前是否支持倾斜手势
|
boolean |
isZoomControlsEnabled()
Deprecated.
从4.3.1弃用,建议使用自定义View
|
boolean |
isZoomGesturesEnabled()
获取当前是否支持缩放手势
|
void |
setAllGesturesEnabled(boolean flag)
设置是否开启地图所有手势
|
void |
setCompassEnabled(boolean flag)
设置是否显示指南针
|
void |
setCompassExtraPadding(int padding)
设置罗盘的填边,只对Y轴生效
|
void |
setCompassExtraPadding(int xPadding,
int yPadding)
设置罗盘的填边
|
void |
setFlingGestureEnabled(boolean flag) |
void |
setGestureScaleByMapCenter(boolean scaleByMapCenter)
设置是否按地图中心点缩放
|
void |
setIndoorLevelPickerEnabled(boolean enabled)
设置室内图楼层切换控件是否可见
|
void |
setLogoPosition(int logoAnchor)
设置Logo的显示位置
|
void |
setLogoPosition(int logoAnchor,
int[] marginParams)
根据地图四个Anchor 模式(左上、左下、右下、右上)以及相应的Margins来设置Logo位置
|
void |
setLogoPositionWithMargin(int position,
int top,
int bottom,
int left,
int right)
设置Logo的显示位置,带偏移量,单位像素
设置Logo的显示位置
|
void |
setLogoScale(float logoScale)
设置Logo的缩放比例,比例范围(0.7~1.3)
|
void |
setLogoSize(int logoSize)
设置图标大小,暂时不生效
|
void |
setMyLocationButtonEnabled(boolean flag)
设置是否显示定位按钮
|
void |
setRotateGesturesEnabled(boolean flag)
设置是否开启地图旋转手势
|
void |
setScaleViewEnabled(boolean show)
设置当前是否显示比例尺
|
void |
setScaleViewPosition(int position)
设置比例尺的显示位置
|
void |
setScaleViewPositionWithMargin(int position,
int top,
int bottom,
int left,
int right)
设置比例尺的显示位置,带偏移量,单位像素
|
void |
setScrollGesturesEnabled(boolean flag)
设置是否开启地图滚动手势
|
void |
setTiltGesturesEnabled(boolean flag)
设置是否开启地图倾斜手势
|
void |
setZoomControlsEnabled(boolean flag)
Deprecated.
从4.3.1弃用,Android对
ZoomButton 已不维护,建议使用自定义View |
void |
setZoomGesturesEnabled(boolean flag)
设置是否开启地图缩放手势
|
void |
setZoomPosition(int position)
Deprecated.
从4.3.1弃用,建议使用自定义View
|
protected UiSettings()
protected UiSettings(com.tencent.map.sdk.basemap.controllers.UiSettingControl iuisettingsdelegate)
public void setZoomControlsEnabled(boolean flag)
ZoomButton
已不维护,建议使用自定义Viewflag
- 是否显示:true 显示 false 隐藏public void setCompassEnabled(boolean flag)
flag
- 是否显示:true 显示 false 隐藏public void setCompassExtraPadding(int padding)
padding
- 间距public void setCompassExtraPadding(int xPadding, int yPadding)
xPadding
- x轴间距yPadding
- y轴间距public void setMyLocationButtonEnabled(boolean flag)
flag
- 是否显示:true 显示 false 隐藏public void setScrollGesturesEnabled(boolean flag)
flag
- 是否开启:true 开启 false 关闭public void setFlingGestureEnabled(boolean flag)
public void setZoomGesturesEnabled(boolean flag)
flag
- 是否开启:true 开启 false 关闭public void setTiltGesturesEnabled(boolean flag)
flag
- 是否开启:true 开启 false 关闭public void setRotateGesturesEnabled(boolean flag)
flag
- 是否开启:true 开启 false 关闭public void setAllGesturesEnabled(boolean flag)
flag
- 是否开启:true 开启 false 关闭public boolean isZoomControlsEnabled()
public boolean isCompassEnabled()
public boolean isMyLocationButtonEnabled()
public boolean isScrollGesturesEnabled()
public boolean isZoomGesturesEnabled()
public boolean isTiltGesturesEnabled()
public boolean isRotateGesturesEnabled()
public boolean isIndoorLevelPickerEnabled()
public void setScaleViewEnabled(boolean show)
public boolean isScaleViewEnabled()
public void setScaleViewPosition(int position)
position
- 地图比例尺显示位置:
TencentMapOptions.SCALEVIEW_POSITION_BOTTOM_CENTER
TencentMapOptions.SCALEVIEW_POSITION_BOTTOM_LEFT
TencentMapOptions.SCALEVIEW_POSITION_BOTTOM_RIGHT
TencentMapOptions.SCALEVIEW_POSITION_TOP_CENTER
public void setScaleViewPositionWithMargin(int position, int top, int bottom, int left, int right)
position
- 地图比例尺显示位置:
TencentMapOptions.SCALEVIEW_POSITION_BOTTOM_CENTER
TencentMapOptions.SCALEVIEW_POSITION_BOTTOM_LEFT
TencentMapOptions.SCALEVIEW_POSITION_BOTTOM_RIGHT
TencentMapOptions.SCALEVIEW_POSITION_TOP_CENTER
top
- position为TOP时,该值生效,不需要偏移请传负数bottom
- position为BOTTOM时,该值生效,不需要偏移请传负数left
- position为LEFT时,该值生效,不需要偏移请传负数right
- position为RIGHT时,该值生效,不需要偏移请传负数public final void setLogoPosition(int logoAnchor)
public final void setZoomPosition(int position)
position
- 地图ZoomControl的显示位置:
TencentMapOptions.ZOOM_POSITION_BOTTOM_LEFT
TencentMapOptions.ZOOM_POSITION_BOTTOM_RIGHT
public final void setLogoSize(int logoSize)
logoSize
- 图标大小: 支持0,1,-1,-2,-3。0为标准大小。1较标准稍大 -1,-2,-3 依次变小public final void setLogoPositionWithMargin(int position, int top, int bottom, int left, int right)
position
- 地图logo显示位置:
TencentMapOptions.LOGO_POSITION_BOTTOM_CENTER
TencentMapOptions.LOGO_POSITION_BOTTOM_LEFT
TencentMapOptions.LOGO_POSITION_BOTTOM_RIGHT
TencentMapOptions.LOGO_POSITION_TOP_CENTER
top
- position为TOP时,该值生效,不需要偏移请传负数bottom
- position为BOTTOM时,该值生效,不需要偏移请传负数left
- position为LEFT时,该值生效,不需要偏移请传负数right
- position为RIGHT时,该值生效,不需要偏移请传负数public final void setLogoPosition(int logoAnchor, int[] marginParams)
logoAnchor
-
TencentMapOptions.LOGO_POSITION_BOTTOM_LEFT
TencentMapOptions.LOGO_POSITION_BOTTOM_RIGHT
marginParams
- 若logoAnchor为 LOGO_POSITION_BOTTOM_LEFT,则Logo的 bottomMargin 为 marginParams[0], leftMargin 为 marginParams[1]
若logoAnchor为 LOGO_POSITION_BOTTOM_RIGHT,则Logo的 bottomMargin 为 marginParams[0], rightMargin 为 marginParams[1]
若logoAnchor为 LOGO_POSITION_TOP_RIGHT,则Logo的 topMargin 为 marginParams[0], rightMargin 为 marginParams[1]
若logoAnchor为 LOGO_POSITION_TOP_LEFT ,则Logo 的 topMargin 为 marginParams[0], leftMargin 为 marginParams[1]
public void setGestureScaleByMapCenter(boolean scaleByMapCenter)
scaleByMapCenter
- true:所有缩放操作都按中心点缩放 false:按默认模式进行缩放public void setIndoorLevelPickerEnabled(boolean enabled)
enabled
- public void setLogoScale(float logoScale)
logoScale
-