new RoutingGeoportail( [options])
Parameters:
| Name | Type | Argument | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | 
            
            Object | 
                
                    <optional> | 
            
            
            
                Properties
  | 
        
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
 - 
    
addButton(className, title, info)
 - 
    
    
Add a new button
Parameters:
Name Type Description classNamestring titlestring infostring  - 
    
ajax(url, onsuccess, onerror)
 - 
    
    
Send an ajax request (GET)
Parameters:
Name Type Description urlstring onsuccessfunction callback
onerrorfunction callback
 - 
    
calculate(steps)
 - 
    
    
Calculate route
Parameters:
Name Type Description stepsArray.<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 dnumber 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
 
 - 
    
setConstraint(type [, value])
 - 
    
    
Add / remove constraint
Parameters:
Name Type Argument Description typestring valuestring <optional> 
 - 
    
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.
 - 
    
setMethod(method [, silent])
 - 
    
    
Set method (shortest, fastest)
Parameters:
Name Type Argument Default Description methodstring silentboolean <optional> 
false pervent calculating
 - 
    
setMode(mode [, silent])
 - 
    
    
Set the mode (car/pedestrian)
Parameters:
Name Type Argument Default Description modestring silentboolean <optional> 
false pervent calculating