arlas-web-components / Exports / MapglComponent

Class: MapglComponent

Mapgl Component allows to display and select geometrical data on a map.

Implements

  • OnInit
  • AfterViewInit
  • OnChanges
  • AfterContentInit

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new MapglComponent(http, _snackBar, translate)

Parameters

Name Type
http HttpClient
_snackBar MatSnackBar
translate TranslateService

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:442

Properties

FINISH_DRAWING

FINISH_DRAWING: string = 'Double click to finish drawing'

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:124


basemapStyles

basemapStyles: BasemapStyle[]

input : Angular

description List of styles to apply to the base map

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:178


basemapStylesGroup

basemapStylesGroup: BasemapStylesGroup

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:410


boundsToFit

boundsToFit: number[][]

input : Angular

description Bounds that the view map fits. It's an array of two corners. Each corner is an lat-long position : For example : boundsToFit = [[30.51, -54.3],[30.57, -54.2]]

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:220


currentLat

currentLat: string

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:412


currentLng

currentLng: string

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:413


dataSources

dataSources: Set<string>

input : Angular

description List of data sources names that should be added to the map. Sources should be of type geojson

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:321


defaultBasemapStyle

defaultBasemapStyle: BasemapStyle

input : Angular

description Default style of the base map

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:170


displayCurrentCoordinates

displayCurrentCoordinates: boolean = false

input : Angular

description Whether the coordinates are displayed.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:150


displayScale

displayScale: boolean = true

input : Angular

description Whether the scale is displayed.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:145


downloadSourceEmitter

downloadSourceEmitter: Subject<{ collection: string ; downloadType: string ; layerId: string ; layerName: string ; sourceName: string }>

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:400


dragEndX

dragEndX: number

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:429


dragEndY

dragEndY: number

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:430


dragStartX

dragStartX: number

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:426


dragStartY

dragStartY: number

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:425


draw

draw: any

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:103


drawButtonEnabled

drawButtonEnabled: boolean = false

input : Angular

description Whether the draw tools are activated

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:267


drawClickCounter

drawClickCounter: number = 0

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:438


drawData

drawData: Object

input : Angular

description Features drawn at component start

Type declaration

Name Type
features any[]
type string

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:261


drawOption

drawOption: any = {}

input : Angular

description Options object for draw tools : https://github.com/mapbox/mapbox-gl-draw/blob/master/docs/API.md#options

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:255


drawPolygonVerticesLimit

drawPolygonVerticesLimit: number

input : Angular

description Maximum number of vertices allowed for a polygon

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:273


featureToHightLight

featureToHightLight: Object

input : Angular

description Feature to highlight.

Type declaration

Name Type
elementidentifier ElementIdentifier
isleaving boolean

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:236


featuresToSelect

featuresToSelect: ElementIdentifier[]

input : Angular

description List of feature to select.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:244


firstDrawLayer

firstDrawLayer: string = ''

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:422


fitBoundsMaxZoom

fitBoundsMaxZoom: number = 22

input : Angular

description The maximum zoom level so that the bounds fit the map view.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:231


fitBoundsOffSet

fitBoundsOffSet: number[]

input : Angular

description The padding added in the top-left and bottom-right corners of a map container that shouldn't be accounted for when setting the view to fit bounds.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:226


icons

icons: IconConfig[]

input : Angular

description List of icons to add to the map and that can be used in layers.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:339


id

id: string = 'mapgl'

input : Angular

description element identifier given to map container

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:133


idFeatureField

idFeatureField: string

input : Angular

description the field name of ids.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:214


initCenter

initCenter: [number, number]

input : Angular

description Coordinates of the map's centre when it's initialized.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:198


initZoom

initZoom: number = 2

input : Angular

description Zoom of the map when it's initialized

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:183


isDrawPolyonSelected

isDrawPolyonSelected: boolean = false

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:437


layersMap

layersMap: Map<string, Layer>

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:409


legendOpen

legendOpen: boolean = true

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:105


legendUpdater

legendUpdater: Subject<Map<string, Map<string, LegendData>>>

input : Angular

description Subject of [collection, [field, legendData]] map. The map subscribes to it to keep the legend updated with the data displayed on the map.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:308


legendVisibiltyStatus

legendVisibiltyStatus: Subject<Map<string, boolean>>

output : Angular

description Emits which layers are displayed in the Legend

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:399


map

map: any

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:102


