tempLayers


URI

<tempLayersSet_uri>/{tempLayersID}[.<format>]

Supported methods

GET, PUT, DELETE, HEAD

Parent resource

tempLayersSet

Child resources

tempLayer

Introduction

A tempLayers resource is a temporary layer set, which can be output as a map image. A tempLayers resource is identified with tempLayersID. Via the tempLayers resource, you can get the list of layers in the temporary layer set, or modify the layers in it. For the life cycle of the resource, see Life cycle of temporary resources.

Supported methods

Supported output formats:rjson, json, html, xml, jsonp.

GIS Services Resource Hierarchy

root maps map tempLayersSet tempLayers

HTTP request methods

Implement the HTTP request on the following URI, where supermapiserver is the server name, WorldMap is the map name (mapName), 92ecaz23_05b8193fe4fa4700b82c6d41d0d98539 is a temporary layer set in WorldMap, URI represent a temporary layer set with its ID 92ecaz23_05b8193fe4fa4700b82c6d41d0d98539.

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

GET Request

Gets the list of layers in the temporary layer set (tempLayersID).

Request parameters

Field Type Definition
_cache boolean [Optional parameters]
Whether to use cache, the default is True. False means close all the caches.

Response structure

If you implement the GET request on the tempLayers resource, a temporary layer set will be returned. The layer described by the element in the temporary layer set can be a layer of the type UGCMapLayer, WMSLayer or WFSLayer. All SuperMap layers are sublayers of UGCMapLayer.

The structure of the element in the response collection is shown as below:

Field Type Definition
name String The layer name, used to uniquely identify the layer in the map. None case-sensitive.
bounds double The bounds of the layer.
caption String

The layer caption. By default, it is identical to the layer name. It is displayed in the legend and layer control. Note the different between the caption and the name.

description String The descriptive information about the layer.
queryable boolean Whether the object in the layer is queryable. True indicates it could be queried and false indicates it could not be queried.
visible boolean Whether the layer is visible. When the layer is invisible, all the other property settings will not be allowed.
type LayerType The layer type.
The layer types currently provided by the SuperMap iServer Java are: UGC (SuperMap layer), WFS (WFS layer), WMS (WMS layer), and CUSTOM (custom layer).
subLayers LayerCollection The sublayer set.
In the UGCMapLayer is the layer set for SuperMap data.
completeLineSymbolDisplayed boolean Whether to display the complete line. True indicates to display. False indicates not to display.
maxScale double The maximum visible scale of the layer. The maximum visible scale cannot be negative. When the current display scale is greater than the maximum layer visible scale, this layer will not be displayed.
The default is true.
minScale double The minimum visible scale of the layer. The minimum visible scale cannot be negative. When the current display scale is less than the minimum visible scale, this layer will not be displayed.
The default is true.
minVisibleGeometrySize double The minimum visible size of the geometric objects. Unit: pixels.
opaqueRate int The opacity of the layer, 0-100.
symbolScalable boolean Whether the symbols are allowed to scale up and down with the layer.
True indicates that when a layer is zoomed in or out, the symbols will be also zoomed in or out; False indicates that the symbol size could not scale up or down with the image.
symbolScale double The reference scale of the symbol.
The reference scale of the symbol is valid when symbols are allowed to scale up and down with the layer. The reference scale is the display scale of the layer when the symbol is at its original size.

 

The structure of the tempLayers resource is identical to the request body when implementing the POST request on the templayersSet resource As to the representation in HTML format, the name of the subLayers is in the form of "dataset name@datasource name.number@@map name"; as to that in XML format, it is in the form of "dataset name@datasoruce name#number". The dataset name, datasource name, and index correspond to datasetInfo.name, datasetInfo.dataSourceName, and the order of the layer.

Example usage

Implement the GET request on a tempLayers resource with the ID of 1 with http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/tempLayersSet/92ecaz23_05b8193fe4fa4700b82c6d41d0d98539.rjson and you will get the response in rjson format, as shown below:

