Skip to main content

DrawingLayerToolState

geovisto-mapReadme | API


geovisto-map / DrawingLayerToolState

Class: DrawingLayerToolState

This class provide functions for using the state of the layer tool.

Author

Andrej Tlcina

Extends

Implements

  • IDrawingLayerToolState

Constructors

new DrawingLayerToolState()

new DrawingLayerToolState(tool): DrawingLayerToolState

It creates a tool state.

Parameters

tool: IDrawingLayerTool\<ILayerToolProps, IDrawingLayerToolDefaults, IDrawingLayerToolState\<ILayerToolProps, IDrawingLayerToolDefaults, IDrawingLayerToolConfig, ILayerToolDimensionsConfig, ILayerToolDimensions>, IDrawingLayerToolConfig, IMapToolInitProps\<IDrawingLayerToolConfig>>

Returns

DrawingLayerToolState

Overrides

LayerToolState.constructor

Source

tools/layers/drawing/DrawingLayerToolState.ts:55

Properties

createdVertices

createdVertices: any[]

Implementation of

IDrawingLayerToolState.createdVertices

Source

tools/layers/drawing/DrawingLayerToolState.ts:49


extraSelected

extraSelected: any[]

Implementation of

IDrawingLayerToolState.extraSelected

Source

tools/layers/drawing/DrawingLayerToolState.ts:51


featureGroup

featureGroup: any

Implementation of

IDrawingLayerToolState.featureGroup

Source

tools/layers/drawing/DrawingLayerToolState.ts:45


mappedMarkersToVertices

mappedMarkersToVertices: MappedMarkersToVertices

Implementation of

IDrawingLayerToolState.mappedMarkersToVertices

Source

tools/layers/drawing/DrawingLayerToolState.ts:50


selectedLayer

selectedLayer: any

Implementation of

IDrawingLayerToolState.selectedLayer

Source

tools/layers/drawing/DrawingLayerToolState.ts:47


selecting

selecting: boolean

Implementation of

IDrawingLayerToolState.selecting

Source

tools/layers/drawing/DrawingLayerToolState.ts:46


tool

tool: IDrawingLayerTool\<ILayerToolProps, IDrawingLayerToolDefaults, IDrawingLayerToolState\<ILayerToolProps, IDrawingLayerToolDefaults, IDrawingLayerToolConfig, ILayerToolDimensionsConfig, ILayerToolDimensions>, IDrawingLayerToolConfig, IMapToolInitProps\<IDrawingLayerToolConfig>>

Implementation of

IDrawingLayerToolState.tool

Source

tools/layers/drawing/DrawingLayerToolState.ts:48

Methods

addExtraSelected()

addExtraSelected(layer): void

add passed layer to array and highlights it

Parameters

layer: any

Returns

void

Implementation of

IDrawingLayerToolState.addExtraSelected

Source

tools/layers/drawing/DrawingLayerToolState.ts:109


addLayer()

addLayer(layer): any

add layer to featureGroup and it is displayed

Parameters

layer: any

Returns

any

Implementation of

IDrawingLayerToolState.addLayer

Source

tools/layers/drawing/DrawingLayerToolState.ts:230


addMappedVertices()

private addMappedVertices(layer, result): void

saving topology information to marker

Parameters

layer: any

result: Source

Returns

void

Source

tools/layers/drawing/DrawingLayerToolState.ts:281


areSameType()

private areSameType(layer): boolean

checks if selected and passed object are of the same type

Parameters

layer: any

Returns

boolean

Source

tools/layers/drawing/DrawingLayerToolState.ts:96


clearExtraSelected()

clearExtraSelected(): void

clears extraSelected array and sets normal styles to each geo. object

Returns

void

Implementation of

IDrawingLayerToolState.clearExtraSelected

Source

tools/layers/drawing/DrawingLayerToolState.ts:76


clearSelectedLayer()

clearSelectedLayer(): void

removes selected layer

Returns

void

Implementation of

IDrawingLayerToolState.clearSelectedLayer

Source

