<map_uri>/templayersset[.<format>]
ERROR: Variable (map_link) is undefined.
The temporary layer set is a child resource of the map resource. By implementing POST on the tempLayersSet resource, one can create temporary layer sets, i.e. the tempLayers resource--each tempLayers resource corresponds to a temporary map. For the living time of the created tempLayersset on the server, please refer to Life Cycle of Temporary Resources.
Supported Methods:
Supported output formats: rjson, json, html, xml.
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/tempLayersSet.rjson
Gets the list of all the temporary layer sets.
Name | Type | Description |
_cache | boolean | [Optional parameter] Whether to use cache, the default is True. False means close all the caches. |
When implementing GET on the tempLayersSet resource, it returns the information about the temporary layer set included in WorldMap. The response is an array of descriptions of temporary layer sets. Each element in the array includes the information about one temporary layer set, which is represented in the following structure:
Field | Type | Description |
name | String | Name of the temporary layer set. |
path | String | Path to the temporary layer set. |
resourceConfigID | String | The configuration item ID of the resource. |
resourceType | String | The resource type. |
supportedMediaTypes | String[] | The media-type of the supported representation. |
When implementing GET on the tempLayersSet resource, it returns the following representation in rjson format:
[{
"name": "1",
"path": "http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/tempLayersSet/1",
"resourceConfigID": "tempLayers",
"resourceType": "StaticResource",
"supportedMediaTypes": [
"application/xml",
"text/xml",
"application/json",
"application/rjson",
"text/html",
"application/jsonp",
"application/x-java-serialized-object"
]
}]
Creates new temporary layer sets.
Through a POST request, one can create a temporary layer set. The URI may include the following parameters:
Name | Type | Description |
returnContent | boolean | Indicates whether to return the description of the newly created resource or the URI of the resource. If true, it will directly return the newly created resource, i.e. the description of the temporary layer set; if false, it returns the URI of the temporary layer set resource. The default is false. |
Request body parameters
The request body should include the description of a temporary layer set. The elements of a temporary layer set can be the type of UGCMapLayer, WMSLayer, or WFSLayer, whose parameter structure is same as the one of the layers resource. Please refer to the response structure for the GET request of the layers resource.
If the request body parameters are valid, SuperMap iServer will create a temporary layer set, i.e. the tempLayers resource, in WorldMap according to these descriptions. When the request body is empty, it returns the entire WorldMap resource.
Note: One element in the request body array indicates the map state of the temporary layer. Generally, the element is UGCMapLayer.
The returned representation structure is as follows after implementing the POST request on the tempLayersSet resource (representation is in the entity body of the response message):
Field | Type | Description |
succeed | boolean | Whether the creation of the temporary layer set is successful. If the operation fails, there will be an error message. |
newResourceID | String | The ID for the query result resource. |
newResourceLocation | String | URI of the newly created temporary layer set, indicating a tempLayers resource. |
error | HttpError | Error message. If the creation is successful, this field will be absent. |
When implementing a POST request on the tempLayersSet resource with http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/tempLayersSet.rjson , the entity body includes one vector layer and one thematic label layer, as shown below:
[{
"name": "WorldMap",
"type": "UGC",
"subLayers": {
"layers": [
{
"type": "UGC",
"caption": "Ocean name",
"ugcLayerType": "THEME",
"visible": true,
"theme": {
"labelExpression": "OceanLabelP_C.ChineseName",
"type": "LABEL",
"uniformStyle":{
"foreColor":{"red": 128,"blue": 0,"green": 0}
}
},
"datasetInfo": {
"name": "OceanLabelP_C",
"dataSourceName": "World",
"type": "POINT"
}
},
{
"type": "UGC",
"caption": "Country boundary",
"ugcLayerType": "VECTOR",
"visible": true,
"datasetInfo": {
"name": "Countries",
"dataSourceName": "World",
"type": "LINE"
},
"style": {
"fillBackOpaque": true,
"lineWidth": 0.1,
"fillBackColor": { "red": 255, "blue": 255, "green": 255},
"fillForeColor": {"red": 242, "blue": 233, "green": 239},
"lineColor": {"red": 128, "blue": 128, "green": 128},
"fillOpaqueRate": 100,
"fillGradientMode": "NONE",
"fillSymbolID": 0,
"fillGradientAngle": 0,
"lineSymbolID": 0
}
}
]
}
}]
Then it returns the representation in the following structure (expressed in the body of response message):
{
"succeed": true,
"newResourceID": "p590w5yp_1",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/tempLayersSet/p590w5yp_1.rjson"
}
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 tempLayersset 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 tempLayersset resource supports the representation in <format> or not.