The TileLayer object defines all the attributes needed to build a layer using SuperMap REST map service.

Attribute list

Attribute Type Description

layerType

string

[Required]

The layer type. Fixed constant: "TILE".

name

string

The layer name.

url

string

[Required]

The address (uri) of the map service.

searchSetting

RestMapSearchSetting

[Optional]

Layer search settings.

autoUpdateTime

number

[Optional]

The time for the layer data to be automatically refreshed, in milliseconds.

visible

boolean

[Optional]

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.

credential

WithCredential

[Optional]

According to the security verification method "token" or "key" of the map service, fill in the corresponding security verification information.

   Example

  1. Use the REST map service to build a layer that conforms to the WebMap specification.

 {

        "layers": [

        {

            "layerType": "TILE",

            "name": "World",

            "visible": true,

            "visibleScale": {

                "maxScale": "1:2256.999",

                "minScale": "1:591658710.909"

            },

            "autoUpdateTime": 720000,

            "url": "http://192.168.17.199:8090/iserver/services/map-world/rest/maps/World",

            "searchSetting": [

                {

                    "name": "search",

                    "attributes": [

                        "SmID"

                    ],

                    "createTime": "2020.5.8",

                    "layerName": "continent_T@World"

                }

            ],

            "opacity": 0.85

        }

    ],

 }

  1. Use the REST map service to build a layer that conforms to the WebMap specification.

  {

    "baseLayer": {

        "layerType": "TILE",

        "name": "China",

        "url": "http://192.168.17.199:8090/iserver/services/map-china400/rest/maps/China"

    },

}