Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To check that some of the functions are working, you can click any empty spot on the map to add a marker labelled with a new letter of the alphabet. You can also try clicking on an existing marker to reveal information about the locationslocation. At the top middle center of the map, you will see a button called “Find Current Location”. When clicked on that, you will be prompted to allow location services and the map will center to your current location. To go back, click “Return to UW” at the top left.

In the current code, attributes can be set such as to determine the center of the map upon starting the server, the zoom level, and map type (hybrid/terrain/road). The center of the map can be identified using lat/long coordinates and in this case, it is set to the the middle of the University Shops Plaza. The zoom level is 17 (the higher the number, more zoomed the map is), and the map type is hybrid, showing which shows terrain as well as street/location names.

A listener was added to “listen' “listen” to clicks on the map, and as a result when clicked, a new marker is added with an a sequential alphabet label. Another listener was added to listen to clicks on existing markers, which then shows the info window for that marker.

A list of markers were declared with lat/long coordinates , and content containing the location name. The list was looped through and each marker was added to the map. The red polyline path was drawn using a list of flightPlanCoordinates, which is just another list of lat and long coordinates. Properties of the path polyline were set, such as the colour, opacity, and weight, and the flight path was set to the map. This simply connects each sequential coordinate using a red line and displays the red line on the map.

Finally, functions were added that allow the user to jump to their current location, as well as jumping back the Waterloo campus.