/location/decorate
- Source
Requires
Methods
(inner) decorate(location) → {location}
The location decorator method creates mapp-location typedef object from a JSON location.
Name | Type | Description |
---|---|---|
location | object | JSON location. |
- Source
Decorated Mapp Location.
- Type:
- location
(async, inner) flyTo(maxZoomopt)
Centers the mapview arround the outermost extent of a location, this will also adhere to the maximum zoom level specified on the layer.
The extent from the layers that have been added to the Extents property are used in module:/utils/createExtent, The greatest extent of these is used in module:/mapview/fitView.
Name | Type | Attributes | Description |
---|---|---|---|
maxZoom | integer | <optional> | The maximum zoom level of the layer. |
- Source
(async, inner) getExtent() → {Promise.<Array>}
The method iterates over the location Layers and calculates the overall extent returned from the individual extent methods.
- Source
The overall extent returned from the Extents methods.
- Type:
- Promise.<Array>
(inner) remove()
The remove method is bound to a location in the location.decorate method.
this being the location, the method will first remove itself to prevent the method being called twice.
The remove method will free the location record by deleting the location.hook.
A location.view HTMLElement will be removed from the DOM.
Any Openlayers layer in the location.Layers[] array will be removed from the mapview.
The highlight interaction will be assigned to the location mapview.
The location layer will be reload [and restyled in the process].
Any methods in the location.removeCallbacks[] array will be executed.
- Source
(async, inner) syncFields(fields)
The syncFields method sends a parameterised query to the location_get query template. The fields parameter will be populated from the fields params argument.
Values of the location [this] infoj entry matching the fields will be updated with values from the query response.
Name | Type | Description |
---|---|---|
fields | array |
- Source
(inner) update()
The update method is bound to the location (this) in the decorator method.
The update method will abort if some of the location.infoj entries is invalid.
JSON newValues are created for any json or jsonb type entries in the location.infoj array.
An xhr POST request with all newValues is passed to location_update query template.
infoj entry values are set to the newValues after a successful update.
Dependent fields for updated entries is an array of fields that is passed to the syncFields method, to retrieve the updated values from the location. These dependents fields are reloaded with the updated values from the location.
Dependent layers is an array of layer keys that will be reloaded after the update.
- Source