mapLayers

mapLayers: MapLayers

input : Angular

description List of mapgl layers

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:139


mapSources

mapSources: MapSource[]

input : Angular

description List of mapboxgl sources to add to the map.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:249


margePanForLoad

margePanForLoad: number

input : Angular

description Margin applied to the map extent. Data is loaded in all this extent.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:203


margePanForTest

margePanForTest: number

input : Angular

description Margin applied to the map extent. Before loading data, the components checks first if there are features already loaded in this extent.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:209


maxWidthScale

maxWidthScale: number = 100

input : Angular

description Max width of the scale.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:160


maxZoom

maxZoom: number = 22

input : Angular

description Max zoom of the map

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:188


minZoom

minZoom: number = 0

input : Angular

description Min zoom of the map

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:193


nbPolygonVertice

nbPolygonVertice: number = 0

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:416


offset

offset: Object

input : Angular

description An object with noth,east,south,west properies which represent an offset in pixel Origin is top-left and x axe is west to east and y axe north to south.

Type declaration

Name Type
east number
north number
south number
west number

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:293


onAoiChanged

onAoiChanged: Subject<FeatureCollection<Geometry | GeometryCollection, { [name: string]: any; }>>

output : Angular

description Emits the geojson of an aoi added to the map

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:389


onBasemapChanged

onBasemapChanged: Subject<boolean>

output : Angular

description Emits the geojson of an aoi added to the map

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:394


onFeatureClic

onFeatureClic: EventEmitter<any>

output : Angular

description Emits the event of clicking on a feature.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:359


onFeatureOver

onFeatureOver: EventEmitter<any>

output : Angular

description Emits the event of hovering feature.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:364


onMapClosed

onMapClosed: EventEmitter<MapExtend>

output : Angular

description Emits the map extend on Tab close/refresh

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:384


onMapLoaded

onMapLoaded: Subject<boolean>

output : Angular

description Emits true after the map is loaded and all sources & layers are added.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:345


onMove

onMove: EventEmitter<OnMoveResult>

output : Angular

description Emits the event of moving the map.

deprecated

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:352


onPolygonChange

onPolygonChange: EventEmitter<Object[]>

output : Angular

description Emit the event of updating the draw polygon

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:369


onPolygonError

onPolygonError: EventEmitter<Object>

output : Angular

description Emit the event of invalid geometry creation

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:374


onPolygonSelect

onPolygonSelect: EventEmitter<any>

output : Angular

description Emit the event of selecting polygon

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:379


polygonlabeldata

polygonlabeldata: Object

Type declaration

Name Type
features any[]
type string

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:417


preserveDrawingBuffer

preserveDrawingBuffer: boolean = false

input : Angular

description Whether the drawing buffer is activated If true , the map's canvas can be exported to a PNG using map.getCanvas().toDataURL() default: false

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:286


redrawSource

redrawSource: Subject<{ data: Feature<Geometry | GeometryCollection, { [name: string]: any; }>[] ; source: string }>

input : Angular

description Subject to which the component subscribes to redraw on the map the data of the given source.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:300


showBasemapsList

showBasemapsList: boolean = false

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:408


transformRequest

transformRequest: TransformRequestFunction

input : Angular

description A callback run before the Map makes a request for an external URL, mapbox map option

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:278


unitScale

unitScale: string = 'metric'

input : Angular

description Unit of the scale.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:165


visibilityStatus

visibilityStatus: Map<any, any>

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:436


visibilityUpdater

visibilityUpdater: Subject<Map<string, boolean>>

input : Angular

description Subject of [layerId, boolean] map. The map subscribes to it to keep the legend updated with the visibility of the layer.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:315


visualisationSetsConfig

visualisationSetsConfig: VisualisationSetConfig[]

input : Angular

description List of visualisation sets. A Visualisation set is an entity where to group layers together. If a visualisation set is enabled, all the layers in it can be displayed on the map, otherwise the layers are removed from the map.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:328


visualisations

visualisations: EventEmitter<Set<string>>

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:354


visualisationsSets

visualisationsSets: Object

Type declaration

Name Type
status Map<string, boolean>
visualisations Map<string, Set<string>>

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:330


wrapLatLng

wrapLatLng: boolean = true

input : Angular

description Whether the coordinates should be wraped between -180 and 180.

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:155


xMoveRatio

xMoveRatio: number = 0

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:433


yMoveRatio

