OptionalapiKey?: stringAPI key for services call (route and autocomplete services). The key "calcul" is used by default.
OptionalautocompleteOptions?: anyautocomplete service options. see Gp.Services.autoComplete() to know all autocomplete options
Optionalcollapsed?: booleanSpecify if widget has to be collapsed (true) or not (false) on map loading. Default is true.
Optionaldraggable?: booleanSpecify if widget is draggable
Optionalexclusions?: anylist of exclusions with status (true = checked). By default : no exclusions checked.
Optionalexport?: anySpecify if button "Export" is displayed. For the use of the options of the "Export" control, see packages/Controls/Export/Export.default
Optionalgraphs?: any[]list of resources, by default : ["Voiture", "Pieton"]. The first element is selected.
Optionalid?: numberAbility to add an identifier on the widget (advanced option)
OptionallayerDescription?: { description?: string; title?: string }Layer informations to be displayed in LayerSwitcher widget (only if a LayerSwitcher is also added to the map)
Optionaldescription?: stringLayer description to be displayed in LayerSwitcher
Optionaltitle?: stringLayer title to be displayed in LayerSwitcher
OptionalmarkersOpts?: { 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 :
Optionaloffset?: 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)
Optionalurl?: stringmarker base64 encoded url (ex "data:image/png;base64,...""). Mandatory for a custom marker
OptionalrouteOptions?: anyroute service options. see Gp.Services.route() to know all route options.
Optionalssl?: 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
}
});
ProtecteddisposedThe object has already been disposed.
ProtectedlistenerKey name.
Listener.
Type.
Listener.
ProtectedapplyProtectedApply 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.
ProtecteddisposeProtectedExtension 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
Optionaltype: 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.
ProtectedonceProtectedonKey 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.
ProtectedunProtectedUnlisten for a certain type of event.
Type.
Listener.
route control options