WithCredential

Feedback


It is used to define objects and their attributes related to security verification information. If the server has enabled security authentication, users must set such attributes to access related services.

Attribute list

Attribute Type Description

credential

object<string>

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

Example

Use token to access the data flow service with security authentication enabled, and create a layer that conforms to the WebMap specification.

 {

     "layers": [

        {

            "layerType": "DATAFLOW_HEAT",

            "visible": true,

            "url": "http://server:8090/iserver/services/dataflow/rest",

            "name": "sample",

            "themeSetting": {

                "customSettings": {

                    "2": "#d0021b",

                    "4": "#000000"

                },

                "weight": "Latitude",

                "colors": [

                    "#0000ff",

                    "#00ffff",

                    "#00ff00",

                    "#ffff00",

                    "#ff0000"

                ],

                "radius": 10

            },

            "filterCondition": "City = \"Harbin\"",

            "credential": {

                "token": "token_value"

            }

        }

    ],

}