new Profile( [options])
Parameters:
| Name | Type | Argument | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
Fires:
- event:over
- event:out
- event:show
- event:dragstart
- event:dragging
- event:dragend
- event:dragcancel
Extends
Members
-
info
-
Custom infos list
Methods
-
_numberFormat(number, decimals,)
-
Convert numbers to a custom locale format. Enables language-sensitive number formatting using locales with browser native method toLocaleString. This is useful to change the decimal separator as well as to add/change the thousands separator.
Parameters:
Name Type Description numbernumber | string decimals,number default is 2
Returns:
- Type
- string
-
_unitsConversion(nMeters, targetUnit)
-
Convert meters to another system of measurement or unit
Parameters:
Name Type Description nMetersnumber targetUnit'm' | 'km' | 'ft' | 'mi' default is m
Returns:
- Type
- number
-
getImage(type, encoderOptions)
-
Get profile image
Parameters:
Name Type Description typestring | undefined image format or 'canvas' to get the canvas image, default image/png.
encoderOptionsNumber | undefined between 0 and 1 indicating image quality image/jpeg or image/webp, default 0.92.
Returns:
requested data uri
- Type
- string
-
getSelection(starting, ending)
-
Get selection
Parameters:
Name Type Description startingnumber point
endingnumber point
Returns:
- Type
- Array.<ol.coordinate>
-
hide()
-
Hide panel
-
isShown()
-
Is panel visible
-
onMove()
-
Mouse move over canvas
-
pointAtTime(time)
-
Get the point at a given time on the profile
Parameters:
Name Type Description timenumber time at which to show the point
Returns:
current point
- Type
- ol.coordinates
-
popup(info)
-
Show popup info
Parameters:
Name Type Description infostring to display as a popup
-
refresh()
-
Refresh the profile
-
setGeometry(f [, options])
-
Set the geometry to draw the profile.
Parameters:
Name Type Argument Description fol.Feature | ol.geom.Geometry the feature.
optionsObject <optional>
Properties
Name Type Argument Default Description projectionol.ProjectionLike <optional>
feature projection, default projection of the map
zunit'm' | 'km' | 'ft' | 'mi' <optional>
'm' 'm', 'km', 'ft' or 'mi', default 'm' or 'ft' according to the System of measurement
unit'm' | 'km' | 'ft' | 'mi' <optional>
'km' 'm', 'km', 'ft' or 'mi', default 'km' or 'mi' according to the System of measurement
zminNumber | undefined <optional>
0 default 0
zmaxNumber | undefined <optional>
default max Z of the feature
zDigitsinteger | undefined <optional>
0 number of digits for z graduation, default is calculated according to the value range
xDigitsinteger | undefined <optional>
1 number of digits for x-axis (distance), default 1
zDigitsHovernumber <optional>
2 Decimals number while hovering the profile graph, default 2
xDigitsHovernumber <optional>
1 Decimals number while hovering the profile graph, default 1
zMaxCharsinteger | undefined <optional>
maximum number of chars to be used for z graduation before switching to scientific notation
graduationNumber | undefined <optional>
100 length of each z graduation step, default 100. If
zStepsis provided, this is not usedamplitudeinteger | undefined <optional>
amplitude of the altitude, default zmax-zmin
xStepsinteger | undefined <optional>
number of steps at the x-axis (distance), default 10. If not provided, default is calculated from the distance
zStepsinteger | undefined <optional>
number of steps at the amplitude scale. If not provided, default is calculated from graduation
-
show()
-
Show panel
-
showAt(where)
-
Show point at coordinate or a distance on the profile
Parameters:
Name Type Description whereol.coordinates | number a coordinate or a distance from begining, if none it will hide the point
Returns:
current point
- Type
- ol.coordinates
-
showAtTime(time, delta)
-
Show point at a time on the profile
Parameters:
Name Type Description timeDate | number a Date or a DateTime (in s) to show the profile on, if none it will hide the point
deltabooelan true if time is a delta from the start, default false
Returns:
current point
- Type
- ol.coordinates
-
toggle()
-
Toggle panel