]> git.openstreetmap.org Git - rails.git/commitdiff
Update redefinition of interestingNode to match leaflet-osm
authorTom Hughes <tom@compton.nu>
Tue, 7 Jan 2025 08:38:51 +0000 (08:38 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 7 Jan 2025 08:38:51 +0000 (08:38 +0000)
app/assets/javascripts/leaflet.map.js

index 5e6112fc057e16ec7566a83ea8a8e2e0b52a4680..401a5d9099c8a1000b7ba77f1f7ac8e93b96e597 100644 (file)
@@ -312,13 +312,11 @@ L.OSM.Map = L.Map.extend({
             }
           });
 
             }
           });
 
-          map._objectLayer.interestingNode = function (node, ways, relations) {
+          map._objectLayer.interestingNode = function (node, wayNodes, relationNodes) {
             if (object.type === "node") {
               return true;
             } else if (object.type === "relation") {
             if (object.type === "node") {
               return true;
             } else if (object.type === "relation") {
-              for (var i = 0; i < relations.length; i++) {
-                if (relations[i].members.indexOf(node) !== -1) return true;
-              }
+              if (relationNodes[node.id]) return true;
             } else {
               return false;
             }
             } else {
               return false;
             }