Class: RoutingService service:ngeoRoutingService

ngeo.routing.RoutingService

new RoutingService($http, $injector)

Service to provide access to a Open Source Routing Machine (OSRM) backend of version 5.8 and higher and its features.

Parameters:
Name Type Description
$http angular.$http

Angular http service.

$injector angular.$injector

Main injector.

Members

(static, non-null) module: angular.Module

Methods

getNearest(coordinate, config)

Snaps a coordinate to the street network and returns the nearest match

Parameters:
Name Type Description
coordinate ol.Coordinate

coordinate to query

config ?Object

optional configuration

See:
Returns:
!angular.$http.HttpPromise

promise of the OSRM API request

getRoute(coordinates, config)

Route request

Parameters:
Name Type Description
coordinates Array.

coordinates of the route (at least two!)

config ?Object

optional configuration

Returns:
!angular.$http.HttpPromise

promise of the OSRM API request