I have added a
Map View (with a difference)!
First, Open Data provides the (latitude and longitude) coordinates, for each (most) bus route, for both the outbound and inbound routes. The API request below retrieves details for the
Bus Line 316 and the coordinates are provided in the response property
lineStrings as an array of coordinates (in a string format - the outbound route in the 1st array and the inbound in the 2nd array). Depending on the length of the route, about 80 - 150 coordinates are provided for the each leg of the route.
To view the
Map View, select a route listed in the
Bus Line Network Analysis and click on the
Map button (screenshot provided below).
Bus Route Map window will be shown. The
markers used are:
Start of Bus Route
Bus Stop along route
End of Bus Route
To make the view more engaging and interactive, the mapping of the bus route is animated from start to end and each bus stop is created along the route as it is being plotted.
Bus Stops are listed to the right of the map and the distance between each stop is shown in km and mi.
Furthermore, as your mouse hovers over the list, the corresponding
Bus Stop on the map is animated and the segment of the bus route is highlighted.
The screenshot below illustrates the map view with the mouse hovering over the
Distance information and the corresponding bus route segment highlighted.
The overall mapping information opens up more opportunities to provide additional analysis which I am aiming to develop over the coming weeks!
Just to share with fellow developers…I am using the fantastic
Leaflet open-source JavaScipt library for interactive mapping.