绘制面资源 最后更新时间: 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 requestUrl = "https://restwia.amap.com/api/v1/wia/surface/create";
//url param
HashMap<String, Object> param = Maps.newHashMap();
param.put("key", "在高德开放平台申请的key");
param.put("openId", "当前操作用户的openId");
param.put("bizToken", "在高德开放平台申请的bizToken");
param.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret",new String[]{"工作地图id","openId"}));
param.put("workMapId",env.getWorkMapId());
param.put("title","测试面资源");
param.put("desc","desc");
param.put("color",1);
// param.put("imgList","[,]");
HashMap<String, Object> firstPoint = Maps.newHashMap();
firstPoint.put("name","名称");
firstPoint.put("lat",40.03044215520612);
firstPoint.put("lon",116.4339244359213);
param.put("firstPoint", JSONObject.toJSONString(firstPoint));
param.put("polygonInfo","POLYGON((116.43659837543292 40.017234979293875,116.43034100051642 40.019648795274236,116.44148112740363 40.02771819946398,116.43659837543292 40.017234979293875))");
// param.put("categoryId","文件夹id");
param.put("principal","负责人1openId,负责人2openId");//半角逗号分隔
String s = MyHttpUtils.postFormUrlencoded(requestUrl, param);
}
返回参数
附表
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 requestUrl = "https://restwia.amap.com/api/v1/wia/surface/update";
//url param
HashMap<String, Object> param = Maps.newHashMap();
param.put("key", "在高德开放平台申请的key");
param.put("openId", "当前操作用户的openId");
param.put("bizToken", "在高德开放平台申请的bizToken");
param.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret",new String[]{"工作地图id","openId"}));
param.put("workMapId",env.getWorkMapId());
param.put("resourceId","面资源resourceid");
param.put("title","测试面资源");
param.put("desc","desc");
param.put("color",1);
// param.put("imgList","[,]");
HashMap<String, Object> firstPoint = Maps.newHashMap();
firstPoint.put("name","名称");
firstPoint.put("lat",40.03044215520612);
firstPoint.put("lon",116.4339244359213);
param.put("firstPoint", JSONObject.toJSONString(firstPoint));
param.put("polygonInfo","POLYGON((116.43659837543292 40.017234979293875,116.43034100051642 40.019648795274236,116.44148112740363 40.02771819946398,116.43659837543292 40.017234979293875))");
// param.put("categoryId","文件夹id");
param.put("principal","负责人1openId,负责人2openId");//半角逗号分隔
String s = MyHttpUtils.postFormUrlencoded(requestUrl, param);
}
返回参数
附表
3. 删除『绘制面』
请求地址
请求参数
示例代码(以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 requestUrl = "https://restwia.amap.com/api/v1/wia/surface/remove";
//url param
HashMap<String, Object> param = Maps.newHashMap();
param.put("key", "在高德开放平台申请的key");
param.put("openId", "当前操作用户的openId");
param.put("bizToken", "在高德开放平台申请的bizToken");
param.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret",new String[]{"工作地图id","openId"}));
param.put("workMapId","工作地图id");
param.put("resourceId","面资源资源点id");
String s = MyHttpUtils.postFormUrlencoded(requestUrl, param);
}
返回参数
附表
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 requestUrl = "https://restwia.amap.com/api/v1/wia/surface/detail";
//url param
HashMap<String, Object> param = Maps.newHashMap();
param.put("key", "在高德开放平台申请的key");
param.put("openId", "当前操作用户的openId");
param.put("bizToken", "在高德开放平台申请的bizToken");
param.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret",new String[]{"工作地图id","openId"}));
param.put("workMapId","工作地图id");
param.put("resourceId","面资源资源点id");
String s = MyHttpUtils.postFormUrlencoded(requestUrl, param);
}