Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.59 KB

README.lesson7.md

File metadata and controls

30 lines (21 loc) · 1.59 KB

Lesson 7

Start by checking out the lesson7branch

This week we want to allow the user to display the search results on a map.

Steps:

  1. Add a button to open a bootstrap modal, where we'll display the map.

  2. Add an empty Map inside the modal.

    • Put the map related code in the onMapOpen' function in Client` which runs every time the user opens the Map.
    • See https://developers.google.com/maps/documentation/javascript/examples/map-simple
    • NOTE: In the docs a JavaScript object literal is used when creating the Map, and the center's latitude and logitude. But we don't pass object literals from ScalaJS if we can avoid it. We want type safety! So, instead, you will have to pass a instance of MapOptions to Map and create a LatLng for the center.
  3. Add a Marker for each Hotel.

  4. Update the Map's LatLngBounds, so the Map focuses on the right area.

  5. Add InfoWindows to display a Hotel's description when a marker is clicked on.