Optionalactive?: booleanspecify if control should be actived at startup. Default is false.
OptionalapiKey?: stringAPI key for services call (isocurve and autocomplete services). The key "calcul" is used by default.
OptionaldisplayProfileOptions?: {profile options.
Optionalapply?: 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.
OptionalascendingElevation?: booleandisplay the ascending elevation into the graph
OptionalcurrentSlope?: booleandisplay current slope value on profile mouseover
OptionaldescendingElevation?: booleandisplay the descending elevation into the graph
OptionalgreaterSlope?: booleandisplay the greater slope into the graph
OptionalmeanSlope?: booleandisplay the mean slope into the graph
Optionaltarget?: anyDOM container to use to display the profile.
OptionaltotalDistance?: booleandisplay the total distance of the path
OptionalelevationOptions?: anyelevation path service options. See Gp.Services.getAltitude() for available options
Optionalexport?: anySpecify if button "Export" is displayed. For the use of the options of the "Export" control, see packages/Controls/Export/Export.default
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
Optionalssl?: booleanuse of ssl or not (default true, service requested using https protocol)
OptionalstylesOptions?: { draw?: { finish?: any; pointer?: any; start?: any }; marker?: any }styles management
Optionaldraw?: { finish?: any; pointer?: any; start?: any }styles used when drawing. Specified with following properties.
Optionalfinish?: anyLine Style when finished drawing. Specified with an ol.style.Stroke object.
Optionalpointer?: anyStyle for mouse pointer when drawing the line. Specified with an ol.style.Image subclass object.
Optionalstart?: anyLine Style when drawing. Specified with an ol.style.Stroke object.
Optionalmarker?: 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}
ProtecteddisposedThe object has already been disposed.
ProtectedlistenerStatic_profileStaticDEFAULT_Styles applied by default if stylesOptions property is not set.
Key name.
Listener.
Type.
Listener.
ProtectedapplyProtectedApply 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.
ProtecteddisposeProtectedExtension 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
Optionaltype: 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.
ProtectedonceProtectedonKey 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.
ProtectedunProtectedUnlisten for a certain type of event.
Type.
Listener.
StaticDISPLAY_Display Profile function used by default : no additonal framework needed.
elevations values for profile
html container where to display profile
this control object
StaticDISPLAY_display Profile using Amcharts framework. This method needs AmCharts libraries to be loaded.
collection elevations
container
this control object
StaticDISPLAY_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
StaticDISPLAY_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.