Optional
apiKey?: stringAPI key for services call (route and autocomplete services). The key "calcul" is used by default.
Optional
autocompleteOptions?: anyautocomplete service options. see Gp.Services.autoComplete() to know all autocomplete options
Optional
collapsed?: booleanSpecify if widget has to be collapsed (true) or not (false) on map loading. Default is true.
Optional
draggable?: booleanSpecify if widget is draggable
Optional
exclusions?: anylist of exclusions with status (true = checked). By default : no exclusions checked.
Optional
export?: anySpecify if button "Export" is displayed. For the use of the options of the "Export" control, see packages/Controls/Export/Export.default
Optional
graphs?: any[]list of resources, by default : ["Voiture", "Pieton"]. The first element is selected.
Optional
id?: numberAbility to add an identifier on the widget (advanced option)
Optional
layerDescription?: { description?: string; title?: string }Layer informations to be displayed in LayerSwitcher widget (only if a LayerSwitcher is also added to the map)
Optional
description?: stringLayer description to be displayed in LayerSwitcher
Optional
title?: stringLayer title to be displayed in LayerSwitcher
Optional
markersOpts?: { offset?: any[]; url?: string }options to use your own markers. Object properties can be "departure", "stages" or "arrival". Corresponding value is an object with following properties :
Optional
offset?: any[]Offsets in pixels used when positioning the overlay. The first element in the array is the horizontal offset. A positive value shifts the overlay right. The second element in the array is the vertical offset. A positive value shifts the overlay down. Default is [0, 0]. (see http://openlayers.org/en/latest/apidoc/ol.Overlay.html)
Optional
url?: stringmarker base64 encoded url (ex "data:image/png;base64,...""). Mandatory for a custom marker
Optional
routeOptions?: anyroute service options. see Gp.Services.route() to know all route options.
Optional
ssl?: booleanuse of ssl or not (default true, service requested using https protocol)
var route = ol.control.Route({
"collapsed" : true
"draggable" : true,
"export" : false,
"exclusions" : {
"toll" : true,
"bridge" : false,
"tunnel" : true
},
"graphs" : ['Pieton', 'Voiture'],
"markersOpts" : {
"departure" : {
"url" : "...",
"offset" : [0,0]
},
"stages" : {
"url" : "...",
"offset" : [0,0]
},
"arrival" : {
"url" : "...",
"offset" : [0,0]
}
}
"autocompleteOptions" : {},
"routeOptions" : {}
});
// if you want to pluggued the control Export with options :
var route = new ol.control.Route({
export : {
name : "export",
format : "geojson",
title : "Exporter",
menu : false
}
});
Protected
disposedThe object has already been disposed.
Protected
listenerKey name.
Listener.
Type.
Listener.
Protected
applyProtected
Apply any properties from another object without triggering events.
The source object.
Clean UI : reinit control
Dispatches an event and calls all listeners listening for events
of this type. The event parameter can either be a string or an
Object with a type
property.
Event object.
false
if anyone called preventDefault on the
event object or if any of the listeners returned false.
Clean up.
Protected
disposeProtected
Extension point for disposable objects.
Returns true if widget is collapsed (minimized), false otherwise
collapsed - true if widget is collapsed
Get container
container
Get route informations
data - route informations
Get vector layer
geojson - GeoJSON format layer
Get vector layer where geoJson route is drawn
layer - ol.layer.Vector route layer
Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.
Type.
Listeners.
Get an object of all property names and values.
Object.
Get default style
style
Optional
type: stringType. If not provided,
true
will be returned if this event target has any listeners.
Has listeners.
The object has properties.
This method is public. It allows to init the control.
Key name.
Old value.
Protected
onceProtected
onKey name.
Listener.
Type.
Listener.
Collapse or display widget main container
True to collapse widget, False to display it
Set route data
control informations
computation type
list of exclusions
list of points : [[lon, lat]]
service response
transport type
Set vector layer
GeoJSON format layer
Set vector layer where route geometry is drawn
ol.layer.Vector route layer
Overwrite OpenLayers setMap method
Map.
This function is used to set a target element for the control. It has no
effect if it is called after the control has been added to the map (i.e.
after setMap
is called on the control). If no target
is set in the
options passed to the control constructor and if setTarget
is not called
then the control is added to the map's overlay container.
Target.
Protected
unProtected
Unlisten for a certain type of event.
Type.
Listener.
route control options