DrawingLayerTool
geovisto-map / DrawingLayerTool
Class: DrawingLayerTool
This class represents Drawing layer tool.
Author
Andrej Tlcina
Extends
Implements
IDrawingLayerTool
IMapFormControl
Constructors
new DrawingLayerTool()
new DrawingLayerTool(
props
?):DrawingLayerTool
It creates a new tool with respect to the props.
Parameters
• props?: ILayerToolProps
Returns
Overrides
Source
tools/layers/drawing/DrawingLayerTool.ts:81
Properties
controlDrawingToolbar
private
controlDrawingToolbar:any
Source
tools/layers/drawing/DrawingLayerTool.ts:76
drawingTools
drawingTools:
LooseObject
Implementation of
IDrawingLayerTool.drawingTools
Source
tools/layers/drawing/DrawingLayerTool.ts:74
mapForm
private
mapForm:DrawingForm
Source
tools/layers/drawing/DrawingLayerTool.ts:75
Methods
applyEventListeners()
applyEventListeners(
layer
):void
Parameters
• layer: any
Returns
void
Implementation of
IDrawingLayerTool.applyEventListeners
Brief
aplies event listeners for each geo. object
Source
tools/layers/drawing/DrawingLayerTool.ts:326
copy()
copy():
IDrawingLayerTool
\<ILayerToolProps
,IDrawingLayerToolDefaults
,IDrawingLayerToolState
\<ILayerToolProps
,IDrawingLayerToolDefaults
,IDrawingLayerToolConfig
,ILayerToolDimensionsConfig
,ILayerToolDimensions
>,IDrawingLayerToolConfig
,IMapToolInitProps
\<IDrawingLayerToolConfig
>>
It creates a copy of the uninitialized tool.
Returns
IDrawingLayerTool
\<ILayerToolProps
, IDrawingLayerToolDefaults
, IDrawingLayerToolState
\<ILayerToolProps
, IDrawingLayerToolDefaults
, IDrawingLayerToolConfig
, ILayerToolDimensionsConfig
, ILayerToolDimensions
>, IDrawingLayerToolConfig
, IMapToolInitProps
\<IDrawingLayerToolConfig
>>
Implementation of
IDrawingLayerTool.copy
Overrides
Source
tools/layers/drawing/DrawingLayerTool.ts:102
create()
create():
this
It creates new layer with respect to configuration
Returns
this
Implementation of
IDrawingLayerTool.create
Inherited from
Source
model/internal/layer/AbstractLayerTool.ts:89
createDefaults()
protected
createDefaults():IDrawingLayerToolDefaults
It creates new defaults of the tool.
Returns
IDrawingLayerToolDefaults
Overrides
AbstractLayerTool
.createDefaults
Source
tools/layers/drawing/DrawingLayerTool.ts:129
createLayerItems()
protected
createLayerItems():FeatureGroup
[]
It creates layer items.
Returns
FeatureGroup
[]
Overrides
AbstractLayerTool
.createLayerItems
Source
tools/layers/drawing/DrawingLayerTool.ts:221
createMapForm()
protected
createMapForm():DrawingForm
It creates new tab control.
Returns
DrawingForm
Source
tools/layers/drawing/DrawingLayerTool.ts:158
createState()
protected
createState():IDrawingLayerToolState
\<ILayerToolProps
,IDrawingLayerToolDefaults
,IDrawingLayerToolConfig
,ILayerToolDimensionsConfig
,ILayerToolDimensions
>
It returns default tool state.
Returns
IDrawingLayerToolState
\<ILayerToolProps
, IDrawingLayerToolDefaults
, IDrawingLayerToolConfig
, ILayerToolDimensionsConfig
, ILayerToolDimensions
>
Overrides
Source
tools/layers/drawing/DrawingLayerTool.ts:136
createdListener()
private
createdListener(e
):void
Parameters
• e: any
Returns
void
Brief
called whenever new geo. object is created
Source
tools/layers/drawing/DrawingLayerTool.ts:280
getAPIGetter()
getAPIGetter():
undefined
|IMapToolAPIGetter
It returns the tool API
Returns
undefined
| IMapToolAPIGetter
Implementation of
IDrawingLayerTool.getAPIGetter
Inherited from
AbstractLayerTool
.getAPIGetter
Source
model/internal/tool/MapTool.ts:74
getDefaults()
getDefaults():
IDrawingLayerToolDefaults
It returns default values of the state properties.
Returns
IDrawingLayerToolDefaults
Implementation of
IDrawingLayerTool.getDefaults
Overrides
Source
tools/layers/drawing/DrawingLayerTool.ts:116
getId()
getId():
string
Help function which returns the id of the object.
Returns
string
Implementation of
IDrawingLayerTool.getId
Inherited from
Source
model/internal/object/MapObject.ts:93
getLayerItems()
getLayerItems():
Layer
[]
It returns layer items which should be rendered.
Returns
Layer
[]
Implementation of
IDrawingLayerTool.getLayerItems
Inherited from
AbstractLayerTool
.getLayerItems
Source
model/internal/layer/AbstractLayerTool.ts:163
getMap()
getMap():
undefined
|IMap
\<IMapProps
,IMapDefaults
,IMapState
\<IMapProps
,IMapDefaults
,IMapConfig
>,IMapConfig
,IMapInitProps
\<IMapConfig
>>
Help function returns map which uses this tool.
Do not override this function. Use the state class instead.
Returns
undefined
| IMap
\<IMapProps
, IMapDefaults
, IMapState
\<IMapProps
, IMapDefaults
, IMapConfig
>, IMapConfig
, IMapInitProps
\<IMapConfig
>>
Implementation of
IDrawingLayerTool.getMap
Inherited from
Source
model/internal/tool/MapTool.ts:112
getMapForm()
getMapForm():
DrawingForm
It returns a tab control.
Returns
DrawingForm
Implementation of
Source
tools/layers/drawing/DrawingLayerTool.ts:143
getProps()
getProps():
ILayerToolProps
It returns the props given by the programmer.
Returns
Implementation of
IDrawingLayerTool.getProps
Overrides
Source
tools/layers/drawing/DrawingLayerTool.ts:109
getState()
getState():
IDrawingLayerToolState
\<ILayerToolProps
,IDrawingLayerToolDefaults
,IDrawingLayerToolConfig
,ILayerToolDimensionsConfig
,ILayerToolDimensions
>
It returns the layer tool state.
Returns
IDrawingLayerToolState
\<ILayerToolProps
, IDrawingLayerToolDefaults
, IDrawingLayerToolConfig
, ILayerToolDimensionsConfig
, ILayerToolDimensions
>
Implementation of
IDrawingLayerTool.getState
Overrides
Source
tools/layers/drawing/DrawingLayerTool.ts:122
getType()
getType():
string
Help function which returns the type of the object.
Returns
string
Implementation of
IDrawingLayerTool.getType
Inherited from
Source
model/internal/object/MapObject.ts:86
handleEvent()
handleEvent(
event
):void
This function is called when a custom event is invoked.
Override this function, if needed.
Parameters
• event: IMapEvent
\<IMapObject
\<IMapObjectProps
, IMapObjectDefaults
\<IMapObjectProps
, IMapObjectConfig
>, IMapObjectState
\<IMapObjectProps
, IMapObjectDefaults
\<IMapObjectProps
, IMapObjectConfig
>, IMapObjectConfig
, IMapObjectInitProps
\<IMapObjectConfig
>>, IMapObjectConfig
, IMapObjectInitProps
\<IMapObjectConfig
>>>
Returns
void
Inherited from
Source
model/internal/tool/MapTool.ts:171
hideLayerItems()
protected
hideLayerItems():void
Help function which hides layer items
This function is meant to be private.
Returns
void
Inherited from
AbstractLayerTool
.hideLayerItems
Source
model/internal/layer/AbstractLayerTool.ts:147
highlightElement()
highlightElement(
el
):void
Parameters
• el: any
Returns
void
Implementation of
IDrawingLayerTool.highlightElement
Brief
highlights element
Source
tools/layers/drawing/DrawingLayerTool.ts:355
hightlightOnHover()
private
hightlightOnHover(e
):void
Parameters
• e: TileEvent
Returns
void
Brief
highlights element on mouse hover
Source
tools/layers/drawing/DrawingLayerTool.ts:366
initChangeStyle()
private
initChangeStyle(e
):void
Parameters
• e: LeafletMouseEvent
Returns
void
Brief
called on object click to change its style accordingly
Source
tools/layers/drawing/DrawingLayerTool.ts:400
initialize()
initialize(
initProps
):this
Overrides the super method.
Parameters
• initProps: IMapToolInitProps
\<IDrawingLayerToolConfig
>
Returns
this
Implementation of
IDrawingLayerTool.initialize
Overrides
Source
tools/layers/drawing/DrawingLayerTool.ts:91
initializeDrawingTools()
initializeDrawingTools():
void
Returns
void
Implementation of
IDrawingLayerTool.initializeDrawingTools
Source
tools/layers/drawing/DrawingLayerTool.ts:185
isEnabled()
isEnabled():
boolean
Help getter which returns enabled property of state.
Do not override this function. Use the state class instead.
Returns
boolean
Implementation of
IDrawingLayerTool.isEnabled
Inherited from
Source
model/internal/tool/MapTool.ts:130
isSingleton()
isSingleton():
boolean
Help getter which returns a logtical value whether the tool type is singleton.
Returns
boolean
Implementation of
IDrawingLayerTool.isSingleton
Inherited from
Source
model/internal/tool/MapTool.ts:81
normalizeElement()
normalizeElement(
el
):void
Parameters
• el: any
Returns
void
Implementation of
IDrawingLayerTool.normalizeElement
Brief
sets normal styles for element
Source
tools/layers/drawing/DrawingLayerTool.ts:374
normalizeOnHover()
private
normalizeOnHover(e
):void
Parameters
• e: TileEvent
Returns
void
Brief
sets normal styles for element on mouse hover
Source
tools/layers/drawing/DrawingLayerTool.ts:387
redrawMapForm()
redrawMapForm(
layerType
):void
Parameters
• layerType: ""
| LayerType
Returns
void
Implementation of
IDrawingLayerTool.redrawMapForm
Source
tools/layers/drawing/DrawingLayerTool.ts:150
render()
render(
type
,animateOptions
?):void
It reloads data and redraw the layer with respect to the type.
By default it works with LayerRedrawType
Parameters
• type: number
• animateOptions?: IDataChangeAnimateOptions
Returns
void
Implementation of
IDrawingLayerTool.render
Inherited from
Source
model/internal/layer/AbstractLayerTool.ts:189
setEnabled()
setEnabled(
enabled
):void
It changes layer state to enabled/disabled.
Parameters
• enabled: boolean
Returns
void
Implementation of
IDrawingLayerTool.setEnabled
Overrides
Source
tools/layers/drawing/DrawingLayerTool.ts:167
setGlobalSimplificationTolerance()
setGlobalSimplificationTolerance(
map
):void
Parameters
• map: any
Returns
void
Implementation of
IDrawingLayerTool.setGlobalSimplificationTolerance
Brief
sets global tolerance for brush stroke
Source
tools/layers/drawing/DrawingLayerTool.ts:340
setProps()
protected
setProps(props
):void
It updates the props.
Parameters
• props: IMapObjectProps
Returns
void
Inherited from
Source
model/internal/object/MapObject.ts:38
showLayerItems()
protected
showLayerItems():void
Help function which shows layer items.
This function is meant to be private.
Returns
void
Inherited from
AbstractLayerTool
.showLayerItems
Source
model/internal/layer/AbstractLayerTool.ts:126
switchEnabled()
switchEnabled():
void
Help function which switches enabled state (enabled/disabled).
Do not override this function. Use setEnabled instead.
Returns
void
Implementation of
IDrawingLayerTool.switchEnabled
Inherited from
AbstractLayerTool
.switchEnabled
Source
model/internal/tool/MapTool.ts:158
updateDimension()
updateDimension(
dimension
,value
,renderType
):void
It updates the dimension.
Parameters
• dimension: IMapDimension
\<unknown
>
• value: string
• renderType: undefined
| number
= undefined
Returns
void
Implementation of
IDrawingLayerTool.updateDimension
Inherited from
AbstractLayerTool
.updateDimension