WithPopupInfo

Feedback


Used to define the relevant information of the layer attribute pop-up window.

Attribute list

Attribute Type Description

title

string/Expressions

The title of the attribute pop-up window.

elements

array

The content array displayed in the attribute pop-up window, the content elements that can be added include:

["IMAGE",MediaInfo], ["VIDEO",MediaInfo], ["FIELD",FieldInfo], ["TEXT",TextInfo], ["DIVIDER",Divider]

Expressions

This data structure can flexibly meet to the needs of data formatting and dynamic calculations.

Attribute Type Description

Get

array

Get the attribute value from the current root object, which can be composed of the constant "get" and the attribute field name of the string type, for example: ["get","region name"]; it can also be the constant "get" and nested Get/Concat Attribute composition, for example: ["get",["concat","area name"].

Concat

array

The string concatenation operator can be composed of the constant "concat" and string type text, for example: ["concat","pop window"]; it can also be composed of the constant "concat" and nested Get/Concat attributes, for example: ["concat",["get","area name"],"pop window"].

MediaInfo

Used to define the media info in the pop-up window.

Attribute Type Description

type

string

The media type. Fixed Constants: "IMAGE", "VIDEO".

title

string/Expressions

The name of the media information.

value

string/Expressions

The link of media information, or its corresponding field name.

FieldInfo

Used to define the field info in the pop-up window.

Attribute Type Description

type

string

The info type. Fixed constant: "FIELD".

filedName

string

The field name.

TextInfo

Used to define the text info in the pop-up window.

Attribute Type Description

type

string

The info type. Fixed constant: "TEXT".

infos

array<object>

The text info array, [insert,attributes].

insert

Used to define text content information.

Attribute Type Description

insert

string/Expressions

The text content information.

 

attributes

Used to define the text style.

Attribute Type Description

link

string/Expressions

Text hyperlink.

font

string

Text font, supported font types include: "Microsoft", "SimSun", "SimHei", "KaiTi", "FangSong", "Arial", "Times-New-Roman", "sans-serif"

size

string

Text font size, supported font sizes include: "small", "normal", "large", "huge"

color

string

Text color.

bold

boolean

Whether the text is bold.

underline

boolean

Whether to underline the text.

strike

boolean

Whether to add strikethrough to the text.

align

string

Text alignment, supported alignments include: "right", "left", "justify", "center".

italic

boolean

Whether the text is italic.

Divider

Used to divide the content in the pop-up window into blocks.

Attribute Type Description

type

string

Fixed constant: "DIVIDER".

 

Example

Create an attribute pop-up window that conforms to the WebMap specification.

{

    "popupInfo": {

        "title": [

            "concat",

            [

                "get",

                "District name"

            ],

            "Pop-ups"

        ],

        "elements": [

            {

                "type": "FIELDS",

                "fieldName": "fieldName1"

            },

            {

                "type": "FIELDS",

                "fieldName": "fieldName2"

            },

            {

                "type": "VIDEO",

                "title": [

                    "concat",

                    "2001",

                    [

                        "get",

                        "Population"

                    ],

                    "people"

                ],

                "url": [

                    "concat",

                    "https://cn.bing.com/images/",

                    [

                        "get",

                        "file name"

                    ]

                ]

            },

            {

                "type": "IMAGE",

                "title": "Live video",

                "url": "https://cn.bing.com/images/xxx/.png"

            },

            {

                "type": "DIVISION"

            },

            {

                "type": "TEXT",

                "infos": [

                    {

                        "insert": [

                            "concat",

                            "This site is",

                            [

                                "get",

                                "description"

                            ]

                        ],

                        "attributes": {

                            "size": "huge",

                            "bold": true,

                            "align": "center"

                        }

                    }

                ]

            },

            {

                "type": "TEXT",

                "infos": [

                    {

                        "insert": "This is a description of string type",

                        "attributes": {

                            "size": "huge",

                            "bold": true,

                            "align": "center"

                        }

                    }

                ]

            }

        ]

    },

}