/ui/layers/panels/jsonEditor
The layer panels module exports a default method to open a dialog with a layerJSE element to update the mapp layer.
Requires
Methods
(inner) jsonEditor(layer) → {HTMLElement}
The jsonEditor method asigns a jsoneditor element to the decorated layer and a removeCallback method to close the dialog.
The button returned from the panel method will display a modal dialog with the jsoneditor element.
The 'Update Layer' button of the jsoneditor element will attempt to update the layer object with the json content of the editor.
| Name | Type | Description |
|---|---|---|
layer | layer | A decorated mapp layer. |
A button to toggle the jsoneditor dialog.
- Type:
- HTMLElement
(async, inner) updateLayer(jse, layer) → {Promise.<layer>}
The method extracts the content from the provided jsoneditor argument and attempts to decorate a new layer from the json content.
The view of the new layer is inserted before the view of the current layer, which may be in a listview group. The current layer is removed and the new layer is assigned with the key of the current layer to the mapview.layers.
| Name | Type | Description |
|---|---|---|
jse | jse | A jsoneditor instance. |
layer | layer | A decorated mapp layer. |
The new decorated mapp layer.
- Type:
- Promise.<layer>