tools/layers/drawing/DrawingLayerToolState.ts:267


deserialize()

deserialize(config): void

deserializes internal JSON representation to map state

Parameters

config: IDrawingLayerToolConfig

Returns

void

Implementation of

IDrawingLayerToolState.deserialize

Overrides

LayerToolState.deserialize

Source

tools/layers/drawing/DrawingLayerToolState.ts:511


deserializeDimensions()

deserializeDimensions(dimensionsConfig): void

It sets the marker layer dimensions property of tool state.

Parameters

dimensionsConfig: ILayerToolDimensionsConfig

Returns

void

Implementation of

IDrawingLayerToolState.deserializeDimensions

Inherited from

LayerToolState.deserializeDimensions

Source

model/internal/layer/LayerToolState.ts:67


deserializeGeoJSON()

deserializeGeoJSON(geojson): void

deserializes GeoJSON to map state

Parameters

geojson: ExportGeoJSON

Returns

void

Implementation of

IDrawingLayerToolState.deserializeGeoJSON

Source

tools/layers/drawing/DrawingLayerToolState.ts:366


getDimensions()

getDimensions(): ILayerToolDimensions

It returns the map layer dimensions property of the tool state.

Returns

ILayerToolDimensions

Implementation of

IDrawingLayerToolState.getDimensions

Inherited from

LayerToolState.getDimensions

Source

model/internal/layer/LayerToolState.ts:120


getIcon()

getIcon(): string

It returns the icon property of the tool state.

Returns

string

Implementation of

IDrawingLayerToolState.getIcon

Inherited from

LayerToolState.getIcon

Source

model/internal/tool/MapToolState.ts:120


getId()

getId(): string

It returns the id property of the tool state.

Returns

string

Implementation of

IDrawingLayerToolState.getId

Inherited from

LayerToolState.getId

Source

model/internal/object/MapObjectState.ts:87


getLabel()

getLabel(): string

It returns the label property of the tool state.

Returns

string

Implementation of

IDrawingLayerToolState.getLabel

Inherited from

LayerToolState.getLabel

Source

model/internal/tool/MapToolState.ts:104


getLayerItems()

getLayerItems(): undefined | Layer[]

It returns the layer items property of the tool state.

Returns

undefined | Layer[]

Implementation of

IDrawingLayerToolState.getLayerItems

Inherited from

LayerToolState.getLayerItems

Source

model/internal/layer/LayerToolState.ts:104


getLayerName()

getLayerName(): string

It returns the layer name property of the tool state.

Returns

string

Implementation of

IDrawingLayerToolState.getLayerName

Inherited from

LayerToolState.getLayerName

Source

model/internal/layer/LayerToolState.ts:88


getMap()

getMap(): IMap\<IMapProps, IMapDefaults, IMapState\<IMapProps, IMapDefaults, IMapConfig>, IMapConfig, IMapInitProps\<IMapConfig>>

It returns the map property of the tool state.

Returns

IMap\<IMapProps, IMapDefaults, IMapState\<IMapProps, IMapDefaults, IMapConfig>, IMapConfig, IMapInitProps\<IMapConfig>>

Implementation of

IDrawingLayerToolState.getMap

Inherited from

LayerToolState.getMap

Source

model/internal/tool/MapToolState.ts:136


getMapObject()

protected getMapObject(): IMapObject\<IMapObjectProps, IMapObjectDefaults\<IMapObjectProps, IMapObjectConfig>, IMapObjectState\<IMapObjectProps, IMapObjectDefaults\<IMapObjectProps, IMapObjectConfig>, IMapObjectConfig, IMapObjectInitProps\<IMapObjectConfig>>, IMapObjectConfig, IMapObjectInitProps\<IMapObjectConfig>>

It makes the map object visible to extended classes.

Returns

IMapObject\<IMapObjectProps, IMapObjectDefaults\<IMapObjectProps, IMapObjectConfig>, IMapObjectState\<IMapObjectProps, IMapObjectDefaults\<IMapObjectProps, IMapObjectConfig>, IMapObjectConfig, IMapObjectInitProps\<IMapObjectConfig>>, IMapObjectConfig, IMapObjectInitProps\<IMapObjectConfig>>

