map


URI

<maps_uri>/{id}[.<format>]

支持的方法

GETPUTDELETEHEAD

父资源

maps

子资源

mapStatusmapShareSettingmapVisitCount

介绍

地图资源。支持查看、修改和删除操作。

支持的方法:

支持的表述格式:rjson、json、html、xml。

资源层次

HTTP 请求方法

对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiportal 是服务器名。

http://supermapiportal:8090/iportal/web/maps/{id}.rjson

GET 请求

获取指定的地图信息。

响应结构

对 map 资源执行 GET 请求,返回的资源表述结构如下:

名称 类型 含义
authorizeSetting List<IportalAuthorizeEntity> 授权信息。
center Point2D 地图的中心点。
controls List<String> 地图显示控件集合。
createTime Long 地图的创建时间。
description String 地图描述信息。
epsgCode Integer 投影坐标系对应的 EPSG 代码。
extent Rectangle2D 地图的范围。
id Integer 地图的标识。
isDefaultBottomMap Boolean 是否是默认底图。
layers List<Layer> 地图的图层列表。
level Integer 地图的缩放级别。
nickname String 用户的昵称。
sourceType SourceType 地图的来源类型。
status ViewerMapStatus 地图状态 save、publish。该参数已过期,即 SuperMap iPortal 8C 版或更高版本将不再沿用此参数。
tags List<String> 地图标签。
thumbnail String 地图的缩略图路径。
title String 地图名称。

units

String 地图的单位。默认是'degrees'。可选值为'degrees'(或者'dd')、‘m’、'ft'、'km'、'mi'、'inches'。

updateTime

Long 地图的更新时间。

userName

String 用户的标识。

visitCount

Integer 地图的访问次数。

响应示例

对 map 资源:http://localhost:8090/iportal/web/maps/3.rjson 执行 GET 请求,返回的 rjson 格式的表述如下:

{

    "authorizeSetting": [

        {

            "aliasName": "admin",

            "entityId": null,

            "entityName": "admin",

            "entityType": "USER",

            "permissionType": "DELETE"

        }

    ],

    "center": {

        "x": 4503.62403215259,

        "y": -3861.91147219247

    },

    "centerString": "{\"x\":4503.624032152586,\"y\":-3861.911472192471}",

    "controls": null,

    "controlsString": "",

    "createTime": 1471500923499,

    "description": null,

    "epsgCode": -1000,

    "extent": null,

    "extentString": "",

    "id": 3,

    "isDefaultBottomMap": false,

    "layers": [

        {

            "bounds": {

                "bottom": -7668.24529207453,

                "left": 48.397189336313,

                "leftBottom": {

                    "x": 48.397189336313,

                    "y": -7668.24529207453

                },

                "right": 8958.85087496886,

                "rightTop": {

                    "x": 8958.85087496886,

                    "y": -55.5776523104111

                },

                "top": -55.5776523104111

            },

            "boundsString": "{\"top\":-55.577652310411075,\"left\":48.39718933631297,\"bottom\":-7668.245292074532,\"leftBottom\":{\"x\":48.39718933631297,\"y\":-7668.245292074532},\"right\":8958.850874968857,\"rightTop\":{\"x\":8958.850874968857,\"y\":-55.577652310411075}}",

            "cartoCSS": null,

            "datasourceName": null,

            "features": null,

            "featuresString": "null",

            "id": 3,

            "identifier": null,

            "isVisible": true,

            "layerType": null,

            "mapId": 3,

            "markers": null,

            "markersString": "null",

            "name": null,

            "opacity": 1,

            "prjCoordSys": {

                "coordSystem": null,

                "coordUnit": "METER",

                "distanceUnit": "METER",

                "epsgCode": -1000,

                "name": "平面坐标系---m",

                "projection": null,

                "projectionParam": null,

                "type": "PCS_NON_EARTH"

            },

            "prjCoordSysString": "{\"distanceUnit\":\"METER\",\"projectionParam\":null,\"epsgCode\":-1000,\"coordUnit\":\"METER\",\"name\":\"平面坐标系---m\",\"projection\":null,\"type\":\"PCS_NON_EARTH\",\"coordSystem\":null}",

            "scales": null,

            "scalesString": "null",

            "style": null,

            "styleString": "null",

            "subLayers": null,

            "subLayersString": "null",

            "title": "长春市区图",

            "type": "SUPERMAP_REST",

            "url": "http://192.168.112.217:8090/iserver/services/map-changchun/rest/maps/长春市区图",

            "zindex": null

        }

    ],

    "level": null,

    "nickname": "admin",

    "resolution": 0,

    "sourceType": "SUPERMAP_REST",

    "status": null,

    "tags": [

        "changchun"

    ],

    "thumbnail": "http://192.168.112.217:8090/iserver/services/map-changchun/rest/maps/%E9%95%BF%E6%98%A5%E5%B8%82%E5%8C%BA%E5%9B%BE/entireImage.png",

    "title": "长春市区图",

    "units": null,

    "updateTime": 1471500923517,

    "userName": "admin",

    "visitCount": 1

}

