# Class: Routing

## (abstract) bemap.Routing(context, options)

Base class for routing calculation.

## Constructor

#### (abstract) new Routing(context, options)

##### Parameters:

Name | Type | Description
--- | --- | ---
`context` | bemap.Context | BeMap-JS-API Context. Mandatory.
`options` | object | see below the available values.

Source:
  - bemap-services/bemap-routing.js, line 14

### Members

#### criterias :bemap.Criteria

Array of route Criteria.

##### Type:

- bemap.Criteria

Source:
  - bemap-services/bemap-routing.js, line 296

#### (protected) destinations :bemap.Coordinates

Destinations

##### Type:

- bemap.Coordinates

Source:
  - bemap-services/bemap-routing.js, line 290

#### (protected) geometryId :String

ID of geometry.

##### Type:

- String

Source:
  - bemap-services/bemap-routing.js, line 54

#### (protected) markerMapObject :bemap.Marker

Marker(s) list.

##### Type:

- bemap.Marker

Source:
  - bemap-services/bemap-routing.js, line 38

#### (protected) nativeBeMapParams :String

Native parameters of BeMap server.

##### Type:

- String

Source:
  - bemap-services/bemap-routing.js, line 24

#### (protected) poylineAsPolygon :boolean

Draw a polygon with the polyline array.

##### Type:

- boolean

Source:
  - bemap-services/bemap-routing.js, line 61

#### (protected) routes :bemap.Route

Calculated route(s).

##### Type:

- bemap.Route

Source:
  - bemap-services/bemap-routing.js, line 31

#### (protected) stopPoints :Object

Vias(s) list.

##### Type:

- Object

Source:
  - bemap-services/bemap-routing.js, line 46

### Methods

#### cleanMarkers() → {bemap.markerMapObject}

Clean the markerMapObject object.

Source:
  - bemap-services/bemap-routing.js, line 749

##### Returns:

this

Type
  bemap.markerMapObject

#### compute(options) → {bemap.Routing}

Execute the routing calculation.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | object | See below the available values. ###### Properties
Name | Type | Description
--- | --- | ---
`geoserver` | String | Geoserver name will be used for this computation.
`success` | function | the function to call in case of successed request.
`failed` | function | the function to call in case of failed request.

Source:
  - bemap-services/bemap-routing.js, line 276

##### Returns:

this

Type
  bemap.Routing

#### createMarker(options, listener) → {bemap.markerMapObject}

Show the destinations markers on map.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options.map` | bemap.Map | the new marker to set.
`options` | Object | See below the available values.
`listener` | listener | return click on marker.

Source:
  - bemap-services/bemap-routing.js, line 769

##### Returns:

Return this.

Type
  bemap.markerMapObject

#### getFirstRoute() → {bemap.Route}

Get the calculated route object.

Source:
  - bemap-services/bemap-routing.js, line 95

##### Returns:

the calculated route.

Type
  bemap.Route

#### getRoute(index) → {bemap.Route}

Get the calculated route object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`index` | integer | of route.

Source:
  - bemap-services/bemap-routing.js, line 76

##### Returns:

the calculated route.

Type
  bemap.Route

#### getRoutes(index) → {bemap.Route}

Get the calculated route object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`index` | integer | of route.

Source:
  - bemap-services/bemap-routing.js, line 86

##### Returns:

the calculated route.

Type
  bemap.Route

#### reset() → {bemap.Routing}

Reset the Routing object. Clear the previous result.

Source:
  - bemap-services/bemap-routing.js, line 104

##### Returns:

this

Type
  bemap.Routing

#### resetRoute() → {bemap.Routing}

Reset the Routing object. Clear the previous result.

Source:
  - bemap-services/bemap-routing.js, line 133

##### Returns:

this

Type
  bemap.Routing

#### showOnMap(map, options) → {bemap.Routing}

Show the route(s) on map.

##### Parameters:

Name | Type | Description
--- | --- | ---
`map` | bemap.Map | the new color of text border to set.
`options` | Object | See below the available values. ###### Properties
Name | Type | Description
--- | --- | ---
`polylineStyle` | bemap.LineStyle | Style of line used by the renderer.
`chargingStationStepImageSrc` | String | Image path of pool stations.
`chargingStationStepNoPopup` | String | If set to true, disable the popup when the icon is clicked.
`chargingStationPopupTextCallback` | function | Function called wehen a pool statiion is clicked, the called function get the step point object and return the text of popup.

Source:
  - bemap-services/bemap-routing.js, line 600

##### Returns:

Return this.

Type
  bemap.Routing

#### showOnMapMarkers(map, options, listener) → {bemap.markerMapObject}

Show the destinations markers on map.

##### Parameters:

Name | Type | Description
--- | --- | ---
`map` | bemap.Map | the new marker to set.
`options` | Object | See below the available values. ###### Properties
Name | Type | Description
--- | --- | ---
`layer` | bemap.Layer | Layer for markers.
`response` | Object | Optionally response from geocoding or list of coords.
`listener` | listener | return click on marker.

Source:
  - bemap-services/bemap-routing.js, line 678

##### Returns:

Return this.

Type
  bemap.markerMapObject