omeka / MallMap

0 stars 4 forks source link

Alvin updates #31

Closed bierleya closed 3 years ago

bierleya commented 3 years ago

2 main changes in this branch:

  1. Added numbered markers to the tours Before, all points in the tour were marked with the same solid color, blank marker. I took inspiration from this website to add numbers to each marker, based on the order of the tour. To do this, I added a CSS class to create the marker and add the numbers as text, and extended the geoJSON response to write the numbers onto the markers based on the ordering of the tour points.

  2. Added walking routes to the tours There were originally no walking directions between each of the tour markers, as each point in the tour was simply connected to the next with a straight line (didn't take walking directions into account). To resolve this, I used the openrouteservice API to generate walking directions between any two tour locations on the map. This works by making an API call between 2 points (doing this repeatedly as indicated by the order of the tour), and each API call returns a list of coordinates that correspond to walking directions. By combining the walking directions between all the points, a full walking route is generated, and this is displayed on the map by creating a polyline using the coordinates.