X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f8b0b861d4be9a665f6dc381647ece9f6a312f4b..0d11ad741589de384df3f57d1333e3ed699a7a8e:/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; } }