map


URI

1.<maps_uri>/{mapName}[.<format>]

2.<maps_uri>/{mapIndex}[.<format>]

Supported methods

GET, HEAD

Parent resource

maps

Child resources

image, entireImage, overview, trackingLayer, layers, tempLayersSet, distance, area, chartFeatureInfoSpecs, queryResults, tileImage, highlightImage, clearCache, symbol, prjCoordSys, zxyTileImage

Introduction

The map resource provides entrance for accessing online map resource. A map resource can be used to retrieve basic status information of the map, such as its center, scale, map extent, image size, map unit, layers contained, images contained, etc. You can create a temp layer set through the map resource.

When performing a GET request on a map resource, you can get flash, flash3d, silverlight, javascript, supermapcloud and tianditu representations aiming at the applications of Flash client, Flash3D client, Silverlight client, JavaScript client, SuperMapCloud application and Tianditu application which achieve simple map functions. KML is another possible output format if you implement the GET request on the map resource. For example, the kml URI http://supermapiserver:8090/iserver/services/map-world/rest/maps/World%20Map.kml can be directly opened and displayed in GoogleEarth.

According to state regulations, data of SuperMap cloud and TianDiTu are decrypted, thus for the supermapcloud representation, the current map and the cloud services layer may have deviations; for the TianDiTu representation, the current map and the TianDiTu layer may have deviations.

Please refer to Gets map parameters for information about this resource usage.

Supported Methods:

Supported output formats: RJSON, JSON, JSONP, HTML, XML, KML, Flex, Flash3D, Silverlight, JavaScript, SuperMapCloud.

Resource hierarchy

resources.htm maps.htm map.htm

HTTP request methods

Implement the HTTP request on the following URI, where supermapiserver is the server name and WorldMap is the map name {mapName}, with rjson being the output format.

http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap.rjson

GET request

Get the basic information of the current map status, including the center, scale, the display extent, the size of the image output, the map unit, and the distance unit, etc. When performing dynamic projection, viewBounds is the enclosing rectangle of the polygon of the target projection, other map status parameters will also be changed, like center and scale.

URI parameters

There are two types of URI corresponding to the map resource, mapName will be matched in higher priority:

1st Type: <maps_uri>/{mapName}[.<format>], the map resource is identified with specific map name {mapName}.

2nd Type: <maps_uri>/{mapIndex}[.<format>], the map resource is identified with specific map index {mapIndex}, which starts from 0, following with 1, 2, 3, etc.

Request parameter

In URI, parameters that can be passed after "?" includes:

Name Type Description
_cache boolean [Optional parameter]
Whether to use cache, the default is True. False means close all the caches.
prjCoordSys

PrjCoordSys

[Optional parameter]
Used to specify the coordinate system of the requested map, the server will return the map status information according to the coordinate system specified.
If this parameter is null, the status information of the map of the original coordinate system will be returned by default; if specify a different coordinate system, the server will perform dynamic projection and return the map status information.

When using this parameter, it need to be constructed by the fields in PrjCoordSys, input coordinate system by just passing epsgCode is also supported, such as:

prjCoordSys={"epsgCode":3857}.
queryResultID

String

[Optional parameters] [Supported in JavaScript formulation]
Used to display the map query result.
The map query result (queryResult) can be displayed through the JavaScript formulation of map resource, such as queryResultID=eiicoeik_889fa578956b4c90bb8aa841e5abfb7d.

Map Locating

 Flash, flash3d, silverlight and javascript representations support for positioning the map in the URI. For example, after getting the flash representation of the map named WorldMap with URI:http://supermapiserver:8090/iserver/services/map-world/rest/maps/World+Map.flash, the scale of the map and the coordinates of the center point will be automatically displayed after "#" of URI in the pattern of "scale/center X/center Y", e.g: by dragging or zooming map, http://supermapiserver:8090/iserver/services/map-world/rest/maps/World+Map.ifx#3.691951051719594e-8/10767652.46246/4260478.7946309 changes the viewBounds of the map, which will automatically update the scale in URI and the coordinates of the center point. User can quickly resolve the scale and the coordinates of the center point with the URI of the current map to position the map.

Dynamic Projection

The REST Map service in SuperMap iServer supports the publish of maps in all kinds of coordinate systems, and the dynamic projection of the maps (planar coordinate system without projection is not supported).

