VerticalAxis
Extends:
Displays a simple vertical coordinate dropdown selector for a coverage data layer.
Example:
new C.VerticalAxis(covLayer).addTo(map)
// Selecting a vertical coordinate automatically sets the 'vertical' property in the layer.
// Similarly, when the layer fires an 'axisChange' event with {axis: 'vertical'}
// the control reflects that change.
var heights = [0,10,20,50,100,500,1000]
var fakeLayer = {
verticalSlices: heights,
vertical: heights[1], // select the second height step initially
crsVerticalAxis: {
name: {
en: 'Gravity-related height'
},
unit: {
symbol: 'm'
}
}
}
var verticalAxis = new C.VerticalAxis(fakeLayer).addTo(map)
// change the height and trigger a manual update
fakeLayer.vertical = heights[0]
verticalAxis.update()
Constructor Summary
Public Constructor | ||
public |
constructor(covLayer: object, options: object) Creates a vertical axis control. |
Method Summary
Public Methods | ||
public |
update() Triggers a manual update of the vertical axis control based on the
|
Public Constructors
public constructor(covLayer: object, options: object) source
Creates a vertical axis control.
Params:
Name | Type | Attribute | Description |
covLayer | object | The coverage data layer, or any object with |
|
options | object |
|
Control options. |
options.position | string |
|
The initial position of the control (see Leaflet docs). |
options.title | string |
|
The label to show above the control if |
options.templateId | string |
|
Element ID of an alternative HTML |
Public Methods
public update() source
Triggers a manual update of the vertical axis control based on the
vertical
property of the layer.
Useful if the supplied coverage data layer is not a real layer and won't fire the necessary events for automatic updates.