vectorStyles


URI

<tileFeature_uri>/**[.<format>]

Supported methods

GET, HEAD

Parent resource

tileFeature

Child resources

vectorStyle

Introduction

By executing a request on the vectorStyles resource, you can get the style information for the specified layer, such as the point, line, region symbol style, font style, and so on. The description of style information is based on the CartoCSS language. Only supports GET request. When performing a GET request, users can specify one or multiple layers, if not specified, it will query the style information for all layers.

Supported Methods:

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

Resource hierarchy

HTTP request methods

Implement the HTTP request on the following URI, where supermapiserver is the server name, with rjson being the output format. "World" is the map name.

http://supermapiserver:8090/iserver/services/map-China400/rest/maps/World/tileFeature/vectorStyles.rjson

GET request

Get the style information for specified layers.

Request parameter

Request a GET request for a vectorstyles resource to get the style information for the specified layer in the map. You need to include the relevant parameters in the URI. If no parameters are specified, the style information for all the layers in the map is acquired by default. The parameters are:

Name Type Description
type VectorStyleType The description language type of the layer style. Currently only supports CartoCSS language.
layerNames String The layer name to be queried. E.g., ["Countries@World","Lakes@World@@World"].

Response structure

Returns information that contains the layer name and its style.

Field Type Description
type VectorStyleType The description language type of the layer style, which is CartoCSS.
style String The layer style information. It includes the layer name and its style.

Response example

To request the layer style information of China_Nation_txt_1@China and China_Hyd_R@China400 in the China400 map on the vectorStyles resource, perform the GET request:

http://supermapiserver:8090/iserver/services/map-China400/rest/maps/China/tileFeature/vectorstyles?type=cartoCSS&layerNames=%5B"China_Nation_txt_1@China","China_Hyd_R@China400"%5D.

The rjson resource representation returned is as follows:

#China_Hyd_R@China400[zoom>=2.1634093716513974E-7]

{text-placement-type:simple;text-placements:"E,NE,SE,W,NW,SW";line-color:rgba(169,191,211,1);line-width:1;line-pattern-file:url(SYMBOLLINE__China_Hyd_R@China400__64__64__true__-1409619663.png);polygon-fill:rgba(145,185,234,1);polygon-pattern-file:url(SYMBOLFILL__China_Hyd_R@China400__64__64__true__-1409619663.png);point-file:url(SYMBOLMARKER__China_Hyd_R@China400__64__64__true__-1409619663.png);polygon-opacity:1;polygon-pattern-opacity:1;}

#China_Nation_txt_1@China[zoom<=1.3521308572821239E-8][zoom>=6.760654286410611E-9]

{text-placement-type:simple;text-placements:"E,NE,SE,W,NW,SW";line-color:rgba(245,243,240,1);line-width:1;line-pattern-file:url(SYMBOLLINE__China_Nation_txt_1@China__64__64__true__605218360.png);polygon-fill:rgba(208,255,240,1);polygon-pattern-file:url(SYMBOLFILL__China_Nation_txt_1@China__64__64__true__605218360.png);point-file:url(SYMBOLMARKER__China_Nation_txt_1@China__64__64__true__605218360.png);polygon-opacity:1;polygon-pattern-opacity:1;}

HEAD request

Returns the same HTTP response header as the GET request, but does not have the response entity. It can get the metadata information in the response header without transferring the whole response content. Metadata information includes media type, character encoding, compression encoding, entity content length, and so on.

The HEAD request can be used to determine whether the vectorStyles resource exists or whether the client has authority to access the resource. It can quickly determine whether the vectorStyles resource supports the representation in <format> format by performing HEAD request on URI with <format>.

See