for (var node_id in nodes) {
var node = nodes[node_id];
- if (this.interestingNode(node)) {
+ if (this.interestingNode(node, ways)) {
features.push(node);
}
}
return false;
},
- interestingNode: function (node) {
+ interestingNode: function (node, ways) {
+ var used = false;
+
+ for (var i = 0; i < ways.length; i++) {
+ if (ways[i].nodes.indexOf(node) >= 0) {
+ used = true;
+ break;
+ }
+ }
+
+ if (!used) {
+ return true;
+ }
+
for (var key in node.tags) {
- if (!~this.options.uninterestingTags.indexOf(key)) {
+ if (this.options.uninterestingTags.indexOf(key) < 0) {
return true;
}
}