Skip to content

Commit

Permalink
Update arguments of data overlay interestingNode()
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Jan 7, 2025
1 parent f946797 commit 937d461
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/assets/javascripts/leaflet.map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
for (var i = 0; i < relations.length; i++) {
if (relations[i].members.indexOf(node) !== -1) return true;
}
return Boolean(relationNodes[node.id]);
} else {
return false;
}
Expand Down
13 changes: 13 additions & 0 deletions test/system/browse_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require "application_system_test_case"

class BrowseTest < ApplicationSystemTestCase
test "relation member nodes should be visible on the map when viewing relations" do
relation = create(:relation)
node = create(:node)
create(:relation_member, :relation => relation, :member => node)

visit relation_path(relation)

assert_selector "#map .leaflet-overlay-pane path"
end
end

0 comments on commit 937d461

Please sign in to comment.