Inherited from

LayerToolState.getMapObject

Source

model/internal/object/MapObjectState.ts:39


getSelecting()

getSelecting(): boolean

getter

Returns

boolean

Implementation of

IDrawingLayerToolState.getSelecting

Source

tools/layers/drawing/DrawingLayerToolState.ts:223


getType()

getType(): string

It returns the type property of the tool state.

Returns

string

Implementation of

IDrawingLayerToolState.getType

Inherited from

LayerToolState.getType

Source

model/internal/object/MapObjectState.ts:80


initMappedMarkersToVertices()

private initMappedMarkersToVertices(lType, result, source): void

called so when we import topology dragging of vertices works

Parameters

lType: "" | LayerType

result: any

source: Source

Returns

void

Source

tools/layers/drawing/DrawingLayerToolState.ts:295


initialize()

initialize(defaults, props, initProps): void

It resets the state with respect to the initial props.

Parameters

defaults: ILayerToolDefaults

props: ILayerToolProps

initProps: IMapToolInitProps

Returns

void

Implementation of

IDrawingLayerToolState.initialize

Inherited from

LayerToolState.initialize

Source

model/internal/layer/LayerToolState.ts:35


isConnectMarker()

isConnectMarker(marker): boolean

checks if markers is connect marker

Parameters

marker: any

Returns

boolean

Implementation of

IDrawingLayerToolState.isConnectMarker

Source

tools/layers/drawing/DrawingLayerToolState.ts:126


isEnabled()

isEnabled(): boolean

It returns the enabled property of the tool state.

Returns

boolean

Implementation of

IDrawingLayerToolState.isEnabled

Inherited from

LayerToolState.isEnabled

Source

model/internal/tool/MapToolState.ts:88


isInExtraSelected()

private isInExtraSelected(layerId): number

checks if layer is in extraSelected objects

Parameters

layerId: string

Returns

number

Source

tools/layers/drawing/DrawingLayerToolState.ts:86


pushVertice()

pushVertice(vertice): void

Pushes vertice into created ones

Parameters

vertice: any

Returns

void

Implementation of

IDrawingLayerToolState.pushVertice

Source

tools/layers/drawing/DrawingLayerToolState.ts:143


removeGivenVertice()

removeGivenVertice(lId): void

removes vertice based on given leaflet id

Parameters

lId: string

Returns

void

Implementation of

IDrawingLayerToolState.removeGivenVertice

Source

tools/layers/drawing/DrawingLayerToolState.ts:152


removeLayer()

removeLayer(layer): void

removes layer from featureGroup and from map

Parameters

layer: any

Returns

void

Implementation of

IDrawingLayerToolState.removeLayer

Source

tools/layers/drawing/DrawingLayerToolState.ts:239


removeMappedVertices()

private removeMappedVertices(idsOfVerticesToRemove): MappedMarkersToVertices

removes vertice which ids were passed

Parameters

idsOfVerticesToRemove: Set\<string>

Returns

MappedMarkersToVertices

mappedMarkersToVertices

Source

tools/layers/drawing/DrawingLayerToolState.ts:171


removeMarkersMappedVertices()

removeMarkersMappedVertices(lId): void

takes in leaflet id and removes vertices mapped to marker

Parameters

lId: string

Returns

void

Implementation of

IDrawingLayerToolState.removeMarkersMappedVertices

Source

tools/layers/drawing/DrawingLayerToolState.ts:195


removeSelectedLayer()

removeSelectedLayer(): void

removes selected layer

Returns

void

Implementation of

IDrawingLayerToolState.removeSelectedLayer

Source

tools/layers/drawing/DrawingLayerToolState.ts:246


selectedLayerIsConnectMarker()

selectedLayerIsConnectMarker(): boolean

checks if selected layer is connect marker

Returns

boolean

Implementation of

