Optional
active?: booleanspecify if control should be actived at startup. Default is false.
Optional
apiKey?: stringAPI key for services call (isocurve and autocomplete services). The key "calcul" is used by default.
Optional
displayProfileOptions?: {profile options.
Optional
apply?: Functionfunction to display profile if you want to cutomise it. By default, (DISPLAY_PROFILE_BY_DEFAULT()) is used. Helper functions to use with D3 (DISPLAY_PROFILE_LIB_D3()) or AmCharts (DISPLAY_PROFILE_LIB_AMCHARTS()) frameworks are also provided. You may also provide your own function.
Optional
ascendingElevation?: booleandisplay the ascending elevation into the graph
Optional
currentSlope?: booleandisplay current slope value on profile mouseover
Optional
descendingElevation?: booleandisplay the descending elevation into the graph
Optional
greaterSlope?: booleandisplay the greater slope into the graph
Optional
meanSlope?: booleandisplay the mean slope into the graph
Optional
target?: anyDOM container to use to display the profile.
Optional
totalDistance?: booleandisplay the total distance of the path
Optional
elevationOptions?: anyelevation path service options. See Gp.Services.getAltitude() for available options
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
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
ssl?: booleanuse of ssl or not (default true, service requested using https protocol)
Optional
stylesOptions?: { draw?: { finish?: any; pointer?: any; start?: any }; marker?: any }styles management
Optional
draw?: { finish?: any; pointer?: any; start?: any }styles used when drawing. Specified with following properties.
Optional
finish?: anyLine Style when finished drawing. Specified with an ol.style.Stroke object.
Optional
pointer?: anyStyle for mouse pointer when drawing the line. Specified with an ol.style.Image subclass object.
Optional
start?: anyLine Style when drawing. Specified with an ol.style.Stroke object.
Optional
marker?: anystyles management of marker displayed on map when the user follows the elevation path. Specified with an ol.style.Image subclass object
var measure = new ol.control.ElevationPath({
export : false,
stylesOptions : {
draw : {
finish : new ol.style.Stroke({
color : "rgba(0, 0, 0, 0.5)",
width : 2
})
},
}
displayProfileOptions : {
apply : ol.control.ElevationPath.DISPLAY_PROFILE_RAW,
}
});
// if you want to pluggued the control Export with options :
var measure = new ol.control.ElevationPath({
export : {
name : "export",
format : "geojson",
title : "Exporter",
menu : false
}
});
Exemples :
- displayProfileOptions.apply : null
- displayProfileOptions.apply : function (elevations, container, context) { // do some stuff... }
- displayProfileOptions.apply : ol.control.ElevationPath.DISPLAY_PROFILE_{LIB_AMCHARTS | LIB_D3 | RAW}
Protected
disposedThe object has already been disposed.
Protected
listenerStatic
_profileStatic
DEFAULT_Styles applied by default if stylesOptions property is not set.
Key name.
Listener.
Type.
Listener.
Protected
applyProtected
Apply any properties from another object without triggering events.
The source object.
clean
remove layer
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 actived (drawing), false otherwise
active - true or false
Get container
container
Get elevation data
data - elevations
{
* type // "elevationpath"
* greaterSlope // pente max
* meanSlope // pente moyenne
* distancePlus // distance cumulée positive
* distanceMinus // distance cumulée négative
* ascendingElevation // dénivelé cumulée positive
* descendingElevation // dénivelé cumulée négative
* altMin // altitude min
* altMax // altitude max
* distance // distance totale
* unit // unité des mesures de distance
* points // elevations
* }
Get vector layer
geojson - GeoJSON format layer
Get layer
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.
Key name.
Old value.
Protected
onceProtected
onKey name.
Listener.
Type.
Listener.
Actived widget drawing or not
true / false
Set profile data
elevations
{
* greaterSlope // pente max
* meanSlope // pente moyenne
* distancePlus // distance cumulée positive
* distanceMinus // distance cumulée négative
* ascendingElevation // dénivelé cumulée positive
* descendingElevation // dénivelé cumulée négative
* altMin // altitude min
* altMax // altitude max
* distance // distance totale
* unit // unité des mesures de distance
* points // elevations
* }
Set layer
ol.layer.Vector profil layer
Attach control to map. Overloaded ol.control.Control.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.
Static
DISPLAY_Display Profile function used by default : no additonal framework needed.
elevations values for profile
html container where to display profile
this control object
Static
DISPLAY_display Profile using Amcharts framework. This method needs AmCharts libraries to be loaded.
collection elevations
container
this control object
Static
DISPLAY_display Profile using D3 javascript framework. This method needs D3 libraries to be loaded.
elevations values for profile
html container where to display profile
this control object
Static
DISPLAY_display Profile without graphical rendering (raw service response)
elevations values for profile
html container where to display profile
this control object
event triggered when the compute is finished
elevationpath:compute
event triggered at the end of drawing input
elevationpath:drawend
event triggered at the start of drawing input
elevationpath:drawstart
options for function call.