[{

    "bounds": {

        "bottom": -90,

        "left": -180,

        "leftBottom": {

            "x": -180,

            "y": -90

        },

        "right": 180,

        "rightTop": {

            "x": 180,

            "y": 90

        },

        "top": 90

    },

    "caption": null,

    "completeLineSymbolDisplayed": false,

    "description": "",

    "maxScale": 0,

    "minScale": 0,

    "minVisibleGeometrySize": 0,

    "name": "WorldMap",

    "opaqueRate": 100,

    "queryable": false,

    "subLayers": {"layers": [{

        "bounds": {

            "bottom": -90,

            "left": -180,

            "leftBottom": {

                "x": -180,

                "y": -90

            },

            "right": 180,

            "rightTop": {

                "x": 180,

                "y": 83.62359619140630

            },

            "top": 83.62359619140630

        },

        "caption": "Countries@World",

        "completeLineSymbolDisplayed": false,

        "datasetInfo": {

            "bounds": {

                "bottom": -90,

                "left": -180,

                "leftBottom": {

                    "x": -180,

                    "y": -90

                },

                "right": 180,

                "rightTop": {

                    "x": 180,

                    "y": 83.62359619140630

                },

                "top": 83.62359619140630

            },

            "dataSourceName": "World",

            "description": null,

            "encodeType": null,

            "isReadOnly": false,

            "name": "Countries",

            "prjCoordSys": null,

            "tableName": null,

            "type": "REGION"

        },

        "description": "",

        "displayFilter": "",

        "joinItems": null,

        "maxScale": 0,

        "minScale": 0,

        "minVisibleGeometrySize": 0.4,

        "name": "Countries@World",

        "opaqueRate": 100,

        "queryable": true,

        "representationField": "",

        "style": {

            "fillBackColor": {

                "blue": 255,

                "green": 255,

                "red": 255

            },

            "fillBackOpaque": true,

            "fillForeColor": {

                "blue": 233,

                "green": 239,

                "red": 242

            },

            "fillGradientAngle": 0,

            "fillGradientMode": "NONE",

            "fillGradientOffsetRatioX": 0,

            "fillGradientOffsetRatioY": 0,

            "fillOpaqueRate": 100,

            "fillSymbolID": 0,

            "lineColor": {

                "blue": 128,

                "green": 128,

                "red": 128

            },

            "lineSymbolID": 0,

            "lineWidth": 0.1,

            "markerAngle": 0,

            "markerSize": 2.4,

            "markerSymbolID": 0

        },

        "subLayers": {},

        "symbolScalable": false,

        "symbolScale": 0,

        "type": "UGC",

        "ugcLayerType": "VECTOR",

        "visible": true

    }]},

    "symbolScalable": false,

    "symbolScale": 0,

    "type": "UGC",

    "visible": true

}]

PUT request

Modify the temp layer, tempLayers resource. This requires the name attribute and description information of the modified field be included in the request body.

Request parameters

To implement PUT request to modify the layer set, the name attribute and the changed fields should be included in the PUT request body as parameters,if the parameters are legal, the server will modify the corresponding temporary layer set of the URI, tempLayers resource, and the parameter information will be transferred in the request body.

To modify a tempLayers resource, just need to put the name attribute and the information in changed fields into the request body and transfer to the server, the parameter structure is in accordance with the representation structure of layers resources. Please see the response structure of the GET request for the layers resource.

Please note that if you want to modify an element in the temporary layer set, parameters included in the request body to represent the temporary layer set must be consistent with those returned by implementing the GET request on the tempLayers resource and the element must be of the type UGCMapLayer. More specifically, elements corresponding to WMSLayers and WFSLayers cannot be modified.

Response structure

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

Name Type Description
succeed boolean

Whether the create new layer operation is successful. If not, there would be an error message.

error HttpError An error message. If successful, the field will be absent.

Example usage

When you implement the PUT request on http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/tempLayersSet/92ecaz23_05b8193fe4fa4700b82c6d41d0d98539.rjson to change the queryable property of the Countries layer in the temporary layer set to true, parameters included in the request body are as follows:

[

    {

    "name": "WorldMap",

    "subLayers":{

      "layers": [{

            "name": "Countries@World#1",      

            "queryable": true

                       }

                     ]

                }

     }

]

The response in rjson format is as follows:

{

    "succeed": true

}

DELETE

Deletes the temporary layer set resource. If the temporary layer set doesn't exist, the status code 404 will be returned.

Response structure

None. Implement the DELETE request on the tempLayers resource and you will get the response indicating whether the delete operation is successful.

Name Type Description
succeed boolean If the operation was successful.
error HttpError An error message, if the operation is successful, you do not have this field.

Example usage

Implement the DELETE request on the tempLayers resource with http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/tempLayersSet/1.rjson to delete the temporary layer set with the ID of 1 and you will get the response in rjson format, as shown below:

{

    "succeed": true

}

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 tempLayers 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 tempLayers resource supports the representation in <format> or not.

See