Constructor
Optional
options: ValhallaControlOptionsPlugin control options
Protected
_Protected
_Protected
Optional
controlProtected
defaultProtected
eventsProtected
Optional
mapProtected
modeProtected
optionsProtected
Optional
terradrawProtected
cssCSS prefix for the control buttons. Default is empty string
Get/Set font glyph for valhalla control layers
As default, this maesure control uses maplibre's default font glyphs(Open Sans Regular,Arial Unicode MS Regular
) described at https://maplibre.org/maplibre-style-spec/layers/#text-font
If you are using your own maplibre style or different map privider, you probably need to set the font glyphs to match your maplibre style.
Font glyph availability depends on what types of glyphs are supported by your maplibre style (e.g., Carto, Openmap tiles, Protomap, Maptiler, etc.) Please make sure the font glyphs are available in your maplibre style.
Usage:
const drawControl = new MaplibreValhallaControl()
drawControl.fontGlyphs = ['Open Sans Italic']
map.addControl(drawControl)
get the state of whether the control is expanded or collapsed
set the state of the control either expanded or collapsed.
terradraw mode will be reset if the state is changed.
either expanded
or collapsed
event is dispatched when changed
Set the list of contours for Valhalla isochrone api
Contour[]
Get the dialog instance for settings
Get the URL of Valhalla API
Set the URL of Valhalla API
URL of Valhalla API
Activate Terra Draw to start drawing
Protected
addAdd Terra Draw drawing mode button
Terra Draw mode name
clean maplibre style to filter only for terradraw related layers or without them. If options are not set, returns original style given to the function.
This can be useful incase users only want to get terradraw related layers or without it.
Usage:
cleanStyle(map.getStyle, { excludeTerraDrawLayers: true})
cleanStyle(map.getStyle, { onlyTerraDrawLayers: true})
maplibre style spec
Optional
options: { excludeTerraDrawLayers?: boolean; onlyTerraDrawLayers?: boolean }Optional
excludeTerraDrawLayers?: booleanreturn maplibre style without terradraw layers and sources
Optional
onlyTerraDrawLayers?: booleanreturn maplibre style with only terradraw layers and sources
Protected
clearClear GeoJSON feature related to extended control such as measure and valhalla by TerraDraw feature ID
the array of source ID to delete
the array of feature ID. Optional, if undefined, delete all labels for source
void
Deactivate Terra Draw to stop drawing
Protected
dispatchDispatch an event. Pass the current snapshot of features and mode
event type
Optional
args: { [key: string]: unknown }additional arguments
Get the default control position
default control position. Default is 'top-right'
get GeoJSON features
If true, returns only selected features. Default is false.
FeatureCollection in GeoJSON format
Get the Terra Draw instance. For the Terra Draw API, please refer to https://terradraw.io/#/api
Terra Draw instance
Protected
handleDownload button click event handler
add the plugin control to maplibre
Maplibre Map object
HTML Element
Remove the plugin control from maplibre
void
Reset active mode to back to render mode
Protected
toggleToggle the state of buttons when there is no features
Protected
toggleToggle the state of delete-select button
Protected
toggleToggle editor control
Maplibre GL Terra Draw Measure Control