Module: josm

This modules exports an objects with a set of properties and methods to access JOSMs internals.
Source:

Example

import josm from 'josm'

Members


<static, readonly> commands

the global command history

Replies the global command history. Use this object to undo/redo commands, or to clear the command history.
Properties:
Name Type Description
commands module:josm/command.CommandHistory
Source:
Example
import josm from 'josm'

// undoes the last command
josm.commands.undo()

// redoes two commands
josm.commands.redo(2)

<static, readonly> console

Replies an accessor to the JOSM scripting console.

Replies an accessor to the JOSM scripting console. Use this object to write messages to the scripting console
Properties:
Name Type Description
console module:josm/scriptingconsole accessor to the JOSM scripting console
Source:

<static, readonly> layers

accessor for JOSM layers

Replies the layers object.
Properties:
Name Type Description
layers module:josm/layers the layers object
Source:
Example
import josm from 'josm'
josm.alert('num layers: ' + josm.layers.length)

// name of first layer
josm.alert('num layers: ' + josm.layers.get(0).name)

<static, readonly> menu

Replies an accessor for JOSMs menu bar.

Replies an accessor for JOSMs menu bar. Use this object to inspect or modify the menu bar, i.e. to add additional menu items.
Properties:
Name Type Description
menu module:josm/ui/menu~MenuBar accessor for JOSMs menu bar
Source:

<static, readonly> version

JOSM version string

Replies the current JOSM version string.
Properties:
Name Type Description
version string the JOSM version
Source:
Example
import josm from 'josm'
josm.alert(josm.version)