Mixin NodeMixin

This mixin is auto-loaded by the scripting plugin and mixed into the native java class Node. It provides additional properties and methods which you can invoke on an instance of Node.

This mixin extends the mixin OsmPrimitiveMixin. Properties and methods of the parent mixin are available for scripting, too.

This mixin provides additional properties and methods for the native Java class Node, whose native public methods are available for scripting, too. If a native method name is hidden by a property name in the mixin, then prefix the native name with $.

Properties

east:number

Get the projected east coordinate, or undefined, if the projected east coordinate isn't known.

var nb = require("josm/builder").NodeBuilder;

// set members 
var n = nb.create();
n.east;  

lat:number

Get or set the node latitude.

get
Replies the current latitude, or undefined, if the latitude isn't known.
set
Assign the latitude. Expects a number in the range [-90,90]. Raises an error, if the node is a proxy node.

var nb = require("josm/builder").NodeBuilder;

// set members 
var n = nb.create();
n.lat = 23.245;
n.lat;  // -> 23.245

lon:number

Get or set the node longitude.

get
Replies the current longitude, or undefined, if the longitude isn't known.
set
Assign the longitude. Expects a number in the range [-180,180]. Raises an error, if the node is a proxy node.

var nb = require("josm/builder").NodeBuilder;

// set members 
var n = nb.create();
n.lon = -120.78;
n.lon;  // -> -120.78;

north:number

Get the projected north coordinate, or undefined, if the projected north coordinate isn't known.

var nb = require("josm/builder").NodeBuilder;

// set members 
var n = nb.create();
n.north;  

pos:LatLon

Get or set the node position.

get
replies an instance of LatLon or undefined, if the position isn't known.
set
Assign the position. Either an instance of LatLon or an object with the properties {lat: ..., lon: ...}

var LatLon = org.openstreetmap.josm.data.coor.LatLon;
var nb = require("josm/builder").NodeBuilder;

// assign a LatLon as position  
n.pos = new LatLon(23, 32.33);

// assign an object as position 
n.pos = {lat: 23, lon: 32.33};

// get the position
n.pos;  // -> a LatLon with the position 
Name Description
Properties
east Get the projected east coordinate.
lat Get or set the node latitude.
lon Get or set the node longitude.
north Get the projected north coordinate.
pos Get or set the node position.