The JOSM scripting plugin executes scripts in the Open Street Map editor JOSM.
Scripts can be defined in any scripting language for which a JSR-223 compatible script engine is available, in particular in
The scripting plugin can be installed and kept up to date using JOSMs plugin manager:
- Select Preferences -> Plugins
- Search for the plugin "Scripting" and install it
The scripting plugin includes an embedded scripting engine for JavaScript based on Mozilla Rhino. It provides a custom JavaScript API to write scripts for the JOSM editor,refer to the API documentation.
Furthermore, it can
- load and execute plugins written in Python.
- execute scripts written in Ruby, Groovy, and other languages, refer to these examples.
If you want to contribute to the scripting plugin itself, please fork this repository and submit your pull requests.
Add a new entry to releases.conf then run:
% git checkout deploy # switch to deploy branch
% git merge master # make sure the latest changes are merged to 'deploy'
% git push origin deploy # push the 'deploy' branch
% ./gradlew clean build # build the plugin
% ./gradlew deploy # deploys the plugin jar to github,
# where it is picked up by the JOSM
# plugin installer
There are two suites of unit tests
-
a suite of unit tests implemented in java and groovy which can be executed with a JUnit 4 test runner
How to run:
$ ./gradlew test
-
a suite of unit tests implemented in JavaScript which provide test cases for the JavaScript API.
How to run:
- Add the path
$JOSM_SCRIPTING_PLUGIN_ROOT/test/script-api
to the list of module repositories- launch JOSM
- Scripting -> Configure ...
- Select Tab 'Embedded Rhino Engine'
- Add the module repository for unit tests
- Launch JOSM, open the scripting console and enter
require("suite").run();
- Click on Run. Results are logged to the console.
- Add the path
The JOSM scripting plugin uses:
- jsyntaxpane by Ayman Al-Sairafi
- Rhino scripting engine by Mozilla Foundation
Published under GPL Version 3 and higher. See included LICENSE file.