地图 最后更新时间: 2024年08月30日
产品介绍
该 API 是通过 HTTPS 协议访问远程服务的接口,提供新建/修改/删除地图、添加/移除地图成员的能力。
使用限制
详细的服务调用量限制可点我查阅。
使用说明
接收请求返回的数据(JSON或XML格式),参考返回参数文档解析数据。
如无特殊声明,接口的输入参数和输出数据编码全部统一为 UTF-8 编码方式。
1. 新建地图
请求地址
请求参数
示例代码(以java为例)
import com.amap.wia.openapi.test.lib.MyHttpUtils;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/demo-lib
import com.amap.wia.openapi.test.lib.SignatureHelper;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/biz-token-sign
/*
* 通用 import 内容等暂略
*/
public static void main(String[] args) {
String url = "https://restwia.amap.com/api/v1/wia/core/create";
String openId = "当前操作用户的openId";
String key = "在高德开放平台申请的key";
String bizToken = "在高德开放平台申请的bizToken";
String bizSecret = "在高德开放平台申请的bizSecret";
String workMapName = "测试地图" + TimeUtil.getTimeString("yy-MM-dd HH-mm");
Map<String, Object> requestParams = new HashMap<>();
requestParams.put("key", key);
requestParams.put("openId", openId);
requestParams.put("bizToken", bizToken);
String[] signArgs = new String[]{openId,bizToken};
requestParams.put("bizSign", SignatureHelper.calcSign(bizSecret, signArgs));
url = MyHttpUtils.attachParamsToUrl(url, requestParams);
Map<String, Object> postParams = new HashMap<>();
postParams.put("workMapName", workMapName);
String response = MyHttpUtils.postFormUrlencoded(url, postParams);
System.out.println(response);
}
返回参数
附表
2. 获取地图信息
请求地址
请求参数
示例代码(以java为例)
import com.amap.wia.openapi.test.lib.MyHttpUtils;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/demo-lib
import com.amap.wia.openapi.test.lib.SignatureHelper;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/biz-token-sign
/*
* 通用 import 内容等暂略
*/
public static void main(String[] args) {
String url = "https://restwia.amap.com/api/v1/wia/core/info";
Map<String, Object> params = new HashMap<>();
String key = "在高德开放平台申请的key";
String openId = "当前操作用户的openId";
String bizToken = "在高德开放平台申请的bizToken";
String bizSecret = "在高德开放平台申请的bizSecret";
String workMapId ="要操作的工作地图id";
params.put("key", key);
params.put("openId", openId);
params.put("bizToken", bizToken);
String[] signArgs = new String[]{workMapId};
params.put("workMapId", workMapId);
params.put("bizSign", SignatureHelper.calcSign(bizSecret, signArgs));
url = MyHttpUtils.attachParamsToUrl(url, params);
String response = MyHttpUtils.get(url);
System.out.println(response);
}
返回参数
附表
3.获取地图列表
如无特殊声明,接口的输入参数和输出数据编码全部统一为 UTF-8 编码方式。
请求地址
请求参数
示例代码(以java为例)
import com.amap.wia.openapi.test.lib.MyHttpUtils;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/demo-lib
import com.amap.wia.openapi.test.lib.SignatureHelper;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/biz-token-sign
/*
* 通用 import 内容等暂略
*/
public static void main(String[] args) {
String url = "https://restwia.amap.com/api/v1/wia/core/list";
String key = "在高德开放平台申请的key";
String openId = "当前操作用户的openId";
String bizToken = "在高德开放平台申请的bizToken";
String bizSecret = "在高德开放平台申请的bizSecret";
Map<String, Object> params = new HashMap<>();
params.put("key", key);
params.put("openId", openId);
params.put("bizToken", bizToken);
params.put("pageNumber", 1);
params.put("pageSize", 50);
String[] signArgs = new String[]{openId, bizToken};
params.put("bizSign", SignatureHelper.calcSign(bizSecret, signArgs));
url = MyHttpUtils.attachParamsToUrl(url, params);
String response = MyHttpUtils.postFormUrlencoded(url, null);
System.out.println(response);
}
返回参数
4. 修改地图信息
请求地址
特别注意:暂无。
请求参数
示例代码(以java为例)
import com.amap.wia.openapi.test.lib.MyHttpUtils;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/demo-lib
import com.amap.wia.openapi.test.lib.SignatureHelper;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/biz-token-sign
/*
* 通用 import 内容等暂略
*/
public static void main(String[] args) {
String url = "https://restwia.amap.com/api/v1/wia/core/update";
Map<String, Object> params = new HashMap<>();
String workMapId = "工作地图id";
params.put("key", "在高德开放平台申请的key");
params.put("openId", "当前操作用户的openId");
params.put("bizToken", "在高德开放平台申请的bizToken");
params.put("workMapId", workMapId);
String[] signArgs = new String[]{workMapId};
params.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret", signArgs));
params.put("workMapName", "修改后的地图名称");
String response = MyHttpUtils.postFormUrlencoded(url, params);
System.out.println(response);
}
返回参数
附表
5. 删除地图
请求地址
特别注意:暂无。
请求参数
示例代码(以java为例)
import com.amap.wia.openapi.test.lib.MyHttpUtils;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/demo-lib
import com.amap.wia.openapi.test.lib.SignatureHelper;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/biz-token-sign
/*
* 通用 import 内容等暂略
*/
public static void main(String[] args) {
String url = "https://restwia.amap.com/api/v1/wia/core/delete";
String openId = "当前操作用户的openId";
String key = "在高德开放平台申请的key";
String bizToken = "在高德开放平台申请的bizToken";
String bizSecret = "在高德开放平台申请的bizSecret";
String workMapId ="要操作的工作地图id";
Map<String, Object> requestParams = new HashMap<>();
requestParams.put("key", key);
requestParams.put("openId", openId);
requestParams.put("bizToken", bizToken);
String[] signArgs = new String[]{workMapId};
requestParams.put("bizSign", SignatureHelper.calcSign(bizSecret, signArgs));
Map<String, Object> postParams = new HashMap<>();
postParams.put("workMapId", workMapId);
url = MyHttpUtils.attachParamsToUrl(url, requestParams);
String response = MyHttpUtils.postFormUrlencoded(url, postParams);
System.out.println(response);
}
返回参数
附表
6. 地图超管转移
请求地址
请求参数
示例代码(以java为例)
import com.amap.wia.openapi.test.lib.MyHttpUtils;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/demo-lib
import com.amap.wia.openapi.test.lib.SignatureHelper;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/biz-token-sign
/*
* 通用 import 内容等暂略
*/
public static void main(String[] args) {
String url = "https://restwia.amap.com/api/v1/wia/core/transfer";
String openId = "当前超级管理员的openId";
String key = "在高德开放平台申请的key";
String bizToken = "在高德开放平台申请的bizToken";
String bizSecret = "在高德开放平台申请的bizSecret";
String workMapId ="要操作的工作地图id";
String targetOpenId = "新的超级管理员 openId";
Map<String, Object> requestParams = new HashMap<>();
requestParams.put("key", key);
requestParams.put("bizToken", bizToken);
requestParams.put("openId", openId);
String[] signArgs = new String[]{workMapId, openId};
requestParams.put("bizSign", SignatureHelper.calcSign(bizSecret, signArgs));
Map<String, Object> postParams = new HashMap<>();
postParams.put("workMapId", workMapId);
postParams.put("targetOpenId", targetOpenId);
url = MyHttpUtils.attachParamsToUrl(url, requestParams);
String response = MyHttpUtils.postFormUrlencoded(url, postParams);
System.out.println(response);
}
返回参数
附表
7. 新增地图管理员
请求地址
请求参数
示例代码(以java为例)
import com.amap.wia.openapi.test.lib.MyHttpUtils;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/demo-lib
import com.amap.wia.openapi.test.lib.SignatureHelper;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/biz-token-sign
/*
* 通用 import 内容等暂略
*/
public static void main(String[] args) {
String url = "https://restwia.amap.com/api/v1/wia/core/manager/add";
String key = "在高德开放平台申请的key";
String openId = "当前操作用户的openId";
String workMapId ="要操作的工作地图id";
String bizToken = "在高德开放平台申请的bizToken";
String bizSecret = "在高德开放平台申请的bizSecret";
String openIds = "见参数说明";
Map<String, Object> requestParams = new HashMap<>();
requestParams.put("key", key);
requestParams.put("bizToken", bizToken);
requestParams.put("openId", openId);
String[] signArgs = new String[]{workMapId,openId};
requestParams.put("bizSign", SignatureHelper.calcSign(bizSecret, signArgs));
Map<String, Object> postParams = new HashMap<>();
postParams.put("workMapId", workMapId);
postParams.put("openIds", openIds);
url = MyHttpUtils.attachParamsToUrl(url, requestParams);
String response = MyHttpUtils.postFormUrlencoded(url, postParams);
System.out.println(response);
}
返回参数
附表
8. 移除地图管理员
请求地址
请求参数
示例代码(以java为例)
import com.amap.wia.openapi.test.lib.MyHttpUtils;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/demo-lib
import com.amap.wia.openapi.test.lib.SignatureHelper;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/biz-token-sign
/*
* 通用 import 内容等暂略
*/
public static void main(String[] args) {
String url = "https://restwia.amap.com/api/v1/wia/core/manager/remove";
String key = "在高德开放平台申请的key";
String openId = "当前操作用户的openId";
String workMapId ="要操作的工作地图id";
String bizToken = "在高德开放平台申请的bizToken";
String bizSecret = "在高德开放平台申请的bizSecret";
String openIds = "见参数说明";
Map<String, Object> requestParams = new HashMap<>();
requestParams.put("key", key);
requestParams.put("bizToken", bizToken);
requestParams.put("openId", openId);
String[] signArgs = new String[]{workMapId,openId};
requestParams.put("bizSign", SignatureHelper.calcSign(bizSecret, signArgs));
Map<String, Object> postParams = new HashMap<>();
postParams.put("workMapId", workMapId);
postParams.put("openIds", openIds);
url = MyHttpUtils.attachParamsToUrl(url, requestParams);
String response = MyHttpUtils.postFormUrlencoded(url, postParams);
System.out.println(response);
}
返回参数
附表
9、生成二维码链接
此接口用于生成二维码,邀请其他用户加入地图(其他用户需要用高德地图扫码加入)。
此接口返回的字段中,有『二维码链接』,使用方需要根据这个链接自己生成二维码图片。
请求地址
请求参数
示例代码(以java为例)
import com.amap.wia.openapi.test.lib.MyHttpUtils;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/demo-lib
import com.amap.wia.openapi.test.lib.SignatureHelper;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/biz-token-sign
/*
* 通用 import 内容等暂略
*/
public static void main(String[] args) {
String url = "https://restwia.amap.com/api/v1/wia/core/qrCode";
Map<String, Object> params = new HashMap<>();
String key = "在高德开放平台申请的key";
String openId = "当前操作用户的openId";
String bizToken = "在高德开放平台申请的bizToken";
String bizSecret = "在高德开放平台申请的bizSecret";
String workMapId ="要操作的工作地图id";
params.put("key", key);
params.put("openId", openId);
params.put("bizToken", bizToken);
String[] signArgs = new String[]{workMapId, openId};
params.put("workMapId", workMapId);
params.put("bizSign", SignatureHelper.calcSign(bizSecret, signArgs));
url = MyHttpUtils.attachParamsToUrl(url, params);
String response = MyHttpUtils.postFormUrlencoded(url, null);
System.out.println(response);
}