[RESULT MAP] insert a map on the result page
Goals
Have an overview of results on a map with markers
Link result cards and markers on the map
Changes
-
app/assets/javascripts/map.js
: create a function to display a Google Map on the result page with all markers and all eventlisteners -
app/stylesheets/main.scss
: added some css to manage page scrolling on the left while the map remains centered -
app/controllers/results_controller.rb
: create variables to create input for JS function -
app/views/layouts/application.html.erv
: include Google Maps API in JS tag in head -
app/views/result_lines/_result_line
: change result cards to ad an id for css & make cards horizontal -
app/views/results/show.html.erb
: add call to JS function in head + create a div for the map in html body -
app/views/results/show.js.erb
: hum... file to delete, created for tests -
config/application.rb
: insert line to switch devise in french
Tests
-
When I launch a search, the results are displayed as cards and as markers on the Google Map : PASSED -
When I hover a pin on the map, both the matching card and the marker switch color to blue temporarily : PASSED -
When a marker on the map is clicked, the page is scrolled to the matching card : PASSED