Class

MapComponent

MapComponent(…props)

The only true map that shows inside the application.

Constructor

# new MapComponent(…props)

Default constructor, gets called automatically upon initialization.

Parameters:
Name Type Attributes Description
props MapComponentProps <repeatable>

Props received so that the component can function properly.

View Source Components/MapComponent/MapComponent.jsx, line 38

Members

# drawNewRoute

After receiving the updated stops, send a call to the routingAPI to find a suitable route between two points/stations, if a route is found, it's returned and drawn to the map.

View Source Components/MapComponent/MapComponent.jsx, line 159

# removeCurrentRoute

Remove the current route drawn on the map

View Source Components/MapComponent/MapComponent.jsx, line 217

Methods

# componentDidMount()

Create Openlayers map (source, view, layer, etc...). Add event listener onClick to handle location selection from map.

View Source Components/MapComponent/MapComponent.jsx, line 73

# componentDidUpdate()

Perform the necessary actions when receiving updated props. If new stops are received, then remove any existing stops/routes and draw those stops/routes.

View Source Components/MapComponent/MapComponent.jsx, line 114

# render()

Render the map component to the dom

View Source Components/MapComponent/MapComponent.jsx, line 229