The MapStylerLayer object defines the properties of a layer that conforms to the MapBox style specification.

Attribute list

Attribute Type Description

layerType

string

[Required]

The layer type. Fixed constant: "MAPBOXSTYLE".

name

string

[Required]

The layer name.

visible

boolean

[Required]

The visibility of the layer.

opacity

number

[Optional]

The opacity of the layer. The maximum value is 1 and the minimum value is 0.

visibleScale

VisibleScale

[Optional]

Stores the visible scale range of the current layer.

dataSource

object

[Required]

Data source. When the attribute value of the sub-attribute "type" is "PORAL_DATA", the data source type is PortalDataSource;

When the attribute value of "type" is "EXTERNAL", you also need to set the "url" sub-attribute of the string type, which is used to write the externally registered mapbox style url address.

Example

Create a basemap that conforms to the MapBox style specification.

 {

    "baseLayer": {

        "layerType": "MAPBOXSTYLE",

        "name": "China_4326",

        "dataSource": {

            "type": "EXTERNAL",

            "url": "http://192.168.17.199:8090/iserver/services/map-china400/restjsr/v1/vectortile/maps/China_4326/style.json"

        }

    },

}