The usage of REST map service dynamic projection is as follows:

  1. Get the map status after dynamic projection: get the status of the current map through the GET operation of map resource, including the target projected coordinate system list that the current map supported, then pass prjCoordSys parameter through GET request and get the map information after dynamic projection, like prjCoordSys={"epsgCode":3857}.
  2. Get the map image after dynamic projection: implement GET request on output resources, like image, entireImage or tileImage and pass prjCoordSys parameter to get the map images after dynamic projection.

Note that the status information like unit, center, scale, map extent will be different after the dynamic projection. When implementing dynamic projection on map resource, the extent is the viewBounds of the map in the target projection, and the viewBounds is the enclosing rectangle of the polygon after projection, like image, entireImage, tileImage, the default coordinate system of these resources is in accordance with the current coordinate of the map resource.

Please refer to: EPSG Code supported by iServer for information about EPSG Code supported by Supermap iServer.

Response structure

When implementing the GET request on the map resource, the representation of the resource returned is included in the entity body of the response message, as shown below:  

Field Type Description
name String The name of the current map.
center Point2D The center point for map display.
scale double Specify the scale of the map. See definition of scale.
maxScale double The maximum display scale of the map. 0 indicates no limit on the display scale.
minScale double The minimum display scale of the map. 0 indicates no limit on the display scale.
bounds Rectangle2D The full spatial extent of the map.
viewBounds Rectangle2D The extent of the map window display region, it is a rectangle frame.
If dynamic projection has set for the map, this parameter represent the enclosing rectangle of the polygon converted by the viewBounds.
viewer The rectangle object The viewer, or the size of the image to be generated.
prjCoordSys PrjCoordSys Returns the coordinate system of the current map.
dynamicPrjCoordSyses PrjCoordSys Returns the target projected coordinate system list that the current map supports.

If the current coordinate system supports all kinds of coordinate systems of dynamic projection, epsgCode=0, type=PCS_ALL.

customParams String The custom parameter.
They can be strings with any combination of characters. This is for users to pass any custom parameters.
userToken UserInfo The user information.
clipRegion Geometry The clip region for map display.
clipRegionEnabled boolean Whether clipRegion is enabled.
customEntireBounds Rectangle2D The custom entire bounds.
customEntireBoundsEnabled boolean Whether the enable custom entire bounds.
angle double The rotation angle of the map.
antialias boolean Whether the map is anti-alias.
backgroundStyle Style The background style of the map.
colorMode MapColorMode The color mode of the map.
coordUnit Unit The map coordinate unit.
distanceUnit Unit The unit for distance measurement.
description String The description of the map.
dynamicProjection boolean Whether to allow dynamic projection while displaying the map.
markerAngleFixed boolean Whether the angle of marker symbols is fixed.
maxVisibleTextSize double The maximum visible size (in pixels) of the text.
maxVisibleVertex int

The maximum visible vertices of the geometric object.

If a geometric feature has more than maxVisibleVertex vertices, it will not be displayed.

minVisibleTextSize double The minimum visible size (in pixels) of the text.
overlapDisplayed boolean Whether to display overlapped features.
paintBackground boolean Whether to render the background of the map.
textAngleFixed boolean Whether the angles of the text are fixed.
textOrientationFixed boolean Whether the orientations of the text are fixed.

Example usage

When implementing a GET requestion on the map resource with WorldMap: http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap.rjson, the representation of the returned resource in rjson format will be as follows:

