/utils/queryParams
The queryParams module exports the queryParams utility method.
- Source
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.
| Name | Type | Description |
|---|---|---|
_this | Object | Object from which the query originates, eg. layer, dataview entry. |
params | Object | The params object to set the center param on if found. |
| Name | Type | Attributes | Description |
|---|---|---|---|
_this.layer | layer | <optional> | A mapp layer associated with _this object. The layer is required to calculate a viewport, center, zoom [z], or table [if not explicit]. |
- Source
(inner) geomParam(_this, params)
Assign the geom param value from the layer object.
| Name | Type | Description |
|---|---|---|
_this | Object | Object from which the query originates, eg. layer, dataview entry. |
params | Object | The params object to set the geom param on if found. |
| Name | Type | Attributes | Description |
|---|---|---|---|
params.geom | boolean | The geom param is set to true to trigger the assignment of the geom param value. | |
_this.layer | layer | <optional> | A mapp layer associated with _this object. |
- Source
(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.
| Name | Type | Description |
|---|---|---|
_this | Object | Object from which the query originates, eg. layer, dataview entry. |
| Name | Type | Attributes | Description |
|---|---|---|---|
_this.queryparams | Object | <optional> | Parameter object for the query. |
_this.layer | layer | <optional> | A dataview associated with a mapp layer will have a layer reference. |
- Source
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.
| Name | Type | Description |
|---|---|---|
_this | Object | Object from which the query originates, eg. layer, dataview entry. |
params | Object | The params object to set the table param on if found. |
| Name | Type | Attributes | Description |
|---|---|---|---|
_this.location | location | <optional> | A mapp location associated with _this object. |
location.layer | layer | <optional> | A mapp layer associated with _this.location. |
_this.layer | layer | <optional> | A mapp layer associated with _this object. |
- Source
(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.
| Name | Type | Description |
|---|---|---|
_this | Object | Object from which the query originates, eg. layer, dataview entry. |
params | Object | The params object to set the viewport param on if found. |
| Name | Type | Attributes | Description |
|---|---|---|---|
_this.layer | layer | <optional> | A mapp layer associated with _this object. The layer is required to calculate a viewport, center, zoom [z], or table [if not explicit]. |
- Source