IDrawingLayerToolState.selectedLayerIsConnectMarker

Source

tools/layers/drawing/DrawingLayerToolState.ts:136


serialize()

serialize(defaults): IDrawingLayerToolConfig

serializes map state to internal JSON representation

Parameters

defaults: undefined | IDrawingLayerToolDefaults

Returns

IDrawingLayerToolConfig

Implementation of

IDrawingLayerToolState.serialize

Overrides

LayerToolState.serialize

Source

tools/layers/drawing/DrawingLayerToolState.ts:431


serializeToGeoJSON()

serializeToGeoJSON(): ExportGeoJSON

serializes map state to GeoJSON

Returns

ExportGeoJSON

Implementation of

IDrawingLayerToolState.serializeToGeoJSON

Source

tools/layers/drawing/DrawingLayerToolState.ts:331


setDimensions()

setDimensions(dimensions): void

It sets the map layer dimensions property of tool state.

Parameters

dimensions: ILayerToolDimensions

Returns

void

Implementation of

IDrawingLayerToolState.setDimensions

Inherited from

LayerToolState.setDimensions

Source

model/internal/layer/LayerToolState.ts:129


setEnabled()

setEnabled(enabled): void

It sets the enabled property of tool state.

Parameters

enabled: boolean

Returns

void

Implementation of

IDrawingLayerToolState.setEnabled

Inherited from

LayerToolState.setEnabled

Source

model/internal/tool/MapToolState.ts:97


setIcon()

setIcon(icon): void

It sets the icon property of the tool state.

Parameters

icon: string

Returns

void

Implementation of

IDrawingLayerToolState.setIcon

Inherited from

LayerToolState.setIcon

Source

model/internal/tool/MapToolState.ts:129


setId()

setId(id): void

It sets the id property of the tool state.

Parameters

id: string

Returns

void

Implementation of

IDrawingLayerToolState.setId

Inherited from

LayerToolState.setId

Source

model/internal/object/MapObjectState.ts:96


setLabel()

setLabel(label): void

It sets the label property of the tool state.

Parameters

label: string

Returns

void

Implementation of

IDrawingLayerToolState.setLabel

Inherited from

LayerToolState.setLabel

Source

model/internal/tool/MapToolState.ts:113


setLayerItems()

setLayerItems(layerItems): void

It sets the layer items property of tool state.

Parameters

layerItems: Layer[]

Returns

void

Implementation of

IDrawingLayerToolState.setLayerItems

Inherited from

LayerToolState.setLayerItems

Source

model/internal/layer/LayerToolState.ts:113


setLayerName()

setLayerName(layerName): void

It sets the layer name property of the tool state.

Parameters

layerName: string

Returns

void

Implementation of

IDrawingLayerToolState.setLayerName

Inherited from

LayerToolState.setLayerName

Source

model/internal/layer/LayerToolState.ts:97


setMap()

protected setMap(map): void

It sets the map property of the tool state.

Parameters

map: IMap\<IMapProps, IMapDefaults, IMapState\<IMapProps, IMapDefaults, IMapConfig>, IMapConfig, IMapInitProps\<IMapConfig>>

Returns

void

Inherited from

LayerToolState.setMap

Source

model/internal/tool/MapToolState.ts:145


setSelectedLayer()

setSelectedLayer(layer): void

sets selected layer and highlights it

Parameters

layer: any

Returns

void

Implementation of

IDrawingLayerToolState.setSelectedLayer

Source

tools/layers/drawing/DrawingLayerToolState.ts:257


setSelecting()

setSelecting(is): void

setter

Parameters

is: boolean

Returns

void

Implementation of

IDrawingLayerToolState.setSelecting

Source

tools/layers/drawing/DrawingLayerToolState.ts:216


setVerticesToMarker()

setVerticesToMarker(lId, val): void

sets vertices to marker

Parameters

lId: string

val: IndexedVertices

Returns

void

Implementation of

IDrawingLayerToolState.setVerticesToMarker

Source

tools/layers/drawing/DrawingLayerToolState.ts:274