This mixin provides additional properties and methods which you can invoke on an instance of Way.
You can access nodes using indexed properties, i.e.
way[i], see example below.
Name | Description |
---|---|
Properties | |
first | The first node |
last | The last node |
length | Replies the number of nodes. |
nodes | Set or get the nodes of a way. |
Methods | |
contains | Checks if a node is part of a way. |
remove | Removes one or more nodes from the way. |
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
Way, 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 $
.
first:Node
The first node or undefined, if this way doesn't have nodes (i.e. because it is a proxy way).
last:Node
The last node or undefined, if this way doesn't have nodes (i.e. because it is a proxy way).
length:number
Replies the number of nodes.
nodes:array
Set or get the nodes of a way.
var way = ... // create the way;
var n1,n2,n3 = ...; // create the nodes
way.nodes = [n1,n2,n3];
way.nodes; // -> [n1,n2,n3]
contains:boolean
Checks if a node is part of a way.
Name | Type | Description |
---|---|---|
node | Node | the node to check |
remove
Removes one or more nodes from the way.
Signatures