routing planner results - GeoSmartCity-CIP/gsc-client GitHub Wiki

View Routing Planner Results

This module implements an OpenLayers widgets view the results of a routing planner request. It consists of a map overlay panel where the route descriptions are shown as well as a number of underlying JavaScript methods execute and search for routes.

This module is part of enclosing gsc-client library and provides capabilities for viewing the results of the routing planner on the map.

API

The full API is available at GitHub in the file /src/routing/routing.js and is fully documented in the JsDoc syntax

Dependencies

The view routing planner results functionality relies on an OpenLayers 3 Map object for overlaying panels (list of saved routes) and geometries (route geometries).

Examples

Add a route list widget to an OpenLayers3 Map object

var olMap = new ol.Map({
     // Map creation options
});

gsc.routing.savedRouteListWidget(olMap);

Add a route display widget to an OpenLayers3 Map object

var olMap = new ol.Map({
     // Map creation options
});

var myRoute = new gsc.routing.Route(); // Initialize a route object

// Then simply add the widget on top of the map object using this static method
gsc.routing.viewRouteWidget(myRoute, olMap);

The map below shows the display of the route geometry as well as the details of the route based on a calculation on the OSM road network base map.

The full source code of the examples can be found at here.