X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/43bfebdd9e83685cbc999f46a3a88e85f9960cbc..a4571898806b04ecfbcadb90a96126a71c2dbfaa:/vendor/assets/leaflet/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; } }