ui/locations/entries/geometry
The geometry entry module exports a default entry method to process infoj entries with a geometry value.
Requires
Methods
(inner) draw(entry)
The draw method push drawing interface elements to the entry.elements[] array.
Name | Type | Description |
---|---|---|
entry | infoj-entry | type:geometry entry. |
(inner) edit(entry)
The edit method will push elements for geometry edits into the entry.elements array.
Name | Type | Description |
---|---|---|
entry | infoj-entry | type:geometry entry. |
Name | Type | Attributes | Description |
---|---|---|---|
entry.edit | Object | <optional> | editing must be configured for the geometry entry. |
entry.value | Object | <optional> | entry must have a geometry value to be editable. |
(inner) geometry(entry) → {HTMLElement}
The geometry method will create an OL entry.Style object from the entry.style{} spread into the location.style{}. The geometry will not be rendered with entry.style null.
The entry will be decorated with a show() method if not implicit.
By default a checkbox element will be returned which can trigger the show method or will hide the geometry in the mapview if toggled off.
Drawing elements will be displayed in the entry.node for the entry.draw{} configuration.
The draw object can be nested within the entry.edit{} configuration object. In this case the edit and draw elements will only be visible if editing is enabled for the location.
A vector layer entry.L will be created to render a style feature for the geometry entry in the entry.mapview.
Name | Type | Description |
---|---|---|
entry | infoj-entry | type:geometry entry. |
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
entry.display | boolean | Whether the geometry should be displayed in the mapview. | ||
entry.value | Object | geometry as JSON value. | ||
entry.style | Object | MAPP style configuration. | ||
entry.format | string | <optional> | 'GeoJSON' | format for entry.value geometry. |
entry.edit | Object | <optional> | configuration object for editing the geometry. | |
entry.draw | Object | <optional> | configuration object for mapview draw interaction. | |
entry.api | function | <optional> | Method to request geometry from an external API. |
elements for the location view.
- Type:
- HTMLElement
(inner) modify()
The modify method will toggle a mapview modify interaction for the entry geometry.
The entry.show() method will be called prior to the modify interaction.
(inner) show()
The show method is bound to the geometry type making this the entry object.
The show method sets the entry.display flag and associated checkbox element status true.
A geometry can be requested from an entry.api() method if no geometry entry.value is present.
An existing OL vector layer entry.L will be removed from the mapview and deleted.
A new OL vector layer entry.L will be created and added to the mapview.
(inner) update(entry)
The update method will update the geometry entry.value in the location data at rest.
Update depedents and the location view.
Name | Type | Description |
---|---|---|
entry | infoj-entry | type:geometry entry. |