# Class RoutingService

#### Hierarchy

- RoutingService

- Defined in src/routing/RoutingService.js:37

#####
Index

### Properties

$http_
ngeoOsrmBackendUrl_
protocolVersion_
routingOptions_

### Methods

getNearest
getRoute

## Properties

### $http_

$http_: IHttpService

- Defined in src/routing/RoutingService.js:41

### ngeoOsrmBackendUrl_

ngeoOsrmBackendUrl_: string

URL for OSRM backend API. Defaults to demo backend.

- Defined in src/routing/RoutingService.js:54

### protocolVersion_

protocolVersion_: string

Version of the protocol implemented by the service. see: https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md

- Defined in src/routing/RoutingService.js:67

### routingOptions_

routingOptions_: ngeoRoutingOptions

- Defined in src/routing/RoutingService.js:46

## Methods

### getNearest

- getNearest(coordinate: Coordinate, config: Config): IHttpPromise<Object>

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

  ### Returns

  promise of the OSRM API request

  ### See

  https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#nearest-service

  #### Parameters

  - ##### coordinate: Coordinate

    coordinate to query

  - ##### config: Config

    optional configuration

  #### Returns IHttpPromise<Object>

  - Defined in src/routing/RoutingService.js:165

### getRoute

- getRoute(coordinates: Coordinate[], config: Config): IHttpPromise<Routes>

- Route request

  ### Returns

  promise of the OSRM API request

  #### Parameters

  - ##### coordinates: Coordinate[]

    coordinates of the route (at least two!)

  - ##### config: Config

    optional configuration

  #### Returns IHttpPromise<Routes>

  - Defined in src/routing/RoutingService.js:108

Generated using TypeDoc