autk-map / LayerManager
Class: LayerManager
Defined in: layer-manager.ts:23
Manages the layers of the map.
This class provides methods to add, remove, and search for layers, as well as to manage the bounding box of the map.
Constructors
Constructor
new LayerManager():
LayerManager
Defined in: layer-manager.ts:51
Constructor for LayerManager
Returns
LayerManager
Properties
_bbox
protected_bbox:BBox
Defined in: layer-manager.ts:40
Bounding box of the map.
_origin
protected_origin:number[]
Defined in: layer-manager.ts:46
Origin of the map.
_rasterLayers
protected_rasterLayers:RasterLayer[] =[]
Defined in: layer-manager.ts:34
List of raster layers in the map.
_vectorLayers
protected_vectorLayers:VectorLayer[] =[]
Defined in: layer-manager.ts:28
List of vector layers in the map.
Accessors
bboxAndOrigin
Get Signature
get bboxAndOrigin():
BBox
Defined in: layer-manager.ts:84
Get the bounding box of the map.
Returns
BBox
- The bounding box as a GeoJSON polygon.
Set Signature
set bboxAndOrigin(
bbox):void
Defined in: layer-manager.ts:92
Set the origin and the bounding box of the map.
Parameters
bbox
BBox
The bounding box to set.
Returns
void
origin
Get Signature
get origin():
number[]
Defined in: layer-manager.ts:76
Get the origin of the map.
Returns
number[]
- The origin coordinates in meters.
rasterLayers
Get Signature
get rasterLayers():
RasterLayer[]
Defined in: layer-manager.ts:68
Get the raster layers of the map.
Returns
- The list of layers.
vectorLayers
Get Signature
get vectorLayers():
VectorLayer[]
Defined in: layer-manager.ts:60
Get the vetor layers of the map.
Returns
- The list of layers.
Methods
addRasterLayer()
addRasterLayer(
layerInfo,layerRender,layerData):RasterLayer|null
Defined in: layer-manager.ts:135
Adds a raster layer to the map.
Parameters
layerInfo
The information about the layer.
layerRender
The rendering information for the layer.
layerData
The data associated with the layer.
Returns
RasterLayer | null
- The created layer or null if the type is unknown.
addVectorLayer()
addVectorLayer(
layerInfo,layerRender,layerData):VectorLayer|null
Defined in: layer-manager.ts:107
Adds a layer to the map.
Parameters
layerInfo
The information about the layer.
layerRender
The rendering information for the layer.
layerData
The data associated with the layer.
Returns
VectorLayer | null
- The created layer or null if the type is unknown.
computeZindex()
computeZindex(
layerType):number
Defined in: layer-manager.ts:217
Computes the Z-index for a given layer type.
Parameters
layerType
The type of the layer.
Returns
number
- The computed Z-index.
delLayer()
delLayer(
layerId):void
Defined in: layer-manager.ts:157
Removes a layer from the map.
Parameters
layerId
string
The ID of the layer to remove.
Returns
void
removeLayerById()
removeLayerById(
layerId):void
Defined in: layer-manager.ts:181
Removes a layer by its ID.
Parameters
layerId
string
The ID of the layer to remove.
Returns
void
searchByLayerId()
searchByLayerId(
layerId):VectorLayer|RasterLayer|null
Defined in: layer-manager.ts:191
Searches for a layer by its ID.
Parameters
layerId
string
The ID of the layer to search for.
Returns
VectorLayer | RasterLayer | null
- The found layer or null if not found.