mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 17:23:02 +00:00
27 lines
636 B
JavaScript
27 lines
636 B
JavaScript
iD.Way = iD.Entity.extend({
|
|
type: "way",
|
|
nodes: [],
|
|
|
|
isOneWay: function() {
|
|
return this.tags.oneway === 'yes';
|
|
},
|
|
|
|
isClosed: function() {
|
|
return this.nodes.length > 0 && this.nodes[this.nodes.length - 1] === this.nodes[0];
|
|
},
|
|
|
|
// a way is an area if:
|
|
//
|
|
// - area=yes
|
|
// - closed and
|
|
// - doesn't have area=no
|
|
// - doesn't have highway tag
|
|
isArea: function() {
|
|
return this.tags.area === 'yes' ||
|
|
(this.isClosed() &&
|
|
this.tags.area !== 'no' &&
|
|
!this.tags.highway &&
|
|
!this.tags.barrier);
|
|
}
|
|
});
|