Class: RoutingGeoportail

ol.control. RoutingGeoportail

Geoportail routing Control.


new RoutingGeoportail( [options])

Parameters:
Name Type Argument Description
options Object <optional>
Properties
Name Type Argument Default Description
className string

control class name

leng string <optional>
en

control language

apiKey string | undefined <optional>

the service api key.

authentication: string | undefined

basic authentication for the service API as btoa("login:pwd")

target Element | string | undefined

Specify a target if you want the control to be rendered outside of the map's viewport.

label string | undefined

Text label to use for the search button, default "search"

placeholder string | undefined

placeholder, default "Search..."

inputLabel string | undefined

label for the input, default none

noCollapse string | undefined

prevent collapsing on input blur, default false

typing number | undefined

a delay on each typing to start searching (ms) use -1 to prevent autocompletion, default 300.

minLength integer | undefined

minimum length to start searching, default 1

maxItems integer | undefined

maximum number of items to display in the autocomplete list, default 10

maxHistory integer | undefined

maximum number of items to display in history. Set -1 if you don't want history, default maxItems

getTitle function

a function that takes a feature and return the name to display in the index.

autocomplete function

a function that take a search string and callback function to send an array

timeout number

default 20s

Fires:
  • event:select
  • change:input
  • routing:start
  • event:routing
  • step:select
  • step:hover
  • event:error
  • event:abort

Extends

Members


instructions

Instructions labels

Methods


abort()

Abort request


ajax(url, onsuccess, onerror)

Send an ajax request (GET)

Parameters:
Name Type Description
url string
onsuccess function

callback

onerror function

callback


calculate(steps)

Calculate route

Parameters:
Name Type Description
steps Array.<ol.coordinate> | undefined

an array of steps in EPSG:4326, default use control input values

Returns:

true is a new request is send (more than 2 points to calculate)

Type
boolean

getDistanceString(d)

Gets distance as string

Parameters:
Name Type Description
d number

distance

Returns:
Type
string

getSource()

Get point source

Returns:
Type
ol.source.Vector

getTimeString(routing)

Gets time as string

Parameters:
Name Type Description
routing *

routing response

Returns:
Type
string

setMap(map)

Set the map instance the control is associated with and add its controls associated to this map.

Parameters:
Name Type Description
map _ol_Map_

The map instance.