Add osmNode#isEndpoint

This commit is contained in:
Bryan Housel
2017-01-23 21:03:34 -05:00
parent e9e442e998
commit 04971478cb
2 changed files with 34 additions and 0 deletions
+10
View File
@@ -45,6 +45,16 @@ _.extend(osmNode.prototype, {
},
isEndpoint: function(resolver) {
return resolver.transient(this, 'isEndpoint', function() {
var id = this.id;
return resolver.parentWays(this).filter(function(parent) {
return !parent.isClosed() && !!parent.affix(id);
}).length > 0;
});
},
isIntersection: function(resolver) {
return resolver.transient(this, 'isIntersection', function() {
return resolver.parentWays(this).filter(function(parent) {