# 渲染多个图层组成的地图
# 配置渲染参数
# 请求 URL:
http://host:port/heycloud/api/render/map
# 请求方式:
- POST
# 请求 Header:
字段 | 类型 | 是否必选 | 说明 |
---|---|---|---|
x-heycloud-admin-session | String | 否 | 通过 session 提供管理权限 |
x-heycloud-account-id | String | 否 | 帐号的唯一标识符 |
x-heycloud-render-expire | String | 否 | 渲染配置的过期时间,单位秒 |
# 请求参数:
# Content type: application/json
字段 | 可选值 | 类型 | 是否必选 | 说明 |
---|---|---|---|---|
datasource | - | Object | 是 | |
├ type | vdataset | idataset | String | 是 | 瓦片的类型 |
├ attrFields | 通过 meta 接口获取 | Array | 否(style.type 为非 simple 时必选) | 渲染的字段 |
└ source | - | String | 是 | 瓦片的唯一标识 |
style | 参考详细的样式说明 | Object | 是 | 样式设置 |
由 图层 元素构成的数组
# 请求示例:
POST http://host:port/heycloud/api/render/map
[{
"datasource": {
"type": "vdataset",
"source": "2662558d-5ea0-4862-945c-76856ec4f092"
},
"style": {
"type": "polygon-simple",
"fillOpacity": 1,
"outlineColor": "#fff",
"outlineWidth": 0.5,
"outlineDashArray": "6,2"
}
},{
"datasource": {
"type": "vdataset",
"source": "2662558d-5ea0-4862-945c-76856ec4f092"
},
"style": {
"type": "polyline-simple",
}
}]
# 正确响应示例:
{
"result": {
"uid": "xxx",
"updatedAt": 1593702110989
}
}
# 错误响应示例:
{
"error": "ERROR",
"message": "错误信息"
}
# 更新渲染配置的过期时间
# 请求 URL:
http://host:port/heycloud/api/render/map/:uid
# 请求方式:
- POST
# 请求 Header:
字段 | 类型 | 是否必选 | 说明 |
---|---|---|---|
x-heycloud-admin-session | String | 否 | 通过 session 提供管理权限 |
x-heycloud-account-id | String | 否 | 帐号的唯一标识符 |
x-heycloud-render-expire | String | 否 | 渲染配置的过期时间,单位秒 |
# 请求参数:
# Params&Query:
字段 | 类型 | 说明 |
---|---|---|
uid | String | 渲染配置的唯一标识,配置的变化会导致 uid 的变化 |
# 请求示例:
POST http://host:port/heycloud/api/render/map/xxxxx
# 正确响应示例:
{
"result": {
"ok": true
}
}
# 错误响应示例:
{
"error": "UPDATE_EXPIRE_FAILED",
"message": "更新过期时间失败"
}
# 获取渲染配置
# 请求 URL:
http://host:port/heycloud/api/render/map/:uid
# 请求方式:
- GET
# 请求 Header:
字段 | 类型 | 是否必选 | 说明 |
---|---|---|---|
x-heycloud-admin-session | String | 否 | 通过 session 提供管理权限 |
x-heycloud-account-id | String | 否 | 帐号的唯一标识符 |
# 请求参数:
# Params&Query:
字段 | 类型 | 说明 |
---|---|---|
uid | String | 渲染配置的唯一标识,配置的变化会导致 uid 的变化 |
# 请求示例:
GET http://host:port/heycloud/api/render/map/xxxxx
# 正确响应示例:
{
"result": {...}
}
# 错误响应示例:
{
"error": "ERROR",
"message": "错误信息"
}
# 按瓦片索引渲染为图片
# 请求 URL:
http://host:port/heycloud/api/render/map/:uid/tile/:z/:x/:y/:scale/image.:format
# 请求方式:
- GET
# 请求 Header:
字段 | 类型 | 是否必选 | 说明 |
---|---|---|---|
x-heycloud-admin-session | String | 否 | 通过 session 提供管理权限 |
x-heycloud-account-id | String | 否 | 帐号的唯一标识符 |
x-heycloud-render-disable-cache | String | 否 | 如为字符串'true'则不使用缓存数据,确保为最新的渲染效果 |
x-heycloud-render-cache | String | 否 | 渲染结果的缓存时间,单位秒 |
x-heycloud-render-timeout | String | 否 | 渲染的超时时间,单位秒 |
x-heycloud-render-limit | String | 否 | 渲染的对象数量限制,<=0 即不作限制,该值只对数据库有效 |
# 请求参数:
# Params&Query:
字段 | 类型 | 说明 |
---|---|---|
uid | String | 渲染配置的唯一标识,配置的变化会导致 uid 的变化 |
z | String | 瓦片的层级 |
x | String | 瓦片 x 方向的索引 |
y | String | 瓦片 y 方向的索引 |
scale | String | 渲染的缩放比例,用于高清出图 |
format | String | 图片格式,支持 png/jpeg/webp |
# 请求示例:
GET http://host:port/heycloud/api/render/map/:uid/tile/:z/:x/:y/:scale/image.:format
# 正确响应示例:
{image/*}
# 错误响应示例:
{
"error": "ERROR",
"message": "错误信息"
}
# 按地图范围渲染为图片
# 请求 URL:
http://host:port/heycloud/api/render/map/:uid/:bbox/:width/:height/:scale/image.:format
# 请求方式:
- GET
# 请求 Header:
字段 | 类型 | 是否必选 | 说明 |
---|---|---|---|
x-heycloud-admin-session | String | 否 | 通过 session 提供管理权限 |
x-heycloud-account-id | String | 否 | 帐号的唯一标识符 |
x-heycloud-render-disable-cache | String | 否 | 如为字符串'true'则不使用缓存数据,确保为最新的渲染效果 |
x-heycloud-render-cache | String | 否 | 渲染结果的缓存时间,单位秒 |
x-heycloud-render-timeout | String | 否 | 渲染的超时时间,单位秒 |
x-heycloud-render-limit | String | 否 | 渲染的对象数量限制,<=0 即不作限制,该值只对数据库有效 |
# 请求参数:
# Params&Query:
字段 | 类型 | 说明 |
---|---|---|
uid | String | 渲染配置的唯一标识,配置的变化会导致 uid 的变化 |
bbox | String | 逗号分隔的地图范围,格式为 xmin,ymin,xmax,ymax |
width | Number | 渲染结果的宽度,单位像素 |
height | Number | 渲染结果的高度,单位像素 |
scale | Number | 渲染的缩放比例,用于高清出图 |
format | String | 图片格式,支持 png/jpeg/webp |
# 请求示例:
GET http://host:port/heycloud/api/render/map/:uid/:bbox/:width/:height/:scale/image.:format
# 正确响应示例:
{image/*}
# 错误响应示例:
{
"error": "ERROR",
"message": "错误信息"
}
# WMS 接口
# 请求 URL:
http://host:port/heycloud/api/render/map/:uid/wms
# 请求方式:
- GET
# 请求 Header:
字段 | 类型 | 是否必选 | 说明 |
---|---|---|---|
x-heycloud-admin-session | String | 否 | 通过 session 提供管理权限 |
x-heycloud-account-id | String | 否 | 帐号的唯一标识符 |
x-heycloud-render-disable-cache | String | 否 | 如为字符串'true'则不使用缓存数据,确保为最新的渲染效果 |
x-heycloud-render-cache | String | 否 | 渲染结果的缓存时间,单位秒 |
x-heycloud-render-timeout | String | 否 | 渲染的超时时间,单位秒 |
x-heycloud-render-limit | String | 否 | 渲染的对象数量限制,<0 即不作限制,该值只对数据库有效 |
# 请求参数:
# Params:
字段 | 类型 | 说明 |
---|---|---|
uid | String | 渲染配置的唯一标识,配置的变化会导致 uid 的变化 |
# Query:
字段 | 类型 | 说明 |
---|---|---|
request | String | 操作,可选 GetCapabilities/GetMap |
bbox | String | 逗号分隔的渲染范围 |
width | Number | 图片的像素宽度 |
height | Number | 图片的像素高度 |
format | String | 图片格式,image/png image/jpeg image/webp |
format_options | String | WMS 的格式选项,如 dpi:140 |
# 请求示例:
GET http://host:port/heycloud/api/render/map/:uid/wms?request=GetMap&bbox=15654303,4696291,15967389,5009377&width=256&height=256&format=image/png
# WMTS GetCapabilities/GetTile KVP 接口
# 请求 URL:
http://host:port/heycloud/api/render/map/:uid/wmts
# 请求方式:
- GET
# 请求 Header:
字段 | 类型 | 是否必选 | 说明 |
---|---|---|---|
x-heycloud-admin-session | String | 否 | 通过 session 提供管理权限 |
x-heycloud-account-id | String | 否 | 帐号的唯一标识符 |
x-heycloud-render-disable-cache | String | 否 | 如为字符串'true'则不使用缓存数据,确保为最新的渲染效果 |
x-heycloud-render-cache | String | 否 | 渲染结果的缓存时间,单位秒 |
x-heycloud-render-timeout | String | 否 | 渲染的超时时间,单位秒 |
x-heycloud-render-limit | String | 否 | 渲染的对象数量限制,<0 即不作限制,该值只对数据库有效 |
# 请求参数:
# Params:
字段 | 类型 | 说明 |
---|---|---|
uid | String | 渲染配置的唯一标识,配置的变化会导致 uid 的变化 |
# Query:
字段 | 类型 | 说明 |
---|---|---|
request | String | 操作,可选 GetCapabilities/GetTile |
style | String | 样式,可选 defaultStyle/retinaStyle |
tileMatrix | Number | 瓦片的层级 |
tileCol | Number | 瓦片 x 方向的索引 |
tileRow | Number | 瓦片 y 方向的索引 |
format | String | 图片格式,支持 png/jpeg/webp |
# 请求示例:
GET http://host:port/heycloud/api/render/map/:uid/wmts?request=GetTile&tileMatrix=0&tileRow=0&tileCol=0&format=png
# WMTS GetCapabilities RESTful 接口
# 请求 URL:
http://host:port/heycloud/api/render/map/:uid/wmts/:version/WMTSCapabilities.xml
# 请求方式:
- GET
# 请求参数:
# Params:
字段 | 类型 | 说明 |
---|---|---|
uid | String | 渲染配置的唯一标识,配置的变化会导致 uid 的变化 |
version | String | WMTS 版本,前只应为 1.0.0 |
# 请求示例:
GET http://host:port/heycloud/api/render/map/:uid/wmts/1.0.0/WMTSCapabilities.xml
# WMTS GetTile RESTful 接口
# 请求 URL:
http://host:port/heycloud/api/render/map/:uid/wmts/tile/:version/:layer/:style/:tileMatrixSet/:tileMatrix/:tileRow/:tileCol.:format
# 请求方式:
- GET
# 请求 Header:
字段 | 类型 | 是否必选 | 说明 |
---|---|---|---|
x-heycloud-admin-session | String | 否 | 通过 session 提供管理权限 |
x-heycloud-account-id | String | 否 | 帐号的唯一标识符 |
x-heycloud-render-disable-cache | String | 否 | 如为字符串'true'则不使用缓存数据,确保为最新的渲染效果 |
x-heycloud-render-cache | String | 否 | 渲染结果的缓存时间,单位秒 |
x-heycloud-render-timeout | String | 否 | 渲染的超时时间,单位秒 |
x-heycloud-render-limit | String | 否 | 渲染的对象数量限制,<0 即不作限制,该值只对数据库有效 |
# 请求参数:
# Params:
字段 | 类型 | 说明 |
---|---|---|
uid | String | 渲染配置的唯一标识,配置的变化会导致 uid 的变化 |
version | String | WMTS 版本,目前只应为 1.0.0 |
layer | String | 图层,目前只应为 defaultLayer |
style | String | 样式,可选 defaultStyle/retinaStyle |
tileMatrixSet | String | 瓦片层级定义,目前只应为 defaultTileMatrixSet |
tileMatrix | String | 瓦片的层级 |
tileCol | String | 瓦片 x 方向的索引 |
tileRow | String | 瓦片 y 方向的索引 |
format | String | 图片格式,支持 png/jpeg/webp |
# 请求示例:
GET http://host:port/heycloud/api/render/map/:uid/wmts/tile/1.0.0/defaultLayer/retinaStyle/defaultTileMatrixSet/0/0/0.png