diff --git a/index.html b/index.html index 6b71d0fdb..ed15236a6 100644 --- a/index.html +++ b/index.html @@ -85,6 +85,10 @@ + + + + diff --git a/js/id/graph/entity.js b/js/id/graph/entity.js index ce3197c99..9c26d66e0 100644 --- a/js/id/graph/entity.js +++ b/js/id/graph/entity.js @@ -119,39 +119,3 @@ iD.Entity.extend = function(properties) { return Subclass; }; - -iD.Node = iD.Entity.extend({ - type: "node" -}); - -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); - } -}); - -iD.Relation = iD.Entity.extend({ - type: "relation", - members: [] -}); diff --git a/js/id/graph/node.js b/js/id/graph/node.js new file mode 100644 index 000000000..1a71674d5 --- /dev/null +++ b/js/id/graph/node.js @@ -0,0 +1,3 @@ +iD.Node = iD.Entity.extend({ + type: "node" +}); diff --git a/js/id/graph/relation.js b/js/id/graph/relation.js new file mode 100644 index 000000000..a4a00dc03 --- /dev/null +++ b/js/id/graph/relation.js @@ -0,0 +1,4 @@ +iD.Relation = iD.Entity.extend({ + type: "relation", + members: [] +}); diff --git a/js/id/graph/way.js b/js/id/graph/way.js new file mode 100644 index 000000000..9c39ba67e --- /dev/null +++ b/js/id/graph/way.js @@ -0,0 +1,26 @@ +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); + } +}); diff --git a/test/index.html b/test/index.html index 2ed56cb74..99e6de387 100644 --- a/test/index.html +++ b/test/index.html @@ -84,6 +84,10 @@ + + + +