{

    "angle": 0,

    "antialias": true,

    "backgroundStyle": {

        "fillBackColor": {

            "blue": 255,

            "green": 255,

            "red": 255

        },

        "fillBackOpaque": true,

        "fillForeColor": {

            "blue": 255,

            "green": 255,

            "red": 255

        },

        "fillGradientAngle": 0,

        "fillGradientMode": "NONE",

        "fillGradientOffsetRatioX": 0,

        "fillGradientOffsetRatioY": 0,

        "fillOpaqueRate": 100,

        "fillSymbolID": 0,

        "lineColor": {

            "blue": 0,

            "green": 0,

            "red": 0

        },

        "lineSymbolID": 0,

        "lineWidth": 0.1,

        "markerAngle": 0,

        "markerSize": 2.4,

        "markerSymbolID": 0

    },

    "bounds": {

        "bottom": -90,

        "left": -180,

        "leftBottom": {

            "x": -180,

            "y": -90

        },

        "right": 180,

        "rightTop": {

            "x": 180,

            "y": 90

        },

        "top": 90

    },

    "cacheEnabled": true,

    "center": {

        "x": 96.1736997712,

        "y": 27.5734580668

    },

    "clipRegion": {

        "center": null,

        "id": 0,

        "parts": null,

        "points": null,

        "style": null,

        "type": "REGION"

    },

    "clipRegionEnabled": false,

    "colorMode": "DEFAULT",

    "coordUnit": "DEGREE",

    "customEntireBounds": null,

    "customEntireBoundsEnabled": false,

    "customParams": "",

    "description": "",

    "distanceUnit": "METER",

    "dynamicPrjCoordSyses": [{

        "coordSystem": null,

        "coordUnit": null,

        "distanceUnit": null,

        "epsgCode": 0,

        "name": null,

        "projection": null,

        "projectionParam": null,

        "type": "PCS_ALL"

    }],

    "dynamicProjection": false,

    "markerAngleFixed": false,

    "maxScale": 1.000000000000032E12,

    "maxVisibleTextSize": 1000,

    "maxVisibleVertex": 3600000,

    "minScale": 0,

    "minVisibleTextSize": 0.3,

    "name": "WorldMap",

    "overlapDisplayed": true,

    "paintBackground": true,

    "prjCoordSys": {

        "coordSystem": {

            "datum": {

                "name": "D_WGS_1984",

                "spheroid": {

                    "axis": 6378137,

                    "flatten": 0.0033528107,

                    "name": "WGS_1984",

                    "type": "SPHEROID_WGS_1984"

                },

                "type": "DATUM_WGS_1984"

            },

            "name": "GCS_WGS_1984",

            "primeMeridian": {

                "longitudeValue": 0,

                "name": "Greenwich",

                "type": "PRIMEMERIDIAN_GREENWICH"

            },

            "spatialRefType": "SPATIALREF_EARTH_LONGITUDE_LATITUDE",

            "type": "GCS_WGS_1984",

            "unit": "DEGREE"

        },

        "coordUnit": "DEGREE",

        "distanceUnit": "METER",

        "epsgCode": 4326,

        "name": "Longitude / Latitude Coordinate System---GCS_WGS_1984",

        "projection": null,

        "projectionParam": null,

        "type": "PCS_EARTH_LONGITUDE_LATITUDE"

    },

    "resourceParameter": null,

    "scale": 2.563206512274041E-8,

    "textAngleFixed": false,

    "textOrientationFixed": false,

    "userToken": {"userID": ""},

    "viewBounds": {

        "bottom": 15.704362017314319,

        "left": 84.30460372171433,

        "leftBottom": {

            "x": 84.30460372171433,

            "y": 15.704362017314319

        },

        "right": 108.04279582068568,

        "rightTop": {

            "x": 108.04279582068568,

            "y": 39.442554116285685

        },

        "top": 39.442554116285685

    },

    "viewer": {

        "bottom": 256,

        "height": 256,

        "left": 0,

        "leftTop": {

            "x": 0,

            "y": 0

        },

        "right": 256,

        "rightBottom": {

            "x": 256,

            "y": 256

        },

        "top": 0,

        "width": 256

    },

    "visibleScales": [],

    "visibleScalesEnabled": false

}

To get the map projected to WebMercator, set prjCoordSys={"epsgCode":3857}, implement GET request on World map resource: http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap.rjson?prjCoordSys={"epsgCode":3857}, the representation of the returned resource in rjson format will be as follows:

