LegendSetting

Feedback


Defines the relevant attributes required for the legend setting in the WebMap specification.

Attribute list

Attribute Type Description

isShow

boolean

Whether the legend is visible.

isFold

boolean

Whether the legend is collapsed.

Example

Create a vector layer that conforms to the WebMap specification, and set the legend to be visible and not collapsed.

 {  

    "layers": [

        {

            "layerType": "VECTOR",

            "name": "Beijing subway traffic lines",

            "visible": true,

            "featureType": "LINE",

            "legendSetting": {

                "isShow": true,

                "isFold": false

            },

            "projection": "EPSG:4326",

            "enableFields": [

                "标准名称"

            ],

            "style": {

                "strokeColor": "#4CC8A3",

                "strokeWidth": 2,

                "strokeOpacity": 1,

                "lineDash": "solid",

                "type": "LINE"

            },

            "searchSetting": [

                {

                    "name": "Traffic line",

                    "attributes": [

                        "Standard name",

                        "dataviz_featureID"

                    ],

                    "createTime": "2020.5.12"

                }

            ],

            "dataSource": {

                "type": "SAMPLE_DATA",

                "name": "BeijingSubwayLine"

            }

        }

    ],

 }