style


URI

<layer_uri>/style[.<format>]

Supported methods

GET, HEAD

Parent resource

layer

Introduction

As a child resource of the layer resource, the style resource is the style of the map layer. By implementing a PUT request on the style resource, one can modify the style of the layer. Only SuperMap vector layers (UGCVectorLayer) allow style settings.

Supported methods

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

GIS Services Resource Hierarchy

resources.htm maps.htm map.htm layer.htm layers.htm style.htm

Here is an example of performing an HTTP request on the following URI, with rjson as the output format. In the URI, supermapiserver is the name of the server, "WorldMap" is the map name (mapName),  Capitals@World is a layer of Map "WorldMap" (layerName), Capitals@World@@WorldMap represents a sublayer of  World layer. Therefore, the URI represents the style of the Capitals@World layer.

http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/layers/Capitals@World@@WorldMap/style.rjson

GET Request

Gets the style of the temporary layer.

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

When implementing GET on the style resource, if the layer is a SuperMap vector layer (UGCVectorLayer), it supports style setting and returns the resource representation in the following structure (expressed in the body of the response message).   

Name Type Description
markerSymbolID int ID of the marker symbol, i.e. the ID of the marker style in the symbol library.
markerSize double Size of the marker symbol.
markerAngle double Rotation of the marker symbol.
lineWidth double Outline width.
lineSymbolID int ID of the line symbol, i.e. the ID of the style in the line symbol library.
lineColor Color Outline color.
fillSymbolID int ID of the fill symbol, i.e. the ID of the style in the fill symbol library.
fillOpaqueRate int Opacity of the fill, a valid setting should be an integer between 0 and 100.
fillGradientOffsetRatioX double Horizontal offset percentage of the gradient fill center in relation to the center of the fill area.
fillGradientOffsetRatioY double Vertical offset percentage of the gradient fill center in relation to the center of the fill area.
fillGradientMode FillGradientMode Gradient type of the gradient fill.
fillGradientAngle double Rotation of the gradient fill.
fillForeColor Color Foreground color.
fillBackOpaque boolean Whether the current background is opaque.
fillBackColor Color Background color of the fill symbol.

If the layer is a SuperMap vector layer (UGCVectorLayer), it does not support style setting and returns the resource representation in the following structure:

Name Type Description
succeed boolean

False, meaning the map layer does not support style setting.

error HttpError Error message.

 

Example of response

Implementing GET on the style resource with http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/layers/Capitals@World@@WorldMap/style.rjson to get the style of the layer Capitals@world, as shown below:

{

    "fillBackColor": {

        "blue": 255,

        "green": 255,

        "red": 255

    },

    "fillBackOpaque": true,

    "fillForeColor": {

        "blue": 196,

        "green": 196,

        "red": 196

    },

    "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,

    "markerSymbolID": 12

}

 

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.

HEAD request can be used to check if the style resource exists, or if the resource can be accessed by clients. It can also determine if the style resource supports an output format <format> if performed on a URI with .<format> included.

See