From a4571898806b04ecfbcadb90a96126a71c2dbfaa Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 8 Nov 2012 12:40:32 -0800 Subject: [PATCH] Update leaflet.osm.js --- vendor/assets/leaflet/leaflet.osm.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/vendor/assets/leaflet/leaflet.osm.js b/vendor/assets/leaflet/leaflet.osm.js index d815f41bd..927d2c3b7 100644 --- a/vendor/assets/leaflet/leaflet.osm.js +++ b/vendor/assets/leaflet/leaflet.osm.js @@ -92,7 +92,7 @@ L.OSM.DataLayer = L.FeatureGroup.extend({ for (var node_id in nodes) { var node = nodes[node_id]; - if (this.interestingNode(node)) { + if (this.interestingNode(node, ways)) { features.push(node); } } @@ -119,9 +119,22 @@ L.OSM.DataLayer = L.FeatureGroup.extend({ 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; } } -- 2.43.2