自定义颜色 最后更新时间: 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/map/config/resource_color/query_all";
Map<String, Object> params = new HashMap<>();
String workMapId = "工作地图id";
String openId = "高德开放用户id";
params.put("key", "在高德开放平台申请的key");
params.put("bizToken", "在高德开放平台申请的bizToken");
String[] signArgs = new String[]{workMapId, openId};
params.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret", signArgs));
params.put("workMapId", workMapId);
params.put("openId", openId);
params.put("resourceType" , 1);
String response = MyHttpUtils.postFormUrlencoded(url, params);
System.out.println(response);
}
响应说明
响应
{
"data": {
"workMapId": "-tPwwzHEwabDyvvBz4WVCw",
"resourceColorSceneInfo": {
"colorScene": 1,
"sceneTitle": "标记点颜色",
"resourceTypeList": [
1
],
"supportColorModelList": [
1,
2
]
},
"colorModel": 1,
"standardModel": {
"colorList": [
{
"colorId": null,
"colorValue": "#7E97FF,#4265FF",
"colorName": null
},
{
"colorId": null,
"colorValue": "#7AB1F5,#307EDF",
"colorName": null
},
{
"colorId": null,
"colorValue": "#4CC7FF,#39A1F8",
"colorName": null
},
{
"colorId": null,
"colorValue": "#12E3AA,#18AD78",
"colorName": null
},
{
"colorId": null,
"colorValue": "#FFBF00,#FD9A00",
"colorName": null
},
{
"colorId": null,
"colorValue": "#FF983F,#F96328",
"colorName": null
},
{
"colorId": null,
"colorValue": "#EA7864,#D76049",
"colorName": null
},
{
"colorId": null,
"colorValue": "#FF6968,#F74746",
"colorName": null
}
]
},
"seniorModel": {
"colorList": [
{
"colorId": "10228487733002",
"colorValue": "#EA7864,#D76049",
"colorName": "标准红"
},
{
"colorId": "10228487733011",
"colorValue": "#FFBF00,#FD9A00",
"colorName": "标准黄"
},
{
"colorId": "10228487734004",
"colorValue": "#15FF29,#00E113",
"colorName": "翠绿色"
}
]
}
},
"code": 1,
"message": "Successful",
"result": true,
"version": "1.0",
"timestamp": 1704771342235,
"requestId": "1eb5d15817047713419111022d0f5f"
}