PUT 请求

修改指定的地图信息。只有授权是可编辑的地图,才能修改,即"permissionType": "READWRITE"。

请求参数

发送请求时,需要在请求体中传递如下参数:

名称 类型 含义

units

String 地图的单位。默认是'degrees'。可选值为'degrees'(或者'dd')、‘m’、'ft'、'km'、'mi'、'inches'。
level Integer 地图的缩放级别。
center Point2D 地图的中心点。
controls List<String> 地图显示控件集合。
description String 地图描述信息。
epsgCode Integer 投影坐标系对应的 EPSG 代码。
extent Rectangle2D 地图的范围。
status ViewerMapStatus 地图状态 save、publish。该参数已过期,即 SuperMap iPortal 8C 版或更高版本将不再沿用此参数。
tags List<String> 地图标签。
layers List<Layer> 地图的图层列表。
title String 地图名称。
thumbnail String 地图的缩略图路径。
sourceType SourceType 地图的来源类型。
authorizeSetting List<IportalAuthorizeEntity> 授权信息。

响应结构

返回的资源表述结构如下:

字段 类型 说明
succeed boolean 修改地图是否成功。
error Httperror 出错信息,如果修改地图成功,则没有本字段。

响应示例

修改地图名称,对 map  资源:http://localhost:8090/iportal/web/maps/4.rjson 执行 PUT 请求,发送请求体如下:

{

    "units": null,

    "level": 0,

    "center": {

        "id": "SuperMap.Geometry.Point_62",

        "x": 0,

        "y": -2.2351741790771E-08

    },

    "controls": [],

    "description": "暂无描述信息",

    "epsgCode": 3857,

    "extent": {

        "left": -80306576.405087,

        "bottom": -51659201.196255,

        "right": 80306576.405087,

        "top": 51659201.196255

    },

    "thumbnail": "http://192.168.120.40:8091/iserver/services/map-china400/rest/maps/China/entireImage.png",

    "scale": 1.69016357160266E-09,

    "authorizeSetting": [

        {

            "permissionType": "DELETE",

            "aliasName": "admin",

            "entityType": "USER",

            "entityName": "admin",

            "entityId": null

        },

        {

            "permissionType": "READ",

            "aliasName": "GUEST",

            "entityType": "USER",

            "entityName": "GUEST",

            "entityId": null

        }

    ],

    "status": null,

    "title": "China_test",

    "tags": [

        "系统地图"

    ],

    "userName": "admin",

    "sourceType": "SUPERMAP_REST",

    "visitCount": 4,

    "resolution": 156543.033928045,

    "id": null,

    "layers": [

        {

            "title": "China",

            "url": "http://192.168.120.40:8091/iserver/services/map-china400/rest/maps/China",

            "opacity": 1,

            "zindex": 0,

            "type": "SUPERMAP_REST",

            "layerType": "BASE_LAYER",

            "name": null,

            "bounds": {

                "left": -20037508.342789,

                "bottom": -20037508.342789,

                "right": 20037508.342789,

                "top": 20037508.342789

            }

        }

    ]

}

则返回的 rjson 格式响应结果如下:

{ "succeed": true}

DELETE 请求

删除指定 id 的地图。

响应结构

返回的资源表述结构如下:

字段 类型 说明
succeed boolean 删除地图是否成功。
error Httperror 出错信息,如果删除地图成功,则没有本字段。

响应示例

对 map 资源:http://localhost:8090/iportal/web/maps/8.rjson 执行 DELETE 请求,返回的 rjson 格式响应结果如下:

{ "succeed": true}

HEAD 请求

返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。

HEAD 请求可以用来判断 map 资源是否存在,或者客户端是否有权限访问 map 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 map 资源是否支持<format>格式的表述。

请参见