LegendSetting

发送反馈


用于定义 WebMap 规范中关于图例设置需的相关属性。

属性列表

属性 类型 说明

isShow

boolean

定义图例是否可见。

isFold

boolean

定义图例是否折叠。

示例

创建一个符合 WebMap 规范的矢量图层,并进行图例设置,设置图例可见且不折叠。

 {  

    "layers": [

        {

            "layerType": "VECTOR",

            "name": "北京市地铁交通线路",

            "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": "交通线路",

                    "attributes": [

                        "标准名称",

                        "dataviz_featureID"

                    ],

                    "createTime": "2020.5.12"

                }

            ],

            "dataSource": {

                "type": "SAMPLE_DATA",

                "name": "BeijingSubwayLine"

            }

        }

    ],

 }