Fix map markers navigation for keyboard users

By using the bindPopup function instead of the click event
popups work when using the keyboard.

Note that now we are loading all the map markers in the first
request in a single query to the database (needed when there
is a lot or markers to show). Because of that we removed the
AJAX endpoint.
This commit is contained in:
Senén Rodero Rodríguez
2023-06-16 15:48:57 +02:00
parent 2b0a812543
commit 3fa3c90db6
7 changed files with 28 additions and 39 deletions

View File

@@ -18,7 +18,7 @@ class Budgets::Investments::MapComponent < ApplicationComponent
end
def coordinates
MapLocation.where(investment: investments).map(&:json_data)
MapLocation.investments_json_data(investments.unscope(:order))
end
def geozones_data

View File

@@ -19,7 +19,7 @@ class Budgets::MapComponent < ApplicationComponent
investments = budget.investments
end
MapLocation.where(investment_id: investments).map(&:json_data)
MapLocation.investments_json_data(investments)
end
def geozones_data