arlas-web-components / Exports / MapglComponent

Class: MapglComponent

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

Implements

  • OnInit
  • AfterViewInit
  • OnChanges
  • OnDestroy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new MapglComponent(http, drawService, basemapService, _snackBar, translate)

Parameters

Name Type
http HttpClient
drawService MapboxAoiDrawService
basemapService MapboxBasemapService
_snackBar MatSnackBar
translate TranslateService

Defined in

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

Properties

FINISH_DRAWING

FINISH_DRAWING: string = 'Double click to finish drawing'

Defined in

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


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:184


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:227


currentLat

currentLat: string

Defined in

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


currentLng

currentLng: string

Defined in

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


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:334


defaultBasemapStyle

defaultBasemapStyle: BasemapStyle

Input

: Angular

Description

Default style of the base map

Defined in

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


displayCurrentCoordinates

displayCurrentCoordinates: boolean = false

Input

: Angular

Description

Whether the coordinates are displayed.

Defined in

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


displayScale

displayScale: boolean = true

Input

: Angular

Description

Whether the scale is displayed.

Defined in

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


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:407


dragEndX

dragEndX: number

Defined in

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


dragEndY

dragEndY: number

Defined in

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


dragStartX

dragStartX: number

Defined in

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


dragStartY

dragStartY: number

Defined in

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


draw

draw: any

Defined in

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


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:274


drawClickCounter

drawClickCounter: number = 0

Defined in

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


drawData

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

Input

: Angular

Description

Features drawn at component start

Defined in

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


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:262


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:280


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:243


featuresToSelect

featuresToSelect: ElementIdentifier[]

Input

: Angular

Description

List of feature to select.

Defined in

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


firstDrawLayer

firstDrawLayer: string = ''

Defined in

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


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:238


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:233


fitBoundsPadding

fitBoundsPadding: number = 10

Input

: Angular

Description

Padding value applied around a fitBounds to fully show the area targeted

Defined in

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


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:358


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:139


idFeatureField

idFeatureField: string

Input

: Angular

Description

the field name of ids.

Defined in

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


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:205


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:190


isDrawPolyonSelected

isDrawPolyonSelected: boolean = false

Defined in

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


layersMap

layersMap: Map<string, Layer>

Defined in

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


legendOpen

legendOpen: boolean = true

Defined in

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


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:321


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:406


map

map: any

Defined in

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


mapAttributionPosition

mapAttributionPosition: "top-right" | "top-left" | "bottom-right" | "bottom-left" = 'bottom-right'

Input

: Angular

Description

Position of the map attribution

Defined in

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


mapLayers

mapLayers: MapLayers

Input

: Angular

Description

List of mapgl layers

Defined in

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


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:256


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:210


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:216


maxWidthScale

maxWidthScale: number = 100

Input

: Angular

Description

Max width of the scale.

Defined in

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


maxZoom

maxZoom: number = 22

Input

: Angular

Description

Max zoom of the map

Defined in

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


minZoom

minZoom: number = 0

Input

: Angular

Description

Min zoom of the map

Defined in

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


nbPolygonVertice

nbPolygonVertice: number = 0

Defined in

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


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:300


onAoiChanged

onAoiChanged: EventEmitter<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:395


onAoiEdit

onAoiEdit: EventEmitter<AoiEdition>

Defined in

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


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:401


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:379


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:384


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:390


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:364


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:372


polygonlabeldata

polygonlabeldata: Object

Type declaration

Name Type
features any[]
type string

Defined in

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


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:293


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:313


showBasemapsList

showBasemapsList: boolean = false

Defined in

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


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:285


unitScale

unitScale: string = 'metric'

Input

: Angular

Description

Unit of the scale.

Defined in

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


visibilityStatus

visibilityStatus: Map<any, any>

Defined in

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


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:328


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:341


visualisations

visualisations: EventEmitter<Set<string>>

Defined in

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


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:349


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:161


xMoveRatio

xMoveRatio: number = 0

Defined in

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


yMoveRatio

yMoveRatio: number = 0

Defined in

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


zoom

zoom: number

Defined in

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


zoomStart

zoomStart: number

Defined in

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

Methods

addGeoBox

addGeoBox(): void

Description

Displays the geobox

Returns

void

Defined in

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


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:524


declareMap

declareMap(): void

Returns

void

Defined in

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


deleteSelectedItem

deleteSelectedItem(): void

Returns

void

Defined in

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


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:507


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:567


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:573


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:466


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:471


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:1320


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:1337


handleKeyboardEvent

handleKeyboardEvent(event): void

Parameters

Name Type
event KeyboardEvent

Returns

void

Defined in

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


hideBasemapSwitcher

hideBasemapSwitcher(): void

Returns

void

Defined in

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


moveToCoordinates

moveToCoordinates(lngLat): void

Parameters

Name Type
lngLat [number, number]

Returns

void

Defined in

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


ngAfterViewInit

ngAfterViewInit(): void

Returns

void

Implementation of

AfterViewInit.ngAfterViewInit

Defined in

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


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:635


ngOnDestroy

ngOnDestroy(): void

Returns

void

Implementation of

OnDestroy.ngOnDestroy

Defined in

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


ngOnInit

ngOnInit(): void

Returns

void

Implementation of

OnInit.ngOnInit

Defined in

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


onChangeBasemapStyle

onChangeBasemapStyle(): void

Returns

void

Defined in

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


openInvalidGeometrySnackBar

openInvalidGeometrySnackBar(): void

Returns

void

Defined in

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


paddedFitBounds

paddedFitBounds(bounds, options?): void

Wrapper method to fit the map to the given bounds with enough padding to properly visualize the area

Parameters

Name Type
bounds LngLatBoundsLike
options? FitBoundsOptions

Returns

void

Defined in

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


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:1306


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:581


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:1403


showBasemapSwitcher

showBasemapSwitcher(): void

Description

Display the basemapswitcher

Returns

void

Defined in

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


switchToDrawMode

switchToDrawMode(): void

Returns

void

Defined in

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


switchToEditMode

switchToEditMode(): void

Returns

void

Defined in

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


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:545


getMapglJsonSchema

Static getMapglJsonSchema(): Object

Returns

Object

Defined in

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