{

    "angle": 0,

    "antialias": true,

    "backgroundStyle": {

        "fillBackColor": {

            "blue": 255,

            "green": 255,

            "red": 255

        },

        "fillBackOpaque": true,

        "fillForeColor": {

            "blue": 255,

            "green": 255,

            "red": 255

        },

        "fillGradientAngle": 0,

        "fillGradientMode": "NONE",

        "fillGradientOffsetRatioX": 0,

        "fillGradientOffsetRatioY": 0,

        "fillOpaqueRate": 100,

        "fillSymbolID": 0,

        "lineColor": {

            "blue": 0,

            "green": 0,

            "red": 0

        },

        "lineSymbolID": 0,

        "lineWidth": 0.1,

        "markerAngle": 0,

        "markerSize": 2.4,

        "markerSymbolID": 0

    },

    "bounds": {

        "bottom": -2.5776731363158423E7,

        "left": -2.0037508342789244E7,

        "leftBottom": {

            "x": -2.0037508342789244E7,

            "y": -2.5776731363158423E7

        },

        "right": 2.0037508342789244E7,

        "rightTop": {

            "x": 2.0037508342789244E7,

            "y": 2.57767313631584E7

        },

        "top": 2.57767313631584E7

    },

    "cacheEnabled": false,

    "center": {

        "x": 1.0706007286235156E7,

        "y": 3258532.6200602674

    },

    "clipRegion": {

        "center": null,

        "id": 0,

        "parts": null,

        "points": null,

        "style": null,

        "type": "REGION"

    },

    "clipRegionEnabled": false,

    "colorMode": "DEFAULT",

    "coordUnit": "DEGREE",

    "customEntireBounds": null,

    "customEntireBoundsEnabled": false,

    "customParams": "",

    "description": "",

    "distanceUnit": "METER",

    "dynamicPrjCoordSyses": [{

        "coordSystem": null,

        "coordUnit": null,

        "distanceUnit": null,

        "epsgCode": 0,

        "name": null,

        "projection": null,

        "projectionParam": null,

        "type": "PCS_ALL"

    }],

    "dynamicProjection": true,

    "markerAngleFixed": false,

    "maxScale": 1.000000000000032E12,

    "maxVisibleTextSize": 1000,

    "maxVisibleVertex": 3600000,

    "minScale": 0,

    "minVisibleTextSize": 0.3,

    "name": "WorldMap",

    "overlapDisplayed": true,

    "paintBackground": true,

    "prjCoordSys": {

        "coordSystem": {

            "datum": {

                "name": "D_WGS_1984",

                "spheroid": {

                    "axis": 6378137,

                    "flatten": 0.0033528107,

                    "name": "WGS_1984",

                    "type": "SPHEROID_WGS_1984"

                },

                "type": "DATUM_WGS_1984"

            },

            "name": "GCS_WGS_1984",

            "primeMeridian": {

                "longitudeValue": 0,

                "name": "Greenwich",

                "type": "PRIMEMERIDIAN_GREENWICH"

            },

            "spatialRefType": "SPATIALREF_EARTH_LONGITUDE_LATITUDE",

            "type": "GCS_WGS_1984",

            "unit": "DEGREE"

        },

        "coordUnit": "METER",

        "distanceUnit": "METER",

        "epsgCode": 3857,

        "name": "User Define",

        "projection": {

            "name": "Mercator",

            "type": "PRJ_MERCATOR"

        },

        "projectionParam": {

            "azimuth": 0,

            "centralMeridian": 0,

            "centralParallel": 0,

            "falseEasting": 0,

            "falseNorthing": 0,

            "firstPointLongitude": 0,

            "firstStandardParallel": 0,

            "scaleFactor": 0,

            "secondPointLongitude": 0,

            "secondStandardParallel": 0

        },

        "type": "PCS_USER_DEFINED"

    },

    "resourceParameter": null,

    "scale": 2.257298309111974E-8,

    "textAngleFixed": false,

    "textOrientationFixed": false,

    "userToken": {"userID": ""},

    "viewBounds": {

        "bottom": 1758952.3535372897,

        "left": 9206427.019712178,

        "leftBottom": {

            "x": 9206427.019712178,

            "y": 1758952.3535372897

        },

        "right": 1.2205587552758133E7,

        "rightTop": {

            "x": 1.2205587552758133E7,

            "y": 4758112.886583245

        },

        "top": 4758112.886583245

    },

    "viewer": {

        "bottom": 256,

        "height": 256,

        "left": 0,

        "leftTop": {

            "x": 0,

            "y": 0

        },

        "right": 256,

        "rightBottom": {

            "x": 256,

            "y": 256

        },

        "top": 0,

        "width": 256

    },

    "visibleScales": [],

    "visibleScalesEnabled": false

}

HEAD request

Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The meta-information includes the media-type, content-encoding, transfer-encoding, content-length, etc.

The HEAD request helps check the existence of the map resource and whether it can be accessed by the client. By implementing the HEAD request on the URI, with .<format> appended to the end, we can quickly get to know whether the layer resource supports the representation in <format> or not.

See