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

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer.

Returns:

A button to toggle the jsoneditor dialog.

Type: 
HTMLElement

(inner) updateLayer(jse, layer)

The method extracts the content from the provided jsoneditor argument and attempt to update the mapp with the json content.

Parameters:
NameTypeDescription
jsejse

A jsoneditor instance.

layerlayer

A decorated mapp layer.