Add style

Description

Adds a style to a vector layer.

Endpoint

/path/{pathId}/vector/style

Method

POST

Access Level Rules

Access Level

edit+

Processing Units

Processing units

2

Parameters

NameDescriptionRequiredDefault

pathId

The id of the vector layer.

true

name

The name of the new style.

true

default

Boolean whether the style should be the default style.

true

method

The method of the style. Must be one of "rules", "transitionPoints", "'random", "singleColor" or "fromColorProperty".

true

parameters

A JSON containing the parameters of the style. Below table defines the style parameters, whose content differs between methods.

true

Sample requests for different methods

{
    "name": "Vector Style",
    "default": true,
    "method": "singleColor",
    "parameters": {
        "alpha": 0.5,
        "width": 2,
        "radius": {
            "method": "constant",
            "parameters": {
                "value": 7
            }
        },
        "color": "#c75b1c",
        "pattern":null,
        "icon":null,
        "borderColor": "#934314"        
        }
}

A pattern must be an object with:

  • type: One of solid, diagonal, horizontal or vertical

  • width: a float between 1 and 50

  • backgroundColor: a hex color, optional.

Example:

pattern = {"type":"diagonal", "width": 2, "backgroundColor":"#934314"}

An icon must be an object with

  • name: the name of the icon as a string.

All valid inputs for name can be listed with

GET /image/listIcons

Example:

icon = {"name":"dog"}

πŸ–ŒοΈVector styling methods

Last updated