# 底图

# 查询所有底图列表

# 请求 URL:

  • http://host:port/heycloud/api/base/basemap/list

# 请求方式:

  • GET

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限

# 请求示例:

GET http://host:port/heycloud/api/base/basemap/list

# 正确响应示例:

{
  "result": {
    "internal": [
      // 内置地图
      {
        "id": "50b157a5-2839-4b97-84f7-04970f51d5f3",
        "title": "默认内置地图",
        "thumb": "thumbs/basemap-unknown.png",
        "type": "geohey-default",
        "parameters": null,
        "sr": "web-mercator",
        "createdAt": "2021-03-04T04:31:02.636Z",
        "updatedAt": null,
        "enable": true
      }
    ],
    "external": [
      // 外部地图

      {
        "id": "856bd682-f696-46db-a2f8-64c75ebceb32",
        "title": "OSM",
        "thumb": "thumbs/basemap-osm.png",
        "type": "osm",
        "parameters": null,
        "sr": "web-mercator",
        "createdAt": "2021-03-04T04:30:59.772Z",
        "updatedAt": null,
        "enable": true
      }
    ]
  }
}

# 错误响应示例:

{
  "error": "Error",
  "message": "错误信息"
}

# 添加一个外部底图

# 请求 URL:

  • http://host:port/heycloud/api/base/basemap/external/add

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限

# 请求参数:

参数名称 可选值 类型 是否必须 默认值 说明
title - String - 底图的标题
thumb - String - 底图的缩略图
type - String - 底图的类型,如 xyz、wmts
parameters - Object - 底图的参数
└url - String - url
sr web-mercator | wgs-84 | cgcs-2000 | gcj-02 | bd-09 String - 坐标系统

# 请求示例:

POST http://host:port/heycloud/api/base/basemap/external/add

{
  "title": "示例底图",
  "thumb": "thumbs/basemap-xyz.png",
  "type": "xyz",
  "parameters": {"url": "http://.../{z}/{x}/{y}"},
  "sr": "web-mercator"
}

# 正确响应示例:

{
  "result": {
    "id": "xxx",
    "createdAt": "..."
  }
}

# 错误响应示例:

{
  "error": "Error",
  "message": "错误信息"
}

# 删除一个外部底图

# 请求 URL:

  • http://host:port/heycloud/api/base/basemap/external/:basemapId

# 请求方式:

  • DELETE

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限

# 请求参数:

参数名称 类型 是否必须 默认值 说明
basemapId String - 底图 ID

# 请求示例:

DELETE http://host:port/heycloud/api/base/basemap/external/xxxxx

# 正确响应示例:

{
  "result": {
    "id": "3f79e1ac-d091-498d-8be6-1a4f54299999",
    "deletedAt": "2021-03-12T02:58:48.651Z"
  }
}

# 错误响应示例:

{
  "error": "Error",
  "message": "错误信息"
}