Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pull/5585'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Feb 2, 2025
2 parents 8f38723 + b9f1e31 commit 22761a9
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions app/controllers/api/maps_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,12 @@ def show

nodes += Node.includes(:node_tags).find(nodes_to_fetch) unless nodes_to_fetch.empty?

visible_nodes = {}
@nodes = []
nodes.each do |node|
if node.visible?
visible_nodes[node.id] = node
@nodes << node
end
end
@nodes = nodes.filter(&:visible?)

@ways = []
way_ids = []
ways.each do |way|
if way.visible?
way_ids << way.id
@ways << way
end
end
@ways = ways.filter(&:visible?)

@relations = Relation.nodes(visible_nodes.keys).visible +
Relation.ways(way_ids).visible
@relations = Relation.nodes(@nodes).visible +
Relation.ways(@ways).visible

# we do not normally return the "other" partners referenced by an relation,
# e.g. if we return a way A that is referenced by relation X, and there's
Expand Down

0 comments on commit 22761a9

Please sign in to comment.