yMoveRatio: number = 0

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:434


zoom

zoom: number

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:104


zoomStart

zoomStart: number

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:435

Methods

addGeoBox

addGeoBox(): void

description Displays the geobox

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1289


addVisualisation

addVisualisation(visualisation, layers, sources): void

description Add an external visulisation set to the map

Parameters

Name Type Description
visualisation VisualisationSetConfig A visulisation set object to add to the map
layers AnyLayer[] List of actual layers that are declared in visualisation object
sources MapSource[] List of sources that these external layers use.

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:509


deleteSelectedItem

deleteSelectedItem(): void

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1388


downloadLayerSource

downloadLayerSource(downaload): void

Parameters

Name Type
downaload Object
downaload.downloadType string
downaload.layer Layer

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:492


drop

drop(event): void

puts the visualisation set list in the new order after dropping

Parameters

Name Type
event CdkDragDrop<string[], string[], any>

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:550


dropLayer

dropLayer(event, visuName): void

puts the layers list in the new order after dropping

Parameters

Name Type
event CdkDragDrop<string[], string[], any>
visuName string

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:556


emitLegendVisibility

emitLegendVisibility(visualisation, l, visible): void

Parameters

Name Type Description
visualisation string visualisation set name
l string layer id
visible boolean whether the layer is enabled and visible in the visualisation set

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:451


emitVisualisations

emitVisualisations(visualisationName): void

Hides/shows all the layers inside the given visualisation name

Parameters

Name Type
visualisationName string

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:456


getAllPolygon

getAllPolygon(mode): any

Return the polygons geometry in WKT or GeoJson given the mode

Parameters

Name Type Description
mode "wkt" | "geojson" : string

Returns

any

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1331


getPolygonById

getPolygonById(id, mode): any

Parameters

Name Type
id number
mode "wkt" | "geojson"

Returns

any

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1361


getSelectedPolygon

getSelectedPolygon(mode): any

Return the selected polygon geometry in WKT or GeoJson given the mode

Parameters

Name Type Description
mode "wkt" | "geojson" : string

Returns

any

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1348


handleKeyboardEvent

handleKeyboardEvent(event): void

Parameters

Name Type
event KeyboardEvent

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1401


hideBasemapSwitcher

hideBasemapSwitcher(): void

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1415


ngAfterContentInit

ngAfterContentInit(): void

Returns

void

Implementation of

AfterContentInit.ngAfterContentInit

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:702


ngAfterViewInit

ngAfterViewInit(): void

Returns

void

Implementation of

AfterViewInit.ngAfterViewInit

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:707


ngOnChanges

ngOnChanges(changes): void

Parameters

Name Type
changes SimpleChanges

Returns

void

Implementation of

OnChanges.ngOnChanges

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:614


ngOnInit

ngOnInit(): void

Returns

void

Implementation of

OnInit.ngOnInit

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:547


onChangeBasemapStyle

onChangeBasemapStyle(selectedStyle): void

Parameters

Name Type
selectedStyle BasemapStyle

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1321


onChangePolygonDraw

onChangePolygonDraw(): void

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1303


openInvalidGeometrySnackBar

openInvalidGeometrySnackBar(): void

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:535


removeAois

removeAois(): void

description Removes all the aois if none of them is selected. Otherwise it removes the selected one only

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1297


reorderLayers

reorderLayers(): void

Sets the layers order according to the order of visualisationSetsConfig list

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:564


selectFeaturesByCollection

selectFeaturesByCollection(features, collection): void

Parameters

Name Type
features ElementIdentifier[]
collection string

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1408


setBaseMapStyle

setBaseMapStyle(style): void

Parameters

Name Type
style string | Style

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:661


setStyle

setStyle(s, style): void

Parameters

Name Type
s Style
style string | Style

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:671


showBasemapSwitcher

showBasemapSwitcher(): void

description Display the basemapswitcher

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1282


switchToDrawMode

switchToDrawMode(): void

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1374


switchToEditMode

switchToEditMode(): void

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:1380


updateLayerVisibility

updateLayerVisibility(visibility): void

description Updates the visibility status of the given layers in Legend component

Parameters

Name Type Description
visibility Map<string, boolean> Map of layerId, and its visibility status as boolean (true = visible)

Returns

void

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:530


getMapglJsonSchema

Static getMapglJsonSchema(): Object

Returns

Object

Defined in

projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts:543