new ElevationPath(options)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object |
options for function call.
|
Fires:
- elevationpath:drawstart
- elevationpath:drawend
- elevationpath:compute
- export:compute
Example
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}
Extends
- ol.control.Control
Members
-
staticol.control.ElevationPath.DEFAULT_STYLES
-
Styles applied by default if stylesOptions property is not set.
Methods
-
staticDISPLAY_PROFILE_BY_DEFAULT(data, container, context)
OpenLayers/Controls/ElevationPath.js, line 408 -
Display Profile function used by default : no additonal framework needed.
Name Type Description data Object elevations values for profile
container HTMLElement html container where to display profile
context Object this control object
-
staticDISPLAY_PROFILE_LIB_AMCHARTS(data, container, context)
OpenLayers/Controls/ElevationPath.js, line 345 -
display Profile using Amcharts framework. This method needs AmCharts libraries to be loaded.
Name Type Description data Object collection elevations
container HTMLElement container
context Object this control object
-
staticDISPLAY_PROFILE_LIB_D3(data, container, context)
OpenLayers/Controls/ElevationPath.js, line 368 -
display Profile using D3 javascript framework. This method needs D3 libraries to be loaded.
Name Type Description data Object elevations values for profile
container HTMLElement html container where to display profile
context Object this control object
-
staticDISPLAY_PROFILE_RAW(data, container, context)
OpenLayers/Controls/ElevationPath.js, line 391 -
display Profile without graphical rendering (raw service response)
Name Type Description data Object elevations values for profile
container HTMLElement html container where to display profile
context Object this control object
-
clean()
OpenLayers/Controls/ElevationPath.js, line 712 -
clean
-
getActive(){Boolean}
OpenLayers/Controls/ElevationPath.js, line 574 -
Returns true if widget is actived (drawing),
false otherwiseReturns:
- true or false
-
getContainer(){DOMElement}
OpenLayers/Controls/ElevationPath.js, line 643 -
Get container
-
getData(){Object}
OpenLayers/Controls/ElevationPath.js, line 609 -
Get elevation data
Returns:
- elevations
Example
{ 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 }
-
getGeoJSON(){String}
OpenLayers/Controls/ElevationPath.js, line 684 -
Get vector layer
Returns:
- GeoJSON format layer
-
getLayer(){ol.layer.Vector}
OpenLayers/Controls/ElevationPath.js, line 652 -
Get layer
-
getStyle(){ol.style}
OpenLayers/Controls/ElevationPath.js, line 705 -
Get default style
-
init()
OpenLayers/Controls/ElevationPath.js, line 734 -
This method is public.
It allows to init the control. -
setActive(active)
OpenLayers/Controls/ElevationPath.js, line 584 -
Actived widget drawing or not
Name Type Description active Boolean true / false
-
setData(data)
OpenLayers/Controls/ElevationPath.js, line 634 -
Set profile data
Name Type Description data * elevations
Example
{ 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 }
-
setLayer(layer)
OpenLayers/Controls/ElevationPath.js, line 661 -
Set layer
Name Type Description layer Object ol.layer.Vector profil layer
-
setMap(map)
OpenLayers/Controls/ElevationPath.js, line 528 -
Attach control to map. Overloaded ol.control.Control.setMap() method.
Name Type Description map ol.Map Map.