/utils/queryParams

The queryParams module exports the queryParams utility method.

Methods

(inner) centerParam(_this, params)

Assigns center param to params object if the center of the mapview can be found from the _this.layer.

The method will shortcircuit if a center param is already provided as a string or if the layer or mapview is not found.

Parameters:
NameTypeDescription
_thisObject

Object from which the query originates, eg. layer, dataview entry.

paramsObject

The params object to set the center param on if found.

Properties
NameTypeAttributesDescription
_this.layerlayer<optional>

A mapp layer associated with _this object. The layer is required to calculate a viewport, center, zoom [z], or table [if not explicit].

(inner) geomParam(_this, params)

Assign the geom param value from the layer object.

Parameters:
NameTypeDescription
_thisObject

Object from which the query originates, eg. layer, dataview entry.

paramsObject

The params object to set the geom param on if found.

Properties
NameTypeAttributesDescription
params.geomboolean

The geom param is set to true to trigger the assignment of the geom param value.

_this.layerlayer<optional>

A mapp layer associated with _this object.

(inner) queryParams(_this) → {object}

The queryParams method returns a params object for the creation of a query URL params string.

The utility facilitates the creation of params argument for the mapp.utils.paramString() method.

The queryParams method is particularly useful for calculating the current [viewport] bounds for a data query and to determine the current table for the mapviews current zoom level.

Parameters:
NameTypeDescription
_thisObject

Object from which the query originates, eg. layer, dataview entry.

Properties
NameTypeAttributesDescription
_this.queryparamsObject<optional>

Parameter object for the query.

_this.layerlayer<optional>

A dataview associated with a mapp layer will have a layer reference.

Returns:

A params object to create a params string.

Type: 
object

(inner) tableParam(_this, params)

Assigns table param to params object if a table can be found on the _this object or its location or layer.

The method will shortcircuit if a table param is already provided as a string if the param is nullish.

Parameters:
NameTypeDescription
_thisObject

Object from which the query originates, eg. layer, dataview entry.

paramsObject

The params object to set the table param on if found.

Properties
NameTypeAttributesDescription
_this.locationlocation<optional>

A mapp location associated with _this object.

location.layerlayer<optional>

A mapp layer associated with _this.location.

_this.layerlayer<optional>

A mapp layer associated with _this object.

(inner) viewportParam(_this, params)

Assigns viewport param to params object if the viewport of the mapview can be found from the _this.layer.

The method will shortcircuit if a viewport param is already provided as a string or if the layer or mapview is not found.

Parameters:
NameTypeDescription
_thisObject

Object from which the query originates, eg. layer, dataview entry.

paramsObject

The params object to set the viewport param on if found.

Properties
NameTypeAttributesDescription
_this.layerlayer<optional>

A mapp layer associated with _this object. The layer is required to calculate a viewport, center, zoom [z], or table [if not explicit].