public final class MapsInitializer
extends java.lang.Object
MapsInitializer.initialize(Context)来设置一个可用的context。
MapsInitializer.initialize(Context).| 限定符和类型 | 字段和说明 |
|---|---|
static int |
HTTP
Http协议。
|
static int |
HTTPS
Https协议。
|
static java.lang.String |
sdcardDir
地图缓存目录。
|
| 构造器和说明 |
|---|
MapsInitializer() |
| 限定符和类型 | 方法和说明 |
|---|---|
static java.lang.String |
getDeviceId(android.content.Context context)
获取设备号
Get the device number |
static java.lang.String |
getLibAbi() |
static java.lang.String |
getLibPath() |
static boolean |
getNetWorkEnable()
已过时。
5.0.0开始废弃
Deprecated since version 5.0.0. |
static int |
getProtocol()
返回访问使用的协议类别
Return the protocol category used for access |
static int |
getRegionLanguageType() |
static LatLng |
getRegionLocation()
获取多语言当前经纬度
Get current latitude and longitude for multilingual |
static java.lang.String |
getVersion()
返回地图SDK的版本号。
|
static java.lang.String |
getWorldVectorOfflineMapStyleAssetsPath() |
static void |
initialize(android.content.Context paramContext)
初始化全局 context。
|
static boolean |
isContourLineEnable() |
static boolean |
isOverSea() |
static boolean |
isTerrainEnable()
是否打开地形图, 默认为关闭
打开地形图之后,底图会变成3D模式,添加的点线面等覆盖物也会自动带有高程
Whether to open the terrain map, default is off After opening the terrain map, the base map will become 3D mode, and the added point, line, and surface overlays will automatically have elevation |
static void |
setApiKey(java.lang.String apiKey)
动态设置apiKey。
|
static void |
setContourLIneEnable(boolean enable) |
static void |
setCurrentLocation(LatLng latLng)
多语言设置当前经纬度
Multilingual setting of current latitude and longitude |
static void |
setExternalBasePath(java.lang.String externalBasePath)
设置外部资源路径
Set the external resource path 设置后,地图资源将从该路径加载;传入 null 则恢复从 APK assets 加载。 |
static void |
setIsOverSea(boolean isOverSea)
设置是否为海外环境。
|
static void |
setNetWorkEnable(boolean enable)
已过时。
5.0.0开始废弃
Deprecated since version 5.0.0. |
static void |
setProtocol(int protocol)
设置访问使用的协议类别。
|
static void |
setTerrainEnable(boolean isTerrainEnable)
是否打开地形图, 默认为关闭
打开地形图之后,底图会变成3D模式,添加的点线面等覆盖物也会自动带有高程
注意:需要在MapView创建之前调用
Whether to open the terrain map, default is off
After opening the terrain map, the base map will become 3D mode, and the added point, line, and surface overlays will automatically have elevation
Note: It needs to be called before the MapView is created
|
static void |
updatePrivacyAgree(android.content.Context context,
boolean isAgree)
更新同意隐私状态,需要在初始化地图之前完成
Update the consent privacy status, which needs to be completed before initializing the map |
static void |
updatePrivacyShow(android.content.Context context,
boolean isContains,
boolean isShow)
更新隐私合规状态,需要在初始化地图之前完成
Update the privacy compliance status, which needs to be completed before initializing the map |
public static java.lang.String sdcardDir
public static final int HTTP
public static final int HTTPS
public static void initialize(android.content.Context paramContext)
throws android.os.RemoteException
paramContext - context对象,不能为空。
android.os.RemoteExceptionpublic static java.lang.String getLibPath()
public static java.lang.String getLibAbi()
public static void setNetWorkEnable(boolean enable)
enable - 是否可以联网获取地图数据。默认为true,可以联网
public static boolean getNetWorkEnable()
public static void setApiKey(java.lang.String apiKey)
apiKey - 在高德官网上申请的apiKey。
public static java.lang.String getVersion()
public static void setProtocol(int protocol)
protocol - 包含Http和Https两种协议。
public static int getProtocol()
public static java.lang.String getWorldVectorOfflineMapStyleAssetsPath()
public static java.lang.String getDeviceId(android.content.Context context)
context - public static boolean isTerrainEnable()
public static boolean isContourLineEnable()
public static void setTerrainEnable(boolean isTerrainEnable)
注意:需要在MapView创建之前调用
Whether to open the terrain map, default is off After opening the terrain map, the base map will become 3D mode, and the added point, line, and surface overlays will automatically have elevation
Note: It needs to be called before the MapView is created
isTerrainEnable - true为打开,默认false
public static void setContourLIneEnable(boolean enable)
public static void setIsOverSea(boolean isOverSea)
isOverSea - 是否为海外环境。true 表示海外,false 表示国内。
public static boolean isOverSea()
public static int getRegionLanguageType()
public static void setCurrentLocation(LatLng latLng)
latLng - public static LatLng getRegionLocation()
public static void updatePrivacyShow(android.content.Context context,
boolean isContains,
boolean isShow)
context: - 上下文isContains: - 隐私权政策是否包含高德开平隐私权政策 true是包含
isShow: 隐私权政策是否弹窗展示告知用户 true是展示 - public static void updatePrivacyAgree(android.content.Context context,
boolean isAgree)
context: - 上下文isAgree: - 隐私权政策是否取得用户同意 true是用户同意
public static void setExternalBasePath(java.lang.String externalBasePath)
设置后,地图资源将从该路径加载;传入 null 则恢复从 APK assets 加载。
externalBasePath - 外部资源路径,如 "/sdcard/my_assets/";传入 null 恢复默认