The Tianditu map can be used as the basemap. TiandituLayer object defines the attributes of the Tianditu map.

Attribute list

Attribute Type Description

layerType

string

[Required]The layer type. Optional values:

"TIANDITU_VEC_4326", "TIANDITU_IMG_4326", "TIANDITU_TER_4326", "TIANDITU_VEC_3857", "TIANDITU_IMG_3857", "TIANDITU_TER_3857".

name

string

[Required]

The layer name.

visible

boolean

[Required]

The visibility of the layer.

labelLayerVisible

boolean

[Required]

The visibility of the labelLayer.

tk

string

Tianditu key.

Note: This is an internal attribute and does not need to be filled in. Only when accessing the http://<server>:<port>/iportal/web/maps/{id}/map.json , iPortal reads the configured key and outputs in the response body.

Example

  1. Create a TiandituLayer that conforms to the WebMap specification as a basemap.

{

 "baseLayer": {

        "layerType": "TIANDITU_TER_4326",

        "labelLayerVisible": true,

        "visible": true,

        "name": "Tianditu terrian(latitude and longitude)"

    },

}

  1. Visit http://127.0.0.1:8190/iportal/web/maps/1096522478/map.json to read the class structure information of the basemap of the Tianditu map.

 {

 "baseLayer": {

        "layerType": "TIANDITU_TER_4326",

        "labelLayerVisible": true,

        "visible": true,

        "tk": "a58f3713862426ec0b2927cb43da8065",

        "name": "Tianditu terrian(latitude and longitude)"

    },

 }