获取场景中 shp 素材的样式
优质
小牛编辑
126浏览
2023-12-01
接口说明
获取场景中shp素材的样式
如需调用,请访问 开发者文档 来查看详细的接口使用说明
该接口仅开放给已获取SDK的开发者
如开启https功能,请求地址的协议应改为https,如:https://www.example.com/wish3dearth/api/access/v1.0.0/getLicenseInfo
API地址
GET
/wish3dearth/api/material/shp/v1.0.0/getShpStyle
是否需要登录
否
请求字段说明
参数 | 类型 | 请求类型 | 是否必须 | 说明 |
---|---|---|---|---|
sceneId | string | query | 是 | 场景ID |
materialId | string | query | 是 | 素材ID |
响应字段说明
参数 | 类型 | 说明 |
---|---|---|
id | string | id |
materialId | string | 素材ID |
senceId | string | 场景ID |
styleJson | string | 素材样式json |
createTime | string | 创建时间 |
updateTime | string | 更新时间 |
响应成功示例
{ "code": 0, "data": { "createTime": "2019-12-11 14:46:31", "id": "e54611d2a47a4f65ae401d137d7fddd7", "materialId": "5e6731d3cfb740228fc90dbaab7b73a5", "senceId": "c4bfc032b13417e3d5b0d05c2da9d462", "styleJson": "{\"asset\":{\"version\":\"1.0.0\"},\"styles\":[{\"color\":\"rgba(33, 150, 243,1)\",\"lineWidth\":1,\"lineType\":[],\"outline\":true,\"outlineColor\":\"#2196F3\",\"icon\":\"http://my.wish3d.com:8080/Wish3DEarth/images/GEMarker/red-circle.png\",\"font\":\"bold 14px sans-serif\"}]}", "updateTime": "2019-12-16 09:53:24" }, "message": "成功" }
响应失败示例
{ "code": 500, "message": "未知错误,请及时联系管理人员进行处理" }
响应接受类型
application/json
响应状态码
HTTP状态码 | 原因 |
---|---|
0 | 成功 |
200 | OK |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
10000 | token不能为空 |
10001 | token已失效,请重新登录 |
99998 | 非法请求 |
99999 | 服务器异常 |
示例代码
$.ajax({ url: '/wish3dearth/api/material/shp/v1.0.0/getShpStyle?sceneId=&materialId=', type: 'GET', data: '', dataType: 'text', cache: false, contentType: 'application/json', xhrFields: { withCredentials: true }, crossDomain: true, success:function(data){ // 成功返回值 }, error:function(XMLHttpRequest, textStatus, errorThrown){ } })