CategoryWidget

CategoryWidget

Widget that shows grouped data fetched using WPS Aggregate

Constructor

new CategoryWidget(config)

Source:
Parameters:
Name Type Description
config Object

Configuration object

Properties
Name Type Attributes Default Description
title String

Widget title

server String

URL of map server

namespace Object

Namespace object

Properties
Name Type Description
name String

Namespace to use

url String

Namespace URL

layerName String

Name of the layer to query

property String

Field to use in aggregate function

totalLabel String <optional>
'Total'

Label to be shown within total count

categories Object

Categories configuration

Properties
Name Type Description
property String

Property that defines the style to use

style.values Object

Object with possible values and their correspoding style

format function <optional>

Function to parse and transform data fetched from server. This function should return a human friendly value as it will be shown as the widget current value.

Extends

Methods

(protected) format() → {Object}

Source:
Overrides:

Processes the widget value and returns a human friendly version.

Returns:
  • Current widget value prepared to be shown
Type
Object

(protected) parseResponse(value)

Source:
Overrides:

Parses data fetched from server and sets widget value to an easily readable format

Parameters:
Name Type Description
value Object

JSON data fetched from server

refresh()

Source:
Inherited From:

Reloads the widget value using the formatted value.