/location/decorate

Requires

Methods

(inner) decorate(location) → {location}

The location decorator method creates mapp-location typedef object from a JSON location.

Parameters:
NameTypeDescription
locationobject

JSON location.

Returns:

Decorated Mapp Location.

Type: 
location

(inner) flyTo()

(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.

(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.