Routing¶
Requirements¶
In addition to the Getting started, the Routing Control must be configured with URL of routing service and added to the map:
Code
const routingControl = new ControlRouting({
projectName: config.projectName,
routeServiceUrl: 'https://ssp.deepmap.de/routingservice',
showDialog: true
});
map.addControl(routingControl);
Routing from Feature to Feature by Original Serial¶
It’s possible to route from one feature to another using their original serials. The following example will draw the route on the map and zoom to it with an animation.
Code
routingControl.getRouteWithOriginalSerials("stand_manual_8032", "stand_manual_809", true, true, true);
Routing from Point to Point¶
Routing from Point to Point is also possible:
Code
var startRoutePoint = {
lng: 8.6685557,
lat: 49.4186050484,
level: 0,
};
var endRoutePoint = {
lng: 8.672886187,
lat: 49.417546901,
level: 0
};
routingControl.getRouteByRoutePoint(startRoutePoint, endRoutePoint, true, true, true);
For more details see the API