From: John Firebaugh Date: Thu, 8 Nov 2012 20:40:32 +0000 (-0800) Subject: Update leaflet.osm.js X-Git-Tag: live~5244^2~20 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/a4571898806b04ecfbcadb90a96126a71c2dbfaa Update leaflet.osm.js --- 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; } }