{"version":3,"file":"arlas-map.mjs","sources":["../../../projects/arlas-map/src/lib/map/model/map.ts","../../../projects/arlas-map/src/lib/arlas-map-framework.service.ts","../../../projects/arlas-map/src/lib/basemaps/basemap.service.ts","../../../projects/arlas-map/src/lib/basemaps/basemap.component.ts","../../../projects/arlas-map/src/lib/basemaps/basemap.component.html","../../../projects/arlas-map/src/lib/basemaps/basemaps.model.ts","../../../projects/arlas-map/src/lib/bbox-generator/coordinates.tools.ts","../../../projects/arlas-map/src/lib/coordinates/coordinates.pipe.ts","../../../projects/arlas-map/src/lib/coordinates/coordinates.component.ts","../../../projects/arlas-map/src/lib/coordinates/coordinates.component.html","../../../projects/arlas-map/src/lib/map/model/layers.ts","../../../projects/arlas-map/src/lib/map/tools.ts","../../../projects/arlas-map/src/lib/draw/modes/LimitVertexDirectSelectMode.ts","../../../projects/arlas-map/src/lib/draw/modes/ValidGeomDrawPolygonMode.ts","../../../projects/arlas-map/src/lib/draw/modes/circles/circle.mode.ts","../../../projects/arlas-map/src/lib/draw/modes/utils.ts","../../../projects/arlas-map/src/lib/draw/modes/circles/radius.circle.mode.ts","../../../projects/arlas-map/src/lib/draw/modes/circles/utils.ts","../../../projects/arlas-map/src/lib/draw/modes/directSelectOverride.ts","../../../projects/arlas-map/src/lib/draw/modes/rectangleMode.ts","../../../projects/arlas-map/src/lib/draw/modes/simpleSelectOverride.ts","../../../projects/arlas-map/src/lib/draw/modes/strip/strip.mode.ts","../../../projects/arlas-map/src/lib/draw/modes/strip/strip.direct.mode.ts","../../../projects/arlas-map/src/lib/draw/themes/default-theme.ts","../../../projects/arlas-map/src/lib/draw/draw.service.ts","../../../projects/arlas-map/src/lib/map/AbstractArlasMapGL.ts","../../../projects/arlas-map/src/lib/arlas-map.service.ts","../../../projects/arlas-map/src/lib/draw/arlas-draw.component.ts","../../../projects/arlas-map/src/lib/draw/arlas-draw.component.html","../../../projects/arlas-map/src/lib/legend/layer-name.pipe.ts","../../../projects/arlas-map/src/lib/legend/legend.config.ts","../../../projects/arlas-map/src/lib/legend/legend-icon/layer-icon.component.ts","../../../projects/arlas-map/src/lib/legend/legend-icon/layer-icon.component.html","../../../projects/arlas-map/src/lib/map/model/filters.ts","../../../projects/arlas-map/src/lib/legend/format-legend.pipe.ts","../../../projects/arlas-map/src/lib/legend/legend.tools.ts","../../../projects/arlas-map/src/lib/legend/legend.service.ts","../../../projects/arlas-map/src/lib/legend/legend-item/legend-item.component.ts","../../../projects/arlas-map/src/lib/legend/legend-item/legend-item.component.html","../../../projects/arlas-map/src/lib/legend/legend.component.ts","../../../projects/arlas-map/src/lib/legend/legend.component.html","../../../projects/arlas-map/src/lib/arlas-map.component.ts","../../../projects/arlas-map/src/lib/arlas-map.component.html","../../../projects/arlas-map/src/lib/bbox-generator/bbox-form-error.pipe.ts","../../../projects/arlas-map/src/lib/bbox-generator/bbox-generator.utils.ts","../../../projects/arlas-map/src/lib/bbox-generator/bbox-generator.component.ts","../../../projects/arlas-map/src/lib/bbox-generator/bbox-generator.component.html","../../../projects/arlas-map/src/lib/draw/AbstractDraw.ts","../../../projects/arlas-map/src/lib/map-import/map-import.component.ts","../../../projects/arlas-map/src/lib/map-import/map-import-dialog.component.html","../../../projects/arlas-map/src/lib/map-settings/map-settings.component.ts","../../../projects/arlas-map/src/lib/map-settings/map-settings-dialog.component.html","../../../projects/arlas-map/src/lib/map/model/controls.ts","../../../projects/arlas-map/src/lib/map/model/vector-style.ts","../../../projects/arlas-map/src/public-api.ts","../../../projects/arlas-map/src/arlas-map.ts"],"sourcesContent":["/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n\nexport interface OnMoveResult {\n  zoom: number;\n  zoomStart: number;\n  center: Array<number>;\n  centerWithOffset: Array<number>;\n  extend: Array<number>;\n  extendWithOffset: Array<number>;\n  rawExtendWithOffset: Array<number>;\n  extendForLoad: Array<number>;\n  extendForTest: Array<number>;\n  rawExtendForLoad: Array<number>;\n  rawExtendForTest: Array<number>;\n  xMoveRatio: number;\n  yMoveRatio: number;\n  visibleLayers: Set<string>;\n}\n\nexport class ArlasLngLat {\n  public lng: number;\n  public lat: number;\n\n  public constructor(lng: number, lat: number) {\n    this.lng = lng;\n    this.lat = lat;\n  }\n\n  public toArray(): number[] {\n    return [this.lng, this.lat];\n  }\n}\n\nexport class ArlasLngLatBounds {\n  public sw: ArlasLngLat;\n  public ne: ArlasLngLat;\n\n  public constructor(sw: ArlasLngLat, ne: ArlasLngLat) {\n    this.sw = sw;\n    this.ne = ne;\n  }\n\n  public getEast() {\n    return this.ne.lng;\n  }\n\n  public getNorth() {\n    return this.ne.lat;\n  }\n\n  public getWest() {\n    return this.sw.lng;\n  }\n\n  public getSouth() {\n    return this.sw.lat;\n  }\n}\n\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Injectable } from '@angular/core';\nimport { Feature, FeatureCollection } from 'geojson';\nimport { Subject } from 'rxjs';\nimport { AbstractDraw } from './draw/AbstractDraw';\nimport { AbstractArlasMapGL, ArlasMapOption, MapConfig } from './map/AbstractArlasMapGL';\nimport { MapLayerMouseEvent } from './map/model/events';\nimport { ArlasPoint } from './map/model/geometry';\nimport { ArlasLngLat, ArlasLngLatBounds } from './map/model/map';\nimport { VectorStyle } from './map/model/vector-style';\n\n/**\n * This service exposes a list of map interaction methods that are abstract.\n * Theses methods will be implemented by the chosen cartographical framework to use.\n *\n * L: a layer class/interface.\n * S: a source class/interface.\n * M: a Map configuration class/interface.\n */\n@Injectable({\n  providedIn: 'root'\n})\nexport abstract class ArlasMapFrameworkService<L, S, M> {\n  /** Bus used to transmit errors */\n  private readonly _errorBus$ = new Subject<string>();\n  public readonly errorBus$ = this._errorBus$.asObservable();\n\n  public abstract getInitTransformRequest(): Function;\n  public abstract setTransformRequest(map: AbstractArlasMapGL, transformRequest: Function): void;\n  public abstract buildMapProviderOption(mapOption: ArlasMapOption): M;\n  public abstract createMap(config: MapConfig<M>): AbstractArlasMapGL;\n\n  public abstract createDraw(drawOptions: any, enabled: boolean, map: AbstractArlasMapGL): AbstractDraw;\n\n  /**\n   * @description Gets the bounds from the two given coordinates.\n   * @param c1 Coordinates of the first corner.\n   * @param c2 Coordinates of the second corner.\n   * @returns Bounds formed from the two given coordinates.\n   */\n  public getLngLatBound(c1: ArlasLngLat, c2: ArlasLngLat): ArlasLngLatBounds {\n    return new ArlasLngLatBounds(c1, c2);\n  }\n\n  /**\n   * Fits the map to its current bounds. To be used when a map container is resized.\n   * @param map Map instance.\n   */\n  public abstract fitMapBounds(map: AbstractArlasMapGL): void;\n\n  public abstract getBoundsAsString(map: AbstractArlasMapGL): string;\n\n  /**\n   * @description Gets the Point (geometry) from mouse click on the screen.\n   * @param mouseEvent Click mouse event.\n   * @param container Map container.\n   * @returns a Point instance.\n   */\n  public abstract getPointFromScreen(mouseEvent: MouseEvent, container: HTMLElement): ArlasPoint;\n\n  /**\n   * @description Sets `data` to a Geojson `source` of the map\n   * @param source A Geojson source\n   * @param data A feature collection object.\n   */\n  public abstract setDataToGeojsonSource(source: S, data: FeatureCollection<GeoJSON.Geometry>): void;\n\n\n  /**\n   * Returns the canvas element of the map\n   * @param map Map instance.\n   */\n  public abstract getCanvas(map: AbstractArlasMapGL): HTMLCanvasElement;\n\n  public abstract addImage(name: string, url: string, map: AbstractArlasMapGL, errorMessage: string, opt?: any): void;\n\n  /**\n   * @description Adds a layer to the map instance.\n   * @param map Map instance.\n   * @param layer A layer. It could be a layer identifier OR a layer object (it will depend on the framwork implementation).\n   * @param beforeId Identifier of an already added layer. The 'layer' is added under this 'beforeId' layer.\n   */\n  public abstract addLayer(map: AbstractArlasMapGL, layer: L, beforeId?: L | string): void;\n\n  public abstract getLayersFromPattern(map: AbstractArlasMapGL, layersIdPattern: string): L[];\n  public abstract getLayerIdsFromPattern(map: AbstractArlasMapGL, layersIdPattern: string): string[];\n  public abstract getLayersStartingWithSource(map: AbstractArlasMapGL, sourceIdPattern: string): L[];\n  public abstract getAllLayers(map: AbstractArlasMapGL): L[];\n\n  public abstract hasLayer(map: AbstractArlasMapGL, layer: L | string): boolean;\n  public abstract hasLayersFromPattern(map: AbstractArlasMapGL, layersIdPattern: string): boolean;\n  public abstract moveLayer(map: AbstractArlasMapGL, layer: L | string, beforeId?: string): void;\n  public abstract onLayerEvent(eventName: string, map: AbstractArlasMapGL, layer: L | string, fn: (e: any) => void): void;\n  public abstract removeLayer(map: AbstractArlasMapGL, layer: L | string, removeSource?: boolean): void;\n  public abstract removeLayers(map: AbstractArlasMapGL, layers: L[] | string[]): void;\n  public abstract removeLayersFromPattern(map: AbstractArlasMapGL, layersIdPattern: string): void;\n  public abstract setLayerVisibility(layer: L | string, isVisible: boolean, map: AbstractArlasMapGL): void;\n  public abstract isLayerVisible(layer: L | string): boolean;\n  public abstract getLayer(map: AbstractArlasMapGL, layerId: string): L;\n  public abstract setTerrain(source: S, map: AbstractArlasMapGL, exaggeration?: number): string[];\n  public abstract removeTerrain(map: AbstractArlasMapGL): void;\n\n  public abstract queryFeatures(mouseEvent: MapLayerMouseEvent, map: AbstractArlasMapGL, layersIdPattern: string, options?: any): Feature[];\n  public abstract hasSource(map: AbstractArlasMapGL, source: L | AbstractArlasMapGL | string): boolean;\n  public abstract getSource(sourceId: string, options: L | AbstractArlasMapGL | string): S;\n  public abstract getAllSources(options:  L | AbstractArlasMapGL | string): Record<string, S>;\n  public abstract setSource(sourceId: string, source: S, options: L | AbstractArlasMapGL | string): void;\n  public abstract removeSource(map: AbstractArlasMapGL, source: S | string): void;\n\n  public abstract addPopup(map: AbstractArlasMapGL, popup: any): void;\n  public abstract createPopup(lng: number, lat: number, message: string): void;\n  public abstract removePopup(map: AbstractArlasMapGL, popup: any): void;\n\n  public abstract onMapEvent(eventName: any, map: AbstractArlasMapGL, fn: (e: any) => void): void;\n  public abstract setMapCursor(map: AbstractArlasMapGL, cursor: string): void;\n  public abstract flyTo(lat: number, lng: number, zoom: number, map: AbstractArlasMapGL): void;\n\n  public abstract addIconLayer(map: AbstractArlasMapGL, layerId: string, iconName: string,\n    iconSize: number, data: GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry>, beforeId?: string): void;\n  public abstract addRasterLayer(map: AbstractArlasMapGL, layerId: string, url: string, bounds: number[],\n    maxZoom: number, tileSize: number, beforeId?: string): void;\n\n  public abstract addGeojsonLayer(map: AbstractArlasMapGL, layerId: string, style: VectorStyle,\n    data: GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry>, beforeId?: string): void;\n\n  /**\n   * Adds a layer displaying the given image on the totality of the given bounds\n   */\n  public abstract addImageLayer(map: AbstractArlasMapGL, layerId: string, imageURL: string,\n    bounds: [[number, number], [number, number], [number, number], [number, number]], beforeId?: string): void;\n\n  public abstract filterGeojsonData(map: AbstractArlasMapGL, layer: L | string, filter: any): void;\n\n  public abstract createGeojsonSource(data: GeoJSON.GeoJSON): S;\n  public abstract createRasterSource(url: string, bounds: number[], maxZoom: number, tileSize: number): S;\n\n  public emitError(message: string) {\n    this._errorBus$.next(message);\n  }\n\n  /**\n   * Toggle layer visibility\n   * @param map\n   * @param ids\n   * @param isVisible\n   */\n  public toggleLayersVisibility(map: AbstractArlasMapGL,  ids: string[],  isVisible: boolean){\n    for (const id of ids) {\n      if (this.hasLayer(map, id)) {\n        map.getMapProvider().setLayoutProperty(id, 'visibility', isVisible ? 'visible' : 'none');\n      }\n    }\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { HttpClient } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\nimport { ArlasMapFrameworkService } from '../arlas-map-framework.service';\nimport { AbstractArlasMapGL } from '../map/AbstractArlasMapGL';\nimport { BasemapStyle } from './basemap.config';\nimport { ArlasBasemaps } from './basemaps.model';\n\n@Injectable({\n  providedIn: 'root'\n})\n/** L: a layer class/interface.\n *  S: a source class/interface.\n *  M: a Map configuration class/interface.\n */\nexport abstract class BasemapService<L, S, M> {\n\n  protected POWERED_BY_ARLAS = ' Powered by ARLAS.';\n  protected LOCAL_STORAGE_BASEMAPS = 'arlas_last_base_map';\n\n\n  protected basemapChangedSource = new Subject<BasemapStyle>();\n  public basemapChanged$ = this.basemapChangedSource.asObservable();\n  public basemaps?: ArlasBasemaps;\n\n  protected protomapBasemapAddedSource = new Subject<boolean>();\n  public protomapBasemapAdded$ = this.protomapBasemapAddedSource.asObservable();\n\n  protected readonly mapFrameworkService = inject(ArlasMapFrameworkService<L, S, M>);\n  protected readonly http = inject(HttpClient);\n\n  public setBasemaps(basemaps: ArlasBasemaps) {\n    this.basemaps = basemaps;\n  }\n\n  public abstract addProtomapBasemap(map: AbstractArlasMapGL): void;\n\n  protected addPMtilesToSource(map: AbstractArlasMapGL, pmtilesSource: any) {\n    /* eslint-disable max-len */\n    pmtilesSource['attribution'] = '<a href=\"https://protomaps.com/\" target=\"_blank\">Protomaps</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">&copy; OpenStreetMap</a>';\n    pmtilesSource['attribution'] = pmtilesSource['attribution'] + this.POWERED_BY_ARLAS;\n    this.mapFrameworkService.setSource('arlas_protomaps_source', pmtilesSource, map);\n  }\n\n  protected addProtomapLayerToMap(map: AbstractArlasMapGL, styleFile: any) {\n    styleFile.layers.forEach((l: any) => {\n      this.mapFrameworkService.removeLayer(map, l.id);\n      this.mapFrameworkService.addLayer(map, l);\n    });\n  }\n\n  public notifyProtomapAddition() {\n    this.protomapBasemapAddedSource.next(true);\n  }\n\n  public abstract removeProtomapBasemap(map: AbstractArlasMapGL): void;\n\n  public abstract declareProtomapProtocol(map: AbstractArlasMapGL): void;\n\n  public cloneStyleFile<T>(selected: BasemapStyle) {\n    return { ...selected.styleFile as T};\n  }\n\n  public buildInitStyle<StyleType, LayerSpec>(clonedStyleFile: StyleType) {\n    (<any>clonedStyleFile).sources = {\n      protomaps_attribution: {\n        'type': 'vector',\n        'attribution': '<a href=\"https://protomaps.com/\" target=\"_blank\">Protomaps</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">&copy; OpenStreetMap</a>' + this.POWERED_BY_ARLAS\n      }\n    };\n    (<any>clonedStyleFile).layers = [{\n      id: 'backgrounds',\n      type: 'background',\n      source: 'protomaps_attribution',\n      paint: {\n        'background-color': 'rgba(0,0,0,0)'\n      }\n    } as unknown as LayerSpec];\n    return clonedStyleFile;\n  };\n  public abstract getInitStyle(selected: BasemapStyle): any;\n  public abstract fetchSources$(): Observable<readonly any[]>;\n  protected abstract getStyleFile(b: BasemapStyle): Observable<any>;\n  public abstract setBasemap(s: any, newBasemap: BasemapStyle, map: AbstractArlasMapGL, options?: any): void;\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core';\nimport { MatIcon } from '@angular/material/icon';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { takeUntil } from 'rxjs';\nimport { Subject } from 'rxjs/internal/Subject';\nimport { AbstractArlasMapGL } from '../map/AbstractArlasMapGL';\nimport { ArlasMapSource } from '../map/model/sources';\nimport { BasemapStyle } from './basemap.config';\nimport { BasemapService } from './basemap.service';\nimport { ArlasBasemaps } from './basemaps.model';\n\n@Component({\n    selector: 'arlas-basemap',\n    templateUrl: './basemap.component.html',\n    styleUrls: ['./basemap.component.scss'],\n    imports: [MatIcon, TranslatePipe]\n})\n/** L: a layer class/interface.\n *  S: a source class/interface.\n *  M: a Map configuration class/interface.\n */\nexport class BasemapComponent<L, S, M>implements OnInit, OnDestroy {\n\n  private readonly _onDestroy$ = new Subject<boolean>();\n\n  @Input() public map?: AbstractArlasMapGL;\n  @Input() public mapSources = new Array<ArlasMapSource<any>>();\n\n  @Output() public basemapChanged = new EventEmitter<void>();\n  @Output() public blur = new Subject<void>();\n\n  public showList = false;\n  public basemaps?: ArlasBasemaps;\n\n  private readonly basemapService = inject(BasemapService<L, S, M>);\n\n  public constructor() {\n    this.basemapService.basemapChanged$.pipe(takeUntil(this._onDestroy$)).subscribe(() => this.basemapChanged.emit());\n  }\n\n  public ngOnInit(): void {\n    this.initBasemaps();\n  }\n\n  protected initBasemaps() {\n    this.basemaps = this.basemapService.basemaps;\n    if (this.basemaps) {\n      const styles = this.basemaps.styles();\n      if (styles) {\n        this.showList = styles.length > 0;\n        styles.filter(bm => !bm.image).forEach(bm => {\n          if (bm.type !== 'protomap' && !!bm.url) {\n            const splitUrl = bm.url.split('/style.json?key=');\n            if (splitUrl.length === 2) {\n              bm.image = `${splitUrl[0]}/0/0/0.png?key=${splitUrl[1]}`;\n            }\n          }\n        });\n      }\n    }\n  }\n\n  /** Removes the old basemap and set the new one that is given as a parameter\n   * @param newBasemap: Basemap selected by the user\n   */\n  public onChangeBasemap(newBasemap: BasemapStyle) {\n    const selectedBasemap = this.basemaps?.getSelected();\n    if (selectedBasemap && selectedBasemap.type === 'protomap' && this.map) {\n      this.basemapService.removeProtomapBasemap(this.map);\n    }\n    this.setBaseMapStyle(newBasemap);\n  }\n\n  public setBaseMapStyle(newBasemap: BasemapStyle) {\n    if (this.map) {\n      this.basemapService.setBasemap(this.basemaps?.getSelected().styleFile, newBasemap, this.map, this.mapSources);\n    }\n  }\n\n  public ngOnDestroy() {\n    this._onDestroy$.next(true);\n    this._onDestroy$.complete();\n  }\n\n}\n","@if (showList) {\n  <div class=\"basemap-container\">\n    @for (style of basemaps?._styles; track style) {\n      @if (!style.errored) {\n        <div class=\"basemap\" [class.selected]=\"style.name === basemaps?._selectedStyle?.name\"\n          (click)=\"onChangeBasemap(style)\" (keyDown)=\"onChangeBasemap(style)\">\n          <div class=\"image\">\n            @if (style?.image && style?.image !== '') {\n              <img src=\"{{style?.image}}\" (error)=\"style.image = undefined\" alt=\"\"/>\n            } @else {\n              <div class=\"no-image\">\n                <mat-icon>wallpaper</mat-icon>\n              </div>\n            }\n            <div class=\"name\">{{style.name | translate}}</div>\n          </div>\n        </div>\n      }\n    }\n  </div>\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { BasemapStyle } from './basemap.config';\n\nexport class ArlasBasemaps {\n  private readonly LOCAL_STORAGE_BASEMAPS = 'arlas_last_base_map';\n  public _selectedStyle?: BasemapStyle;\n  public _styles: BasemapStyle[] = [];\n  private readonly defaultBasemapStyle?: BasemapStyle;\n  private readonly basemapStyles?: BasemapStyle[];\n\n  public constructor(defaultBasemapStyle?: BasemapStyle, basemapStyles?: BasemapStyle[]) {\n    if (defaultBasemapStyle && basemapStyles) {\n      this.defaultBasemapStyle = defaultBasemapStyle;\n      this.basemapStyles = basemapStyles;\n    } else {\n      // todo throw error ?\n    }\n  }\n\n  public styles(): BasemapStyle[] {\n    if (this._styles.length === 0 && this.defaultBasemapStyle && this.basemapStyles) {\n      this._styles = this.getAllBasemapStyles(this.defaultBasemapStyle, this.basemapStyles);\n    }\n    return this._styles.filter(b => !b.errored);\n  }\n\n  public setSelected(style: BasemapStyle) {\n    this._selectedStyle = style;\n    return this;\n  }\n\n  public getStyle(b?: BasemapStyle) {\n    if (!b) {\n      return undefined;\n    }\n    return this.styles().find(s => s.name === b.name);\n  }\n\n  public getSelected(): BasemapStyle {\n    if (!this._selectedStyle) {\n      const styles = this.styles();\n      const localStorageBasemapStyle: BasemapStyle = JSON.parse(localStorage.getItem(this.LOCAL_STORAGE_BASEMAPS) ?? '{}');\n      const sameNameBasemaps = localStorageBasemapStyle ? styles.filter(b => b.name === localStorageBasemapStyle.name) : [];\n\n      const defaultStyle = this.getStyle(this.defaultBasemapStyle);\n      if (sameNameBasemaps.length > 0) {\n        this._selectedStyle = sameNameBasemaps[0];\n      } else if (defaultStyle) {\n        this._selectedStyle = defaultStyle;\n      } else if (styles && styles.length > 0) {\n        this._selectedStyle = styles[0];\n      } else {\n        this._selectedStyle = {\n          name: 'Background',\n          styleFile: {\n            version: 8,\n            sources: {},\n            layers: [\n              {\n                id: 'backgrounds',\n                type: 'background',\n                paint: {\n                  'background-color': 'rgba(0,0,0,0)'\n                }\n              }\n            ]\n          }\n        };\n      }\n    }\n    return this._selectedStyle;\n  }\n\n\n  private getAllBasemapStyles(defaultBasemapTheme: BasemapStyle, basemapStyles: BasemapStyle[]): Array<BasemapStyle> {\n    const allBasemapStyles = new Array<BasemapStyle>();\n    if (basemapStyles) {\n      basemapStyles.forEach(b => allBasemapStyles.push(b));\n      if (defaultBasemapTheme) {\n        if (basemapStyles.map(b => b.name).filter(n => n === defaultBasemapTheme.name).length === 0) {\n          allBasemapStyles.push(defaultBasemapTheme);\n        }\n      }\n    } else if (defaultBasemapTheme) {\n      allBasemapStyles.push(defaultBasemapTheme);\n    }\n    return allBasemapStyles;\n  }\n}\n\n\n\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\n\n// eslint-disable-next-line max-len\nexport const DECIMAL_SEXAGESIMAL_REGEX = '^(?<decimal>[+-]?([0-9]*[.])?[0-9]+)$|^(?<degrees>(-?)[0-9]+)°[ ]*((?<minutes>[0-9]+)\\'[ ]*((?<seconds>[0-9]+)\\\")?)?$';\nexport class PointFormGroup extends FormGroup {\n\n    public latitude: FormControl;\n    public longitude: FormControl;\n\n    public constructor(initLat: number | string, initLng: number | string) {\n        const coordinatesRegex = DECIMAL_SEXAGESIMAL_REGEX;\n        const latitude = new FormControl(String(initLat), [\n            Validators.required,\n            Validators.pattern(coordinatesRegex)\n        ]);\n        const longitude = new FormControl(String(initLng), [\n            Validators.required,\n            Validators.pattern(coordinatesRegex),\n        ]);\n        super({\n            latitude,\n            longitude\n        });\n        this.latitude = latitude;\n        this.longitude = longitude;\n    }\n}\n\nexport class Coordinate {\n  /** Parses a coordinate in decimal or sexagesimal degrees and returns the decimal degrees */\n  public static parse(value: string) {\n    const coordinatesRegex = DECIMAL_SEXAGESIMAL_REGEX;\n    const parsedCoordinates = value.match(coordinatesRegex);\n    if (parsedCoordinates && parsedCoordinates.groups) {\n      const groups = parsedCoordinates.groups;\n      if (groups.decimal) {\n        return +groups.decimal;\n      } else {\n        const degrees = +groups.degrees;\n        const minutes = +groups.minutes;\n        const seconds = +groups.seconds;\n        return this.dmsToDd(degrees, minutes, seconds);\n      }\n    }\n\n    throw new Error('Given value is not a coordinate');\n  }\n\n  /** DegreeMinutesSeconds to Decimal degree */\n  public static dmsToDd(degrees: number, minutes: number, seconds: number) {\n    const isNegative = (degrees < 0);\n    if (!minutes) {\n      minutes = 0;\n    }\n    if (!seconds) {\n      seconds = 0;\n    }\n    const dd = Math.abs(degrees) + minutes / 60 + seconds / 3600;\n    return isNegative ? -dd : dd;\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\n\n@Pipe({\n  name: 'coordinatesFormError'\n})\nexport class CoordinatesErrorPipe implements PipeTransform {\n\n  public transform(formControl: FormControl | FormGroup): string {\n    if (formControl.hasError('required')) {\n      return marker('You must enter a coordinate');\n    }\n    return formControl.hasError('pattern') ? marker('1.1 or 1°6\\'3\"') : '';\n  }\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { DecimalPipe } from '@angular/common';\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIcon } from '@angular/material/icon';\nimport { MatInput } from '@angular/material/input';\nimport { MatError, MatFormField, MatLabel } from '@angular/material/select';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Coordinate, PointFormGroup } from '../bbox-generator/coordinates.tools';\nimport { CoordinatesErrorPipe } from './coordinates.pipe';\n\n@Component({\n  selector: 'arlas-coordinates',\n  templateUrl: './coordinates.component.html',\n  styleUrls: ['./coordinates.component.scss'],\n  imports: [\n    MatTooltip, FormsModule, ReactiveFormsModule, MatFormField, MatLabel, MatButtonModule,\n    MatInput, MatError, MatIcon, DecimalPipe, TranslatePipe, CoordinatesErrorPipe]\n})\nexport class CoordinatesComponent {\n  @Input() public currentLat = '0';\n  @Input() public currentLng = '0';\n\n  /**\n   * @constant\n   */\n  public placeHolder = marker('1.1 or 1°6\\'3\"');\n\n  @Output() public moveToCoordinates$: EventEmitter<[number, number]> = new EventEmitter();\n  public coordinatesForm: PointFormGroup;\n  public editionMode = false;\n\n  public constructor() {\n    this.coordinatesForm = new PointFormGroup(this.currentLat, this.currentLng);\n  }\n\n  public switchToEditionMode() {\n    this.editionMode = true;\n    this.coordinatesForm.latitude.setValue(this.currentLat);\n    this.coordinatesForm.longitude.setValue(this.currentLng);\n  }\n\n  public moveToCoordinates() {\n    const lat = Coordinate.parse(this.coordinatesForm.latitude.value);\n    const lng = Coordinate.parse(this.coordinatesForm.longitude.value);\n    this.moveToCoordinates$.emit([lng, lat]);\n    this.editionMode = false;\n    this.currentLat = String(lat);\n    this.currentLng = String(lng);\n  }\n\n}\n","@if (!editionMode) {\n  <div class=\"current-coordinate\" (click)=\"switchToEditionMode()\" (keyDown)=\"switchToEditionMode()\" [matTooltip]=\"'Enter coordinates and centre the map' | translate\"\n    matTooltipPosition=\"above\">\n    <span class=\"lat\"> {{ 'Lat:' | translate }} {{ currentLat | number:'1.5-5' }} </span>\n    <span class=\"lng\"> {{ 'Lng:' | translate }} {{ currentLng | number:'1.5-5' }} </span>\n  </div>\n} @else {\n  <div class=\"current-coordinate-edition\">\n    <div class=\"section\" [formGroup]=\"coordinatesForm\">\n      <mat-form-field appearance=\"outline\">\n        <mat-label>{{'Latitude' | translate}}</mat-label>\n        <input class=\"input\" matInput [formControl]=\"coordinatesForm.latitude\"\n          [placeholder]=\"placeHolder | translate\">\n        @if (coordinatesForm.latitude.invalid) {\n          <mat-error>{{coordinatesForm.latitude | coordinatesFormError | translate}}\n          </mat-error>\n        }\n      </mat-form-field>\n      <div class=\"coordinate\">\n        <mat-form-field appearance=\"outline\">\n          <mat-label>{{'Longitude' | translate}}</mat-label>\n          <input class=\"input\" matInput [formControl]=\"coordinatesForm.longitude\"\n            [placeholder]=\"placeHolder | translate\">\n          @if (coordinatesForm.longitude.invalid) {\n            <mat-error>{{coordinatesForm.longitude | coordinatesFormError | translate}}</mat-error>\n          }\n        </mat-form-field>\n      </div>\n      <button class=\"move\" matButton=\"filled\" color=\"primary\" (click)=\"moveToCoordinates()\"\n        [disabled]=\"coordinatesForm.invalid\">\n        <span class=\"label\">{{'Move to' | translate}}</span>\n      </button>\n    </div>\n    <div class=\"exit\" (click)=\"editionMode = false\" (keyDown)=\"editionMode = false\">\n      <mat-icon>clear</mat-icon>\n    </div>\n  </div>\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nexport interface ArlasDataLayer {\n  id: string;\n  type: string;\n  minzoom?: number;\n  maxzoom?: number;\n  source: string;\n  metadata?: LayerMetadata;\n  paint: ArlasPaint;\n  layout?: any;\n  filter?: any;\n}\n\nexport interface MapLayers<T> {\n  layers: Array<T>;\n  externalEventLayers?: Array<ExternalEventLayer>;\n  events: LayerEvents;\n}\n\nexport interface LayerEvents {\n  onHover: Set<string>;\n  emitOnClick: Set<string>;\n  zoomOnClick: Set<string>;\n}\n\nexport interface ExternalEventLayer {\n  id: string;\n  on: ExternalEvent;\n}\n\nexport enum ExternalEvent {\n  select = 'select',\n  hover = 'hover'\n}\n\n\nexport interface FillStroke {\n  width?: PaintValue;\n  opacity?: number;\n  color?: PaintValue;\n}\n\nexport interface FillExtrusion {\n  height?: ExpressionValue;\n  opacity?: number;\n  color?: PaintValue;\n}\n\n/** Metadata of a layer containing info about\n * - the collection\n * - whether it has an interaction with the resultlist (scrollable)\n * - geomType for circle heatmap.\n */\nexport interface LayerMetadata {\n  collection?: string;\n  collectionDisplayName?: string;\n  stroke?: FillStroke;\n  extrusion?: FillExtrusion;\n  isScrollableLayer?: boolean;\n  hiddenProps?: MetadataHiddenProps;\n  showLegend?: boolean;\n  cellShape?: CellShape;\n}\n\nexport type CellShape = 'hexagonal' | 'square';\nexport interface MetadataHiddenProps {\n  geomType?: string;\n}\n\nexport type PaintValue = ExpressionValue | PaintColor;\nexport type ExpressionValue = Array<string | Array<string> | number> | string | number;\nexport interface ArlasPaint { [key: string]: PaintValue; }\nexport interface PaintColor {\n  property: string;\n  type: string;\n  stops: Array<Array<string>>;\n}\n\n\nexport const HOVER_LAYER_PREFIX = 'arlas-hover-';\nexport const SELECT_LAYER_PREFIX = 'arlas-select-';\nexport const FILLSTROKE_LAYER_PREFIX = 'arlas-fill_stroke-';\nexport const SCROLLABLE_ARLAS_ID = 'scrollable_arlas_id:';\nexport const EXTRUSION_LAYER_PREFIX = 'arlas-extrusion-';\nexport const ARLAS_ID = 'arlas_id:';\nexport const ARLAS_VSET = ':arlas_vset:';\n\n/** FROM V15.0.0 layer ids look like 'arlas_id:NAME:timestamp\n   * This pipe extracts the 'NAME' in that id\n   */\nexport function getLayerName(id: string): string {\n  if (!!id && id.startsWith(ARLAS_ID)) {\n    const datedName = id.split(ARLAS_ID)[1];\n    const undatedName = datedName.split(':')[0];\n    return undatedName;\n  }\n  return id;\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nimport { ARLAS_ID, EXTRUSION_LAYER_PREFIX, FILLSTROKE_LAYER_PREFIX } from './model/layers';\n\nexport function latLngToWKT(features: GeoJSON.Feature<GeoJSON.Polygon>[]): string {\n  let wktType = 'POLYGON[###]';\n  if (features.length > 1) {\n    wktType = 'MULTIPOLYGON([###])';\n  }\n\n  let polygons = '';\n  features.forEach((feat, indexFeature) => {\n    if (feat) {\n      const currentFeat = feat.geometry.coordinates;\n      polygons += (indexFeature === 0 ? '' : ',') + '((';\n      currentFeat[0].forEach((coord, index) => {\n        polygons += (index === 0 ? '' : ',') + coord[0] + ' ' + coord[1];\n      });\n      polygons += '))';\n    }\n  });\n\n  let wkt = '';\n  if (polygons !== '') {\n    wkt = wktType.replace('[###]', polygons);\n  }\n  return wkt;\n}\n\nexport function getAdditionalFillLayers(id: string){\n  return [id.replace(ARLAS_ID, FILLSTROKE_LAYER_PREFIX), id.replace(ARLAS_ID, EXTRUSION_LAYER_PREFIX)];\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport { getIssues } from '@placemarkio/check-geojson';\n\nexport const limitVertexDirectSelectMode = MapboxDraw.modes.direct_select;\n\nlimitVertexDirectSelectMode.fireInvalidGeom = function (feature) {\n  this.map.fire('draw.invalidGeometry', {\n    action: 'error',\n    features: [feature]\n  });\n};\n\nlimitVertexDirectSelectMode.fireInitialFeature = function (feature) {\n  this.map.fire('draw.edit.saveInitialFeature', {\n    feature: feature\n  });\n};\n\nlimitVertexDirectSelectMode.toDisplayFeatures = function (state, geojson: GeoJSON.Feature<GeoJSON.Polygon>, push) {\n  geojson.properties ??= {};\n  if (state.featureId === geojson.properties.id) {\n    geojson.properties.active = MapboxDraw.constants.activeStates.ACTIVE;\n    push(geojson);\n    MapboxDraw.lib.createSupplementaryPoints(geojson, {\n      map: this.map,\n      midpoints: geojson.geometry.coordinates[0].length < state.maxVertexByPolygon + 1,\n      selectedPaths: state.selectedCoordPaths\n    }).forEach(push);\n  } else {\n    geojson.properties.active = MapboxDraw.constants.activeStates.INACTIVE;\n    push(geojson);\n  }\n  this.fireActionable(state);\n};\n\nlimitVertexDirectSelectMode.onTouchEnd = limitVertexDirectSelectMode.onMouseUp = function (state) {\n  if (state.dragMoving) {\n    const featureCoords = [...state.feature.coordinates[0]];\n    if (\n      featureCoords[0][0] !== featureCoords[featureCoords.length - 1][0] ||\n      featureCoords[0][1] !== featureCoords[featureCoords.length - 1][1]\n    ) {\n      featureCoords.push(featureCoords[0]);\n    }\n    const currentFeature = {\n      type: 'Feature',\n      geometry: {\n        type: 'Polygon',\n        coordinates: [featureCoords]\n      },\n      properties: {}\n    };\n\n    if (getIssues(JSON.stringify(currentFeature)).length === 0) {\n      this.fireUpdate();\n    } else {\n      this.fireInvalidGeom(currentFeature);\n    }\n  }\n  this.stopDragging(state);\n};\n\n\nlimitVertexDirectSelectMode.onSetup = function (opts) {\n  const featureId = opts.featureId;\n  let maxVertexByPolygon = opts.maxVertexByPolygon;\n  const feature = this.getFeature(featureId);\n  this.fireInitialFeature(feature);\n  if (!feature) {\n    throw new Error('You must provide a featureId to enter direct_select mode');\n  }\n\n  if (!maxVertexByPolygon) {\n    maxVertexByPolygon = 100;\n  }\n\n  if (feature.type === MapboxDraw.constants.geojsonTypes.POINT) {\n    throw new TypeError('direct_select mode doesn\\'t handle point features');\n  }\n\n  const state = {\n    featureId,\n    feature,\n    dragMoveLocation: opts.startPos || null,\n    dragMoving: false,\n    canDragMove: false,\n    selectedCoordPaths: opts.coordPath ? [opts.coordPath] : [],\n    maxVertexByPolygon\n  };\n\n  this.setSelectedCoordinates(this.pathsToCoordinates(featureId, state.selectedCoordPaths));\n  this.setSelected(featureId);\n  MapboxDraw.lib.doubleClickZoom.disable(this);\n\n  this.setActionableState({\n    trash: true\n  });\n\n  return state;\n};\n\nexport default limitVertexDirectSelectMode;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport { getIssues } from '@placemarkio/check-geojson';\n\nexport const validGeomDrawPolygonMode = MapboxDraw.modes.draw_polygon;\n\nvalidGeomDrawPolygonMode.fireInvalidGeom = function (feature) {\n  this.map.fire('draw.invalidGeometry', {\n    action: 'error',\n    features: [feature]\n  });\n};\n\nvalidGeomDrawPolygonMode.fireOnClick = function () {\n  this.map.fire('draw.onClick', 'point drawn');\n};\n\nvalidGeomDrawPolygonMode.fireOnStop = function () {\n  this.map.fire('draw.onStop', 'draw end');\n};\n\nvalidGeomDrawPolygonMode.clickOnVertex = function (state) {\n  return this.changeMode(MapboxDraw.constants.modes.STATIC, {});\n};\n\nvalidGeomDrawPolygonMode.onTap = validGeomDrawPolygonMode.onClick = function (state, e) {\n  if (MapboxDraw.lib.CommonSelectors.isVertex(e)) {\n    return this.clickOnVertex(state, e);\n  } else {\n    this.fireOnClick();\n    return this.clickAnywhere(state, e);\n  }\n};\n\nvalidGeomDrawPolygonMode.onStop = function (state) {\n  this.fireOnStop();\n  this.updateUIClasses({ mouse: MapboxDraw.constants.cursors.NONE });\n  MapboxDraw.lib.doubleClickZoom.enable(this);\n  this.activateUIButton();\n\n  // check to see if we've deleted this feature\n  if (this.getFeature(state.polygon.id) === undefined) {\n    return;\n  }\n\n  // remove last added coordinate\n  state.polygon.removeCoordinate(`0.${state.currentVertexPosition}`);\n  if (state.polygon.isValid()) {\n\n    const featureCoords = [...state.polygon.coordinates[0]];\n    if (\n      featureCoords[0][0] !== featureCoords[featureCoords.length - 1][0] ||\n      featureCoords[0][1] !== featureCoords[featureCoords.length - 1][1]\n    ) {\n      featureCoords.push(featureCoords[0]);\n    }\n    const currentFeature = {\n      type: 'Feature',\n      geometry: {\n        type: 'Polygon',\n        coordinates: [featureCoords]\n      },\n      properties: {}\n    };\n\n    if (getIssues(JSON.stringify(currentFeature)).length === 0) {\n      this.map.fire(MapboxDraw.constants.events.CREATE, {\n        features: [state.polygon.toGeoJSON()]\n      });\n    } else {\n      this.fireInvalidGeom(state.polygon);\n      this.deleteFeature([state.polygon.id], { silent: true });\n    }\n  } else {\n    this.deleteFeature([state.polygon.id], { silent: true });\n    this.changeMode(MapboxDraw.constants.modes.STATIC, {}, { silent: true });\n  }\n};\n\nexport default validGeomDrawPolygonMode;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport circle from '@turf/circle';\n\n\nexport const circleMode = { ...MapboxDraw.modes.draw_polygon };\nconst DEFAULT_RADIUS_IN_KM = 2;\n\ncircleMode.onSetup = function (opts) {\n    const polygon = this.newFeature({\n        type: MapboxDraw.constants.geojsonTypes.FEATURE,\n        properties: {\n            isFixedRadius: opts.isFixedRadius !== undefined ? opts.isFixedRadius : false,\n            isCircle: true,\n            center: opts.center ?? []\n        },\n        geometry: {\n            type: MapboxDraw.constants.geojsonTypes.POLYGON,\n            coordinates: [[]]\n        }\n    });\n\n    this.addFeature(polygon);\n\n    this.clearSelectedFeatures();\n    MapboxDraw.lib.doubleClickZoom.disable(this);\n    this.updateUIClasses({ mouse: MapboxDraw.constants.cursors.ADD });\n    this.activateUIButton(MapboxDraw.constants.types.POLYGON);\n    this.setActionableState({\n        trash: true\n    });\n\n    return {\n        initialRadiusInKm: opts.initialRadiusInKm || DEFAULT_RADIUS_IN_KM,\n        steps: opts.steps || 64,\n        units: opts.units || 'kilometers',\n        polygon,\n        currentVertexPosition: 0\n    };\n};\n\n\ncircleMode.clickAnywhere = function (state, e) {\n    if (state.currentVertexPosition === 0) {\n        state.currentVertexPosition++;\n        const center = [e.lngLat.lng, e.lngLat.lat];\n        const options =  {steps: state.steps, units: state.units};\n        const circleFeature = circle(center, state.initialRadiusInKm, options);\n        state.polygon.incomingCoords(circleFeature.geometry.coordinates);\n        state.polygon.properties.center = center;\n        state.polygon.properties.radiusInKm = state.initialRadiusInKm;\n    }\n    return this.changeMode(MapboxDraw.constants.modes.SIMPLE_SELECT, { featureIds: [state.polygon.id] });\n};\n\nexport default circleMode;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nexport function createDrawVertex(parentId: string, coordinates: GeoJSON.Position, path: string, selected: boolean): MapboxDraw.DisplayedFeature {\n  return {\n    type: 'Feature',\n    properties: {\n      meta: 'vertex',\n      parent: parentId,\n      coord_path: path,\n      active: selected ? 'true' : 'false',\n    },\n    geometry: {\n      type: 'Point',\n      coordinates,\n    },\n  };\n}\nexport function displayFeatures(state: Record<string, any>,\n  geojson: MapboxDraw.DisplayedFeature, display: (geojson: MapboxDraw.DisplayedFeature) => void\n) {\n  geojson.properties ??= {};\n  const isActiveLine = geojson.properties.id === state.line.id;\n  geojson.properties.active = isActiveLine ? 'true' : 'false';\n  if (!isActiveLine) {\n    if (geojson.geometry.type === 'Point' || !geojson.geometry.coordinates[0][0]) {\n      return null;\n    }\n    return display(geojson);\n  }\n\n  // Only render the line if it has at least one real coordinate\n  if (geojson.geometry.coordinates.length < 2) {\n    return null;\n  }\n  geojson.properties.meta = 'feature';\n\n  // displays center vertex as a point feature\n  display(\n    createDrawVertex(\n      state.line.id,\n      geojson.geometry.coordinates[\n        state.direction === 'forward'\n          ? geojson.geometry.coordinates.length - 2\n          : 1\n      ] as GeoJSON.Position,\n      `${state.direction === 'forward'\n        ? geojson.geometry.coordinates.length - 2\n        : 1\n      }`,\n      false\n    )\n  );\n\n  // displays the line as it is drawn\n  display(geojson);\n\n}\n\nexport function updateCoordinates(state: Record<string, any>, e: MapboxDraw.MapMouseEvent) {\n  if (state.direction === 'forward') {\n    state.currentVertexPosition += 1;\n    state.line.updateCoordinate(\n      state.currentVertexPosition,\n      e.lngLat.lng,\n      e.lngLat.lat\n    );\n  } else {\n    state.line.addCoordinate(0, e.lngLat.lng, e.lngLat.lat);\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport circle from '@turf/circle';\nimport length from '@turf/length';\nimport numeral from 'numeral';\nimport { displayFeatures, updateCoordinates } from '../utils';\n\nexport const radiusCircleMode = { ...MapboxDraw.modes.draw_line_string };\n\nradiusCircleMode.fireOnStop = function () {\n    this.map.fire('draw.onStop', 'draw end');\n};\n\nfunction getDisplayMeasurements(feature: GeoJSON.Feature) {\n    // should log both metric and standard display strings for the current drawn feature\n\n    // metric calculation\n    const drawnLength = length(feature) * 1000; // meters\n\n    let metricUnits = 'm';\n    let metricFormat = '0,0';\n    let metricMeasurement;\n\n    let standardUnits = 'feet';\n    let standardFormat = '0,0';\n    let standardMeasurement;\n\n    metricMeasurement = drawnLength;\n    if (drawnLength >= 1000) {\n        // if over 1000 meters, upgrade metric\n        metricMeasurement = drawnLength / 1000;\n        metricUnits = 'km';\n        metricFormat = '0.00';\n    }\n\n    standardMeasurement = drawnLength * 3.28084;\n    if (standardMeasurement >= 5280) {\n        // if over 5280 feet, upgrade standard\n        standardMeasurement /= 5280;\n        standardUnits = 'mi';\n        standardFormat = '0.00';\n    }\n\n    const displayMeasurements = {\n        metric: `${numeral(metricMeasurement).format(metricFormat)} ${metricUnits}`,\n        standard: `${numeral(standardMeasurement).format(\n            standardFormat\n        )} ${standardUnits}`,\n    };\n\n    return displayMeasurements;\n}\n\nradiusCircleMode.onSetup = function (opts) {\n    const props = MapboxDraw.modes.draw_line_string.onSetup.call(this, opts);\n    MapboxDraw.lib.doubleClickZoom.disable(this);\n    const polygon = this.newFeature({\n        type: MapboxDraw.constants.geojsonTypes.FEATURE,\n        properties: {\n            meta: 'radius',\n            isFixedRadius: opts.isFixedRadius !== undefined ? opts.isFixedRadius : false,\n            isCircle: true,\n            center: opts.center !== undefined ? opts.center : []\n        },\n        geometry: {\n            type: MapboxDraw.constants.geojsonTypes.POLYGON,\n            coordinates: [[]],\n        },\n    });\n    this.addFeature(polygon);\n\n    return {\n        ...props,\n        circle:polygon,\n        steps: opts.steps || 64,\n        units: opts.units || 'kilometers'\n    };\n};\n\nradiusCircleMode.clickAnywhere = function (state, e) {\n    // this ends the drawing after the user creates a second point, triggering this.onStop\n    if (state.currentVertexPosition === 1) {\n        state.line.addCoordinate(0, e.lngLat.lng, e.lngLat.lat);\n        return this.changeMode('simple_select', { featureIds: [state.line.id] });\n    }\n    this.updateUIClasses({ mouse: MapboxDraw.constants.cursors.ADD });\n    state.line.updateCoordinate(\n        state.currentVertexPosition,\n        e.lngLat.lng,\n        e.lngLat.lat\n    );\n    updateCoordinates(state, e);\n    return null;\n};\n\nradiusCircleMode.onMouseMove = function (state, e) {\n    MapboxDraw.modes.draw_line_string.onMouseMove.call(this, state, e);\n    const geojson = state.line.toGeoJSON();\n    const center = geojson.geometry.coordinates[0];\n    const radiusInKm = length(geojson, { units: state.units });\n    const options =  {steps: state.steps, units: state.units};\n    const circleFeature = circle(center, radiusInKm, options);\n    circleFeature.properties ??= {};\n    circleFeature.properties.parent = state.line.id;\n    circleFeature.properties.meta = 'radius';\n    state.circle.setCoordinates(circleFeature.geometry.coordinates);\n    state.circle.setProperty('center', center);\n};\n\n// creates the final geojson point feature with a radius property\n// triggers draw.create\nradiusCircleMode.onStop = function (state) {\n    MapboxDraw.lib.doubleClickZoom.enable(this);\n\n    this.activateUIButton();\n\n    // check to see if we've deleted this feature\n    if (this.getFeature(state.line.id) === undefined) {\n        return;\n    }\n\n    // remove last added coordinate\n    state.line.removeCoordinate('0');\n    if (state.line.isValid()) {\n        this.deleteFeature([state.line.id], { silent: true });\n\n        this.map.fire('draw.create', {\n            features: [state.circle.toGeoJSON()],\n        });\n    } else {\n        this.deleteFeature([state.line.id], { silent: true });\n        this.changeMode('simple_select', {}, { silent: true });\n    }\n    this.fireOnStop();\n};\n\nradiusCircleMode.toDisplayFeatures = function (state, geojson, display) {\n    displayFeatures(state, geojson, display);\n\n    if (geojson.geometry.coordinates.length >= 2 && geojson.geometry.coordinates[1]) {\n        const displayMeasurements = getDisplayMeasurements(geojson);\n\n        // create custom feature for the current pointer position\n        const currentVertex: GeoJSON.Feature<GeoJSON.Point> = {\n            type: 'Feature',\n            properties: {\n                meta: 'currentPosition',\n                radiusMetric: displayMeasurements.metric,\n                radiusStandard: displayMeasurements.standard,\n                parent: state.line.id,\n            },\n            geometry: {\n                type: 'Point',\n                coordinates: geojson.geometry.coordinates[1] as GeoJSON.Position,\n            },\n        };\n        display(currentVertex);\n    }\n\n    return null;\n};\n\nexport default radiusCircleMode;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\n\nexport function createSupplementaryPointsForCircle(geojson: GeoJSON.Feature<GeoJSON.Polygon>) {\n    const { properties, geometry } = geojson;\n\n    if (!properties?.user_isCircle) {\n        return [];\n    }\n\n    const supplementaryPoints = [];\n    const vertices = geometry.coordinates[0].slice(0, -1);\n    for (let index = 0; index < vertices.length; index += Math.round((vertices.length / 4))) {\n        supplementaryPoints.push(MapboxDraw.lib.createVertex(properties.id, vertices[index], `0.${index}`, false));\n    }\n    return supplementaryPoints;\n}\n\nexport const dragPan = {\n    enable(ctx: any) {\n        setTimeout(() => {\n            // First check we've got a map and some context.\n            if (!ctx.map || !ctx.map.dragPan || !ctx._ctx || !ctx._ctx.store || !ctx._ctx.store.getInitialConfigValue) {\n                return;\n            }\n            // Now check initial state wasn't false (we leave it disabled if so)\n            if (!ctx._ctx.store.getInitialConfigValue('dragPan')) {\n                return;\n            }\n            ctx.map.dragPan.enable();\n        }, 0);\n    },\n\n    disable(ctx: any) {\n        setTimeout(() => {\n            if (!ctx.map || !ctx.map.doubleClickZoom) {\n                return;\n            }\n            // Always disable here, as it's necessary in some cases.\n            ctx.map.dragPan.disable();\n        }, 0);\n    }\n};\n\nexport function moveCircleFeatureCenter(features: GeoJSON.Feature[], delta: MapboxDraw.LngLat) {\n  features\n    .filter(feature => feature.properties?.isCircle)\n    .map(circle => circle.properties?.center)\n    .forEach((center: [number, number]) => {\n        center[0] += delta.lng;\n        center[1] += delta.lat;\n    });\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport circle from '@turf/circle';\nimport distance from '@turf/distance';\nimport { point } from '@turf/helpers';\nimport { createSupplementaryPointsForCircle, moveCircleFeatureCenter } from './circles/utils';\n\n\nexport const directModeOverride = MapboxDraw.modes.direct_select;\n\ndirectModeOverride.dragFeature = function (state, e, delta) {\n    MapboxDraw.lib.moveFeatures(this.getSelected(), delta);\n    moveCircleFeatureCenter(this.getSelected(), delta);\n    state.dragMoveLocation = e.lngLat;\n};\n\ndirectModeOverride.dragVertex = function (state, e, delta) {\n    if (state.feature.properties.isCircle && state.feature.properties.isFixedRadius) {\n        MapboxDraw.lib.moveFeatures(this.getSelected(), delta);\n        moveCircleFeatureCenter(this.getSelected(), delta);\n        state.dragMoveLocation = e.lngLat;\n    } else {\n        if (state.feature.properties.isCircle) {\n            const center = state.feature.properties.center;\n            const movedVertex = [e.lngLat.lng, e.lngLat.lat];\n            const radius = distance(point(center), point(movedVertex), { units: 'kilometers' });\n            const circleFeature = circle(center, radius);\n            state.feature.incomingCoords(circleFeature.geometry.coordinates);\n            state.feature.properties.radiusInKm = radius;\n        } else {\n            const selectedCoords = state.selectedCoordPaths.map((coord_path: string) => state.feature.getCoordinate(coord_path));\n            const selectedCoordPoints = selectedCoords.map((coords: GeoJSON.Position) => ({\n                type: MapboxDraw.constants.geojsonTypes.FEATURE,\n                properties: {},\n                geometry: {\n                    type: MapboxDraw.constants.geojsonTypes.POINT,\n                    coordinates: coords\n                }\n            }));\n\n            const constrainedDelta = MapboxDraw.lib.constrainFeatureMovement(selectedCoordPoints, delta);\n            for (let i = 0; i < selectedCoords.length; i++) {\n                const coord = selectedCoords[i];\n                state.feature.updateCoordinate(state.selectedCoordPaths[i], coord[0] + constrainedDelta.lng, coord[1] + constrainedDelta.lat);\n            }\n        }\n    }\n\n};\n\ndirectModeOverride.toDisplayFeatures = function (state, geojson: GeoJSON.Feature<GeoJSON.Polygon>, push) {\n    geojson.properties ??= {};\n    if (state.featureId === geojson.properties.id) {\n        geojson.properties.active = MapboxDraw.constants.activeStates.ACTIVE;\n        push(geojson);\n\n        let supplementaryPoints;\n        if (geojson.properties.user_isCircle) {\n            supplementaryPoints = createSupplementaryPointsForCircle(geojson);\n        } else {\n            supplementaryPoints = MapboxDraw.lib.createSupplementaryPoints(geojson, {\n                map: this.map,\n                midpoints: true,\n                selectedPaths: state.selectedCoordPaths\n            });\n        }\n        supplementaryPoints.forEach(push);\n    } else {\n        geojson.properties.active = MapboxDraw.constants.activeStates.INACTIVE;\n        push(geojson);\n    }\n    this.fireActionable(state);\n\n};\n\nexport default directModeOverride;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\n\n// Inspired by https://github.com/thegisdev/mapbox-gl-draw-rectangle-mode/tree/master\nexport const rectangleMode = { } as MapboxDraw.DrawCustomMode;\n\nrectangleMode.onSetup = function() {\n    const rectangle = this.newFeature({\n        type: MapboxDraw.constants.geojsonTypes.FEATURE,\n        properties: {\n            source: 'bbox'\n        },\n        geometry: {\n          type: MapboxDraw.constants.geojsonTypes.POLYGON,\n          coordinates: [[]]\n        }\n    });\n    this.addFeature(rectangle);\n\n    this.clearSelectedFeatures();\n    MapboxDraw.lib.doubleClickZoom.disable(this);\n    this.updateUIClasses({ mouse: MapboxDraw.constants.cursors.ADD });\n    this.activateUIButton(MapboxDraw.constants.types.POLYGON);\n    this.setActionableState({\n        trash: true\n    });\n\n    return {\n        rectangle,\n        currentVertexPosition: 0,\n        start: []\n    };\n};\n\nrectangleMode.onClick = function(state, e) {\n    if (state.currentVertexPosition === 1\n        && state.start[0] !== e.lngLat.lng\n        && state.start[1] !== e.lngLat.lat\n    ) {\n        this.updateUIClasses({ mouse: MapboxDraw.constants.cursors.NONE });\n        return this.changeMode('simple_select', { featuresId: state.rectangle.id });\n    }\n    state.start = [e.lngLat.lng, e.lngLat.lat];\n    state.currentVertexPosition++;\n};\n\nrectangleMode.onMouseMove = function(state, e) {\n    if (state.start?.length > 0) {\n        const start = state.start;\n\n        // The bbox needs to be oriented in a certain way to match the parsing in the contributors\n        const west = Math.min(start[0], e.lngLat.lng);\n        const north = Math.max(start[1], e.lngLat.lat);\n        const east = Math.max(start[0], e.lngLat.lng);\n        const south = Math.min(start[1], e.lngLat.lat);\n\n        state.rectangle.updateCoordinate('0.0', east, south);\n        state.rectangle.updateCoordinate('0.1', east, north);\n        state.rectangle.updateCoordinate('0.2', west, north);\n        state.rectangle.updateCoordinate('0.3', west, south);\n    }\n};\n\nrectangleMode.toDisplayFeatures = function(state, geojson, display) {\n    geojson.properties ??= {};\n    const isActivePolygon = geojson.properties.id === state.rectangle.id;\n    geojson.properties.active = isActivePolygon ? 'true' : 'false';\n    if (!isActivePolygon) {\n        return display(geojson);\n    }\n\n    // Only render the rectangular polygon if it has the starting point\n    if (state.start.length === 0) {\n        return;\n    }\n    return display(geojson);\n};\n\nrectangleMode.fireOnStop = function () {\n    this.map.fire('draw.onStop', 'draw end');\n};\n\nrectangleMode.onStop = function(state) {\n    MapboxDraw.lib.doubleClickZoom.enable(this);\n    this.activateUIButton();\n\n    // check to see if we've deleted this feature\n    if (this.getFeature(state.rectangle.id) === undefined) {\n        return;\n    }\n\n    // remove last added coordinate\n    state.rectangle.removeCoordinate('0.4');\n    if (state.rectangle.isValid()) {\n        this.map.fire('draw.create', {\n            features: [state.rectangle.toGeoJSON()],\n        });\n    } else {\n        this.deleteFeature([state.rectangle.id], { silent: true });\n        this.changeMode('simple_select', {featureIds: [state.rectangle.id]}, { silent: true });\n    }\n\n    this.fireOnStop();\n};\n\nrectangleMode.onTrash = function(state) {\n    this.deleteFeature([state.rectangle.id], { silent: true });\n    this.changeMode('simple_select');\n};\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport { createSupplementaryPointsForCircle, moveCircleFeatureCenter } from './circles/utils';\n\nexport const simpleSelectModeOverride = MapboxDraw.modes.simple_select;\n\nsimpleSelectModeOverride.dragMove = function (state, e) {\n    // Dragging when drag move is enabled\n    state.dragMoving = true;\n    e.originalEvent.stopPropagation();\n\n    const delta = {\n        lng: e.lngLat.lng - state.dragMoveLocation.lng,\n        lat: e.lngLat.lat - state.dragMoveLocation.lat\n    };\n\n    MapboxDraw.lib.moveFeatures(this.getSelected(), delta);\n\n    moveCircleFeatureCenter(this.getSelected(), delta);\n\n    state.dragMoveLocation = e.lngLat;\n};\n\nsimpleSelectModeOverride.toDisplayFeatures = function (state, geojson, display) {\n    geojson.properties ??= {};\n    geojson.properties.active = (this.isSelected(geojson.properties.id)) ?\n        MapboxDraw.constants.activeStates.ACTIVE : MapboxDraw.constants.activeStates.INACTIVE;\n    display(geojson);\n    this.fireActionable();\n    if (geojson.properties.active !== MapboxDraw.constants.activeStates.ACTIVE ||\n        geojson.geometry.type === MapboxDraw.constants.geojsonTypes.POINT) {\n        return;\n    }\n    const supplementaryPoints = geojson.properties.user_isCircle ?\n        createSupplementaryPointsForCircle(geojson as GeoJSON.Feature<GeoJSON.Polygon>) : MapboxDraw.lib.createSupplementaryPoints(geojson);\n    supplementaryPoints.forEach(display);\n};\n\n\nexport default simpleSelectModeOverride;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport distance from '@turf/distance';\nimport { bearingToAzimuth, point, polygon } from '@turf/helpers';\nimport length from '@turf/length';\nimport midpoint from '@turf/midpoint';\nimport rhumbBearing from '@turf/rhumb-bearing';\nimport rhumbDestination from '@turf/rhumb-destination';\nimport transformRotate from '@turf/transform-rotate';\nimport transformTranslate from '@turf/transform-translate';\nimport { displayFeatures, updateCoordinates } from '../utils';\n\nexport const stripMode = { ...MapboxDraw.modes.draw_line_string };\n\nexport function rotateStrip(start: GeoJSON.Position, end: GeoJSON.Position,\n    state: Record<string, any>, currentMaxBearing = 0, options: any = {}\n) {\n    const properties = options.properties ? options.properties : {};\n    const startPoint = point(start);\n    const endPoint = point(end);\n    const bearing = rhumbBearing(startPoint, endPoint);\n    const rotatedPoly = transformRotate(state.strip, bearing - currentMaxBearing, { pivot: start });\n    state.currentMaxBearing = bearing;\n    return polygon(rotatedPoly.coordinates, properties);\n}\n\nexport function buildStrip(start: GeoJSON.Position, end: GeoJSON.Position, halfSwath: number, options: any = {}) {\n    const properties = options.properties ? options.properties : {};\n    // main\n    const coordinates = [];\n    const startPoint = point(start);\n    const endPoint = point(end);\n    // build polygone\n    const bearing = rhumbBearing(startPoint, endPoint);\n    const corner1 = rhumbDestination(startPoint, halfSwath, bearing - 90);\n    const corner2 = rhumbDestination(startPoint, halfSwath, bearing + 90);\n    const corner3 = rhumbDestination(endPoint, halfSwath, bearing + 90);\n    const corner4 = rhumbDestination(endPoint, halfSwath, bearing - 90);\n    coordinates.push(corner1.geometry.coordinates);\n    coordinates.push(corner2.geometry.coordinates);\n    coordinates.push(corner3.geometry.coordinates);\n    coordinates.push(corner4.geometry.coordinates);\n    coordinates.push(coordinates[0]);\n    properties.start = start;\n    properties.end = end;\n    return polygon([coordinates], properties);\n}\n\nexport function computeStripProperties(coordinates: number[][]) {\n    const properties = new Map();\n\n    // Compute bearing\n    const bearingAngle = rhumbBearing(point(coordinates[0]), point(coordinates[3]));\n    properties.set('bearingAngle', bearingToAzimuth(bearingAngle));\n\n    // Compute origin\n    properties.set('origin', midpoint(point(coordinates[0]), point(coordinates[1])).geometry.coordinates);\n\n    // Compute length\n    properties.set('length', distance(point(coordinates[1]), point(coordinates[2]), { units: 'kilometers' }));\n\n    return properties;\n}\n\nconst doubleClickZoom = {\n    enable: (ctx: any) => {\n        setTimeout(() => {\n            // First check we've got a map and some context.\n            if (\n                !ctx.map?.doubleClickZoom ||\n                !ctx._ctx?.store?.getInitialConfigValue\n            ) {\n                return;\n            }\n            // Now check initial state wasn't false (we leave it disabled if so)\n            if (!ctx._ctx.store.getInitialConfigValue('doubleClickZoom')) {\n                return;\n            }\n            ctx.map.doubleClickZoom.enable();\n        }, 0);\n    },\n};\nstripMode.onSetup = function (opts) {\n    const halfSwath = opts.halfSwath;\n    const maxLength = opts.maxLength;\n\n    if (!halfSwath) {\n        throw new Error('You must provide a valid halfSwath to enter strip_direct mode');\n    }\n    if (!maxLength) {\n        throw new Error('You must provide a valid maxLength to enter strip_direct mode');\n    }\n    const props = MapboxDraw.modes.draw_line_string.onSetup.call(this, opts);\n    const polygon = this.newFeature({\n        type: MapboxDraw.constants.geojsonTypes.FEATURE,\n        properties: {\n            meta: 'strip',\n            isCircle: false,\n            isStrip: true,\n            halfSwath: opts.halfSwath,\n            maxLength: opts.maxLength,\n            bearingAngle: 0\n\n        },\n        geometry: {\n            type: MapboxDraw.constants.geojsonTypes.POLYGON,\n            coordinates: [[]],\n        },\n    });\n    this.addFeature(polygon);\n\n    return {\n        ...props,\n        strip: polygon,\n        halfSwath,\n        maxLength,\n        meta: 'strip'\n    };\n};\n\nstripMode.fireOnStop = function () {\n    this.map.fire('draw.onStop', 'draw end');\n};\n\nstripMode.clickAnywhere = function (state, e) {\n    // this ends the drawing after the user creates a second point, triggering this.onStop\n    if (state.currentVertexPosition === 1) {\n        state.line.addCoordinate(0, e.lngLat.lng, e.lngLat.lat);\n        return this.changeMode('simple_select', {\n            featureIds: [state.line.id]\n        });\n    }\n    this.updateUIClasses({ mouse: MapboxDraw.constants.cursors.ADD });\n    state.line.updateCoordinate(\n        state.currentVertexPosition,\n        e.lngLat.lng,\n        e.lngLat.lat\n    );\n    updateCoordinates(state, e);\n    return null;\n};\n\nstripMode.onMouseMove = function (state, e) {\n    if (state.currentVertexPosition === 1) {\n        MapboxDraw.modes.draw_line_string.onMouseMove.call(this, state, e);\n        const geojson = state.line.toGeoJSON();\n        const stripLength = length(geojson, { units: 'kilometers' });\n        const start = geojson.geometry.coordinates[0];\n        const end = [e.lngLat.lng, e.lngLat.lat];\n        const startPoint = point(start);\n        const endPoint = point(end);\n        const bearing = rhumbBearing(startPoint, endPoint);\n        if (stripLength > state.maxLength && state.isStripDrew === undefined) {\n            const translateDistance = -(stripLength - state.maxLength);\n            const translatedPoint = transformTranslate(endPoint, translateDistance, bearing);\n            const stripFeature = buildStrip(start, translatedPoint.geometry.coordinates, state.halfSwath);\n            stripFeature.properties.parent = state.line.id;\n            stripFeature.properties.meta = 'strip';\n            state.strip.setCoordinates(stripFeature.geometry.coordinates);\n            state.currentMaxBearing = bearing;\n            state.isStripDrew = true;\n            Object.assign(state.strip.properties, computeStripProperties(stripFeature.geometry.coordinates[0]));\n        } else if (stripLength <= state.maxLength || state.isStripDrew === undefined) {\n            const stripFeature = buildStrip(start, end, state.halfSwath);\n            stripFeature.properties.parent = state.line.id;\n            stripFeature.properties.meta = 'strip';\n            state.strip.setCoordinates(stripFeature.geometry.coordinates);\n            state.currentMaxBearing = bearing;\n            state.isStripDrew = true;\n            Object.assign(state.strip.properties, computeStripProperties(stripFeature.geometry.coordinates[0]));\n        } else if (state.isStripDrew && stripLength > state.maxLength) {\n            const stripFeature = rotateStrip(start, end, state, state.currentMaxBearing);\n            stripFeature.properties.parent = state.line.id;\n            stripFeature.properties.meta = 'strip';\n            state.strip.setCoordinates(stripFeature.geometry.coordinates);\n            Object.assign(state.strip.properties, computeStripProperties(stripFeature.geometry.coordinates[0]));\n        }\n    }\n};\n\n// creates the final geojson point feature with a radius property\n// triggers draw.create\nstripMode.onStop = function (state) {\n    doubleClickZoom.enable(this);\n\n    this.activateUIButton();\n\n    // check to see if we've deleted this feature\n    if (this.getFeature(state.line.id) === undefined) {\n        // if the strip polygone exist, remove it\n        if(this.getFeature(state.strip?.id)){\n            this.deleteFeature([state.strip?.id], { silent: true });\n        }\n        return;\n    }\n\n    // remove last added coordinate\n    state.line.removeCoordinate('0');\n    if (state.line.isValid()) {\n        this.deleteFeature([state.line.id], { silent: true });\n\n        this.map.fire('draw.create', {\n            features: [state.strip.toGeoJSON()],\n        });\n    } else {\n        this.deleteFeature([state.line.id, state.strip?.id], { silent: true });\n        this.changeMode('simple_select', {}, { silent: true });\n    }\n    this.fireOnStop();\n};\n\nstripMode.toDisplayFeatures = function (state, geojson: GeoJSON.Feature<GeoJSON.LineString>, display) {\n    displayFeatures(state, geojson, display);\n\n    if (geojson.geometry.coordinates.length >= 2 && geojson.geometry.coordinates[1]) {\n        // create custom feature for the current pointer position\n        const currentVertex: GeoJSON.Feature<GeoJSON.Point> = {\n            type: 'Feature',\n            properties: {\n                meta: 'currentPosition',\n                parent: state.line.id,\n            },\n            geometry: {\n                type: 'Point',\n                coordinates: geojson.geometry.coordinates[1],\n            },\n        };\n        display(currentVertex);\n    }\n\n    return null;\n};\n\nexport default stripMode;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport center from '@turf/center';\nimport distance from '@turf/distance';\nimport { point } from '@turf/helpers';\nimport midpoint from '@turf/midpoint';\nimport rhumbBearing from '@turf/rhumb-bearing';\nimport rhumbDestination from '@turf/rhumb-destination';\nimport transformRotate from '@turf/transform-rotate';\nimport { buildStrip, computeStripProperties } from './strip.mode';\n\nexport const stripDirectSelectMode = {} as MapboxDraw.DrawCustomMode;\n\nstripDirectSelectMode.onSetup = function (opts) {\n    const featureId = opts.featureId;\n    const halfSwath = opts.halfSwath;\n    const maxLength = opts.maxLength;\n    const feature = this.getFeature(featureId);\n\n    if (!featureId) {\n        throw new Error('You must provide a valid featureId to enter strip_direct mode');\n    }\n    if (!halfSwath) {\n        throw new Error('You must provide a valid halfSwath to enter strip_direct mode');\n    }\n    if (!maxLength) {\n        throw new Error('You must provide a valid maxLength to enter strip_direct mode');\n    }\n\n    if (feature.type !== MapboxDraw.constants.geojsonTypes.POLYGON) {\n        throw new TypeError('strip_direct mode can only handle polygons');\n    }\n    if (feature.coordinates === undefined\n        || feature.coordinates.length !== 1\n        || feature.coordinates[0].length <= 2) {\n        throw new TypeError('strip_direct mode can only handle polygons');\n    }\n\n    const state = {\n        featureId,\n        feature,\n        halfSwath,\n        maxLength,\n        resizePointRadius: opts.resizePointRadius !== undefined ? opts.resizePointRadius : 1,\n        rotationPointRadius: opts.rotationPointRadius !== undefined ? opts.rotationPointRadius : 1.0,\n        canSelectFeatures: opts.canSelectFeatures !== undefined ? opts.canSelectFeatures : true,\n        dragMoveLocation: opts.startPos || null,\n        dragMoving: false,\n        canDragMove: false,\n        selectedCoordPaths: opts.coordPath ? [opts.coordPath] : []\n    };\n\n    this.setSelectedCoordinates(this.pathsToCoordinates(featureId, state.selectedCoordPaths));\n    this.setSelected(featureId);\n    MapboxDraw.lib.doubleClickZoom.disable(this);\n    this.setActionableState({\n        combineFeatures: false,\n        uncombineFeatures: false,\n        trash: true\n    });\n    this.addFeature(feature);\n\n    return state;\n};\n\nstripDirectSelectMode.fireOnStop = function () {\n    this.map.fire('draw.onStop', 'draw end');\n};\n\nstripDirectSelectMode.toDisplayFeatures = function (state, geojson, push) {\n    geojson.properties ??= {};\n    if (state.featureId === geojson.properties.id) {\n        geojson.properties.active = MapboxDraw.constants.activeStates.ACTIVE;\n        push(geojson);\n        const suppPoints = MapboxDraw.lib.createSupplementaryPoints(geojson, {\n            map: this.map,\n            midpoints: false,\n            selectedPaths: state.selectedCoordPaths\n        });\n        const actionsPoints = this.createActionPoints(state, geojson, suppPoints);\n        actionsPoints.forEach(push);\n    } else {\n        geojson.properties.active = MapboxDraw.constants.activeStates.INACTIVE;\n        push(geojson);\n    }\n\n    this.setActionableState({\n        combineFeatures: false,\n        uncombineFeatures: false,\n        trash: true\n    });\n\n};\n\nstripDirectSelectMode.onStop = function () {\n    MapboxDraw.lib.doubleClickZoom.enable(this);\n    this.clearSelectedCoordinates();\n    this.fireOnStop();\n};\n\nstripDirectSelectMode.pathsToCoordinates = MapboxDraw.modes.direct_select.pathsToCoordinates;\n\nstripDirectSelectMode.createActionPointHelper = function (actionWidgets, featureId, v1, v2, rotCenter, radiusScale, type) {\n    const cR0 = midpoint(v1, v2).geometry.coordinates;\n    const heading = rhumbBearing(rotCenter, cR0);\n    const distance0 = distance(rotCenter, cR0);\n    const distance1 = radiusScale * distance0;\n    const cR1 = rhumbDestination(rotCenter, distance1, heading, {}).geometry.coordinates;\n\n    actionWidgets.push({\n        type: MapboxDraw.constants.geojsonTypes.FEATURE,\n        properties: {\n            meta: MapboxDraw.constants.meta.MIDPOINT,\n            actionType: type,\n            parent: featureId,\n            lng: cR1[0],\n            lat: cR1[1],\n            coord_path: v1.properties?.coord_path,\n            coord_path_coords: cR0,\n            heading: heading,\n        },\n        geometry: {\n            type: MapboxDraw.constants.geojsonTypes.POINT,\n            coordinates: cR1\n        }\n    }\n    );\n};\n\nstripDirectSelectMode.createActionPoints = function (state, geojson, suppPoints) {\n    const { type } = geojson.geometry;\n    const featureId = geojson.properties && geojson.properties.id;\n    const actionWidgets = new Array<GeoJSON.Feature>();\n    if (type !== MapboxDraw.constants.geojsonTypes.POLYGON) {\n        return;\n    }\n    const corners = suppPoints.slice(0);\n    corners[corners.length] = corners[0];\n    let v1: GeoJSON.Feature<GeoJSON.Point> | null = null;\n    const rotCenter = center(geojson);\n    corners.forEach((v2) => {\n        if (v1?.properties?.coord_path === '0.2') {\n            this.createActionPointHelper(actionWidgets, featureId, v1, v2, rotCenter, state.rotationPointRadius, 'resize');\n        }\n        if (v1?.properties?.coord_path === '0.0') {\n            this.createActionPointHelper(actionWidgets, featureId, v1, v2, rotCenter, state.rotationPointRadius, 'origin');\n        }\n        if (v1?.properties?.coord_path === '0.3') {\n            this.createActionPointHelper(actionWidgets, featureId, v1, v2, rotCenter, state.rotationPointRadius, 'rotation');\n        }\n        v1 = v2;\n    });\n    state.actionWidgets = actionWidgets;\n    return actionWidgets;\n};\n\nstripDirectSelectMode.startDragging = function (state, e) {\n    this.map.dragPan.disable();\n    state.canDragMove = true;\n    state.dragMoveLocation = e.lngLat;\n};\n\nstripDirectSelectMode.stopDragging = function (state) {\n    this.map.dragPan.enable();\n    state.dragMoving = false;\n    state.canDragMove = false;\n    state.dragMoveLocation = null;\n};\n\nconst isMidPoint = MapboxDraw.lib.CommonSelectors.isOfMetaType(MapboxDraw.constants.meta.MIDPOINT);\n\nstripDirectSelectMode.onTouchStart = stripDirectSelectMode.onMouseDown = function (state, e) {\n    if (isMidPoint(e)) {\n        return this.onActivatePoint(state, e);\n    }\n    if (MapboxDraw.lib.CommonSelectors.isActiveFeature(e)) {\n        return this.onFeature(state, e);\n    }\n};\n\nconst stripDirectMode = {\n    Resize: 1,\n    Rotate: 2\n};\n\nstripDirectSelectMode.onActivatePoint = function (state, e) {\n    this.computeAxes(state, state.feature.toGeoJSON());\n    this.startDragging(state, e);\n    const about = e.featureTarget.properties;\n    state.selectedCoordPaths = [about?.coord_path];\n    if (e.featureTarget.properties?.actionType === 'rotation') {\n        state.stripDirectMode = stripDirectMode.Rotate;\n    } else if (e.featureTarget.properties?.actionType === 'resize') {\n        state.stripDirectMode = stripDirectMode.Resize;\n    }\n};\n\nstripDirectSelectMode.onFeature = function (state, e) {\n    state.selectedCoordPaths = [];\n    this.startDragging(state, e);\n};\n\nstripDirectSelectMode.coordinateIndex = function (coordPaths) {\n    if (coordPaths.length >= 1) {\n        const parts = coordPaths[0].split('.');\n        return Number.parseInt(parts[parts.length - 1], 10);\n    } else {\n        return 0;\n    }\n};\n\nstripDirectSelectMode.computeAxes = function (state, polygon) {\n    const centroid = center(polygon);\n    const corners = polygon.geometry.coordinates[0].slice(0);\n    const n = corners.length - 1;\n    const rotateCenters = [];\n    const headings = [];\n    for (let i1 = 0; i1 < n; i1++) {\n        let i0 = i1 - 1;\n        if (i0 < 0) {\n            i0 += n;\n        }\n        const c0 = corners[i0];\n        const c1 = corners[i1];\n        const rotPoint = midpoint(point(c0), point(c1));\n        rotateCenters[i1] = centroid.geometry.coordinates;\n        headings[i1] = rhumbBearing(centroid, rotPoint);\n    }\n    state.rotation = {\n        feature0: polygon,  // initial feature state\n        centers: rotateCenters,\n        headings: headings, // rotation start heading for each point\n    };\n};\n\nstripDirectSelectMode.onDrag = function (state, e) {\n    if (state.canDragMove !== true) {\n        return;\n    }\n    state.dragMoving = true;\n    e.originalEvent.stopPropagation();\n\n    const delta = {\n        lng: e.lngLat.lng - state.dragMoveLocation.lng,\n        lat: e.lngLat.lat - state.dragMoveLocation.lat\n    };\n    if (state.selectedCoordPaths.length > 0 && state.stripDirectMode) {\n        switch (state.stripDirectMode) {\n            case stripDirectMode.Rotate:\n                this.dragRotatePoint(state, e, delta);\n                break;\n            case stripDirectMode.Resize:\n                this.dragResizePoint(state, e, delta);\n                break;\n        }\n    } else {\n        this.dragFeature(state, e, delta);\n    }\n\n\n    state.dragMoveLocation = e.lngLat;\n};\n\nstripDirectSelectMode.dragRotatePoint = function (state, e, delta) {\n    if (state.rotation === undefined || state.rotation == null) {\n        console.error('state.rotation required');\n        return;\n    }\n    const m1 = point([e.lngLat.lng, e.lngLat.lat]);\n    const n = state.rotation.centers.length;\n    const cIdx = (this.coordinateIndex(state.selectedCoordPaths) + 1) % n;\n    const cCenter = state.rotation.centers[cIdx];\n    const cp = point(cCenter);\n    const heading1 = rhumbBearing(cp, m1);\n    const heading0 = state.rotation.headings[cIdx];\n    const rotateAngle = heading1 - heading0; // in degrees\n    const rotatedFeature = transformRotate(state.rotation.feature0,\n        rotateAngle,\n        {\n            pivot: cp,\n            mutate: false,\n        });\n    state.start = undefined;\n    state.feature.incomingCoords(rotatedFeature.geometry.coordinates);\n    Object.assign(state.feature.properties, computeStripProperties(state.feature.coordinates[0]));\n    this.fireUpdate();\n};\n\n\nstripDirectSelectMode.dragResizePoint = function (state, e, delta) {\n    const end = [e.lngLat.lng, e.lngLat.lat];\n    let start;\n    if (!state.selectedResizePaths) {\n        state.selectedResizePaths = state.selectedCoordPaths[0];\n    }\n    if (!state.start || state.selectedResizePaths !== state.selectedCoordPaths[0]) {\n        if (state.selectedCoordPaths[0] === '0.0') {\n            start = state.actionWidgets.find((a: GeoJSON.Feature) => a.properties?.coord_path === '0.2').properties.coord_path_coords;\n        } else {\n            start = state.actionWidgets.find((a: GeoJSON.Feature) => a.properties?.coord_path === '0.0').properties.coord_path_coords;\n        }\n        state.start = start;\n    }\n    const dist = distance(point(state.start), point(end), { units: 'kilometers' });\n    const newPolygon = buildStrip(state.start, end, state.halfSwath);\n    if (dist <= state.maxLength) {\n        state.feature.setCoordinates(newPolygon.geometry.coordinates);\n        Object.assign(state.feature.properties, computeStripProperties(state.feature.coordinates[0]));\n        this.fireUpdate();\n    }\n};\n\nstripDirectSelectMode.dragFeature = function (state, e, delta) {\n    MapboxDraw.lib.moveFeatures(this.getSelected(), delta);\n    state.dragMoveLocation = e.lngLat;\n    state.start = undefined;\n    Object.assign(state.feature.properties, computeStripProperties(state.feature.coordinates[0]));\n    this.fireUpdate();\n};\n\nstripDirectSelectMode.fireUpdate = function () {\n    this.map.fire(MapboxDraw.constants.events.UPDATE, {\n        action: MapboxDraw.constants.updateActions.CHANGE_COORDINATES,\n        features: this.getSelected().map((f: any) => f.toGeoJSON())\n    });\n};\n\nstripDirectSelectMode.onMouseOut = function (state) {\n    // As soon as you mouse leaves the canvas, update the feature\n    if (state.dragMoving) {\n        this.fireUpdate();\n    }\n};\n\nstripDirectSelectMode.onTouchEnd = stripDirectSelectMode.onMouseUp = function (state) {\n    if (state.dragMoving) {\n        this.fireUpdate();\n    }\n    this.stopDragging(state);\n};\n\nstripDirectSelectMode.onClick = function (state, e) {\n    if (MapboxDraw.lib.CommonSelectors.noTarget(e)) {\n        if (state.canSelectFeatures) {\n            this.changeMode(MapboxDraw.constants.modes.SIMPLE_SELECT);\n        }\n        return;\n    }\n    if (MapboxDraw.lib.CommonSelectors.isActiveFeature(e)) {\n        state.selectedCoordPaths = [];\n        this.clearSelectedCoordinates();\n        state.feature.changed();\n        return;\n    }\n    if (MapboxDraw.lib.CommonSelectors.isInactiveFeature(e)) {\n        if (state.canSelectFeatures) {\n            this.changeMode(MapboxDraw.constants.modes.SIMPLE_SELECT, {\n                featureIds: [e.featureTarget.properties?.id]\n            });\n        }\n        return;\n    }\n    this.stopDragging(state);\n};\n\nstripDirectSelectMode.onTrash = function () {\n    this.deleteFeature(this.getSelectedIds());\n};\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nconst roundLineLayout = {\n  'line-cap': 'round',\n  'line-join': 'round'\n};\n\nconst staticModeVertex = ['all',\n  ['==', 'meta', 'vertex'],\n  ['==', '$type', 'Point'],\n  ['!=', 'mode', 'static']\n];\n\nconst deactivatedStaticModeFeature = ['all',\n  ['==', 'active', 'false'],\n  ['==', '$type', 'Point'],\n  ['==', 'meta', 'feature'],\n  ['!=', 'mode', 'static']\n];\nconst deactivatedStaticPolygon = ['all',\n  ['==', 'active', 'false'],\n  ['==', '$type', 'Polygon'],\n  ['!=', 'mode', 'static']\n];\n\nconst activatedMidPoint = ['all',\n  ['==', '$type', 'Point'],\n  ['==', 'active', 'true'],\n  ['!=', 'meta', 'midpoint']\n];\nconst staticLineMidPoint = ['all', ['==', 'meta', 'midpoint'],\n  ['==', 'actionType', 'rotation'],\n  ['==', '$type', 'LineString'],\n  ['!=', 'mode', 'static']\n];\n\nconst staticPolygon = ['all', ['==', 'mode', 'static'], ['==', '$type', 'Polygon']];\nconst activePolygon = ['all', ['==', 'active', 'true'], ['==', '$type', 'Polygon']];\nconst staticMidpoint = ['all',\n  ['==', 'meta', 'midpoint'],\n  ['==', 'actionType', 'resize'],\n  ['==', '$type', 'Point'],\n  ['!=', 'mode', 'static']\n];\n\nconst rotatePointFilter = ['all',\n  ['==', 'meta', 'midpoint'],\n  ['==', 'actionType', 'rotation'],\n  ['==', '$type', 'Point'],\n  ['!=', 'mode', 'static']\n];\n\n/** Summarized style of a draw component */\nexport interface DrawStyle {\n  color?: string;\n  opacity?: number;\n  dash?: number[];\n}\n\nexport interface DrawTheme {\n  /** Style for active drawings */\n  active?: DrawStyle;\n  /** Style for deactivated drawings */\n  inactive?: DrawStyle;\n}\n\nfunction buildLinePaint(color: string, dash: number[]) {\n  return {\n    'line-color': color,\n    'line-dasharray': dash,\n    'line-width': 2\n  };\n}\n\n/**\n * Builds the style for the Mapbox/Maplibre draw layers\n * @param theme Theme summarizing the drawing styles\n */\nexport function buildDrawStyle(theme: DrawTheme) {\n  const activeColor = theme?.active?.color ?? '#fbb03b';\n  const activeOpacity = theme?.active?.opacity ?? 0.1;\n  const activeDash = theme.active?.dash ?? [0.2, 2];\n\n  const activeLinePaint = buildLinePaint(activeColor, activeDash);\n\n  const inactiveColor = theme?.inactive?.color ?? '#3bb2d0';\n  const inactiveOpacity = theme?.inactive?.opacity ?? 0.1;\n  const inactiveDash = theme.inactive?.dash ?? [0.2, 2];\n\n  const inactiveLinePaint = buildLinePaint(inactiveColor, inactiveDash);\n\n  return [\n    {\n      'id': 'gl-draw-polygon-fill-inactive',\n      'type': 'fill',\n      'filter': deactivatedStaticPolygon,\n      'paint': {\n        'fill-color': inactiveColor,\n        'fill-outline-color': inactiveColor,\n        'fill-opacity': inactiveOpacity\n      }\n    },\n    {\n      'id': 'gl-draw-polygon-fill-active',\n      'type': 'fill',\n      'filter': activePolygon,\n      'paint': {\n        'fill-color': activeColor,\n        'fill-outline-color': activeColor,\n        'fill-opacity': activeOpacity\n      }\n    },\n    {\n      'id': 'gl-draw-polygon-midpoint',\n      'type': 'circle',\n      'filter': ['all',\n        ['==', '$type', 'Point'],\n        ['==', 'meta', 'midpoint']],\n      'paint': {\n        'circle-radius': 3,\n        'circle-color': activeColor\n      }\n    },\n    {\n      'id': 'gl-draw-polygon-stroke-inactive',\n      'type': 'line',\n      'filter': deactivatedStaticPolygon,\n      'layout': roundLineLayout,\n      'paint': inactiveLinePaint\n    },\n    {\n      'id': 'gl-draw-polygon-stroke-active',\n      'type': 'line',\n      'filter': activePolygon,\n      'layout': roundLineLayout,\n      'paint': activeLinePaint\n    },\n    {\n      'id': 'gl-draw-line-inactive',\n      'type': 'line',\n      'filter': ['all',\n        ['==', 'active', 'false'],\n        ['==', '$type', 'LineString'],\n        ['!=', 'mode', 'static']\n      ],\n      'layout': roundLineLayout,\n      'paint': inactiveLinePaint\n    },\n    {\n      'id': 'gl-draw-line-active',\n      'type': 'line',\n      'filter': ['all',\n        ['==', '$type', 'LineString'],\n        ['==', 'active', 'true']\n      ],\n      'layout': roundLineLayout,\n      'paint': activeLinePaint\n    },\n    {\n      'id': 'gl-draw-polygon-and-line-vertex-stroke-inactive',\n      'type': 'circle',\n      'filter': staticModeVertex,\n      'paint': {\n        'circle-radius': 5,\n        'circle-color': '#fff'\n      }\n    },\n    {\n      'id': 'gl-draw-polygon-and-line-vertex-inactive',\n      'type': 'circle',\n      'filter': staticModeVertex,\n      'paint': {\n        'circle-radius': 3,\n        'circle-color': activeColor\n      }\n    },\n    {\n      'id': 'gl-draw-point-point-stroke-inactive',\n      'type': 'circle',\n      'filter': deactivatedStaticModeFeature,\n      'paint': {\n        'circle-radius': 5,\n        'circle-opacity': 1,\n        'circle-color': '#fff'\n      }\n    },\n    {\n      'id': 'gl-draw-point-inactive',\n      'type': 'circle',\n      'filter': deactivatedStaticModeFeature,\n      'paint': {\n        'circle-radius': 3,\n        'circle-color': inactiveColor\n      }\n    },\n    {\n      'id': 'gl-draw-point-stroke-active',\n      'type': 'circle',\n      'filter': activatedMidPoint,\n      'paint': {\n        'circle-radius': 7,\n        'circle-color': '#fff'\n      }\n    },\n    {\n      'id': 'gl-draw-point-active',\n      'type': 'circle',\n      'filter': activatedMidPoint,\n      'paint': {\n        'circle-radius': 5,\n        'circle-color': activeColor\n      }\n    },\n    {\n      'id': 'gl-draw-polygon-fill-static',\n      'type': 'fill',\n      'filter': staticPolygon,\n      'paint': {\n        'fill-color': inactiveColor,\n        'fill-outline-color': inactiveColor,\n        'fill-opacity': inactiveOpacity\n      }\n    },\n    {\n      'id': 'gl-draw-polygon-stroke-static',\n      'type': 'line',\n      'filter': staticPolygon,\n      'layout': roundLineLayout,\n      'paint': inactiveLinePaint\n    },\n    {\n      'id': 'gl-draw-line-static',\n      'type': 'line',\n      'filter': ['all', ['==', 'mode', 'static'], ['==', '$type', 'LineString']],\n      'layout': roundLineLayout,\n      'paint': {\n        'line-color': '#404040',\n        'line-width': 2\n      }\n    },\n    {\n      'id': 'gl-draw-point-static',\n      'type': 'circle',\n      'filter': ['all', ['==', 'mode', 'static'], ['==', '$type', 'Point']],\n      'paint': {\n        'circle-radius': 5,\n        'circle-color': '#404040'\n      }\n    },\n    {\n      'id': 'gl-draw-line-rotate-point',\n      'type': 'line',\n      'filter': staticLineMidPoint,\n      'layout': roundLineLayout,\n      'paint': activeLinePaint\n    },\n    {\n      'id': 'gl-draw-polygon-rotate-point-stroke',\n      'type': 'circle',\n      'filter': rotatePointFilter,\n      'paint': {\n        'circle-radius': 4,\n        'circle-color': '#fff'\n      }\n    },\n    {\n      'id': 'gl-draw-polygon-rotate-point',\n      'type': 'circle',\n      'filter': rotatePointFilter,\n      'paint': {\n        'circle-radius': 2,\n        'circle-color': activeColor\n      }\n    },\n    {\n      'id': 'gl-draw-polygon-rotate-point-icon',\n      'type': 'symbol',\n      'filter': rotatePointFilter,\n      'layout': {\n        'icon-image': 'rotate',\n        'icon-allow-overlap': true,\n        'icon-ignore-placement': true,\n        'icon-rotation-alignment': 'map',\n        'icon-rotate': ['get', 'heading']\n      },\n      'paint': {\n        'icon-opacity': 1,\n        'icon-opacity-transition': {\n          'delay': 0,\n          'duration': 0\n        }\n      }\n    },\n    {\n      'id': 'gl-draw-line-resize-point',\n      'type': 'line',\n      'filter': staticLineMidPoint,\n      'layout': roundLineLayout,\n      'paint': activeLinePaint\n    },\n    {\n      'id': 'gl-draw-polygon-resize-point-stroke',\n      'type': 'circle',\n      'filter': staticMidpoint,\n      'paint': {\n        'circle-radius': 5,\n        'circle-color': '#fff'\n      }\n    },\n    {\n      'id': 'gl-draw-polygon-resize-point',\n      'type': 'circle',\n      'filter': staticMidpoint,\n      'paint': {\n        'circle-radius': 6,\n        'circle-color': activeColor\n      }\n    },\n    {\n      'id': 'gl-draw-polygon-resize-point-icon',\n      'type': 'symbol',\n      'filter': staticMidpoint,\n      'layout': {\n        'icon-image': 'resize',\n        'icon-allow-overlap': true,\n        'icon-ignore-placement': true,\n        'icon-rotation-alignment': 'map',\n        'icon-rotate': ['get', 'heading']\n      },\n      'paint': {\n        'icon-opacity': 1,\n        'icon-opacity-transition': {\n          'delay': 0,\n          'duration': 0\n        }\n      }\n    }\n  ];\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Injectable } from '@angular/core';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport area from '@turf/area';\nimport bbox from '@turf/bbox';\nimport { lineString } from '@turf/helpers';\nimport length from '@turf/length';\nimport { Feature, FeatureCollection, Polygon } from 'geojson';\nimport { Subject } from 'rxjs';\nimport { AbstractDraw } from './AbstractDraw';\nimport { AoiEdition, BboxDrawCommand, Corner } from './draw.models';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class MapboxAoiDrawService {\n  private mapDraw!: AbstractDraw;\n  private editionId?: string;\n  private registeringMode = false;\n  private ids: Set<string> = new Set();\n\n  private readonly editAoiSource = new Subject<AoiEdition>();\n  public editAoi$ = this.editAoiSource.asObservable();\n\n  private readonly drawBboxSource = new Subject<BboxDrawCommand>();\n  public drawBbox$ = this.drawBboxSource.asObservable();\n\n  /** Set to true when the user is drawing a bbox. */\n  public isDrawingBbox = false;\n  /** Set to true when the user is drawing a circle. */\n  public isDrawingCircle = false;\n  /** Set to true when the user is drawing a strip. */\n  public isDrawingStrip = false;\n  /** Set to true when the user is drawing a polygon. */\n  public isDrawingPolygon = false;\n  /** Set to true when the user is in simple draw mode. */\n  public isInSimpleDrawMode = false;\n  /** Set to true when the drawn geometry is selected. */\n  public isDrawSelected = false;\n  public isReady = false;\n\n  public isDrawing() {\n    return this.isDrawingBbox || this.isDrawingCircle || this.isDrawingPolygon || this.isDrawingStrip;\n  }\n\n  public drawBbox(fCorner: Corner, sCorner: Corner) {\n    const west = Math.min(fCorner.lng, sCorner.lng);\n    const east = Math.max(fCorner.lng, sCorner.lng);\n    const south = Math.min(fCorner.lat, sCorner.lat);\n    const north = Math.max(fCorner.lat, sCorner.lat);\n    this.drawBboxSource.next({\n      west,\n      east,\n      south,\n      north\n    });\n  }\n\n  public setDraw(mapboxDraw: AbstractDraw) {\n    this.mapDraw = mapboxDraw;\n    this.isReady = true;\n    this.onSelectionChange();\n    this.onRender();\n    this.onDelete();\n    this.onStop();\n  }\n\n  /**\n   * Add new features to the mapboxdraw object.\n   * @param fc Featurecollection to be added to mapboxdraw object.\n   * @param deleteOld if true, the mapboxdraw object is purged first, before adding the new given feature collection.\n   */\n  public addFeatures(fc: FeatureCollection<GeoJSON.Geometry>, deleteOld = false) {\n    if (deleteOld) {\n      this.mapDraw.deleteAll();\n    }\n    this.registeringMode = true;\n    this.mapDraw.add(fc);\n  }\n\n  /** Deletes all the features from Mapboxdraw object */\n  public deleteAll() {\n    this.registeringMode = true;\n    this.mapDraw.deleteAll();\n  }\n\n  /** Deletes all the features from Mapboxdraw object that have not been saved */\n  public deleteUnregisteredFeatures() {\n    this.mapDraw.delete(this.getUnregistredFeatures().map(f => f.id?.toString() as string));\n  }\n\n  /** Returns the area of the given feature */\n  public calculateArea(feature: Feature): number {\n    if (this.isArea(feature)) {\n      return area(feature);\n    }\n    return 0;\n  }\n\n  /** Returns the width x height of the given feature's envelope */\n  public calculateEnvelopeDimension(feature: Feature): [number, number] {\n    if (this.isLine(feature)) {\n      const [minX, minY, maxX, maxY] = bbox(feature);\n      const verticalLine = lineString([[minX, minY], [minX, maxY]]);\n      const horizontalLine = lineString([[minX, minY], [maxX, minY]]);\n      return [length(horizontalLine), length(verticalLine)];\n    }\n    return [0, 0];\n  }\n\n  /** on selection of a drawn polygon, we get its corresponding id. */\n  private onSelectionChange() {\n    this.mapDraw.on('draw.selectionchange', (e) => {\n      const features = e.features;\n      if (this.hasFeatures(features)) {\n        this.editionId = features[0].id;\n      } else {\n        this.endDimensionsEmission();\n      }\n    });\n  }\n\n  private hasFeatures(features: any[]) {\n    return !!features && features.length > 0;\n  }\n\n  /** Triggered on deletion of feature(s).\n   * - Removes the deleted feature(s) from this service's register.\n   * - Stops emitting Aoi dimension info.\n   * */\n  private onDelete() {\n    this.mapDraw.on('draw.delete', (e) => {\n      e.features.forEach((f: Feature) => this.unregister(f.id));\n      this.endDimensionsEmission();\n    });\n  }\n\n\n  private onStop() {\n    this.mapDraw.on('draw.onStop', (e) => {\n      if (this.editionId) {\n        this.register(this.editionId);\n      }\n      this.endDimensionsEmission();\n    });\n  }\n\n  /**\n   * This event is triggered :\n   * - after draw.update\n   * - after draw.delete\n   * - on adding/deleting features from mapboxdraw object.\n   */\n  private onRender() {\n    this.mapDraw.on('draw.render', (e) => {\n      if (this.mapDraw) {\n        this.registerAll();\n        const unregisteredFeatures = this.getUnregistredFeatures();\n        if (unregisteredFeatures && (unregisteredFeatures.length === 1 || unregisteredFeatures.length === 2)) {\n          const index = unregisteredFeatures.length - 1;\n          this.editionId = unregisteredFeatures[index].id + '';\n        }\n        if (this.editionId) {\n          const feature = this.getFeature(this.editionId, this.mapDraw);\n          if (feature) {\n            this.emitDimensions(feature);\n          }\n        }\n      }\n    });\n  }\n\n  public emitStartBBox() {\n    this.editAoiSource.next({\n      area: 0,\n      areaMessage: marker('Start draging to draw a bbox.'),\n      envelope: {\n        width: 0,\n        height: 0\n      },\n      show: true\n    });\n  }\n\n  /** Emits dimension info of the given feature.*/\n  public emitDimensions(feature: Feature) {\n    const a = this.calculateArea(feature);\n    const wh = this.calculateEnvelopeDimension(feature);\n    this.editAoiSource.next({\n      area: a,\n      areaMessage: a > 0 ? '' : marker('Draw at least 2 points.'),\n      envelope: {\n        width: wh[0],\n        height: wh[1]\n      },\n      show: true\n    });\n  }\n\n  /** Stops emitting Aoi dimension info */\n  public endDimensionsEmission() {\n    this.editionId = undefined;\n    this.editAoiSource.next({\n      area: 0,\n      envelope: {\n        width: 0,\n        height: 0\n      },\n      show: false\n    });\n  }\n\n  /** Mapbox lacks a method to get the identifier of a new feature that is being drawn and not yet created\n   * this method detects this feature on 'draw.render' event.\n  */\n  private getUnregistredFeatures(): Feature[] {\n    return this.mapDraw.getAllFeatures().filter(f => f.id && !this.ids.has(f.id.toString()));\n  }\n\n  /** registers the identifiers of each drawn polygon in this service. */\n  private registerAll() {\n    if (this.registeringMode) {\n      this.ids.clear();\n      const fc = this.mapDraw.getAll();\n      if (!!fc && !!fc.features) {\n        this.ids = new Set(fc.features.map(f => f.id?.toString() as string));\n      }\n      this.registeringMode = false;\n    }\n  }\n\n  /** Unregisters the given feature id in this service. */\n  private unregister(id?: string | number) {\n    if (id !== undefined) {\n      this.ids.delete(id.toString());\n    }\n  }\n\n  /** Registers the given feature id in this service. */\n  private register(id: string | number) {\n    this.ids.add(id.toString());\n  }\n\n  /** Gets the given feature from MapboxDraw object. */\n  private getFeature(featureId: string, mapDraw: AbstractDraw) {\n    return mapDraw.get(featureId);\n  }\n\n  /** Checks if the given feature has enough coordinates to represent an area (polygon) */\n  private isArea(feature: Feature) {\n    if (feature.geometry.type === 'GeometryCollection' || feature.geometry.type === 'Point') {\n      return false;\n    }\n\n    const isGeometryDefined = !!feature && !!feature.geometry;\n    const areCoordinatesDefined = isGeometryDefined && !!feature.geometry.coordinates;\n    if (areCoordinatesDefined) {\n      const coordinates = feature.geometry.coordinates;\n      const isArea = coordinates.length === 1 && coordinates[0].length > 3;\n      return isArea;\n    }\n    return false;\n  }\n\n  /** Checks if the given feature has enough coordinates to represent a line */\n  private isLine(feature: Feature) {\n    if (feature.geometry.type === 'GeometryCollection' || feature.geometry.type === 'Point') {\n      return false;\n    }\n\n    const isGeometryDefined = !!feature && !!feature.geometry;\n    const areCoordinatesDefined = isGeometryDefined && !!feature.geometry.coordinates;\n    if (areCoordinatesDefined) {\n      const coordinates = feature.geometry.coordinates;\n      const isLine = coordinates.length === 1 && coordinates[0].length > 1;\n      return isLine;\n    }\n    return false;\n  }\n\n  /**\n   * Chck if its a valid circle\n   * @param feature\n   */\n  public isValidCircle(feature: Feature): boolean {\n    if (feature.geometry.type !== 'Polygon') {\n      return false;\n    }\n\n    const coordinates = feature.geometry.coordinates;\n    return this.isCircle(feature) && coordinates?.[0]?.[0] !== null && coordinates?.[0]?.[0] !== undefined && feature.properties?.center;\n  }\n\n  public isValidPolygon(feature: Feature): boolean {\n    if (feature.geometry.type !== 'Polygon') {\n      return false;\n    }\n\n    const coordinates = feature.geometry.coordinates;\n    return this.isPolygon(feature) && coordinates?.[0]?.[0] !== null && coordinates?.[0]?.[0] !== undefined;\n  }\n\n  public isPolygon(feature: Feature): feature is Feature<Polygon> {\n    return feature.geometry.type === 'Polygon' && !this.isCircle(feature);\n  }\n\n  public isCircle(feature: Feature): boolean {\n    return feature.properties?.isCircle;\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { signal } from '@angular/core';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport bbox from '@turf/bbox';\nimport { fromEvent, map, Observable, Subscription } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { ControlPosition, ControlsOption, DrawControlsOption } from './model/controls';\nimport { MapExtent } from './model/extent';\nimport { ArlasLngLat, ArlasLngLatBounds, OnMoveResult } from './model/map';\n\n\n/** Conf */\nexport interface MapConfig<T> {\n  displayCurrentCoordinates: boolean;\n  fitBoundsPadding: number;\n  margePanForLoad: number;\n  margePanForTest: number;\n  wrapLatLng: boolean;\n  offset: ArlasMapOffset;\n  mapProviderOptions: T;\n  maxWidthScale?: number;\n  unitScale?: string;\n  controls?: ControlsOption;\n}\n\nexport interface ArlasMapOption {\n  container: string;\n  style: any;\n  center: [number, number];\n  zoom: number;\n  maxZoom: number;\n  minZoom: number;\n  renderWorldCopies: boolean;\n  preserveDrawingBuffer: boolean;\n  locale: {\n    'NavigationControl.ZoomIn'?: string;\n    'NavigationControl.ZoomOut'?: string;\n    'NavigationControl.ResetBearing'?: string;\n    'GlobeControl.Enable'?: string;\n    'GlobeControl.Disable'?: string;\n  };\n  pitchWithRotate: boolean;\n  transformRequest: unknown;\n  attributionControl: boolean;\n  maxPitch: number;\n}\n\nexport interface ArlasMapOffset {\n  north: number;\n  east: number;\n  south: number;\n  west: number;\n}\n\nexport const GEOJSON_SOURCE_TYPE = 'geojson';\n\nexport const CROSS_LAYER_PREFIX = 'arlas_cross';\nexport const ZOOM_IN = marker('Zoom in');\nexport const ZOOM_OUT = marker('Zoom out');\nexport const RESET_BEARING = marker('Reset bearing to north');\nexport const LAYER_SWITCHER_TOOLTIP = marker('Manage layers');\nexport const OPACITY_SUFFIX = '-opacity';\nexport const ENABLE_GLOBE = marker('Enable globe');\nexport const DISABLE_GLOBE = marker('Disable globe');\n\nexport const HILLSHADE_SOURCE = 'arlas-hillshade';\nexport const TERRAIN_SOURCE = 'arlas-terrain';\n\n/**\n * The aim of this class is to handle all core interaction we have\n * with a map provider.\n * The aim is also to separate the Arlas map from the Angular framework.\n * It will be instantiated in the map.component and will be responsible for initializing the map and all map behavior.\n */\nexport abstract class AbstractArlasMapGL {\n  /**\n   *  props and methods with unknown type will be specific to the map provider\n   *  we use.\n   *  ex: endLngLat will have a type Maplibre.Pointlike/ Mapbox.Point\n   */\n\n  public abstract startLngLat?: ArlasLngLat;\n  public abstract endLngLat?: ArlasLngLat;\n  public abstract moveLngLat?: ArlasLngLat;\n  protected _offset: ArlasMapOffset;\n  protected _margePanForLoad: number;\n  protected _margePanForTest: number;\n  protected _fitBoundsPadding: number;\n  protected _displayCurrentCoordinates: boolean;\n  protected _wrapLatLng: boolean;\n  protected _controls: ControlsOption;\n  protected _maxWidthScale?: number;\n  protected _unitScale?: string;\n  public currentLat = signal('0');\n  public currentLng = signal('0');\n  public readonly POLYGON_LABEL_SOURCE = 'polygon_label';\n\n  protected _north = 0;\n  protected _east = 0;\n  protected _west = 0;\n  protected _south = 0;\n\n  public zoom = 0;\n  protected _zoomStart = 0;\n\n  protected _dragStartX = 0;\n  protected _dragStartY = 0;\n\n  protected _dragEndX = 0;\n  protected _dragEndY = 0;\n\n  protected _xMoveRatio = 0;\n  protected _yMoveRatio = 0;\n\n  protected _moveEnd$ = new Observable<any>();\n  protected _zoomStart$ = new Observable<any>();\n  protected _dragStart$ = new Observable<any>();\n  protected _dragEnd$ = new Observable<any>();\n\n  protected _eventSubscription: Subscription[] = [];\n\n  protected evented = new EventTarget();\n\n  protected constructor(protected config: MapConfig<any>) {\n    this.config = config;\n    this._offset = config.offset;\n    this._margePanForLoad = config.margePanForLoad;\n    this._margePanForTest = config.margePanForTest;\n    this._displayCurrentCoordinates = config.displayCurrentCoordinates ?? false;\n    this._wrapLatLng = config.wrapLatLng ?? true;\n    this._controls = config.controls ?? {};\n    this._fitBoundsPadding = config.fitBoundsPadding ?? 10;\n    this._maxWidthScale = config.maxWidthScale;\n    this._unitScale = config.unitScale;\n    this.init(config);\n  }\n\n  protected init(config: MapConfig<any>): void {\n    try {\n      this._initMapProvider(config);\n      this._initControls();\n      this._initOnLoad();\n      this._initMapMoveEvents();\n    } catch (e) {\n      console.error(e);\n    }\n  }\n\n  protected _initOnLoad() {\n    this.onLoad(() => {\n      this.evented.dispatchEvent(new Event('beforeOnLoadInit'));\n      this._updateBounds();\n      this._updateZoom();\n      this.getMapProvider().fitBounds(this.getBounds());\n    });\n  }\n\n  public onCustomEvent(event: string, loadFn: () => void) {\n    this.evented.addEventListener(event, loadFn);\n  }\n\n  protected _initMapMoveEvents() {\n    this._zoomStart$ = fromEvent(this.getMapProvider(), 'zoomstart')\n      .pipe(debounceTime(750));\n\n    this._dragStart$ = fromEvent(this.getMapProvider(), 'dragstart')\n      .pipe(debounceTime(750));\n\n    this._dragEnd$ = fromEvent(this.getMapProvider(), 'dragend')\n      .pipe(debounceTime(750));\n\n    this._moveEnd$ = fromEvent(this.getMapProvider(), 'moveend')\n      .pipe(debounceTime(750));\n\n    this._updateOnZoomStart();\n    this._updateOnDragStart();\n    this._updateOnDragEnd();\n    this._updateOnMoveEnd();\n  }\n\n  protected _updateBounds(): void {\n    this._west = this.getWestBounds();\n    this._south = this.getSouthBounds();\n    this._east = this.getEastBounds();\n    this._north = this.getNorthBounds();\n  }\n\n  protected _updateZoom(e?: any): void {\n    this.zoom = this.getZoom();\n  }\n\n  protected _updateCurrentLngLat(e: any): void {\n    const lngLat = e.lngLat;\n    if (this._displayCurrentCoordinates) {\n      const displayedLngLat = this._wrapLatLng ? lngLat.wrap() : lngLat;\n      this.currentLng.set(String(Math.round(displayedLngLat.lng * 100000) / 100000));\n      this.currentLat.set(String(Math.round(displayedLngLat.lat * 100000) / 100000));\n    }\n  }\n\n  protected _updateDragEnd(e: any): void {\n    if (e.originalEvent) {\n      this._dragEndX = e.originalEvent.clientX;\n      this._dragEndY = e.originalEvent.clientY;\n    }\n  }\n\n  protected _updateDragStart(e: any): void {\n    this._dragStartX = e.originalEvent.clientX;\n    this._dragStartY = e.originalEvent.clientY;\n  }\n\n  protected _updateEndLngLat(e: any): void {\n    this.endLngLat = e.lngLat;\n  }\n\n  protected _updateMoveRatio(e: any): void {\n    this._xMoveRatio = Math.abs(this._dragEndX - this._dragStartX) / e.target._canvas.clientWidth;\n    this._yMoveRatio = Math.abs(this._dragEndY - this._dragStartY) / e.target._canvas.clientHeight;\n  }\n\n  protected _updateStartLngLat(e: any): void {\n    this.startLngLat = e.lngLat;\n  }\n\n\n  protected _updateZoomStart(): void {\n    this._zoomStart = this.getZoom();\n  }\n\n  protected _updateOnZoomStart() {\n    const sub = this._zoomStart$.subscribe(_ => this._updateZoomStart());\n    this._eventSubscription.push(sub);\n  }\n\n  protected _updateOnDragStart() {\n    const sub = this._dragStart$.subscribe(e => this._updateDragStart(e));\n    this._eventSubscription.push(sub);\n  }\n\n  protected _updateOnDragEnd() {\n    const sub = this._dragEnd$\n      .subscribe(e => {\n        this._updateDragEnd(e);\n        this._updateMoveRatio(e);\n      });\n    this._eventSubscription.push(sub);\n  }\n\n  protected _updateOnMoveEnd() {\n    const sub = this._moveEnd$\n      .subscribe(_ => {\n        this._updateBounds();\n        this._updateZoom();\n      });\n    this._eventSubscription.push(sub);\n  }\n\n  public onMoveEnd(visualisationsSets: {\n    visualisations: Map<string, Set<string>>;\n    status: Map<string, boolean>;\n  }, cb?: () => void) {\n    return this._moveEnd$\n      .pipe(map(_ => {\n        this._updateBounds();\n        this._updateZoom();\n        if (cb) {\n          cb();\n        }\n        return this._getMoveEnd(visualisationsSets);\n      }));\n  }\n\n  public setLayoutProperty(layer: string, name: string, value: any, options?: any) {\n    this.getMapProvider().setLayoutProperty(layer, name, value, options);\n    return this;\n  }\n\n  public unsubscribeEvents() {\n    this._eventSubscription.forEach(s => s.unsubscribe());\n  }\n\n  public getMaxZoom(): number {\n    return this.getMapProvider().getMaxZoom();\n  }\n\n  public getMinZoom(): number {\n    return this.getMapProvider().getMinZoom();\n  }\n\n  public getPitch(): number {\n    return this.getMapProvider().getPitch();\n  }\n\n  protected abstract _initMapProvider(mapGLConfig: MapConfig<any>): void;\n  protected abstract _initControls(): void;\n  protected abstract _getMoveEnd(visualisationsSets: {\n    visualisations: Map<string, Set<string>>;\n    status: Map<string, boolean>;\n  }): OnMoveResult;\n\n  public abstract addControl(control: any, position?: ControlPosition, eventOverride?: {\n    event: string; fn: (e?: Event) => void;\n  }): void;\n  public abstract calcOffsetPoint(): any;\n  public abstract disableDragPan(): void;\n  public abstract enableDragPan(): void;\n  public abstract fitBounds(bounds: ArlasLngLatBounds | number[], options?: unknown, unknown?: unknown): this;\n  public abstract fitToPaddedBounds(bounds: ArlasLngLatBounds | number[]): void;\n  public abstract getBounds(): unknown;\n  public abstract getCanvasContainer(): HTMLElement;\n  public abstract getEastBounds(): number;\n  public abstract getMapExtend(): MapExtent;\n  public abstract getMapProvider(): any;\n  public abstract getMaxBounds(): unknown;\n  public abstract getNorthBounds(): number;\n  public abstract getNorthEastBounds(): ArlasLngLat;\n  public abstract getSouthBounds(): number;\n  public abstract getSouthWestBounds(): ArlasLngLat;\n  public abstract getWestBounds(): number;\n  public abstract getZoom(): number;\n  public abstract initDrawControls(config: DrawControlsOption): void;\n  public abstract on(type: string, listener: (ev: any) => void): this;\n  public abstract onLoad(fn: () => void): void;\n  public abstract onIdle(fn: () => void): void;\n  public abstract queryRenderedFeatures(pointOrBox?: unknown, options?: { layers?: string[]; filter?: any[]; }): any[];\n  public abstract resize(eventData?: unknown): this;\n  public abstract setCenter(center: unknown, unknown?: unknown): this;\n  public abstract setMaxBounds(unknown?: unknown): this;\n  public abstract setFilter(layer: string, filter?: boolean | any[], options?: unknown): this;\n  public abstract paddedBounds(npad: number, spad: number, epad: number,\n    wpad: number, map: any, SW: ArlasLngLat, NE: ArlasLngLat): ArlasLngLat[];\n  public abstract setLayerOpacity(layerId: string, layerType: string, opacityValue: any): this;\n  /**\n   * Returns the corresponding keyword for paint style based on the layer type\n   * @param layerType Type of the layer\n   */\n  public abstract layerTypeToPaintKeyword(layerType: string): string;\n  /**\n   * Gets all the layers on the map ordered from the one the more in the background to the top-most\n   */\n  public abstract getLayersOrder(): string[];\n\n  /** Gets bounds of the given geometry */\n  public geometryToBounds(geometry: any, paddingPercentage?: number): ArlasLngLatBounds {\n    const boundingBox = bbox(geometry);\n    let west = boundingBox[0];\n    let south = boundingBox[1];\n    let east = boundingBox[2];\n    let north = boundingBox[3];\n    if (paddingPercentage !== undefined) {\n      let width = east - west;\n      let height = north - south;\n      /** if there is one hit, then west=east ===> we consider a width of 0.05°*/\n      if (width === 0) {\n        width = 0.05;\n      }\n      /** if there is one hit, then north=south ===> we consider a height of 0.05°*/\n      if (height === 0) {\n        height = 0.05;\n      }\n      west = west - paddingPercentage * width;\n      south = Math.max(-90, south - paddingPercentage * height);\n      east = east + paddingPercentage * width;\n      north = Math.min(90, north + paddingPercentage * height);\n    }\n    const bounds = new ArlasLngLatBounds(\n      new ArlasLngLat(west, south),\n      new ArlasLngLat(east, north)\n    );\n    return bounds;\n  }\n\n}\n\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { inject, Injectable } from '@angular/core';\nimport { ElementIdentifier } from 'arlas-web-components';\nimport { FeatureCollection } from 'geojson';\nimport { ArlasMapFrameworkService } from './arlas-map-framework.service';\nimport { AbstractArlasMapGL, CROSS_LAYER_PREFIX } from './map/AbstractArlasMapGL';\nimport { ArlasDataLayer, ExternalEvent, MapLayers } from './map/model/layers';\nimport { ArlasMapSource } from './map/model/sources';\nimport { VisualisationSetConfig } from './map/model/visualisationsets';\n\nexport const QUICKLOOK_ON_MAP_LAYER_PREFIX = 'arlas-quicklook-source';\n\nexport const ARLAS_RASTER_SOURCE_PREFIX = 'arlas-raster-source-';\n\n/**\n * This service propose a set of method to execute the ArlasMapComponent logic.\n * Do not confuse with ArlasMapFrameworkService that is more dedicated to a framework logic.\n */\n@Injectable({\n  providedIn: 'root'\n})\n/** L: a layer class/interface.\n *  S: a source class/interface.\n *  M: a Map configuration class/interface.\n */\nexport abstract class AbstractArlasMapService<L, S, M> {\n  /** @description List of arlas data sources declared in configuration */\n  public dataSources: S[] = [];\n  /** @description Map of ARLAS data layers and their ids (the ids being the key of the map).  */\n  public layersMap: Map<string, ArlasDataLayer> = new Map();\n  /**\n   * @description Object to describe visualisation sets\n   * - visulisations: a map of <visualisation name, set of layers identifiers>;\n   * - status: a map of <visualisation name, visibility status>\n   */\n  public visualisationsSets: {\n    visualisations: Map<string, Set<string>>;\n    status: Map<string, boolean>;\n  } = {\n      visualisations: new Map(),\n      status: new Map()\n    };\n\n  protected readonly mapFrameworkService = inject(ArlasMapFrameworkService<L, S, M>);\n\n  /**\n   * @description Declares the arlas data sources provided in configuration.\n   * @param dataSourcesIds Identifiers of arlas data sources.\n   * @param data A feature collection.\n   * @param map Map instance.\n   */\n  public abstract declareArlasDataSources(dataSourcesIds: Set<string>, data: FeatureCollection<GeoJSON.Geometry>, map: AbstractArlasMapGL): void;\n\n  public abstract declareLabelSources(labelSourceId: string, data: FeatureCollection<GeoJSON.Geometry>, map: AbstractArlasMapGL): void;\n\n  public abstract declareBasemapSources(basemapSources: Array<ArlasMapSource<any>>, map: AbstractArlasMapGL): void;\n\n  public abstract setLayersMap(mapLayers: MapLayers<ArlasDataLayer>, layers?: Array<ArlasDataLayer>): void;\n\n  public updateLabelSources(labelSourceId: string, data: FeatureCollection<GeoJSON.Geometry>, map: AbstractArlasMapGL) {\n    if (labelSourceId) {\n      const source = this.mapFrameworkService.getSource(labelSourceId, map);\n      this.mapFrameworkService.setDataToGeojsonSource(source, data);\n    }\n  }\n\n  /**\n   * @description Inits a map of visulisation sets from the configuration.\n   * @param visualisationSetsConfig Visualisation set configuration.\n   */\n  public initVisualisationSet(visualisationSetsConfig: VisualisationSetConfig[]) {\n    if (visualisationSetsConfig) {\n      visualisationSetsConfig.forEach(visu => {\n        this.visualisationsSets.visualisations.set(visu.name, new Set(visu.layers));\n        this.visualisationsSets.status.set(visu.name, !!visu.enabled);\n      });\n    }\n  }\n\n  public initMapLayers(mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL) {\n    if (mapLayers) {\n      this.setLayersMap(mapLayers);\n    }\n  }\n\n  public abstract moveArlasDataLayer(map: AbstractArlasMapGL, layer: any, layersMap: Map<string, ArlasDataLayer>, beforeId?: string): void;\n\n  /**\n   * Add a layer to the map instance. This method handles any specific treatment when adding ARLAS data.\n   * For instance, in mapbox and maplibre implementation, adding a fill layer needs to add systematically the stroke layer.\n   * @param map Map instance.\n   * @param layer A layer. It could be a layer identifier OR a layer object (it will depend on the framwork implementation).\n   * @param layersMap Map of ARLAS data layers and their ids (the ids being the key of the map).\n   * @param beforeId Identifier of an already added layer. The layers of layersMap are added under this 'beforeId' layer.\n   */\n  public abstract addArlasDataLayer(map: AbstractArlasMapGL, layer: ArlasDataLayer | string,\n    layersMap: Map<string, ArlasDataLayer>, beforeId?: string): void;\n\n  public addArlasDataLayers(visualisationSetsConfig: VisualisationSetConfig[], mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL) {\n    this.initMapLayers(mapLayers, map);\n    this.initVisualisationSet(visualisationSetsConfig);\n    for (let i = visualisationSetsConfig.length - 1; i >= 0; i--) {\n      const visualisation: VisualisationSetConfig = visualisationSetsConfig[i];\n      if (visualisation.layers) {\n        for (let j = visualisation.layers.length - 1; j >= 0; j--) {\n          const l = visualisation.layers[j];\n          const layer = this.layersMap.get(l);\n          if (layer) {\n            this.addArlasDataLayer(map, layer, this.layersMap);\n          }\n        }\n      }\n    }\n    this._addExternalEventLayers(mapLayers, map);\n    this.visualisationsSets.status.forEach((visible, vs) => {\n      this.visualisationsSets.visualisations.get(vs)?.forEach(l => {\n        this.mapFrameworkService.setLayerVisibility(l, visible, map);\n      });\n    });\n    this.reorderLayers(visualisationSetsConfig, map);\n  }\n\n  private _addExternalEventLayers(mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL) {\n    if (mapLayers.externalEventLayers) {\n      mapLayers.layers\n        .filter(layer => mapLayers.externalEventLayers?.map(e => e.id).includes(layer.id))\n        .forEach(l => {\n          this.mapFrameworkService.addLayer(map, l as L);\n        });\n    }\n  }\n\n\n  public reorderLayers(visualisationSetsConfig: VisualisationSetConfig[], map: AbstractArlasMapGL) {\n    // parses the visulisation list from bottom in order to put the fist ones first\n    for (let i = visualisationSetsConfig.length - 1; i >= 0; i--) {\n      const visualisation: VisualisationSetConfig = visualisationSetsConfig[i];\n      if (!!visualisation.layers && visualisation.enabled) {\n        for (let j = visualisation.layers.length - 1; j >= 0; j--) {\n          const l = visualisation.layers[j];\n          this.moveArlasDataLayer(map, l, this.layersMap);\n        }\n      }\n    }\n    this.reorderInactiveDrawLayers(map);\n    this.reorderImageLayers(map);\n    this.reorderActiveDrawLayers(map);\n\n  }\n\n  /** Moves the active draw layers to the top of the map */\n  protected abstract reorderActiveDrawLayers(map: AbstractArlasMapGL): void;\n\n  /** Moves the inactive draw layers to the top of the map */\n  protected abstract reorderInactiveDrawLayers(map: AbstractArlasMapGL): void;\n\n  /**\n   * Reorders the image layers (COG, quicklook, cross) on the map to respect the following order (top to bottom):\n   * - Cross over COGs to close them\n   * - COGs\n   * - Quicklooks\n   * @param map Map instance\n   */\n  public reorderImageLayers(map: AbstractArlasMapGL): void {\n    // Layers are added from bottom to top\n    const quicklookLayers = this.mapFrameworkService.getLayerIdsFromPattern(map, QUICKLOOK_ON_MAP_LAYER_PREFIX);\n    quicklookLayers.forEach(l => this.mapFrameworkService.moveLayer(map, l));\n\n    const cogLayers = this.mapFrameworkService.getLayerIdsFromPattern(map, ARLAS_RASTER_SOURCE_PREFIX);\n    cogLayers.forEach(l => this.mapFrameworkService.moveLayer(map, l));\n\n    const crossLayers = this.mapFrameworkService.getLayerIdsFromPattern(map, CROSS_LAYER_PREFIX);\n    crossLayers.forEach(l => this.mapFrameworkService.moveLayer(map, l));\n  }\n\n\n  public abstract filterLayers(mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL,\n    visibilityCondition: boolean, visibilityFilter: Array<any>, visibilityEvent: ExternalEvent,\n    collection?: string): void;\n\n  public selectFeatures(mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL, elementToSelect: Array<ElementIdentifier>) {\n    if (elementToSelect) {\n      const ids = elementToSelect.length > 0 ?\n        elementToSelect.reduce((memo, element) => {\n          memo.push(element.idValue);\n          return memo;\n        }, new Array<string | number>()) : [];\n      const numericalIds = ids.filter(id => !Number.isNaN(+id)).map(id => +id);\n      const visibilityFilter = ids.length > 0 ? ['in', ['get', elementToSelect[0].idFieldName], ['literal', ids.concat(numericalIds)]] : [];\n      this.filterLayers(mapLayers, map, (elementToSelect.length > 0), visibilityFilter, ExternalEvent.select);\n    }\n  }\n\n  public selectFeaturesByCollection(mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL,\n    features: Array<ElementIdentifier>, collection: string) {\n    const ids: Array<number | string> = features.map(f => f.idValue);\n    const numericalIds = ids.filter(id => !Number.isNaN(+id)).map(id => +id);\n    const visibilityFilter = ids.length > 0 ? ['in', ['get', features[0].idFieldName], ['literal', ids.concat(numericalIds)]] : [];\n    this.filterLayers(mapLayers, map, (features.length > 0), visibilityFilter, ExternalEvent.select, collection);\n  }\n\n\n  public updateLayoutVisibility(visualisationName: string, visualisationSetsConfig: VisualisationSetConfig[], map: AbstractArlasMapGL) {\n    const visuStatus = !this.visualisationsSets.status.get(visualisationName);\n    const vs = visualisationSetsConfig.find(v => v.name === visualisationName);\n    if (vs) {\n      vs.enabled = visuStatus;\n    }\n\n    if (!visuStatus) {\n      const layersSet = new Set(this.visualisationsSets.visualisations.get(visualisationName));\n      this.visualisationsSets.visualisations.forEach((ls, v) => {\n        if (v !== visualisationName) {\n          ls.forEach(ll => {\n            if (layersSet?.has(ll)) {\n              layersSet.delete(ll);\n            }\n          });\n        }\n      });\n      layersSet.forEach(ll => {\n        this.mapFrameworkService.setLayerVisibility(ll, false, map);\n      });\n    }\n    this.visualisationsSets.status.set(visualisationName, visuStatus);\n    const layers = new Set<string>();\n    this.visualisationsSets.visualisations.forEach((ls, v) => {\n      if (this.visualisationsSets.status.get(v)) {\n        ls.forEach(l => {\n          layers.add(l);\n          this.mapFrameworkService.setLayerVisibility(l, true, map);\n        });\n      }\n    });\n    return layers;\n  }\n\n  public updateVisibility(visibilityStatus: Map<string, boolean>, visualisationSetsConfig: VisualisationSetConfig[], map: AbstractArlasMapGL) {\n    visibilityStatus.forEach((visibilityStatus, l) => {\n      let layerInVisualisations = false;\n      if (visibilityStatus) {\n        let oneVisualisationEnabled = false;\n        visualisationSetsConfig.forEach(v => {\n          const ls = new Set(v.layers);\n          if (!layerInVisualisations) {\n            layerInVisualisations = ls.has(l);\n          }\n          if (ls.has(l) && v.enabled) {\n            oneVisualisationEnabled = true;\n            this.mapFrameworkService.setLayerVisibility(l, true, map);\n          }\n        });\n        if (!oneVisualisationEnabled && layerInVisualisations) {\n          this.mapFrameworkService.setLayerVisibility(l, false, map);\n        }\n      } else {\n        visualisationSetsConfig.forEach(v => {\n          const ls = new Set(v.layers);\n          if (!layerInVisualisations) {\n            layerInVisualisations = ls.has(l);\n          }\n        });\n        if (layerInVisualisations) {\n          this.mapFrameworkService.setLayerVisibility(l, false, map);\n        }\n      }\n    });\n  }\n\n\n  public findVisualisationSetLayer(visuName: string, visualisationSetsConfig: VisualisationSetConfig[]) {\n    return visualisationSetsConfig.find(v => v.name === visuName)?.layers;\n  }\n  public setVisualisationSetLayers(visuName: string, layers: string[], visualisationSetsConfig: VisualisationSetConfig[]) {\n    const f = visualisationSetsConfig.find(v => v.name === visuName);\n    if (f) {\n      f.layers = layers;\n    }\n  }\n\n  public abstract updateMapStyle(map: AbstractArlasMapGL, l: any, ids: Array<string | number>, sourceName: string): void;\n\n  public abstract getVisibleIdsFilter(map: AbstractArlasMapGL, layer: any, ids: Array<string | number>): any[];\n\n  /**\n   * Move an external layer\n   * @param map\n   * @param arlasDataLayers\n   * @param additionalLayer\n   * @param beforeId\n   * @protected\n   */\n  protected moveExternalLayer(map: AbstractArlasMapGL, arlasDataLayers: Map<string, ArlasDataLayer>,\n                              additionalLayer: ArlasDataLayer, beforeId?: string){\n    const selectId = 'arlas-' + ExternalEvent.select.toString() + '-' + additionalLayer.id;\n    this.moveLayerIfExist(map, arlasDataLayers, selectId,beforeId);\n    const hoverId = 'arlas-' + ExternalEvent.hover.toString() + '-' + additionalLayer.id;\n    this.moveLayerIfExist(map, arlasDataLayers, hoverId, beforeId);\n  }\n\n  /**\n   * Move layer if exist\n   * @param map\n   * @param arlasDataLayers\n   * @param selectId\n   * @param beforeId\n   * @protected\n   */\n  protected moveLayerIfExist(map: AbstractArlasMapGL, arlasDataLayers: Map<string, ArlasDataLayer>,\n                             selectId: string, beforeId?: string){\n    const selectLayer = arlasDataLayers.get(selectId);\n    if (!!selectLayer && this.mapFrameworkService.hasLayer(map, selectId)) {\n      this.mapFrameworkService.moveLayer(map, selectId, beforeId);\n    }\n  }\n\n  /**\n   * Applies an opacity style to map layers based on a specified range of field values.\n   * This method iterates over all layers whose source IDs start with the given sourceIdPrefix\n   * and adjusts the opacity of features within those layers. Features with field values\n   * within the specified range (between start and end values) will have the insideOpacity\n   * applied, while features with values outside this range will have the outsideOpacity applied.\n   *\n   * @param {AbstractArlasMapGL} map - The map instance on which the opacity style will be applied.\n   * @param {string} sourceIdPrefix - The prefix used to identify source IDs of the layers to which the opacity style will be applied.\n   * @param {string} field - The name of the field on which the range filter is applied.\n   * @param {number} start - The start value of the range filter.\n   * @param {number} end - The end value of the range filter.\n   * @param {number} insideOpacity - The opacity value to apply to features with field values within the specified range.\n   * @param {number} outsideOpacity - The opacity value to apply to features with field values outside the specified range.\n   */\n  public abstract adjustOpacityByRange(map: AbstractArlasMapGL, sourceIdPrefix: string, field: string,\n    start: number, end: number, insideOpacity: number, outsideOpacity: number): void;\n\n  /**\n   * Applies an opacity style to map layers based on a list of field values.\n   * This method iterates over all layers whose source IDs start with the given sourceIdPrefix\n   * and adjusts the opacity of features within those layers. Features with field values\n   * within the specified list will have the insideOpacity applied, while features with values\n   * outside this list will have the outsideOpacity applied.\n   *\n   * @param {AbstractArlasMapGL} map - The map instance on which the opacity style will be applied.\n   * @param {string} sourceIdPrefix - The prefix used to identify source IDs of the layers to which the opacity style will be applied.\n   * @param {string[]} values - List of values to match\n   * @param {number} insideOpacity - The opacity value to apply to features with field values within the specified range.\n   * @param {number} outsideOpacity - The opacity value to apply to features with field values outside the specified range.\n   * @param {string[]} ignoreLayer - List of layer IDs to ignore when changing opacity.\n   */\n  public abstract adjustOpacityByValue(map: AbstractArlasMapGL, sourceIdPrefix: string, field: string,\n    values: string[], insideOpacity: number, outsideOpacity: number, ignoreLayer?: string[]): void;\n\n  /**\n   * Resets the initial configured opacity style of the map layers whose source IDs start with the given sourceIdPrefix.\n   *\n   * @param {AbstractArlasMapGL} map - The map instance on which the opacity style will be applied.\n   * @param {string} sourceIdPrefix - The prefix used to identify source IDs of the layers to which the opacity style will be applied.\n   */\n  public abstract resetOpacity(map: AbstractArlasMapGL, sourceIdPrefix: string): void;\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n  Component, ElementRef, EventEmitter, HostListener, inject, input, Input, OnInit, Output, signal, SimpleChanges, viewChild, ViewEncapsulation\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport StaticMode from '@mapbox/mapbox-gl-draw-static-mode';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport centroid from '@turf/centroid';\nimport cleanCoords from '@turf/clean-coords';\nimport { polygon } from '@turf/helpers';\nimport { Feature, FeatureCollection, LineString, MultiLineString, MultiPolygon, Polygon } from 'geojson';\nimport { ArlasMapFrameworkService } from '../arlas-map-framework.service';\nimport { AbstractArlasMapService } from '../arlas-map.service';\nimport { AbstractArlasMapGL } from '../map/AbstractArlasMapGL';\nimport { DrawControlsOption } from '../map/model/controls';\nimport { MapMouseEvent } from '../map/model/events';\nimport { latLngToWKT } from '../map/tools';\nimport { AbstractDraw, DrawModes } from './AbstractDraw';\nimport { AoiEdition, BboxDrawCommand } from './draw.models';\nimport { MapboxAoiDrawService } from './draw.service';\nimport { limitVertexDirectSelectMode } from './modes/LimitVertexDirectSelectMode';\nimport { validGeomDrawPolygonMode } from './modes/ValidGeomDrawPolygonMode';\nimport { circleMode } from './modes/circles/circle.mode';\nimport { radiusCircleMode } from './modes/circles/radius.circle.mode';\nimport { directModeOverride } from './modes/directSelectOverride';\nimport { rectangleMode } from './modes/rectangleMode';\nimport { simpleSelectModeOverride } from './modes/simpleSelectOverride';\nimport { stripDirectSelectMode } from './modes/strip/strip.direct.mode';\nimport { stripMode } from './modes/strip/strip.mode';\nimport { buildDrawStyle, DrawTheme } from './themes/default-theme';\n\n@Component({\n    selector: 'arlas-draw',\n    templateUrl: './arlas-draw.component.html',\n    styleUrls: ['./arlas-draw.component.scss'],\n    encapsulation: ViewEncapsulation.None,\n    imports: [TranslatePipe]\n})\n/** L: a layer class/interface.\n *  S: a source class/interface.\n *  M: a Map configuration class/interface.\n */\nexport class ArlasDrawComponent<L, S, M> implements OnInit {\n\n  public map = input.required<AbstractArlasMapGL>();\n\n  @Input() public emptyData: FeatureCollection<GeoJSON.Geometry> = {\n    'type': 'FeatureCollection',\n    'features': []\n  };\n  /**  @description Options object for draw tools : https://github.com/mapbox/mapbox-gl-draw/blob/master/docs/API.md#options */\n  @Input() public drawOption: any = {};\n  /** Draw instance. */\n  public draw!: AbstractDraw;\n  /** @description Features drawn at component start */\n  @Input() public drawData: FeatureCollection<GeoJSON.Geometry> = ({ ...this.emptyData });\n  /** @description Whether the draw tools are activated. */\n  @Input() public drawButtonEnabled = false;\n  /** @description Maximum number of vertices allowed for a polygon. */\n  @Input() public drawPolygonVerticesLimit?: number;\n  /** @description Whether the drawing buffer is activated */\n  /** If true, the map's canvas can be exported to a PNG using map.getCanvas().toDataURL(). Default: false */\n  @Input() public preserveDrawingBuffer = false;\n  /** @description Theme for the drawn polygons */\n  public drawTheme = input<DrawTheme>({});\n\n  /** @description Emits the geojson of an aoi added to the map. */\n  @Output() public onAoiChanged: EventEmitter<FeatureCollection<GeoJSON.Geometry>> = new EventEmitter();\n\n  /** @description Emits the the dimensions of the polygon/bbox that is being drawn. */\n  @Output() public onAoiEdit: EventEmitter<AoiEdition> = new EventEmitter();\n\n\n  /** Number of drawn vertices (incremented in draw mode). Reset to 0 when the drawing is finished. */\n  public nbPolygonVertices = 0;\n  /** Number of clicks while drawing a geometry. */\n  public drawClickCounter = 0;\n\n  /** List of drawn polygons centroid */\n  public polygonlabeldata: FeatureCollection<GeoJSON.Geometry> = ({ ...this.emptyData });\n\n  /** Drawn geometry's state when editing/updating. */\n  protected savedEditFeature?: any;\n  /** Html element that holds the drawing message. */\n  protected drawTooltipElement = viewChild<ElementRef<HTMLDivElement>>('arlas_draw_tooltip');\n  /** Message shown to explain how to draw. */\n  public drawTooltipMessage = signal<string>('');\n\n  private readonly mapFrameworkService = inject(ArlasMapFrameworkService<L, S, M>);\n\n  public constructor(\n    private readonly drawService: MapboxAoiDrawService,\n    private readonly _snackBar: MatSnackBar,\n    private readonly translate: TranslateService,\n    protected mapService: AbstractArlasMapService<L, S, M>\n  ) {\n    this.drawService.editAoi$.pipe(takeUntilDestroyed()).subscribe(ae => this.onAoiEdit.emit(ae));\n    this.drawService.drawBbox$.pipe(takeUntilDestroyed()).subscribe({\n      next: (bboxDC: BboxDrawCommand) => {\n        this.drawBbox(bboxDC.east, bboxDC.south, bboxDC.west, bboxDC.north);\n      }\n    });\n  }\n\n  /**\n   * @description Stops the drawing mode by changing to static mode.\n   */\n  private stopDrawingAtVerticeLimit() {\n    if (this.nbPolygonVertices === this.drawPolygonVerticesLimit) {\n      this.draw.changeMode('static');\n      this.drawService.isDrawingPolygon = false;\n      this.nbPolygonVertices = 0;\n      this.drawClickCounter = 0;\n    }\n  }\n\n  private listenToDrawOnCreate() {\n    this.draw.on('draw.create', (e) => {\n      this.onAoiChanged.next(\n        {\n          'type': 'FeatureCollection',\n          'features': this.draw.getAllFeatures().filter(fc =>\n            this.drawService.isValidPolygon(fc) ||\n            this.drawService.isValidCircle(fc)\n          ).map(f => cleanCoords(f))\n        });\n    });\n  }\n\n  private listenToDrawUpdate() {\n    this.draw.on('draw.update', (e) => {\n      if (e) {\n        const features = e.features;\n        if (features && features.length > 0) {\n          this.savedEditFeature = { ...features[0], coordinates: [[]] };\n          for (const f of features[0].geometry.coordinates[0]) {\n            // TODO: WARNING issue in typing with savedEditFeature\n            (this.savedEditFeature as any).coordinates[0].push(f);\n          }\n        }\n      }\n    });\n  }\n\n  private listenToDrawDelete() {\n    this.draw.on('draw.delete', (e) => {\n      this.onAoiChanged.next(\n        {\n          'type': 'FeatureCollection',\n          'features': this.draw.getAllFeatures().filter(fc =>\n            this.drawService.isPolygon(fc) ||\n            this.drawService.isCircle(fc)\n          ).map(f => cleanCoords(f))\n        });\n    });\n  }\n\n  private listenToDrawInvalidGeometry() {\n    this.draw.onDrawInvalidGeometry((e) => {\n      if (this.savedEditFeature) {\n        const featureCoords = this.savedEditFeature.coordinates[0].slice();\n        if (featureCoords[0][0] !== featureCoords.at(-1)[0] ||\n          featureCoords[0][1] !== featureCoords.at(-1)[1]) {\n          featureCoords.push(featureCoords[0]);\n        }\n        const currentFeature: Feature<Polygon> = {\n          id: '',\n          type: 'Feature',\n          geometry: {\n            'type': 'Polygon',\n            'coordinates': [featureCoords]\n          },\n          properties: {}\n        };\n        currentFeature.id = this.savedEditFeature.id;\n        currentFeature.properties = this.savedEditFeature.properties;\n        this.draw.add(currentFeature);\n      }\n      this.openInvalidGeometrySnackBar();\n      this.mapFrameworkService.setMapCursor(this.map(), '');\n    });\n  }\n\n  private listenToDrawSelectionChange() {\n    this.draw.onDrawSelectionchange((e) => {\n      if (e.features.length > 0) {\n        this.drawService.isDrawSelected = true;\n      } else {\n        this.savedEditFeature = undefined;\n        this.drawService.isDrawSelected = false;\n        this.onAoiChanged.next(\n          {\n            'type': 'FeatureCollection',\n            'features': this.draw.getAllFeatures().filter(fc =>\n              this.drawService.isValidPolygon(fc) ||\n              this.drawService.isValidCircle(fc)\n            ).map(f => cleanCoords(f))\n          });\n        this.switchToStaticMode();\n        this.mapFrameworkService.setMapCursor(this.map(), '');\n      }\n    });\n  }\n\n  private listenToDrawModeChange() {\n    this.draw.onDrawModeChange((e) => {\n      this.updateTooltipMessage();\n      this.drawService.isDrawingPolygon = e.mode === this.draw.getMode('DRAW_POLYGON');\n      this.drawService.isDrawingStrip = e.mode === this.draw.getMode('DRAW_STRIP') || e.mode === this.draw.getMode('DIRECT_STRIP');\n      this.drawService.isDrawingCircle = e.mode === this.draw.getMode('DRAW_CIRCLE') || e.mode === this.draw.getMode('DRAW_RADIUS_CIRCLE');\n      this.drawService.isDrawingBbox = e.mode === this.draw.getMode('DRAW_RECTANGLE');\n      if (this.drawService.isDrawingPolygon || this.drawService.isDrawingCircle || this.drawService.isDrawingStrip || e.mode === 'static') {\n        this.drawService.isInSimpleDrawMode = false;\n      }\n      if (e.mode === 'simple_select') {\n        this.drawService.isInSimpleDrawMode = true;\n      } else if (e.mode === 'static') {\n        this.mapFrameworkService.setMapCursor(this.map(), '');\n      } else if (e.mode === 'direct_select') {\n        const selectedFeatures = this.draw.getSelectedFeatures();\n        const selectedIds = this.draw.getSelectedIds();\n        if (selectedFeatures && selectedIds && selectedIds.length > 0) {\n          if (selectedFeatures[0].properties?.source === 'bbox') {\n            this.draw.changeMode('simple_select', {\n              featureIds: [selectedIds[0]]\n            });\n            this.drawService.isInSimpleDrawMode = true;\n          } else if (this.drawPolygonVerticesLimit && selectedFeatures[0].properties?.meta !== 'strip') {\n            this.draw.changeMode('limit_vertex', {\n              featureId: selectedIds[0],\n              maxVertexByPolygon: this.drawPolygonVerticesLimit,\n              selectedCoordPaths: (selectedFeatures[0] as Feature<LineString | MultiLineString | Polygon | MultiPolygon>).geometry.coordinates\n            });\n            this.drawService.isInSimpleDrawMode = false;\n          } else if (this.drawPolygonVerticesLimit && selectedFeatures[0].properties?.meta === 'strip') {\n            this.draw.changeMode('direct_strip', {\n              featureId: selectedIds[0],\n              maxLength: selectedFeatures[0].properties.maxLength,\n              halfSwath: selectedFeatures[0].properties.halfSwath,\n            });\n            this.drawService.isInSimpleDrawMode = false;\n          }\n        } else {\n          this.drawService.isInSimpleDrawMode = false;\n          this.mapFrameworkService.setMapCursor(this.map(), '');\n        }\n      }\n    });\n  }\n\n  public ngOnInit(): void {\n    const drawStyles = buildDrawStyle(this.drawTheme());\n    const drawOptions = {\n      ...this.drawOption,\n      styles: drawStyles,\n      modes: {\n        static: StaticMode,\n        limit_vertex: limitVertexDirectSelectMode,\n        draw_polygon: validGeomDrawPolygonMode,\n        draw_circle: circleMode,\n        draw_radius_circle: radiusCircleMode,\n        draw_strip: stripMode,\n        direct_strip: stripDirectSelectMode,\n        draw_rectangle: rectangleMode,\n        direct_select: directModeOverride,\n        simple_select: simpleSelectModeOverride\n      },\n      suppressAPIEvents: true\n    };\n    this.draw = this.mapFrameworkService.createDraw(drawOptions, this.drawButtonEnabled, this.map());\n    this.draw.setMode('DRAW_CIRCLE', 'draw_circle');\n    this.draw.setMode('DRAW_RADIUS_CIRCLE', 'draw_radius_circle');\n    this.draw.setMode('DRAW_STRIP', 'draw_strip');\n    this.draw.setMode('STATIC', 'static');\n    this.draw.setMode('DIRECT_STRIP', 'direct_strip');\n    this.draw.setMode('DRAW_RECTANGLE', 'draw_rectangle');\n    const drawControlConfig: DrawControlsOption = {\n      draw: { control: this.draw },\n      addGeoBox: {\n        enable: true,\n        overrideEvent:\n        {\n          event: 'click',\n          fn: this.addGeoBox\n        }\n      },\n      removeAois: {\n        enable: true,\n        overrideEvent: { event: 'click', fn: this.removeAois }\n      }\n    };\n    this.map().initDrawControls(drawControlConfig);\n    this.drawService.setDraw(this.draw);\n    this.mapFrameworkService.onMapEvent('load', this.map(), () => {\n      this.mapService.declareLabelSources('', this.polygonlabeldata, this.map());\n      this.switchToStaticMode();\n      this.listenToDrawOnCreate();\n      this.listenToDrawUpdate();\n      this.listenToDrawDelete();\n      this.map().getCanvasContainer().addEventListener('mousemove', this.mouseMoveForDraw, true);\n\n      this.draw.onDrawOnStart((e) => {\n        this.drawClickCounter = 0;\n        this.mapFrameworkService.setMapCursor(this.map(), '');\n      });\n      this.draw.onDrawOnStop((e) => {\n        this.drawClickCounter = 0;\n        this.mapFrameworkService.setMapCursor(this.map(), '');\n      });\n\n      this.listenToDrawInvalidGeometry();\n\n      this.draw.onDrawEditSaveInitialFeature((edition) => {\n        this.savedEditFeature = { ...edition.feature };\n        this.savedEditFeature.coordinates = [[]];\n        // TODO: typing\n        edition.feature.coordinates[0].forEach((c: any) => this.savedEditFeature.coordinates[0].push(c));\n      });\n\n      this.listenToDrawSelectionChange();\n      this.listenToDrawModeChange();\n      this.mapFrameworkService.onMapEvent('click', this.map(), (e) => {\n        if (this.drawService.isDrawing()) {\n          this.drawClickCounter++;\n          this.updateTooltipMessage();\n        }\n\n        if (this.drawService.isDrawingCircle) {\n          return;\n        }\n        if (this.drawService.isDrawingPolygon) {\n          this.nbPolygonVertices++;\n          this.stopDrawingAtVerticeLimit();\n        } else {\n          this.nbPolygonVertices = 0;\n          const features = this.map().queryRenderedFeatures(e.point);\n          // edit polygon condition : no arlas feature && mapbox-gl-draw source present\n          const editCondition = features.filter(f => f.layer.id?.indexOf('arlas') >= 0).length === 0 &&\n            features.filter(f => f.source.startsWith('mapbox-gl-draw')).length > 0;\n          if (editCondition) {\n            // edit only on click on the border of the polygon\n            const candidatesProperties = features.find(f => f.source.startsWith('mapbox-gl-draw')\n                                                            && f.layer.id?.indexOf('stroke') >= 0)?.properties;\n            if (candidatesProperties?.id) {\n              if (candidatesProperties.user_meta === 'strip') {\n                this.draw.changeMode('direct_strip', {\n                  featureId: candidatesProperties.id,\n                  maxLength: candidatesProperties.user_maxLength,\n                  halfSwath: candidatesProperties.user_halfSwath\n                });\n                this.drawService.isInSimpleDrawMode = false;\n              } else {\n                this.draw.changeMode('simple_select', {\n                  featureIds: [candidatesProperties.id]\n                });\n                this.drawService.isInSimpleDrawMode = true;\n              }\n            }\n          }\n        }\n      });\n    });\n\n    this.mapFrameworkService.onMapEvent('mousemove', this.map(), (e: MapMouseEvent) => {\n      if (this.drawService.isDrawingBbox || this.drawService.isDrawingPolygon) {\n        this.mapFrameworkService.setMapCursor(this.map(), 'crosshair');\n        this.map().moveLngLat = e.lngLat;\n      }\n    });\n\n  }\n\n  public ngOnChanges(changes: SimpleChanges): void {\n    if (this.map && this.map().getMapProvider() !== undefined) {\n      if (changes['drawData'] !== undefined && this.drawService.isReady) {\n        const centroides = new Array();\n        this.drawData.features.forEach(feature => {\n          const poly = polygon((feature.geometry as Polygon).coordinates);\n          const cent = centroid(poly);\n          cent.properties ??= {};\n          cent.properties.arlas_id = feature.properties?.arlas_id;\n          centroides.push(cent);\n        });\n        this.polygonlabeldata = {\n          type: 'FeatureCollection',\n          features: centroides\n        };\n\n        this.drawService.addFeatures(this.drawData, /** deleteOld */ true);\n        this.mapService.updateLabelSources(this.map().POLYGON_LABEL_SOURCE, this.polygonlabeldata, this.map());\n      }\n\n    }\n  }\n\n  /**\n   * Update the tooltip message when drawing to reflect drawing mode and state\n   */\n  public updateTooltipMessage() {\n    let tooltipMessage = '';\n    switch (this.draw.getCurrentMode().toLocaleUpperCase() as DrawModes) {\n      case 'DRAW_RADIUS_CIRCLE':\n        if (this.drawClickCounter === 0) {\n          tooltipMessage = marker('Click to set the center of the circle');\n        } else {\n          tooltipMessage = marker('Click again to set the radius of the circle');\n        }\n        break;\n      case 'DRAW_POLYGON':\n        if (this.drawClickCounter < 2) {\n          tooltipMessage = marker('Click to set a corner of the polygon');\n        } else {\n          tooltipMessage = marker('Double click to finish drawing');\n        }\n        break;\n      case 'DRAW_CIRCLE':\n        tooltipMessage = marker('Click to create a circle centered on this point');\n        break;\n      case 'DRAW_STRIP':\n        if (this.drawClickCounter === 0) {\n          tooltipMessage = marker('Click to set the origin of the strip');\n        } else {\n          tooltipMessage = marker('Click again to set the length and bearing of the strip');\n        }\n        break;\n      case 'DRAW_RECTANGLE':\n        if (this.drawClickCounter === 0) {\n          tooltipMessage = marker('Click to set the first corner of the rectangle');\n        } else {\n          tooltipMessage = marker('Click again to complete the rectangle');\n        }\n        break;\n      case 'STATIC':\n      case 'SIMPLE_SELECT':\n        this.drawClickCounter = 0;\n        break;\n      default:\n        break;\n    }\n\n    this.drawTooltipMessage.set(tooltipMessage);\n  }\n\n  private readonly mouseMoveForDraw = (e: MouseEvent) => {\n    const x = e.clientX;\n    const y = e.clientY;\n\n    const drawTooltip = this.drawTooltipElement();\n    if (drawTooltip) {\n      drawTooltip.nativeElement.style.top = (y + 20) + 'px';\n      drawTooltip.nativeElement.style.left = (x + 20) + 'px';\n    }\n  };\n\n  /**\n   * @description Emits the bbox drawn by the BboxGenerator component\n   * @param east\n   * @param south\n   * @param west\n   * @param north\n   */\n  protected drawBbox(east: number, south: number, west: number, north: number) {\n    const coordinates = [[\n      [east, south],\n      [east, north],\n      [west, north],\n      [west, south],\n      [east, south],\n    ]];\n    const polygonGeojson: Feature<GeoJSON.Geometry> = {\n      type: 'Feature',\n      properties: {\n        source: 'bbox'\n      },\n      geometry: {\n        type: 'Polygon',\n        coordinates: coordinates\n      }\n    };\n    const geoboxdata = { ...this.emptyData};\n    geoboxdata.features = [];\n    if (this.drawData?.features && this.drawData.features.length > 0) {\n      this.drawData.features.forEach(df => geoboxdata.features.push(df));\n    }\n    geoboxdata.features.push(polygonGeojson);\n    /** This allows to keep the drawn box on the map. It will be overriden in ngOnChanges `changes['drawData']` */\n    this.drawService.addFeatures(geoboxdata, /** deleteOld */ true);\n    this.onAoiChanged.next(geoboxdata);\n    this.drawService.isDrawingBbox = false;\n    this.drawService.endDimensionsEmission();\n  }\n\n  /** @description Enables bbox drawing mode.*/\n  public addGeoBox() {\n    this.mapFrameworkService.setMapCursor(this.map(), 'crosshair');\n    this.switchToDrawMode('draw_rectangle');\n  }\n\n  /**\n   * @description Removes all the aois if none of them is selected. Otherwise it removes the selected one only\n   */\n  public removeAois() {\n    this.mapFrameworkService.setMapCursor(this.map(), '');\n    this.drawService.isDrawingBbox = false;\n    this.deleteSelectedItem();\n  }\n\n  /** @description Deletes the selected drawn geometry. If no drawn geometry is selected, all geometries are deteleted */\n  public deleteSelectedItem() {\n    if (this.drawService.isDrawSelected) {\n      this.draw.trash();\n    } else {\n      this.drawService.deleteAll();\n    }\n    this.drawService.isDrawSelected = false;\n    this.onAoiChanged.next(this.draw.getAll() as FeatureCollection<GeoJSON.Geometry>);\n  }\n\n  /**\n   * @description Shows an invalid-geometry error on a snack bar.\n   */\n  public openInvalidGeometrySnackBar() {\n    this._snackBar.open(this.translate.instant('Invalid geometry'), this.translate.instant('Ok'), {\n      duration: 3 * 1000,\n      verticalPosition: 'top',\n      panelClass: 'invalid-geo-toast'\n    });\n  }\n\n  /**\n   * @description Switches to a drawing mode of a polygon, circle, radius circle or strip.\n   * @param mode Draw mode (DRAW_POLYGON, DRAW_CIRCLE, DRAW_RADIUS_CIRCLE or DRAW_STRIP). Default to DRAW_POLYGON\n   * @param option Mapboxdraw option.\n   */\n  public switchToDrawMode(mode?: string, option?: any) {\n    const selectedMode = mode ?? this.draw.getMode('DRAW_POLYGON');\n    this.drawService.isDrawingCircle = selectedMode === this.draw.getMode('DRAW_CIRCLE')\n      || selectedMode === this.draw.getMode('DRAW_RADIUS_CIRCLE');\n    this.drawService.isDrawingPolygon = selectedMode === this.draw.getMode('DRAW_POLYGON');\n    this.drawService.isDrawingStrip = selectedMode === this.draw.getMode('DRAW_STRIP');\n    this.drawService.isDrawingBbox = selectedMode === this.draw.getMode('DRAW_RECTANGLE');\n    this.drawService.isInSimpleDrawMode = false;\n\n    this.mapFrameworkService.setMapCursor(this.map(), 'crosshair');\n    this.draw.changeMode(selectedMode, option ?? {});\n    this.updateTooltipMessage();\n  }\n\n  /**\n   * @description Switches to direct_select mode.\n   * @param option Mapboxdraw option.\n   */\n  public switchToDirectSelectMode(option?: { featureIds: Array<string>; allowCircleResize: boolean; }\n    | { featureId: string; allowCircleResize: boolean; }) {\n    this.draw.changeMode('direct_select', option);\n    this.drawService.isInSimpleDrawMode = false;\n    this.drawService.isDrawingCircle = false;\n    this.drawService.isDrawingStrip = false;\n    this.drawService.isDrawingPolygon = false;\n    this.drawService.isDrawingBbox = false;\n  }\n\n  /**\n   * @description Switches to simple_select mode.\n   */\n  public switchToEditMode() {\n    this.draw.changeMode('simple_select', {\n      featureIds: this.draw.getAll().features.map(f => f.id)\n    });\n    this.drawService.isInSimpleDrawMode = true;\n    this.drawService.isDrawingCircle = false;\n    this.drawService.isDrawingStrip = false;\n    this.drawService.isDrawingPolygon = false;\n    this.drawService.isDrawingBbox = false;\n  }\n\n  /**\n   * @description Switches to static mode.\n   */\n  public switchToStaticMode() {\n    this.draw.changeMode('static');\n    this.drawService.isInSimpleDrawMode = false;\n    this.drawService.isDrawingBbox = false;\n    this.drawService.isDrawingCircle = false;\n    this.drawService.isDrawingStrip = false;\n    this.drawService.isDrawingPolygon = false;\n    this.updateTooltipMessage();\n  }\n\n  /**\n   * @description Returns all the drawn polygons as wkt or geojson.\n   * @param mode 'wkt' | 'geojson'\n   * @returns\n   */\n  public getAllPolygon(mode: 'wkt' | 'geojson'): string | Object {\n    let polygon;\n    if (mode === 'wkt') {\n      polygon = latLngToWKT(this.draw.getAll().features.filter(f => this.drawService.isPolygon(f) ||\n        this.drawService.isCircle(f)).map(f => cleanCoords(f)));\n    } else {\n      polygon = {\n        'type': 'FeatureCollection',\n        'features': this.draw.getAll().features.filter(f => this.drawService.isPolygon(f) ||\n          this.drawService.isCircle(f)).map(f => cleanCoords(f))\n      };\n    }\n    return polygon;\n  }\n\n  /**\n   * @returns the selected polygon geometry in WKT or GeoJson given the mode\n   * @param mode : 'wkt' | 'geojson'\n   * @returns Wkt string or Geojson object.\n   */\n  public getSelectedPolygon(mode: 'wkt' | 'geojson'): string | Object {\n    let polygon;\n    if (mode === 'wkt') {\n      polygon = latLngToWKT(this.draw.getSelected().features\n        .filter(f => this.drawService.isPolygon(f) || this.drawService.isCircle(f)) as Feature<Polygon>[]);\n    } else {\n      polygon = {\n        'type': 'FeatureCollection',\n        'features': this.draw.getSelected().features.filter(f => this.drawService.isPolygon(f) ||\n          this.drawService.isCircle(f))\n      };\n    }\n    return polygon;\n  }\n\n  @HostListener('document:keydown', ['$event'])\n  public handleKeyboardEvent(event: KeyboardEvent) {\n    if (event.key === 'Escape') {\n      if (this.drawService.isDrawing()) {\n        this.drawService.deleteUnregisteredFeatures();\n        this.mapFrameworkService.setMapCursor(this.map(), '');\n\n        this.switchToStaticMode();\n        this.drawService.endDimensionsEmission();\n      } else if (this.drawService.isInSimpleDrawMode) {\n        this.drawService.isInSimpleDrawMode = false;\n        this.draw.changeMode('simple_select', { featureIds: [] });\n        this.updateTooltipMessage();\n      }\n    }\n  }\n\n}\n\n","<div #arlas_draw_tooltip class=\"draw-tooltip--hide\" [class.draw-tooltip--show]=\"drawTooltipMessage()\">\n    {{drawTooltipMessage() | translate}}</div>","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { getLayerName } from '../map/model/layers';\n\n\n@Pipe({\n  name: 'layerIdToName'\n})\nexport class LayerIdToName implements PipeTransform {\n\n  /** FROM V15.0.0 layer ids look like 'arlas_id:NAME:timestamp\n   * This pipe extracts the 'NAME' in that id\n   */\n  public transform(id: string): string {\n    return getLayerName(id);\n  }\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { HistogramData } from 'arlas-d3';\n\nexport interface LegendData {\n  minValue: number | string;\n  maxValue: number | string;\n  keysColorsMap?: Map<string, string>;\n}\n\nexport interface Legend {\n  type?: PROPERTY_SELECTOR_SOURCE;\n  title?: string;\n  minValue?: string | number;\n  maxValue?: string | number;\n  fixValue?: string | number;\n  interpolatedValues?: Array<string | number>;\n  /** Map (field, (color & highlight)) */\n  manualValues?: Map<string, {color: string | number; highlight: boolean;}>;\n  visible?: boolean;\n  /** data to be plotted as histogram in the legend */\n  histogram?: Array<HistogramData>;\n}\n\nexport interface CircleLegend extends FillLegend {\n  radius: Legend;\n}\n\nexport interface FillLegend {\n  color: Legend;\n  colorPalette: string;\n  strokeColor: Legend;\n  strokeColorPalette: string;\n}\n\nexport interface HeatmapLegend {\n  color: Legend;\n  colorPalette: string;\n  radius: Legend;\n}\n\nexport interface LabelLegend {\n  color: Legend;\n  colorPalette: string;\n  size: Legend;\n}\n\nexport interface LineLegend {\n  color: Legend;\n  colorPalette: string;\n  dashes: Array<number>;\n  width: Legend;\n}\n\nexport enum PROPERTY_SELECTOR_SOURCE {\n  fix = 'Fix',\n  provided = 'Provided',\n  generated = 'Generated',\n  manual = 'Manual',\n  interpolated = 'Interpolated',\n  metric_on_field = 'Metric on field',\n  heatmap_density = 'Density'\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { AfterViewInit, Component, ElementRef, input, Input, OnChanges, SimpleChanges, ViewChild } from '@angular/core';\nimport { select } from 'd3-selection';\nimport { ArlasDataLayer, CellShape } from '../../map/model/layers';\nimport { Legend, PROPERTY_SELECTOR_SOURCE } from '../legend.config';\n\n@Component({\n  selector: 'arlas-layer-icon',\n  templateUrl: './layer-icon.component.html',\n  styleUrls: ['./layer-icon.component.scss']\n})\nexport class LayerIconComponent implements OnChanges, AfterViewInit {\n  public layer = input.required<ArlasDataLayer>();\n  @Input() public colorLegend: Legend = {};\n  @Input() public strokeColorLegend: Legend = {};\n  @Input() public widthLegend: Legend = {};\n  @Input() public radiusLegend: Legend = {};\n  @Input() public lineDasharray: Array<number> = [];\n  @ViewChild('layer_icon', { read: ElementRef, static: false }) public layerIconElement?: ElementRef;\n\n  public ngOnChanges(changes: SimpleChanges) {\n    this.drawIcons();\n  }\n\n  public ngAfterViewInit() {\n    this.drawIcons();\n  }\n\n  private drawIcons(): void {\n    if (!this.layerIconElement) {\n      return;\n    }\n\n    const type = this.layer().type;\n    const source = this.layer().source;\n    switch (type) {\n      case 'circle':\n      case 'circle-heatmap': {\n        if (source.startsWith('feature-metric')) {\n          drawFeatureCircleIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend, true);\n        } else if (source.startsWith('feature')) {\n          drawFeatureCircleIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend);\n        } else if (source.startsWith('cluster')) {\n          const addBlur = type === 'circle-heatmap';\n          drawClusterCircleIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend, addBlur);\n        }\n        break;\n      }\n      case 'line': {\n        if (source.startsWith('feature-metric')) {\n          drawLineIcon(this.layerIconElement.nativeElement, this.colorLegend, this.lineDasharray, true);\n        } else {\n          drawLineIcon(this.layerIconElement.nativeElement, this.colorLegend, this.lineDasharray);\n        }\n        break;\n      }\n      case 'fill': {\n        if (source.startsWith('cluster')) {\n          const fillShape = this.layer().metadata?.cellShape ?? (this.layer().metadata as any)['cell-shape'];\n          drawClusterFillIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend, fillShape);\n        } else if (source.startsWith('feature-metric')) {\n          drawFeatureFillIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend, true);\n        } else {\n          drawFeatureFillIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend);\n        }\n        break;\n      }\n      case 'heatmap': {\n        drawHeatmapIcon(this.layerIconElement.nativeElement, this.colorLegend, this.layer().source.toString().startsWith('feature-metric'));\n        break;\n      }\n      case 'symbol': {\n        const l = this.layer().layout;\n        if (l['text-field']) {\n          drawTextIcon(this.layerIconElement.nativeElement, this.colorLegend);\n        }\n      }\n    }\n  }\n\n}\n\n/**\n * Draws the rectangles icon for cluster mode\n * @param svgNode SVG element on which we append the rectangles using d3.\n * @param colorLegend Color legend, to give the drawn icons rectangles the same color on the map\n * @param strokeColorLegend Color legend, to give the drawn icons rectangles the same stroke color on the map\n * @param fillShape used to define a more precise shape for an icon\n */\nexport function drawClusterFillIcon(svgNode: SVGElement, colorLegend: Legend, strokeColorLegend: Legend, fillShape?: CellShape) {\n  const fillFourColors = getClusterFillColors(colorLegend);\n  let strokeFourColors = fillFourColors;\n  if (strokeColorLegend) {\n    strokeFourColors = getClusterFillColors(strokeColorLegend);\n  }\n  const svg = select(svgNode);\n  svg.selectAll('g').remove();\n  if(fillShape === 'hexagonal') {\n     [\n      drawHexagon(12, 4, 5),\n      drawHexagon(5, 8, 4.5),\n      drawHexagon(11.5, 11.7, 4),\n    ].forEach((hex, i) => {\n       svg.append('g').append('polygon')\n         .data([hex])\n         .attr('points', (d) => d.map(d => [d.x, d.y].join(',')).join(' '))\n         .attr('fill', fillFourColors[i])\n         .attr('fill-opacity', 0.8)\n         .attr('stroke', strokeFourColors[i]).attr('stroke-width', 0.6);\n     });\n  } else {\n    svg.append('g').append('rect')\n      .attr('height', 7).attr('width', 7)\n      .attr('fill', fillFourColors[0]).attr('fill-opacity', 0.8)\n      .attr('stroke', strokeFourColors[0]).attr('stroke-width', 0.6)\n      .attr('y', 3).attr('x', 3);\n    svg.append('g').append('rect')\n      .attr('height', 7).attr('width', 7)\n      .attr('fill', fillFourColors[1]).attr('fill-opacity', 0.6)\n      .attr('stroke', strokeFourColors[1]).attr('stroke-width', 0.6)\n      .attr('y', 10).attr('x', 3);\n    svg.append('g').append('rect')\n      .attr('height', 7).attr('width', 7)\n      .attr('fill', fillFourColors[2]).attr('fill-opacity', 0.6)\n      .attr('stroke', strokeFourColors[2]).attr('stroke-width', 0.6)\n      .attr('y', 10).attr('x', 10);\n    svg.append('g').append('rect')\n      .attr('height', 7).attr('width', 7)\n      .attr('fill', fillFourColors[3]).attr('fill-opacity', 0.6)\n      .attr('stroke', strokeFourColors[3]).attr('stroke-width', 0.6)\n      .attr('y', 3).attr('x', 10);\n  }\n}\n\n/**\n * Draws the hexagon icon for cluster h3 mode\n * @param x\n * @param y\n * @param r rayon\n */\nexport function drawHexagon(x: number, y: number, r: number) {\n  const a = 2 * Math.PI / 6;\n  const data = [];\n  for (let i = 0; i < 6; i++) {\n    data.push({x: x + r * Math.cos(a * i), y: y + r * Math.sin(a * i)});\n  }\n  return data;\n}\n\n/**\n * Draws the rectangles icon for feature and feature-metric modes\n * @param svgNode SVG element on which we append the rectangles using d3.\n * @param colorLegend Color legend, to give the drawn icons rectangles the same color on the map\n * @param strokeColorLegend Color legend, to give the drawn icons rectangles the same stroke color on the map\n * @param [isMetric=false] Whether the layer depends on a metric\n */\nexport function drawFeatureFillIcon(svgNode: SVGElement, colorLegend: Legend, strokeColorLegend: Legend, isMetric = false) {\n  const fillColor = getOneColor(colorLegend);\n  let strokeColor = fillColor;\n  if (strokeColorLegend) {\n    strokeColor = getOneColor(strokeColorLegend);\n  }\n  const polygon = [\n    { 'x': 0, 'y': 2 },\n    { 'x': 18, 'y': 2 },\n    { 'x': 13, 'y': 18 },\n    { 'x': 1, 'y': 18 },\n    { 'x': 8, 'y': 9 },\n    { 'x': 0, 'y': 2 }];\n  const svg = select(svgNode);\n  svg.selectAll('g').remove();\n  svg.append('g').selectAll('polygon')\n    .data([polygon])\n    .enter().append('polygon')\n    .attr('points', (d) => d.map(d => [d.x, d.y].join(',')).join(' ')).attr('fill', fillColor)\n    .attr('fill-opacity', 0.5)\n    .attr('stroke', strokeColor)\n    .attr('stroke-width', 0.9);\n  if (isMetric) {\n    svg.append('g').append('text').text('∑')\n      .attr('x', 14).attr('y', 14).attr('font-size', '0.5em').attr('font-weight', 'bold').attr('fill', colorLegend.fixValue ?? '#eee');\n  }\n}\n\n\nexport function getOneColor(legend: Legend): string {\n  let color = '';\n  if (legend.type === PROPERTY_SELECTOR_SOURCE.interpolated) {\n    const iv = legend.interpolatedValues;\n    if (iv) {\n      color = iv[0].toString();\n    }\n  } else if (legend.type === PROPERTY_SELECTOR_SOURCE.fix) {\n    color = legend.fixValue + '';\n  } else if (legend.type === PROPERTY_SELECTOR_SOURCE.manual || legend.type === PROPERTY_SELECTOR_SOURCE.generated\n    || legend.type === PROPERTY_SELECTOR_SOURCE.provided) {\n    const mv = legend.manualValues;\n    const firstManualValue = mv?.values().next().value;\n    if (firstManualValue) {\n      color = firstManualValue.color.toString();\n    }\n  }\n  return color;\n}\n\n\nexport function drawTextIcon(svgNode: SVGElement, colorLegend: Legend) {\n  const svg = select(svgNode);\n  svg.selectAll('g').remove();\n  svg.append('g').append('text').text(' T ').attr('transform', ' translate(5 0)')\n    .attr('y', 14).attr('font-size', '0.9em').attr('font-family', 'Garamond').attr('fill', colorLegend.fixValue ?? '#eee');\n}\n\n/**\n * draws the heatmap icon for cluster mode\n * @param svgNode SVG element on which we append the heamap circles using d3.\n * @param colorLegend Color legend, to give the drawn icons circles the same color on the map\n * @param small Whether to create a small version of the icon\n */\nexport function drawHeatmapIcon(svgNode: SVGElement, colorLegend: Legend, small: boolean) {\n  const heatmapColors = [];\n  if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.interpolated) {\n    const iv = colorLegend.interpolatedValues;\n    if (iv) {\n      if (iv.length === 1) {\n        heatmapColors.push(iv[0], iv[0], iv[0]);\n      } else if (iv.length === 2) {\n        heatmapColors.push(iv[0], iv[0], iv[1]);\n      } else if (iv.length === 3) {\n        heatmapColors.push(iv[1], iv[Math.trunc(iv.length / 2)], iv[iv.length - 1]);\n      } else if (iv.length >= 4) {\n        heatmapColors.push(iv[1], iv[Math.trunc(iv.length / 3)], iv[Math.trunc(2 * iv.length / 3)], iv[iv.length - 1]);\n      }\n    }\n  }\n  const svg = select(svgNode);\n  svg.selectAll('defs').remove();\n  svg.append('defs')\n    .append('filter').attr('id', 'blur')\n    .append('feGaussianBlur').attr('stdDeviation', 0.8);\n  if (small) {\n    svg.selectAll('g').remove();\n    svg.append('g')\n      .append('circle')\n      .attr('cx', 10).attr('cy', 10)\n      .attr('r', 7)\n      .style('fill', heatmapColors[0])\n      .attr('filter', 'url(#blur)');\n  } else {\n    svg.selectAll('circle').remove();\n    svg.selectAll('circle')\n      .data(heatmapColors).enter()\n      .append('circle')\n      .attr('cx', 10).attr('cy', 10)\n      .attr('r', (d, i) => {\n        if (i === 0) {\n          return 10;\n        }\n        if (i === 1) {\n          return 8;\n        }\n        if (i === 2) {\n          return 6;\n        }\n        if (i === 3) {\n          return 3;\n        }\n        // Fallback case\n        return 0;\n      })\n      .style('fill', (d, i) => d)\n      .attr('filter', 'url(#blur)');\n  }\n}\n\n/**\n * Draws the line icon for feature mode\n * @param svgNode SVG element on which we append the line using d3.\n * @param colorLegend Color legend, to give the drawn icons line the same color on the map\n * @param dashArray Array representing the dash pattern\n * @param [isMetric=false] Whether the layer depends on a metric\n */\nexport function drawLineIcon(svgNode: SVGElement, colorLegend: Legend, dashArray: Array<number>, isMetric = false) {\n  let lineColor = '';\n  if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.fix) {\n    lineColor = colorLegend.fixValue + '';\n  } else if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.interpolated) {\n    const iv = colorLegend.interpolatedValues;\n    if (iv) {\n      lineColor = iv[0] + '';\n    } else {\n      lineColor = '#2da4ff';\n    }\n  } else if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.manual || colorLegend.type === PROPERTY_SELECTOR_SOURCE.generated\n    || colorLegend.type === PROPERTY_SELECTOR_SOURCE.provided) {\n    const mv = colorLegend.manualValues;\n    const firstManualValue = mv?.values().next().value;\n    if (firstManualValue) {\n      lineColor = firstManualValue.color.toString();\n    }\n  }\n  let svgDashArray = '0';\n  if (!!dashArray && dashArray.length > 1) {\n    const joinedDashArray = dashArray.join(',');\n    if (joinedDashArray === '2,5') {\n      svgDashArray = '0, 2, 3';\n    } else if (joinedDashArray === '0.1,5') {\n      svgDashArray = '1,2.5';\n    } else {\n      svgDashArray = '4,2,1';\n    }\n  }\n  const svg = select(svgNode);\n  svg.selectAll('g').remove();\n  svg.append('g').append('line')\n    .attr('x1', 0).attr('y1', 18)\n    .attr('x2', 6).attr('y2', 10)\n    .attr('cx', 2).attr('cy', 2)\n    .attr('stroke', lineColor).attr('stroke-width', 1.5).attr('stroke-dasharray', svgDashArray);\n  svg.append('g').append('line')\n    .attr('x1', 6).attr('y1', 10)\n    .attr('x2', 12).attr('y2', 4)\n    .attr('cx', 2).attr('cy', 2)\n    .attr('stroke', lineColor).attr('stroke-width', 1.5).attr('stroke-dasharray', svgDashArray);\n  svg.append('g').append('line')\n    .attr('x1', 12).attr('y1', 4)\n    .attr('x2', 18).attr('y2', 0)\n    .attr('cx', 2).attr('cy', 2)\n    .attr('stroke', lineColor).attr('stroke-width', 1.5).attr('stroke-dasharray', svgDashArray);\n  if (isMetric) {\n    svg.append('g').append('text').text('∑')\n      .attr('x', 10).attr('y', 16).attr('font-size', '0.5em').attr('font-weight', 'bold').attr('fill', colorLegend.fixValue ?? '#eee');\n  }\n}\n\n/**\n * Draws the circle icon for feature mode\n * @param svgNode SVG element on which we append the circles using d3.\n * @param colorLegend Color legend, to give the drawn icons circles the same color on the map\n * @param strokeColorLegend Color legend, to give the drawn icons circles the same stroke color on the map\n * @param [isMetric=false] Whether the layer depends on a metric\n */\nexport function drawFeatureCircleIcon(svgNode: SVGElement, colorLegend: Legend, strokeColorLegend: Legend, isMetric = false) {\n  const colorsList = new Array<string | number>();\n  const strokeColorsList = new Array<string | number>();\n  populateListFromLegend(colorsList, colorLegend);\n  populateListFromLegend(strokeColorsList, strokeColorLegend);\n\n  const svg = select(svgNode);\n  svg.selectAll('circle').remove();\n  svg.selectAll('g').remove();\n  svg.selectAll('circle')\n    .data(colorsList).enter()\n    .append('circle')\n    .attr('cx', (d, i) => {\n      if (colorsList.length === 1) {\n        return 10;\n      } else {\n        if (i === 0) {\n          return 6;\n        }\n        if (i === 1) {\n          return 12;\n        }\n        if (i === 2) {\n          return 5;\n        }\n        // Fallback case\n        return 0;\n      }\n    })\n    .attr('cy', (d, i) => {\n      if (colorsList.length === 1) {\n        return 10;\n      } else {\n        if (i === 0) {\n          return 5;\n        }\n        if (i === 1) {\n          return 10;\n        }\n        if (i === 2) {\n          return 15;\n        }\n        // Fallback case\n        return 0;\n      }\n    })\n    .attr('r', (d, i) => {\n      if (colorsList.length === 1) {\n        return 7;\n      } else {\n        return 3;\n      }\n    })\n    .style('fill', (d, i) => d).style('fill-opacity', colorsList.length === 1 ? 0.6 : 0.8)\n    .style('stroke', (d, i) => strokeColorsList[i]).style('stroke-width', 0.5);\n\n  if (isMetric) {\n    svg.append('g').append('text').text('∑')\n      .attr('x', 10).attr('y', 16).attr('font-size', '0.5em').attr('font-weight', 'bold').attr('fill', colorLegend.fixValue ?? '#eee');\n  }\n}\n\n\n/**\n * draws the circle icon for cluster mode\n * @param svgNode SVG element on which we append the circles using d3.\n * @param colorLegend Color legend, to give the drawn icons circles the same color on the map\n * @param strokeColorLegend Color legend, to give the drawn icons circles the same stroke color on the map\n * @param addBlur Whether to add blur to the drawn circles\n */\nexport function drawClusterCircleIcon(svgNode: SVGElement, colorLegend: Legend, strokeColorLegend: Legend, addBlur = false) {\n  // todo include radius legend in drawing icons\n  const colorsList = new Array<string | number>();\n  const strokeColorsList = new Array<string | number>();\n  populateListFromLegend(colorsList, colorLegend);\n  populateListFromLegend(strokeColorsList, strokeColorLegend);\n  const svg = select(svgNode);\n  svg.selectAll('circle').remove();\n  svg.append('defs')\n    .append('filter')\n    .attr('id', 'blurHeatmapCircle')\n    .attr('x', '-10%')\n    .attr('y', '-40%')\n    .attr('width', '160%')\n    .attr('height', '160%')\n    .append('feGaussianBlur').attr('stdDeviation', 1.9);\n  svg.selectAll('circle')\n    .data(colorsList).enter()\n    .append('circle')\n    .attr('cx', (d, i) => {\n      if (i === 0) {\n        return 12;\n      }\n      if (i === 1) {\n        return 6;\n      }\n      if (i === 2) {\n        return 10;\n      }\n      // Fallback case\n      return 0;\n    })\n    .attr('cy', (d, i) => {\n      if (i === 0) {\n        return 7;\n      }\n      if (i === 1) {\n        return 11;\n      }\n      if (i === 2) {\n        return 15;\n      }\n      // Fallback case\n      return 0;\n    })\n    .attr('r', (d, i) => {\n      if (i === 0) {\n        return 6;\n      }\n      if (i === 1) {\n        return 5;\n      }\n      if (i === 2) {\n        return 3;\n      }\n      // Fallback case\n      return 0;\n    })\n    .style('fill', (d, i) => d).style('fill-opacity', 0.7)\n    .style('stroke', (d, i) => strokeColorsList[i]).style('stroke-width', 0.8);\n\n  if (addBlur) {\n    svg.selectAll('circle').attr('filter', 'url(#blurHeatmapCircle)');\n  }\n\n}\n\n\nexport function populateListFromLegend(list: Array<string | number>, legend: Legend) {\n  if (legend.type === PROPERTY_SELECTOR_SOURCE.fix && legend.fixValue) {\n    list.push(legend.fixValue, legend.fixValue, legend.fixValue);\n  } else if (legend.type === PROPERTY_SELECTOR_SOURCE.interpolated && legend.interpolatedValues) {\n    const iv = legend.interpolatedValues;\n    if (iv?.length === 1) {\n      list.push(iv[0], iv[0], iv[0]);\n    } else if (iv.length === 2) {\n      list.push(iv[0], iv[0], iv[1]);\n    } else if (iv.length >= 3) {\n      list.push(iv[0], iv[Math.trunc(iv.length / 2)], iv[iv.length - 1]);\n    }\n  } else if (legend.type === PROPERTY_SELECTOR_SOURCE.manual || legend.type === PROPERTY_SELECTOR_SOURCE.generated\n    || legend.type === PROPERTY_SELECTOR_SOURCE.provided) {\n    const iv = legend.manualValues;\n    if (iv && iv.size > 0) {\n      if (iv.size === 1) {\n        const color = iv.values().next().value?.color;\n        if (color) {\n          list.push(color, color, color);\n        }\n      } else if (iv.size === 2) {\n        list.push(Array.from(iv.values())[0].color, Array.from(iv.values())[0].color, Array.from(iv.values())[1].color);\n      } else if (iv.size >= 3) {\n        list.push(Array.from(iv.values())[0].color, Array.from(iv.values())[Math.trunc(Array.from(iv.keys()).length / 2)].color,\n          Array.from(iv.values())[Array.from(iv.keys()).length - 1].color);\n      }\n    } else {\n      list.push('#eee', '#eee', '#eee');\n    }\n  }\n}\n\nexport function getClusterFillColors(colorLegend: Legend): (string | number)[] {\n  const fourColors = [];\n  if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.interpolated) {\n    const iv = colorLegend.interpolatedValues;\n    if (iv) {\n      if (iv.length === 1) {\n        for (let i = 0; i < 4; i++) {\n          fourColors.push(iv[0]);\n        }\n      } else if (iv.length === 2) {\n        fourColors.push(iv[0], iv[1], iv[0], iv[1]);\n      } else if (iv.length >= 3) {\n        fourColors.push(iv[0],\n          iv[Math.trunc(2 * iv.length / 3)],\n          iv[iv.length - 1],\n          iv[Math.trunc(iv.length / 3)]);\n      }\n    }\n  } else if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.fix && colorLegend.fixValue) {\n    const c = colorLegend.fixValue;\n    fourColors.push(c, c, c, c);\n  }\n  return fourColors;\n}\n","<div class=\"legend-icon\">\n  <svg #layer_icon class=\"legend-icon__svg\"></svg>\n</div>\n","\n/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\n\n\nexport const GET = 'get';\nexport const MATCH = 'match';\nexport const INTERPOLATE = 'interpolate';\nexport const OTHER = marker('other_color');\nexport const IN = 'in';\nexport const NOT_IN = '!';\nexport const HEATMAP_DENSITY = 'Heatmap-density';\n\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport { CollectionService } from 'arlas-web-components';\n\nexport interface LegendParamsResult {\n  translateKey: string;\n  field?: string;\n  normalized?: string;\n  normalizedKey?: string;\n  metric?: string;\n  format: ParamsResultType;\n}\n\n/**\n * full :\n *  return all interpolated values to construct a title legend\n *  ex: Average of boats (normalized)\n * metricField :\n *  return metric and field interpolated values.\n *  ex: Average of boats\n * metricNormalised :\n *   return metric and normalized interpolated values.\n *   ex: count (normalized)\n * noMetric :\n *   return field and normalized interpolated values.\n *   ex: Boat visibility (normalized)\n * original\n *   return the original key to be translated. This case appear only if we fail\n *   to parse of if we have an error.\n */\nexport type  ParamsResultType = 'full' | 'metricField' | 'metricNormalised' | 'noMetric' | 'original';\n\n@Pipe({\n  name: 'formatLegend'\n})\nexport class FormatLegendPipe implements PipeTransform {\n\n  public constructor(private readonly collectionService: CollectionService) {\n  }\n  private readonly metrics: string[] = [\n    'avg',\n    'sum',\n    'min',\n    'max',\n    'cardinality',\n    'count'\n  ];\n\n  public transform(field: string | undefined): LegendParamsResult | null {\n    if (!field) {\n      return null;\n    }\n\n    let params: LegendParamsResult = {\n      translateKey: this.collectionService.getDisplayFieldName(field),\n      format: 'original'\n    };\n\n    const parts = field.split(':');\n    // Regular normalized\n    const containsNormalizedPartOrMetric = parts.length === 2\n      // Normalized by key\n      || parts.length === 3\n      // Metric\n      || (parts.length === 1 && this.containsMetrics(parts[0]));\n\n    if (containsNormalizedPartOrMetric) {\n      const valueSplit = parts[0].split('_');\n      if (valueSplit.length === 0) {\n        return params;\n      }\n\n      const hasExtraEmptyValue = valueSplit[valueSplit.length - 1] === '';\n      if (hasExtraEmptyValue) {\n        valueSplit.splice(valueSplit.length - 1, 1);\n      }\n\n      const metric = this.getMetric(valueSplit);\n      const field = this.getField(valueSplit);\n      const normalized = parts[1] ?? '';\n      const normalizedKey =  parts[2] ?? '';\n      params = this.buildInterpolatedParams(params, metric, field, normalized, normalizedKey);\n    } else if (parts[0].endsWith('_arlas__color')){\n      params.translateKey = this.collectionService.getDisplayFieldName(params.translateKey.replace('_arlas__color', ''));\n    }\n\n    return params;\n  }\n\n  public buildInterpolatedParams(params: LegendParamsResult, metric: string | undefined, field: string,\n      normalized: string, normalizedKey: string): LegendParamsResult {\n    const legendParams: LegendParamsResult = {\n      ...params,\n      field: this.collectionService.getDisplayFieldName(field),\n      normalized: '',\n      metric,\n    };\n\n    if (!metric) {\n      legendParams.format = 'noMetric';\n      legendParams.translateKey = marker('legend without metric');\n    } else if (field && normalized) {\n      legendParams.format = 'full';\n      legendParams.translateKey = marker('legend');\n    } else if (field) {\n      legendParams.format = 'metricField';\n      legendParams.translateKey =  marker('legend without normalized');\n    } else if (normalized) {\n      legendParams.format = 'metricNormalised';\n      legendParams.translateKey =  marker('legend without field');\n    }\n\n    if (normalized) {\n      if (normalizedKey) {\n        legendParams.normalized = marker('normalized by key');\n        legendParams.normalizedKey = normalizedKey;\n      } else {\n        legendParams.normalized = marker('normalized');\n      }\n    }\n\n    return legendParams;\n  }\n\n  public getMetric(valueSplit: string[]) {\n    if (this.isMetrics(valueSplit[valueSplit.length - 1])) {\n      return valueSplit[valueSplit.length - 1];\n    }\n  }\n\n  public getField(valueSplit: string[]) {\n    // If last split is a metric, then exclude it\n    if (this.isMetrics(valueSplit[valueSplit.length - 1])) {\n      return valueSplit.slice(0, valueSplit.length - 1).join('_');\n    }\n    return valueSplit.join('_');\n  }\n\n  public isMetrics(metrics: string) {\n    return this.metrics.includes(metrics);\n  }\n\n  public containsMetrics(value: string) {\n    for (const metric of this.metrics) {\n      if (value.includes(metric)) {\n        return true;\n      }\n    }\n  }\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { HistogramData } from 'arlas-d3';\n\nexport function getMax(data: Array<HistogramData>): number {\n    return Math.max(...data.map(hd => +hd.value));\n}\n\nexport const MAX_CIRLE_RADIUS = 7;\nexport const MAX_LINE_WIDTH = 10;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Injectable } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { HistogramData } from 'arlas-d3';\nimport { Subject } from 'rxjs';\nimport tinycolor from 'tinycolor2';\nimport { HEATMAP_DENSITY, IN, INTERPOLATE, MATCH, NOT_IN, OTHER } from '../map/model/filters';\nimport { ArlasDataLayer } from '../map/model/layers';\nimport { CircleLegend, FillLegend, HeatmapLegend, LabelLegend, Legend, LegendData, LineLegend, PROPERTY_SELECTOR_SOURCE } from './legend.config';\nimport { getMax, MAX_CIRLE_RADIUS, MAX_LINE_WIDTH } from './legend.tools';\n\n\n@Injectable({\n  providedIn: 'root'\n})\nexport abstract class LegendService {\n  /** Emits for each layerId that was hovered the properties associated to the features in order to highlight the right ones in the legend */\n  protected highlightSource = new Subject<{layerId: string; properties: Array<{[name: string]: any;}>; }>();\n  public highlight$ = this.highlightSource.asObservable();\n\n  public abstract getCircleLegend(paint: any, visibileMode: boolean, legendData: Map<string, LegendData>, layer: ArlasDataLayer): CircleLegend;\n\n  public abstract getLineLegend(paint: any, visibileMode: boolean, legendData: Map<string, LegendData>, layer: ArlasDataLayer): LineLegend;\n\n  public abstract getFillLegend(paint: any, visibileMode: boolean, legendData: Map<string, LegendData>, layer: ArlasDataLayer): FillLegend;\n\n  public abstract getHeatmapLegend(paint: any, visibileMode: boolean, legendData: Map<string, LegendData>, layer: ArlasDataLayer): HeatmapLegend;\n\n  public abstract getLabelLegend(paint: any, layout: any,\n    visibileMode: boolean, legendData: Map<string, LegendData>, layer: ArlasDataLayer): LabelLegend;\n\n  /** Based on the paint of a layer and its type, returns the field used for the color matching */\n  public abstract getColorField(paint: any, layerType: string): string;\n\n  public highlightFeatures(layerId: string, features: Array<GeoJSON.Feature<GeoJSON.Geometry>>) {\n    this.highlightSource.next({layerId: layerId, properties: features.map(f => f.properties ?? {}).filter(p => !!p)});\n  }\n\n  public static setProvidedColorLegend(colorLegend: Legend, field: string,\n    legendData: Map<string, LegendData>, filter: any[], translate: TranslateService) {\n    colorLegend.title = field;\n    if (!Array.isArray(field)) {\n      colorLegend.type = PROPERTY_SELECTOR_SOURCE.provided;\n      if (field.endsWith('_arlas__color')) {\n        colorLegend.type = PROPERTY_SELECTOR_SOURCE.generated;\n      }\n      colorLegend.manualValues = new Map();\n      if (legendData?.get(field)) {\n        const keysToColors = legendData.get(field)?.keysColorsMap ?? new Map();\n        const colorList = Array.from(keysToColors.keys()).flatMap(k => [k, keysToColors.get(k)]);\n        for (let i = 0; i < colorList.length; i += 2) {\n          colorLegend.manualValues.set(translate ? translate.instant(colorList[i]) : colorList[i], { color: colorList[i + 1], highlight: false});\n        }\n        if (colorList.length === 0) {\n          colorLegend.manualValues.set('', { color: '#eee', highlight: false });\n        }\n      } else {\n        colorLegend.manualValues.set('', { color: '#eee', highlight: false });\n      }\n      if (filter) {\n        LegendService.filterLegend(colorLegend.manualValues, filter,\n          (field).endsWith('_arlas__color') ? (field).slice(0, -13) : field);\n      }\n    }\n  }\n\n\n  public static setMatchColorLegend(colorLegend: Legend, colorExpression: any[], legendData: Map<string, LegendData>,\n    filter: any[], translate: TranslateService) {\n    /** color = [\"match\", [\"get\", \"field\"], .... ]**/\n    colorLegend.type = PROPERTY_SELECTOR_SOURCE.manual;\n    const colorsLength = colorExpression.length;\n    let hasDefaultColor = false;\n    if (colorsLength % 2 !== 0) {\n      hasDefaultColor = true;\n    }\n    const field = colorExpression[1].length === 2 ? colorExpression[1][1] : '';\n    colorLegend.title = field;\n    colorLegend.manualValues = new Map();\n    let keysToColors: Map<string, string>;\n    if (legendData?.get(field + '_color')) {\n      // If there is a legendData, use only the colors in the keysToColors\n      keysToColors = legendData.get(field + '_color')?.keysColorsMap ?? new Map();\n    } else {\n      // If no legendData for this field, use all the colors of colorExpression\n      keysToColors = new Map();\n      for (let i = 2; i < colorExpression.length; i += 2) {\n        if (hasDefaultColor && i === colorsLength - 3) {\n          keysToColors.set(colorExpression[i] + '', colorExpression[i + 1]);\n          keysToColors.set(OTHER, colorExpression[i + 2]);\n          break;\n        } else {\n          keysToColors.set(colorExpression[i] + '', colorExpression[i + 1]);\n        }\n      }\n    }\n    for (let i = 2; i < colorExpression.length; i += 2) {\n      if (hasDefaultColor && i === colorsLength - 3) {\n        if (keysToColors.has(colorExpression[i] + '')) {\n          colorLegend.manualValues.set(translate ? translate.instant(colorExpression[i] + '') : colorExpression[i],\n            {color: colorExpression[i + 1], highlight: false});\n        }\n        colorLegend.manualValues.set(translate ? translate.instant(OTHER) : OTHER, {color: colorExpression[i + 2], highlight: false});\n        break;\n      } else if (keysToColors.has(colorExpression[i] + '')) {\n        colorLegend.manualValues.set(translate ? translate.instant(colorExpression[i] + '') : colorExpression[i],\n          {color: colorExpression[i + 1], highlight: false});\n      }\n    }\n\n    if (filter) {\n      LegendService.filterLegend(colorLegend.manualValues, filter, field);\n    }\n  }\n\n\n  public static setInterpolatedColorLegend(colorLegend: Legend, colorExpression: any[],\n    legendData: Map<string, LegendData>,\n    visibleMode: boolean) {\n    colorLegend.type = PROPERTY_SELECTOR_SOURCE.interpolated;\n    /** color = [\"interplate\", ['linear'], [\"get\", \"field\"], 0, 1... ]**/\n    // todo throw exception if interpolation is not linear\n    const field = colorExpression[2].length === 2 ? colorExpression[2][1] : HEATMAP_DENSITY;\n    colorLegend.title = field;\n    colorLegend.interpolatedValues = [];\n    const palette = new Array<{ proportion: number; value: string; }>();\n    const colors = colorExpression.slice(3);\n    colors.forEach((c, i) => {\n      if (i % 2 === 0) {\n        palette.push({\n          proportion: c,\n          value: colors[i + 1]\n        });\n      }\n    });\n\n    for (const c of palette) {\n      colorLegend.interpolatedValues.push(c.value);\n    }\n\n    const fieldLegend = legendData.get(field);\n    const countLegend = legendData.get('count');\n    if (fieldLegend && field !== 'count') {\n      colorLegend.minValue = fieldLegend.minValue;\n      colorLegend.maxValue = fieldLegend.maxValue;\n      // For heatmaps, the count is used to fetch data, so we use it for the legend\n    } else if (field === HEATMAP_DENSITY && countLegend) {\n      colorLegend.minValue = countLegend.minValue;\n      colorLegend.maxValue = countLegend.maxValue;\n    } else {\n      const colorValues = colorExpression.filter((c, i) => i > 2 && i % 2 !== 0);\n      colorLegend.minValue = colorValues[0] + '';\n      colorLegend.maxValue = colorValues[colorValues.length - 1] + '';\n    }\n    if (!visibleMode) {\n      /** apply greyscale because the layer is not visible */\n      colorLegend.interpolatedValues = colorLegend.interpolatedValues\n        .map((c) => tinycolor(c.toString()).greyscale().lighten(20).toHexString());\n      palette.forEach(p => {\n        p.value = tinycolor(p.value.toString()).greyscale().lighten(20).toHexString();\n      });\n    }\n\n    const minimum = palette[0].proportion;\n    const maximum = palette.slice(-1)[0].proportion;\n    return palette.map(c => c.value + ' ' + (100 * (c.proportion - minimum) / (maximum - minimum)) + '%').join(',');\n\n  }\n\n  public static filterLegend(colorLegendValues: Map<string, {color: string | number; highlight: boolean;}>, filter: any[], field: string) {\n    filter.forEach((f, idx) => {\n      if (idx !== 0 && idx !== filter.length - 1) {\n        switch (f[0]) {\n          case IN: {\n            if (f[1][1] === field) {\n              const valuesToKeep: Array<string> = f[2][1];\n              colorLegendValues.forEach((val, key) => {\n                if (!(valuesToKeep.includes(key))) {\n                  colorLegendValues.delete(key);\n                }\n              });\n            }\n            break;\n          }\n          case NOT_IN: {\n            if (f[1][0] === IN && f[1][1][1] === field) {\n              const valuesToExclude: Array<string> = f[1][2][1];\n              valuesToExclude.forEach(value => {\n                colorLegendValues.delete(value);\n              });\n            }\n            break;\n          }\n        }\n      }\n    });\n  }\n\n  public static buildColorLegend(colorExpression: string | any, visibleMode: boolean, legendData: Map<string, LegendData>,\n    filter: any[], translate: TranslateService): [Legend, string] {\n    const colorLegend: Legend = { visible: true };\n    let colorPalette = '';\n    if (typeof colorExpression === 'string') {\n      colorLegend.type = PROPERTY_SELECTOR_SOURCE.fix;\n      colorLegend.fixValue = colorExpression;\n    } else if (Array.isArray(colorExpression)) {\n      if (colorExpression.length === 2) {\n        /** color = [\"get\", \"field\"]  ==> Generated or Provided */\n        const field = colorExpression[1];\n        colorLegend.title = field;\n        LegendService.setProvidedColorLegend(colorLegend, field, legendData, filter, translate);\n      } else if (colorExpression.length >= 3) {\n        if (colorExpression[0] === MATCH) {\n          LegendService.setMatchColorLegend(colorLegend, colorExpression, legendData, filter, translate);\n        } else if (colorExpression[0] === INTERPOLATE) {\n          colorPalette = LegendService.setInterpolatedColorLegend(colorLegend, colorExpression, legendData, visibleMode);\n        }\n      }\n    }\n\n    colorLegend.visible = visibleMode;\n    return [colorLegend, colorPalette];\n  };\n\n  public static buildRadiusLegend(radiusExpression: string | any, legendData: Map<string, LegendData>): Legend {\n    const radiusLegend: Legend = {};\n    const circleRadiusEvolution: Array<HistogramData> = new Array();\n    if (Array.isArray(radiusExpression)) {\n      if (radiusExpression.length >= 3) {\n        // Filter out the zoom-dependent radius layers (circle-heatmap)\n        if (radiusExpression[0] === INTERPOLATE && radiusExpression[2].length > 1) {\n          const field = radiusExpression[2][1];\n          radiusExpression.filter((w, i) => i >= 3).forEach((w, i) => {\n            if (i % 2 === 0) {\n              circleRadiusEvolution.push({ key: w, value: radiusExpression[i + 1 + 3] });\n            }\n          });\n          radiusLegend.title = field;\n          radiusLegend.type = PROPERTY_SELECTOR_SOURCE.interpolated;\n\n          const fieldLegend = legendData.get(field);\n          if (fieldLegend) {\n            radiusLegend.minValue = fieldLegend.minValue;\n            radiusLegend.maxValue = fieldLegend.maxValue;\n          } else {\n            radiusLegend.minValue = circleRadiusEvolution[0].key + '';\n            radiusLegend.maxValue = circleRadiusEvolution[circleRadiusEvolution.length - 1].key + '';\n          }\n\n          const maxCircleRadius = getMax(circleRadiusEvolution);\n          if (maxCircleRadius > MAX_CIRLE_RADIUS) {\n            circleRadiusEvolution.forEach(lw => lw.value = lw.value * MAX_CIRLE_RADIUS / maxCircleRadius);\n          }\n          radiusLegend.histogram = circleRadiusEvolution;\n        }\n      }\n    }\n    return radiusLegend;\n\n  };\n\n  protected static buildWidthLegend(lineWidth: number | any,\n    legendData: Map<string, LegendData>): Legend {\n    /** if the line width is fix then it is not added to the legend*/\n    const widthLegend: Legend = {};\n    if (Array.isArray(lineWidth)) {\n      if (lineWidth.length >= 3) {\n        if (lineWidth[0] === INTERPOLATE) {\n          const field = lineWidth[2][1];\n          widthLegend.title = field;\n          widthLegend.type = PROPERTY_SELECTOR_SOURCE.interpolated;\n\n          const fieldLegend = legendData.get(field);\n          if (fieldLegend) {\n            widthLegend.minValue = fieldLegend.minValue;\n            widthLegend.maxValue = fieldLegend.maxValue;\n          }\n\n          const lineWidthEvolution: Array<HistogramData> = new Array();\n          lineWidth.filter((w, i) => i >= 3).forEach((w, i) => {\n            if (i % 2 === 0) {\n              lineWidthEvolution.push({ key: w, value: lineWidth[i + 1 + 3] });\n            }\n          });\n          const maxLineWidth = getMax(lineWidthEvolution);\n          if (maxLineWidth > MAX_LINE_WIDTH) {\n            lineWidthEvolution.forEach(lw => lw.value = lw.value * MAX_LINE_WIDTH / maxLineWidth);\n          }\n          widthLegend.histogram = lineWidthEvolution;\n        }\n      }\n    }\n    return widthLegend;\n  }\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { KeyValuePipe } from '@angular/common';\nimport { Component, DestroyRef, ElementRef, input, Input, OnInit, signal, ViewChild } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { FormatNumberPipe, NUMBER_FORMAT_CHAR, ShortenNumberPipe } from 'arlas-web-components';\nimport { filter } from 'rxjs';\nimport { OTHER } from '../../map/model/filters';\nimport { ArlasDataLayer } from '../../map/model/layers';\nimport { FormatLegendPipe } from '../format-legend.pipe';\nimport { Legend, PROPERTY_SELECTOR_SOURCE } from '../legend.config';\nimport { LegendService } from '../legend.service';\n\n@Component({\n  selector: 'arlas-legend-item',\n  templateUrl: './legend-item.component.html',\n  styleUrls: ['./legend-item.component.scss'],\n  imports: [MatTooltip, TranslatePipe, FormatNumberPipe, KeyValuePipe, ShortenNumberPipe, FormatLegendPipe]\n})\nexport class LegendItemComponent implements OnInit {\n  public legend = input.required<Legend>();\n  public title = input.required<string>();\n  public layer = input.required<ArlasDataLayer>();\n  @Input() public colorPalette?: string;\n  /** Whether to display highlights of the legend on hover of the map features */\n  @Input() public highlightLegend = true;\n  @ViewChild('interpolated_svg', { read: ElementRef, static: false }) public interpolatedElement?: ElementRef;\n\n  protected PROPERTY_SELECTOR_SOURCE = PROPERTY_SELECTOR_SOURCE;\n  protected readonly NUMBER_FORMAT_CHAR = NUMBER_FORMAT_CHAR;\n\n  /** List of cursors to display around the interpolated legend */\n  public cursors = new Array<{position: number; value: string | undefined;}>();\n\n  public hasHighlightedKeywords = signal(false);\n\n  public constructor(\n    private readonly legendService: LegendService,\n    private readonly destroyRef: DestroyRef,\n    private readonly translate: TranslateService\n  ) { }\n\n  public ngOnInit() {\n    this.legendService.highlight$\n      .pipe(filter(v => this.highlightLegend && v.layerId === this.layer().id), takeUntilDestroyed(this.destroyRef))\n      .subscribe(highlight => {\n        if (this.legend().manualValues) {\n          this.highlightKeywords(highlight);\n        }\n\n        if (this.legend().interpolatedValues) {\n          this.displayCursors(highlight);\n        }\n      });\n  }\n\n  /**\n   * Change the 'highlight' state of the keywords in the legend to make them pop more\n   * @param highlight The features'values to highlight\n   */\n  private highlightKeywords(highlight: {layerId: string; properties: Array<{[name: string]: any;}>; }) {\n    const colorField = this.legendService.getColorField(this.layer().paint, this.layer().type);\n    if (!colorField) {\n      return;\n    }\n\n    this.hasHighlightedKeywords.set(highlight.properties.length > 0);\n\n    // Get all the unique values from the properties\n    const valuesToHighlight = new Set(highlight.properties.map(p => {\n      const value = p[colorField];\n      if (!this.legend().manualValues?.has(value)) {\n        return this.translate.instant(OTHER);\n      }\n      return value;\n    }));\n\n    // Based on what is received, change the highlight\n    this.legend().manualValues?.forEach((v, k) => {\n      v.highlight = valuesToHighlight.has(k);\n    });\n  }\n\n  /**\n   * For every different value to highlight, add a cursor on the legend.\n   * Only the topmost feature's value will be displayed.\n   * @param highlight The features'values to highlight\n   */\n  private displayCursors(highlight: {layerId: string; properties: Array<{[name: string]: any;}>; }) {\n    if (!this.legend().title) {\n      return;\n    }\n\n    const colorField = this.legend().title;\n\n    if (colorField?.endsWith('normalized')) {\n      const valueField = colorField.split(':')[0] + ':_arlas__short_format';\n\n      this.cursors = highlight.properties\n        .map(p => ({ position: Math.min(100, 100 * p[colorField]), value: p[valueField]}));\n    } else if (colorField) {\n      const min = this.legend().minValue;\n      const max = this.legend().maxValue;\n\n      if (min !== undefined && max !== undefined) {\n        this.cursors = highlight.properties\n          .map(p => ({ position: Math.min(100, 100 * (p[colorField] - +min) / (+max - +min)), value: p[colorField] }));\n      }\n    }\n\n    // Keep the value only for the topmost feature (first in array)\n    this.cursors.forEach((c, idx) => {\n      if (idx !== 0) {\n        c.value = undefined;\n      }\n    });\n  }\n}\n","@if (legend().type && legend().visible !== false) {\n  <div class=\"legend\">\n    @if ((legend().title | formatLegend); as l) {\n      <div class=\"legend__title\">\n        {{ title() | translate}} {{ l.translateKey | translate: {metric: l.metric | translate, field: l.field | translate, normalized: l.normalized | translate: {normalizedKey: l.normalizedKey | translate} } }}\n      </div>\n    }\n    @if (legend().type === PROPERTY_SELECTOR_SOURCE.manual\n      || legend().type === PROPERTY_SELECTOR_SOURCE.generated\n      || legend().type === PROPERTY_SELECTOR_SOURCE.provided) {\n      <div class=\"legend--manual\">\n        @for (manualColor of legend().manualValues | keyvalue; track manualColor) {\n          <div class=\"legend--manual__item\"\n            [class.legend--manual__item--highlighted]=\"manualColor.value.highlight\"\n            [class.legend--manual__item--lessened]=\"!manualColor.value.highlight && hasHighlightedKeywords()\">\n            <div class=\"legend--manual__item__color\" [style.backgroundColor]=\"manualColor.value.color\"\n              [class.circle-tip]=\"layer().type === 'circle'\"\n              [class.line-tip]=\"layer().type === 'line'\"\n              [class.fill-tip]=\"layer().type === 'fill'\">\n            </div>\n            <div class=\"legend--manual__item__key\" [matTooltip]=\"manualColor.key | translate\" [matTooltipPosition]=\"'left'\">\n              {{manualColor.key | translate}}\n            </div>\n          </div>\n        }\n      </div>\n    } @else if (legend().type === PROPERTY_SELECTOR_SOURCE.interpolated) {\n      <div class=\"legend--interpolated\">\n        @for (cursor of cursors; track cursor.value) {\n          <div class=\"legend--interpolated__cursor\" [style.left]=\"cursor.position + '%'\" [class.legend--interpolated__cursor--main]=\"$first\"></div>\n          @if (cursor.value) {\n            <div class=\"legend--interpolated__cursor__value\" [style.left]=\"cursor.position + '%'\">\n              {{ cursor.value | shortenNumber }}\n            </div>\n          }\n        }\n        @if (colorPalette) {\n          <div class=\"legend--interpolated__palette\" [style.background]=\"'linear-gradient(to right, ' + colorPalette + ')'\"></div>\n        } @else {\n          <div class=\"legend--interpolated__svg\">\n            <svg #interpolated_svg></svg>\n          </div>\n        }\n        <div class=\"legend--interpolated__range\">\n          <div class=\"legend--interpolated__range__value\">\n            {{ legend().minValue | formatNumber:NUMBER_FORMAT_CHAR }}\n          </div>\n          <div class=\"legend--interpolated__range__value\">\n            {{ legend().maxValue | formatNumber:NUMBER_FORMAT_CHAR }}\n          </div>\n        </div>\n      </div>\n    }\n  </div>\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n  AfterViewInit, Component, computed, input, Input, OnChanges,\n  OnDestroy,\n  OnInit, Output, signal, SimpleChanges, ViewChild, WritableSignal\n} from '@angular/core';\nimport { MatIcon } from '@angular/material/icon';\nimport { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { MarkerModule } from '@colsen1991/ngx-translate-extract-marker/extras';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { HistogramData } from 'arlas-d3';\nimport { GetCollectionDisplayNamePipe, GetColorPipe } from 'arlas-web-components';\nimport { scaleLinear, ScaleLinear } from 'd3-scale';\nimport { select } from 'd3-selection';\nimport { area, curveLinear, line } from 'd3-shape';\nimport { Observable, Subject, takeUntil } from 'rxjs';\nimport {\n  ARLAS_ID, ArlasDataLayer, EXTRUSION_LAYER_PREFIX, FILLSTROKE_LAYER_PREFIX, HOVER_LAYER_PREFIX, SELECT_LAYER_PREFIX\n} from '../map/model/layers';\nimport { LayerIdToName } from './layer-name.pipe';\nimport { LayerIconComponent } from './legend-icon/layer-icon.component';\nimport { LegendItemComponent } from './legend-item/legend-item.component';\nimport { Legend, LegendData, PROPERTY_SELECTOR_SOURCE } from './legend.config';\nimport { LegendService } from './legend.service';\nimport { getMax, MAX_LINE_WIDTH } from './legend.tools';\n\n\n@Component({\n    selector: 'arlas-legend',\n    templateUrl: './legend.component.html',\n    styleUrls: ['./legend.component.scss'],\n    imports: [\n      MatTooltip, LayerIconComponent, MatIcon, MatMenuTrigger, MatMenu, MatMenuItem, LegendItemComponent,\n      TranslatePipe, MarkerModule, LayerIdToName, GetCollectionDisplayNamePipe, GetColorPipe]\n})\nexport class LegendComponent implements OnInit, AfterViewInit, OnChanges, OnDestroy {\n  /**\n   * @Input : Angular\n   * @description Layer object\n   */\n  public layer = input.required<ArlasDataLayer>();\n  /**\n   * @Input : Angular\n   * @description Collection of the layer\n   */\n  public collection = input.required<string | undefined>();\n  /**\n   * @Input : Angular\n   * @description Current zoom level of the map\n   */\n  public zoom = input.required<number>();\n  /**\n   * @Input : Angular\n   * @description Whether the layer is enabled.\n   */\n  public enabled = input.required<boolean>();\n  /**\n   * @Input : Angular\n   * @description Subject of [collection, [field, legendData]] map. The map subscribes to it to keep\n   * the legend updated with the data displayed on the map.\n   */\n  @Input() public legendUpdater: Subject<Map<string, Map<string, LegendData>>> = new Subject();\n  /**\n   * @Input : Angular\n   * @description Subject of [field, boolean] map. The map subscribes to it to keep\n   * the legend updated with the visibility of the layer.\n   */\n  @Input() public visibilityUpdater = new Observable<Map<string, boolean>>();\n  /**\n   * @Input : Angular\n   * @description Whether to highlight the keywords or color of hovered features\n   */\n  @Input() public highlightLegend = true;\n\n  /**\n   * @Output : Angular\n   * @description Notifies the parent component that this layer is visible or not\n   */\n  @Output() public visibilityStatus: Subject<boolean> = new Subject();\n\n  /**\n   * @Output : Angular\n   * @description Notifies the parent component that the user wants to download the layer\n   */\n  @Output() public downloadSourceEmitter: Subject<{ layer: ArlasDataLayer; downloadType: string; }> = new Subject();\n\n  @ViewChild('width_legend', { static: false }) public lineWidthLegend?: LegendItemComponent;\n  @ViewChild('radius_legend', { static: false }) public circleRadiusLegend?: LegendItemComponent;\n\n  public lineDasharray = new Array<number>();\n\n  public colorLegend: WritableSignal<Legend> = signal({});\n  public hasColorLegend = computed(() =>\n    this.colorLegend().type !== undefined && this.colorLegend().type !== PROPERTY_SELECTOR_SOURCE.fix);\n\n  public strokeColorLegend: WritableSignal<Legend> = signal({});\n  public hasStrokeLegend = computed(() =>\n    this.strokeColorLegend().type !== undefined && this.strokeColorLegend().type !== PROPERTY_SELECTOR_SOURCE.fix);\n\n  public widthLegend: WritableSignal<Legend> = signal({});\n  public hasWidthLegend = computed(() =>\n    this.widthLegend().type !== undefined && this.widthLegend().type !== PROPERTY_SELECTOR_SOURCE.fix);\n\n  public radiusLegend: WritableSignal<Legend> = signal({});\n  public hasRadiusLegend = computed(() =>\n    this.radiusLegend().type !== undefined && this.radiusLegend().type !== PROPERTY_SELECTOR_SOURCE.fix);\n\n  public displayLegendDetailToggle = computed(() =>\n    this.hasColorLegend() || this.hasStrokeLegend() || this.hasWidthLegend() || this.hasRadiusLegend());\n\n  public detail = false;\n  public visibleMode = false;\n\n  private legendData: Map<string, LegendData> = new Map();\n  public colorPalette = '';\n  public strokeColorPalette = '';\n\n  private readonly MAX_CIRLE_RADIUS = 7;\n  private readonly LEGEND_WIDTH = 185;\n  private readonly _onDestroy$ = new Subject<boolean>();\n\n  public constructor(\n    private readonly legendService: LegendService\n  ) { }\n\n  public ngOnInit() {\n    this.legendUpdater\n      .pipe(takeUntil(this._onDestroy$))\n      .subscribe(legendDataPerCollection => {\n        const collection = this.collection();\n\n        this.legendData = collection ? legendDataPerCollection.get(collection) ?? new Map() : new Map();\n        this.drawLegends(this.visibleMode);\n      });\n    this.visibilityUpdater\n      .pipe(takeUntil(this._onDestroy$))\n      .subscribe(visibilityUpdater => {\n        /** check legend visibility according to Data source status (mapcontirbutor) */\n        if (this.layer()) {\n          /** if the visibility updater contains the layer we pick the visibility status otherwise we keep it unchaged */\n          this.visibleMode = visibilityUpdater.get(this.layer().id) !== undefined ? !!visibilityUpdater.get(this.layer().id) : this.visibleMode;\n        } else {\n          this.visibleMode = false;\n        }\n        /** check legend visibility according to VisibilityRules */\n        const minzoom = this.layer().minzoom;\n        const maxzoom = this.layer().maxzoom;\n        if (this.visibleMode && minzoom !== undefined && maxzoom !== undefined) {\n          this.visibleMode = (this.zoom() <= maxzoom && this.zoom() >= minzoom);\n        }\n        /** check legend visibility according to legend enabled or not */\n        if (!this.enabled()) {\n          this.visibleMode = false;\n        }\n        if (!this.visibleMode) {\n          this.detail = this.visibleMode;\n        }\n        /** check legend visibility for external layers that are not set by config nor map contributors */\n        if (!this.layer().id.startsWith(ARLAS_ID) &&\n          !this.layer().id.startsWith(FILLSTROKE_LAYER_PREFIX) && !this.layer().id.startsWith(HOVER_LAYER_PREFIX)\n          && !this.layer().id.startsWith(SELECT_LAYER_PREFIX) &&  !this.layer().id.startsWith(EXTRUSION_LAYER_PREFIX)) {\n          this.visibleMode = this.enabled();\n          if (this.layer().metadata?.showLegend === false) {\n            this.visibleMode = false;\n          }\n        }\n        this.drawLegends(this.visibleMode);\n        this.visibilityStatus.next(this.visibleMode);\n      });\n  }\n\n  public ngAfterViewInit() {\n    this.drawLegends(this.visibleMode);\n  }\n\n  public ngOnChanges(changes: SimpleChanges) {\n    if (changes['layer'] !== undefined) {\n      this.drawLegends(this.visibleMode);\n    }\n  }\n\n  public ngOnDestroy() {\n    this._onDestroy$.next(true);\n    this._onDestroy$.complete();\n  }\n\n  public downloadLayerSource(layer: ArlasDataLayer, downloadType: string): void {\n    const download = {\n      layer,\n      downloadType\n    };\n    this.downloadSourceEmitter.next(download);\n  }\n\n  public showDetail(event: Event) {\n    this.detail = !this.detail;\n    event.stopPropagation();\n  }\n\n  /** Parses the `paint` attribute of a layer and draws the legend elements such as\n   * - color palette\n   * - line width evolution\n   * - circle radius evolution\n   */\n  private drawLegends(visibileMode: boolean): void {\n    const type = this.layer().type;\n    const paint = this.layer().paint;\n    const layout = this.layer().layout;\n    switch (type) {\n      case 'circle': {\n        const circleLegend = this.legendService.getCircleLegend(paint, visibileMode, this.legendData, this.layer());\n        this.colorLegend.set(circleLegend.color);\n\n        // For circle-heatmap layer the stroke can't be configured, so hide it\n        if (this.layer().metadata?.hiddenProps?.geomType !== 'circle-heatmap') {\n          this.strokeColorLegend.set(circleLegend.strokeColor);\n        }\n        this.colorPalette = circleLegend.colorPalette;\n        this.strokeColorPalette = circleLegend.strokeColorPalette;\n        this.radiusLegend.set(circleLegend.radius);\n        if (this.circleRadiusLegend?.interpolatedElement) {\n          const circleRadiusEvolution = circleLegend.radius.histogram ?? [];\n          drawCircleSupportLine(this.circleRadiusLegend.interpolatedElement.nativeElement, circleRadiusEvolution, this.colorLegend(),\n            this.LEGEND_WIDTH, Math.min(this.MAX_CIRLE_RADIUS, getMax(circleRadiusEvolution)) * 2);\n        }\n        break;\n      }\n      case 'line': {\n        const lineLegend = this.legendService.getLineLegend(paint, visibileMode, this.legendData, this.layer());\n        this.lineDasharray = lineLegend.dashes;\n        this.colorLegend.set(lineLegend.color);\n        this.colorPalette = lineLegend.colorPalette;\n        this.widthLegend.set(lineLegend.width);\n        if (this.lineWidthLegend?.interpolatedElement) {\n          const lineWidthEvolution = lineLegend.width.histogram ?? [];\n          drawLineWidth(this.lineWidthLegend.interpolatedElement.nativeElement, lineWidthEvolution, this.colorLegend(),\n            this.LEGEND_WIDTH, MAX_LINE_WIDTH);\n        }\n        break;\n      }\n      case 'fill': {\n        const fillLegend = this.legendService.getFillLegend(paint, visibileMode, this.legendData, this.layer());\n        this.colorLegend.set(fillLegend.color);\n        this.colorPalette = fillLegend.colorPalette;\n        this.strokeColorLegend.set(fillLegend?.strokeColor);\n        this.strokeColorPalette = fillLegend?.strokeColorPalette;\n        break;\n      }\n      case 'heatmap': {\n        const heatmapLegend = this.legendService.getHeatmapLegend(paint, visibileMode, this.legendData, this.layer());\n\n        this.colorLegend.set(heatmapLegend.color);\n        this.colorPalette = heatmapLegend.colorPalette;\n        this.radiusLegend.set(heatmapLegend.radius);\n        if (this.circleRadiusLegend?.interpolatedElement) {\n          const heatmapRadiusEvolution = heatmapLegend.radius.histogram ?? [];\n          drawCircleSupportLine(this.circleRadiusLegend.interpolatedElement.nativeElement, heatmapRadiusEvolution, this.colorLegend(),\n            this.LEGEND_WIDTH, Math.min(this.MAX_CIRLE_RADIUS, getMax(heatmapRadiusEvolution)) * 2);\n        }\n        break;\n      }\n      case 'symbol': {\n        const symbolLegend = this.legendService.getLabelLegend(paint, layout, visibileMode, this.legendData, this.layer());\n        this.colorLegend.set(symbolLegend.color);\n        this.colorPalette = symbolLegend.colorPalette;\n        this.widthLegend.set(symbolLegend.size);\n        if (!!this.lineWidthLegend && !!this.lineWidthLegend.interpolatedElement) {\n          const lineWidthEvolution = symbolLegend.size.histogram ?? [];\n          drawLineWidth(this.lineWidthLegend.interpolatedElement.nativeElement, lineWidthEvolution, this.colorLegend(),\n            this.LEGEND_WIDTH, MAX_LINE_WIDTH);\n        }\n        break;\n      }\n    }\n    if (!this.colorLegend().fixValue) {\n      this.colorLegend().fixValue = visibileMode ? '#444' : '#d3d3d3';\n    }\n  }\n}\n\n/**\n * draws the line width legend\n * @param svgNode SVG element on which we append the line using d3.\n * @param lineWidths List of {key, linewidth}\n * @param cLegend Color legend, to give the drawn legend lines the same color on the map\n * @param legendWidth The width that the svg will take to draw the legend\n * @param legendHeight The height that the svg will take to draw the legend\n */\nexport function drawLineWidth(svgNode: SVGElement, lineWidths: Array<HistogramData>,\n  cLegend: Legend, legendWidth: number, legendHeight: number) {\n  const maxHeight = getMax(lineWidths);\n  const xDomain = scaleLinear().range([0, legendWidth]);\n  const xDomainExtent = [lineWidths[0].key, lineWidths[lineWidths.length - 1].key];\n  xDomain.domain(xDomainExtent);\n  const yDomain: ScaleLinear<number, number> = scaleLinear().range([maxHeight, 0]);\n  yDomain.domain([0, maxHeight]);\n  const svg = select(svgNode).attr('width', legendWidth).attr('height', legendHeight);\n  svg.selectAll('g').remove();\n  const context = svg.append('g').attr('class', 'context');\n  const ar = area<HistogramData>()\n    .curve(curveLinear)\n    .x(d => xDomain(d.key))\n    .y0(maxHeight)\n    .y1(d => yDomain(d.value));\n\n  const widthLineColor = getMiddleColor(cLegend);\n  context.append('path')\n    .datum(lineWidths)\n    .style('fill', widthLineColor)\n    .style('fill-opacity', 0.6)\n    .style('stroke', widthLineColor)\n    .style('stroke-opacity', 0.6)\n    .style('stroke-width', 0.5)\n    .attr('d', ar);\n}\n\nexport function getMiddleColor(colorLegend: Legend): string {\n  let color = '';\n  if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.fix) {\n    color = colorLegend.fixValue as string;\n  } else if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.interpolated) {\n    const iv = colorLegend.interpolatedValues as Array<string>;\n    if (iv.length === 1 || iv.length === 2) {\n      color = iv[0];\n    } else if (iv.length >= 3) {\n      color = iv[Math.trunc(iv.length / 2)];\n    }\n  } else if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.manual || colorLegend.type === PROPERTY_SELECTOR_SOURCE.generated\n    || colorLegend.type === PROPERTY_SELECTOR_SOURCE.provided) {\n    const iv = colorLegend.manualValues;\n    if (iv) {\n      if (iv.size === 1) {\n        color = iv.keys().next().value ?? '';\n      } else if (iv.size >= 2) {\n        const values = Array.from(iv.values());\n        color = values[Math.trunc(values.length / 2)].color as string;\n      }\n    }\n  }\n  return color;\n}\n\ninterface CircleDiameter {\n  key: number | Date;\n  value: number;\n}\n\n/**\n * draws the circle radius legend\n * @param svgNode SVG element on which we append the circles using d3.\n * @param circlesRadiuses List of {key, circleradius}\n * @param cLegend Color legend, to give the drawn legend circles the same color on the map\n * @param legendWidth The width that the svg will take to draw the legend\n * @param legendHeight The height that the svg will take to draw the legend\n */\nexport function drawCircleSupportLine(svgNode: SVGElement, circlesRadiuses: HistogramData[],\n  cLegend: Legend, legendWidth: number, legendHeight: number\n) {\n  const circleDiameters = new Array<CircleDiameter>();\n  circlesRadiuses.forEach(cr => circleDiameters.push({ key: cr.key, value: cr.value * 2 }));\n  const maxHeight = getMax(circleDiameters);\n  const firstRadius = circlesRadiuses[0].value;\n  const lastRadius = circlesRadiuses[circlesRadiuses.length - 1].value;\n  const xDomain = scaleLinear().range([0, legendWidth - firstRadius - lastRadius]);\n  const xDomainExtent = [circleDiameters[0].key, circleDiameters[circleDiameters.length - 1].key];\n  xDomain.domain(xDomainExtent);\n  const yDomain: ScaleLinear<number, number> = scaleLinear().range([maxHeight, 0]);\n  yDomain.domain([0, maxHeight]);\n\n  const svg = select(svgNode).attr('width', legendWidth).attr('height', legendHeight);\n  svg.selectAll('g').remove();\n  const context = svg.append('g').attr('class', 'context');\n  const l = line<CircleDiameter>()\n    .x(d => xDomain(d.key))\n    .y(d => yDomain(d.value));\n\n  context.append('path')\n    .datum(circleDiameters)\n    .attr('fill', 'none')\n    .attr('stroke', '#eaeaea')\n    .attr('stroke-width', 0.8)\n    .attr('transform', 'translate(' + firstRadius + ', 0)')\n    .attr('d', l);\n\n  context.append('g').append('line')\n    .attr('x1', 0).attr('y1', maxHeight)\n    .attr('x2', legendWidth - firstRadius - lastRadius).attr('y2', maxHeight)\n    .attr('cx', 2).attr('cy', 2).attr('fill', 'none')\n    .attr('stroke', '#eaeaea')\n    .attr('stroke-width', 0.8)\n    .attr('transform', 'translate(' + firstRadius + ', 0)');\n\n  const circles = [circlesRadiuses[0], circlesRadiuses[circlesRadiuses.length - 1]];\n  const circleColor = getMiddleColor(cLegend);\n  context.append('g')\n    .selectAll('dot').data(circles).enter().append('circle')\n    .attr('r', (d) => d.value)\n    .attr('cx', (d) => xDomain(d.key))\n    .attr('cy', (d) => maxHeight - d.value)\n    .attr('transform', 'translate(' + firstRadius + ', 0)')\n    .style('fill', circleColor)\n    .style('fill-opacity', 0.6)\n    .style('stroke', circleColor)\n    .style('stroke-width', 0.5);\n\n}\n","\n<div class=\"layer_wrapper\">\n    @let c = collection();\n    <div class=collection_color [matTooltip]=\"'Collection:' | translate: {collection: (c | getCollectionDisplayName)}\"\n      [style.backgroundColor]=\"c ? (c | getColor) : 'transparent'\"></div>\n    <div class=\"layer_container\" >\n      <div class=\"layer_icon_container\">\n        <div class=\"layer_icon\" >\n          <arlas-layer-icon [layer]=\"layer()\" [colorLegend]=\"colorLegend()\" [strokeColorLegend]=\"strokeColorLegend()\"\n            [lineDasharray]=\"lineDasharray\" [widthLegend]=\"widthLegend()\" [radiusLegend]=\"radiusLegend()\"></arlas-layer-icon>\n        </div>\n        <div class=\"layer_name\"\n             [class.layer-name--visible]=\"visibleMode\"\n             [class.layer-name--invisible]=\"!visibleMode\">\n          {{layer().id | layerIdToName | translate}}\n        </div>\n      </div>\n      <div class=\"layer_detail\">\n        <div class=\"download_button\">\n          <mat-icon class=\"download_icon\" [matMenuTriggerFor]=\"menu\" [matTooltip]=\"'Download the layer\\'s data' | translate\">file_download</mat-icon>\n          <mat-menu #menu=\"matMenu\">\n            <button mat-menu-item (click)=\"downloadLayerSource(layer(), 'csv')\">\n              {{'CSV' | translate}}\n            </button>\n            <button mat-menu-item (click)=\"downloadLayerSource(layer(), 'geojson')\">\n              {{'GeoJson' | translate}}\n            </button>\n          </mat-menu>\n        </div>\n\n        @if (displayLegendDetailToggle()) {\n          <div class=\"detail_button\" (click)=\"showDetail($event)\" (keyDown)=\"showDetail($event)\">\n            <mat-icon class=\"detail_icon\">{{ detail ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</mat-icon>\n          </div>\n        }\n      </div>\n    </div>\n\n    <div [hidden]=\"!detail\" class=\"legend-wrapper\">\n      <arlas-legend-item [hidden]=\"!hasColorLegend()\" [legend]=\"colorLegend()\" [layer]=\"layer()\"\n        [title]=\"'Fill:' | marker\" [colorPalette]=\"colorPalette\" [highlightLegend]=\"highlightLegend\"></arlas-legend-item>\n\n      <arlas-legend-item [hidden]=\"!hasStrokeLegend()\" [legend]=\"strokeColorLegend()\" [layer]=\"layer()\"\n        [title]=\"'Stroke:' | marker\" [colorPalette]=\"strokeColorPalette\" [highlightLegend]=\"highlightLegend\"></arlas-legend-item>\n\n      <arlas-legend-item [hidden]=\"!hasWidthLegend()\" #width_legend [legend]=\"widthLegend()\" [layer]=\"layer()\"\n        [title]=\"'Width:' | marker\" [highlightLegend]=\"highlightLegend\"></arlas-legend-item>\n\n      <arlas-legend-item [hidden]=\"!hasRadiusLegend()\" #radius_legend [legend]=\"radiusLegend()\" [layer]=\"layer()\"\n        [title]=\"'Radius:' | marker\" [highlightLegend]=\"highlightLegend\"></arlas-legend-item>\n    </div>\n  </div>\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { CdkDrag, CdkDragDrop, CdkDragHandle, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';\nimport {\n  AfterViewInit, Component, DestroyRef, EventEmitter, inject, input, Input,\n  OnChanges, OnDestroy,\n  Output, signal, SimpleChanges, ViewChild, ViewEncapsulation\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatIcon } from '@angular/material/icon';\nimport { MatSlideToggle } from '@angular/material/slide-toggle';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { ElementIdentifier, GetValuePipe } from 'arlas-web-components';\nimport { Feature, FeatureCollection } from 'geojson';\nimport { filter, finalize, fromEvent, Observable, Subject } from 'rxjs';\nimport { ArlasMapFrameworkService } from './arlas-map-framework.service';\nimport * as mapJsonSchema from './arlas-map.schema.json';\nimport { AbstractArlasMapService } from './arlas-map.service';\nimport { BasemapComponent } from './basemaps/basemap.component';\nimport { BasemapStyle } from './basemaps/basemap.config';\nimport { BasemapService } from './basemaps/basemap.service';\nimport { ArlasBasemaps } from './basemaps/basemaps.model';\nimport { CoordinatesComponent } from './coordinates/coordinates.component';\nimport { ArlasDrawComponent } from './draw/arlas-draw.component';\nimport { AoiEdition } from './draw/draw.models';\nimport { MapboxAoiDrawService } from './draw/draw.service';\nimport { DrawTheme } from './draw/themes/default-theme';\nimport { LegendComponent } from './legend/legend.component';\nimport { LegendData } from './legend/legend.config';\nimport { LegendService } from './legend/legend.service';\nimport {\n  AbstractArlasMapGL, ArlasMapOffset, ArlasMapOption, CROSS_LAYER_PREFIX,\n  DISABLE_GLOBE, ENABLE_GLOBE, MapConfig, RESET_BEARING, ZOOM_IN, ZOOM_OUT\n} from './map/AbstractArlasMapGL';\nimport { ControlPosition, IconConfig } from './map/model/controls';\nimport { InteractedFeatures, MapLayerMouseEvent, MapMouseEvent } from './map/model/events';\nimport { MapExtent } from './map/model/extent';\nimport { ARLAS_VSET, ArlasDataLayer, getLayerName, MapLayers } from './map/model/layers';\nimport { ArlasLngLat, ArlasLngLatBounds, OnMoveResult } from './map/model/map';\nimport { ArlasMapSource } from './map/model/sources';\nimport { TerrainConfiguration } from './map/model/terrain';\nimport { VisualisationSetConfig } from './map/model/visualisationsets';\n\nexport interface LayerDownloadEvent {\n  layerId: string;\n  layerName: string;\n  collection: string;\n  sourceName: string;\n  downloadType: string;\n}\n\n@Component({\n  selector: 'arlas-map',\n  templateUrl: './arlas-map.component.html',\n  styleUrls: ['./arlas-map.component.scss'],\n  encapsulation: ViewEncapsulation.None,\n  imports: [\n    MatTooltip, MatIcon, CdkDropList, CdkDrag, CdkDragHandle, MatSlideToggle, LegendComponent,\n    CoordinatesComponent, BasemapComponent, ArlasDrawComponent, TranslatePipe, GetValuePipe]\n})\n/** L: a layer class/interface.\n *  S: a source class/interface.\n *  M: a Map configuration class/interface.\n */\nexport class ArlasMapComponent<L, S, M> implements AfterViewInit, OnChanges, OnDestroy {\n\n  /** Map instance. */\n  public map = signal<AbstractArlasMapGL | null>(null);\n  /** Whether the legend is visible (open) */\n  public legendOpen = false;\n  /** Used to clear geojson sources. */\n  public emptyData: FeatureCollection<GeoJSON.Geometry> = {\n    'type': 'FeatureCollection',\n    'features': []\n  };\n\n  /** Whether the list of basemaps is shown. */\n  public showBasemapList = false;\n\n  /** Visibility status of each visualisation set*. */\n  public visibilityStatus = new Map<string, boolean>();\n\n  /** Stores the currently hovered features indexed by layer ID. */\n  public hoveredFeaturesByLayer = new Map<string, any>();\n\n  @ViewChild('drawComponent', { static: false }) public drawComponent?: ArlasDrawComponent<ArlasDataLayer, S, M>;\n\n\n  /** ANGULAR INPUTS */\n\n  /** @description Html identifier given to the map container (it's a div ;))*/\n  @Input() public id = 'mapgl';\n  /** @description An object with north,east,south,west properies which represent an offset in pixels */\n  /** Origin is top-left and x-axis is west to east and y-axis north to south.*/\n  @Input() public offset: ArlasMapOffset = { north: 0, east: 0, south: 0, west: 0 };\n\n  /** --- LAYERS */\n\n  /** @description List of configured (by the builder) layers. */\n  public mapLayers = input.required<MapLayers<ArlasDataLayer>>();\n\n  /** --- SCALE & COORDINATES */\n\n  /** @description Whether the map scale is displayed. */\n  @Input() public displayScale = true;\n  /** @description Maximim width in pixels that the map scale could take. */\n  @Input() public maxWidthScale = 100;\n  /** @description Unit display for the map scale. */\n  @Input() public unitScale = 'metric';\n  /** @description Whether to display the coordinates of the mouse while moving. */\n  public displayCurrentCoordinates = input(false);\n  /** @description If true, the coordinates values are wrapped between -180 and 180. */\n  @Input() public wrapLatLng = true;\n\n  /** --- BASEMAPS */\n\n  /** @description Default basemap to display. */\n  @Input() public defaultBasemapStyle?: BasemapStyle;\n  /** @description List of available basemaps. */\n  @Input() public basemapStyles = new Array<BasemapStyle>();\n\n  /** --- INITIAL MAP VIEW : ZOOMs, CENTER, BOUNDS */\n\n  /** @description Zoom of the map when it's initialized. */\n  @Input() public initZoom = 2;\n  /** @description Max zoom of the map. */\n  @Input() public maxZoom = 22;\n  /** @description Min zoom of the map. */\n  @Input() public minZoom = 0;\n  /** @description Coordinates of the map's center when it's first loaded. */\n  @Input() public initCenter: [number, number] = [2.1972656250000004, 45.706179285330855];\n  /** @description Maximum pitch of the map */\n  @Input() public maxPitch = 60;\n\n  /** --- BOUNDS TO FIT STRATEGY */\n\n  /** @description Bounds that the view map fits. It's an array of two corners. */\n  /** Each corner is an lat-long position. For example: boundsToFit = [[30.51, -54.3],[30.57, -54.2]] */\n  @Input() public boundsToFit: Array<Array<number>> = [];\n  /** @description The padding added in the top-left and bottom-right corners of a map container that shouldn't be accounted */\n  /** for when setting the view to fit bounds.*/\n  @Input() public fitBoundsOffSet: [number, number] = [0, 0];\n  /**  @description Padding value applied around a fitBounds to fully show the area targeted. */\n  @Input() public fitBoundsPadding = 10;\n  /** @description The maximum zoom level so that the bounds fit the map view. */\n  @Input() public fitBoundsMaxZoom = 22;\n\n  /** --- DATA LOADING STRATEGIES */\n\n  /** @description Margin applied to the map extent. Data will be fetched in all this extent. */\n  @Input() public margePanForLoad = 5;\n  /**\n   * @description Margin applied to the map extent. Before loading data,\n   * the components checks first if there are features already loaded in this extent.\n   */\n  @Input() public margePanForTest = 5;\n  /** @description A callback run before the Map makes a request for an external URL/ */\n  @Input() public transformRequest: unknown /** TransformRequestFunction or RequestTransformRequest */;\n\n  /** --- MAP INTERACTION */\n  /** @description List of features to select. */\n  @Input() public featuresToSelect: Array<ElementIdentifier> = [];\n\n  /** --- SOURCES */\n\n  /** @description List of sources to add to the map. */\n  @Input() public mapSources: Array<ArlasMapSource<S>> = [];\n  /** @description Subject to which the component subscribes to redraw on the map the `data` of the given `source`. */\n  @Input() public redrawSource = new Observable<{ source: string; data: Feature<GeoJSON.Geometry>[]; }>();\n  /** @description List of data sources names that should be added to the map. Sources should be of type `geojson`. */\n  @Input() public dataSources = new Set<string>();\n\n  /** --- DRAW */\n\n  /**  @description Options object for draw tools : https://github.com/mapbox/mapbox-gl-draw/blob/master/docs/API.md#options */\n  @Input() public drawOption: any = {};\n  /** @description Features drawn at component start */\n  @Input() public drawData: FeatureCollection<GeoJSON.Geometry> = ({ ...this.emptyData });\n  /** @description Whether the draw tools are activated. */\n  @Input() public drawButtonEnabled = false;\n  /** @description Maximum number of vertices allowed for a polygon. */\n  @Input() public drawPolygonVerticesLimit?: number;\n  /** @description Whether the drawing buffer is activated */\n  /** If true, the map's canvas can be exported to a PNG using map.getCanvas().toDataURL(). Default: false */\n  @Input() public preserveDrawingBuffer = false;\n  /** @description Theme for the drawn polygons */\n  public drawTheme = input<DrawTheme>({});\n\n  /** --- ATTRIBUTION */\n\n  /** @description Position of the map attribution. */\n  @Input() public mapAttributionPosition: ControlPosition = 'bottom-right';\n\n  /** --- MAP ICONS */\n\n  /** @description List of icons to add to the map and that can be used in layers. */\n  @Input() public icons = new Array<IconConfig>();\n\n  /** --- LEGEND AND VISUALISATIONS */\n\n  /** @description Subject of [collection, [field, legendData]] map. The map subscribes to it to keep */\n  /** the legend updated with the data displayed on the map. */\n  @Input() public legendUpdater: Subject<Map<string, Map<string, LegendData>>> = new Subject();\n  /** @description Subject of [layerId, boolean] map. The map subscribes to it to keep */\n  /** the legend updated with the visibility of the layer.*/\n  @Input() public visibilityUpdater = new Observable<Map<string, boolean>>();\n  /** @description List of visualisation sets. A Visualisation set is an entity where layers are grouped together. */\n  /** 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. */\n  @Input() public visualisationSetsConfig = new Array<VisualisationSetConfig>();\n\n  /** --- GLOBE */\n  /** @description Whether to allow to switch to globe mode */\n  @Input() public enableGlobe = false;\n\n  /** --- LEGEND HIGHLIGHTS */\n  /** @description Whether to highlight the keywords or color of hovered features */\n  @Input() public highlightLegend = true;\n\n  /** --- Terrain */\n  /** @description Configuration for the display of the terrain */\n  public terrain = input<TerrainConfiguration<S>>({ enable: false });\n  /** @description Whether the map currently has a terrain */\n  public readonly hasTerrain = signal(false);\n  /** @description Sources added to the map for the terrain */\n  private terrainSources = new Array<string>();\n\n  /** ANGULAR OUTPUTS */\n\n  /** @description Emits true after the map is loaded and all sources & layers are added. */\n  @Output() public onMapLoaded: Subject<boolean> = new Subject<boolean>();\n\n  /** @description Emits the map extent when the browser tab is closed/refreshed. */\n  @Output() public onMapClosed: EventEmitter<MapExtent> = new EventEmitter<MapExtent>();\n\n  /**\n   * @deprecated\n   * @description  Emits the event of moving the map. */\n  @Output() public onMove: EventEmitter<OnMoveResult> = new EventEmitter<OnMoveResult>();\n\n  /** @description Emits the visible visualisation sets' names */\n  @Output() public visualisations: EventEmitter<Set<string>> = new EventEmitter();\n\n  /** @description Emits the features that were clicked on. */\n  @Output() public onFeatureClick = new EventEmitter<InteractedFeatures | undefined>();\n\n  /** @description Emits the features that were hovered. */\n  @Output() public onFeatureHover = new EventEmitter<InteractedFeatures | undefined>();\n\n  /** @description Emits the geojson of all aois added to the map. */\n  @Output() public onAoiChanged: EventEmitter<FeatureCollection<GeoJSON.Geometry>> = new EventEmitter();\n\n  /** @description Emits the the dimensions of the polygon/bbox that is being drawn. */\n  @Output() public onAoiEdit: EventEmitter<AoiEdition> = new EventEmitter();\n\n  /** @description Emits an event when the basemap has been changed by the user. */\n  @Output() public onBasemapChanged: Subject<boolean> = new Subject();\n\n  /** @description Emits which layers are displayed on the map. */\n  @Output() public legendVisibiltyStatus: Subject<Map<string, boolean>> = new Subject();\n\n  /** @description  Notifies that the user wants to download the selected layer */\n  @Output() public downloadSourceEmitter: Subject<LayerDownloadEvent> = new Subject();\n\n  protected ICONS_BASE_PATH = 'assets/icons/';\n\n  private readonly mapFrameworkService = inject(ArlasMapFrameworkService<L, S, M>);\n  private readonly destroyRef = inject(DestroyRef);\n\n  public constructor(\n    private readonly drawService: MapboxAoiDrawService,\n    private readonly basemapService: BasemapService<L, S, M>,\n    private readonly translate: TranslateService,\n    protected readonly mapService: AbstractArlasMapService<L, S, M>,\n    private readonly legendService: LegendService\n  ) {\n    this.basemapService.protomapBasemapAdded$.pipe(takeUntilDestroyed())\n      .subscribe(() => this.reorderLayers());\n  }\n\n  public ngAfterViewInit() {\n    /** init values */\n    if (!this.initCenter) {\n      this.initCenter = [0, 0];\n    }\n    this.initZoom ??= 3;\n    this.maxZoom ??= 23;\n    this.minZoom = this.minZoom ?? 0;\n\n    /** BASEMAPS */\n    if (this.defaultBasemapStyle && typeof this.defaultBasemapStyle.styleFile === 'string') {\n      this.defaultBasemapStyle.url = this.defaultBasemapStyle.styleFile;\n    }\n    this.basemapStyles.forEach(bm => {\n      if (typeof bm.styleFile === 'string') {\n        bm.url = (bm.styleFile);\n      }\n    });\n    this.basemapService.setBasemaps(new ArlasBasemaps(this.defaultBasemapStyle, this.basemapStyles));\n    this.basemapService.fetchSources$()\n      .pipe(finalize(() => this.declareMap()), takeUntilDestroyed(this.destroyRef))\n      .subscribe();\n\n    // For protomap basemaps, terrain has to be redeclared after basemap switch\n    this.basemapService.basemapChanged$\n      .pipe(\n        takeUntilDestroyed(this.destroyRef),\n        filter(b => b.type === 'protomap' && this.hasTerrain() && !!this.map)\n      )\n      .subscribe(() => {\n        // Toggle it once to remove the terrain, and another time to add it back\n        this.toggleTerrain();\n        this.toggleTerrain();\n      });\n  }\n\n  public ngOnChanges(changes: SimpleChanges): void {\n    const map = this.map();\n    if (map?.getMapProvider() !== undefined) {\n      if (changes['boundsToFit'] !== undefined) {\n        const newBoundsToFit = changes['boundsToFit'].currentValue;\n        map.fitBounds(newBoundsToFit, {\n          maxZoom: this.fitBoundsMaxZoom,\n          offset: this.fitBoundsOffSet\n        });\n      }\n      if (changes['featuresToSelect'] !== undefined\n        && changes['featuresToSelect'].currentValue !== changes['featuresToSelect'].previousValue) {\n        const featuresToSelect = changes['featuresToSelect'].currentValue;\n        this.selectFeatures(featuresToSelect);\n      }\n    }\n  }\n\n  /**\n   * Tries to get the initialised map. If not ready yet, throws an error\n   */\n  private getMap() {\n    const map = this.map();\n    if (!map) {\n      throw new Error('The map is not initialised yet');\n    }\n    return map;\n  }\n\n  /** If transformRequest' @Input was not set, set a default value : a function that maintains the same url */\n  public initTransformRequest() {\n    if (!this.transformRequest) {\n      this.transformRequest = this.mapFrameworkService.getInitTransformRequest();\n    }\n  }\n\n  /** Zooms on clicked feature from map mouse event e.\n   * @param mouseEvent Map mouse event provided by the map instance.\n   */\n  public zoomOnClick(mouseEvent: MapMouseEvent) {\n    const map = this.getMap();\n\n    const zoom = map.getZoom();\n    let newZoom: number;\n    if (zoom >= 0 && zoom < 3) {\n      newZoom = 4;\n    } else if (zoom >= 3 && zoom < 5) {\n      newZoom = 5;\n    } else if (zoom >= 5 && zoom < 7) {\n      newZoom = 7;\n    } else if (zoom >= 7 && zoom < 10) {\n      newZoom = 10;\n    } else if (zoom >= 10 && zoom < 11) {\n      newZoom = 11;\n    } else {\n      newZoom = 12;\n    }\n    this.mapFrameworkService.flyTo(mouseEvent.lngLat.lat, mouseEvent.lngLat.lng, newZoom, map);\n  }\n\n  /**\n   * Queries all rendered features on the position that was clicked on, on a layer; and emits those features.\n   * @param mapLayerMouseEvent Map mouse event provided by a layer instance.\n   */\n  protected queryRender(mapLayerMouseEvent: MapLayerMouseEvent) {\n    const hasCrossOrDrawLayer = this.mapFrameworkService.queryFeatures(mapLayerMouseEvent, this.getMap(), CROSS_LAYER_PREFIX);\n    if (!this.drawService.isDrawingBbox && !this.drawService.isDrawingPolygon\n      && !this.drawService.isDrawingCircle && !this.drawService.isInSimpleDrawMode && hasCrossOrDrawLayer.length === 0) {\n      this.onFeatureClick.next({ features: mapLayerMouseEvent.features, point: [mapLayerMouseEvent.lngLat.lng, mapLayerMouseEvent.lngLat.lat] });\n    }\n  }\n\n  /** @description Adds the custom icons given in the component's input */\n  public addIcons() {\n    if (this.icons) {\n      this.icons.forEach(icon => {\n        const iconName = icon.path.split('.')[0];\n        const iconPath = this.ICONS_BASE_PATH + icon.path;\n        const iconErrorMessage = 'The icon \"' + this.ICONS_BASE_PATH + icon.path + '\" is not found';\n        this.mapFrameworkService.addImage(iconName, iconPath, this.getMap(), iconErrorMessage, { 'sdf': icon.recolorable });\n      });\n    }\n\n    this.mapFrameworkService.addImage('rotate', this.ICONS_BASE_PATH + 'rotate/01.png', this.getMap(), 'Rotate not found');\n    this.mapFrameworkService.addImage('resize', this.ICONS_BASE_PATH + 'resize/01.png', this.getMap(), 'Resize not found');\n  }\n\n  /**\n   * @description Creates the map instance and adds the basemap, arlas data\n   * and starts listening to arlas data changes and layers visibility updates.\n   * It also starts emiting map moveend event.\n   */\n  public declareMap() {\n    const basemaps = this.basemapService.basemaps;\n    if (!basemaps) {\n      throw new Error('No basemaps defined');\n    }\n\n    this.initTransformRequest();\n    const arlasMapOption: ArlasMapOption = {\n      container: this.id,\n      style: this.basemapService.getInitStyle(basemaps.getSelected()),\n      center: this.initCenter,\n      zoom: this.initZoom,\n      maxZoom: this.maxZoom,\n      minZoom: this.minZoom,\n      renderWorldCopies: true,\n      preserveDrawingBuffer: this.preserveDrawingBuffer,\n      locale: {\n        'NavigationControl.ZoomIn': this.translate.instant(ZOOM_IN),\n        'NavigationControl.ZoomOut': this.translate.instant(ZOOM_OUT),\n        'NavigationControl.ResetBearing': this.translate.instant(RESET_BEARING),\n        'GlobeControl.Enable': this.translate.instant(ENABLE_GLOBE),\n        'GlobeControl.Disable': this.translate.instant(DISABLE_GLOBE)\n      },\n      pitchWithRotate: true,\n      transformRequest: this.transformRequest,\n      attributionControl: false,\n      maxPitch: this.maxPitch\n    };\n    const mapProviderOptions = this.mapFrameworkService.buildMapProviderOption(arlasMapOption);\n    const config: MapConfig<M> = {\n      displayCurrentCoordinates: this.displayCurrentCoordinates(),\n      fitBoundsPadding: this.fitBoundsPadding,\n      margePanForLoad: this.margePanForLoad,\n      margePanForTest: this.margePanForTest,\n      offset: this.offset,\n      wrapLatLng: this.wrapLatLng,\n      maxWidthScale: this.maxWidthScale,\n      unitScale: this.unitScale,\n      mapProviderOptions,\n      controls: {\n        mapAttribution: {\n          enable: true,\n          position: this.mapAttributionPosition,\n          config: {\n            compact: false\n          }\n        },\n        scale: {\n          enable: this.displayScale\n        },\n        navigationControl: {\n          enable: true,\n          config: {\n            showCompass: true,\n            showZoom: true,\n            visualizePitch: true\n          }\n        },\n        globe: {\n          enable: this.enableGlobe === true\n        }\n      }\n    };\n    this.map.set(this.mapFrameworkService.createMap(config));\n    fromEvent(globalThis, 'beforeunload').subscribe(() => {\n      this.onMapClosed.next(this.getMap().getMapExtend());\n    });\n\n    this.getMap().onCustomEvent('beforeOnLoadInit', () => {\n      const map = this.getMap();\n      this.basemapService.declareProtomapProtocol(map);\n      this.basemapService.addProtomapBasemap(map);\n      this.addIcons();\n      this.mapService.declareArlasDataSources(this.dataSources, this.emptyData, map);\n      this.mapService.declareBasemapSources(this.mapSources, map);\n      this.mapService.addArlasDataLayers(this.visualisationSetsConfig, this.mapLayers(), map);\n      this.listenToLayersEvents();\n    });\n\n    this.mapFrameworkService.onMapEvent('load', this.getMap(), () => {\n      if (this.mapLayers !== null) {\n        this.visibilityUpdater.subscribe(visibilityStatus => {\n          this.mapService.updateVisibility(visibilityStatus, this.visualisationSetsConfig, this.getMap());\n        });\n      }\n      this.onMapLoaded.next(true);\n    });\n\n    this.getMap().onMoveEnd(this.mapService.visualisationsSets).subscribe((moveResult => {\n      this.onMove.next(moveResult);\n    }));\n\n    if (this.redrawSource) {\n      this.redrawSource.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(sd => {\n        this.mapFrameworkService.setDataToGeojsonSource(this.mapFrameworkService.getSource(sd.source, this.map()), {\n          'type': 'FeatureCollection',\n          'features': sd.data\n        });\n      });\n    }\n  }\n\n  /**\n   * @description Listens to events on mapLayers input (configured layers).\n   */\n  public listenToLayersEvents() {\n    /** Zooms on the clicked feature of the given layers. */\n    this.mapLayers().events.zoomOnClick.forEach(layerId => {\n      this.mapFrameworkService.onLayerEvent('click', this.getMap(), layerId, (e) => this.zoomOnClick(e));\n    });\n\n    this.hoveredFeaturesByLayer = new Map();\n    this.mapLayers().events.onHover.forEach(layerId => {\n      this.mapFrameworkService.onLayerEvent('mousemove', this.getMap(), layerId, (e) => {\n        this.hoveredFeaturesByLayer.set(layerId, e.features ?? []);\n        this.emitAggregatedHover(e.lngLat);\n      });\n\n      this.mapFrameworkService.onLayerEvent('mouseleave', this.getMap(), layerId, (e) => {\n        this.hoveredFeaturesByLayer.delete(layerId);\n        this.emitAggregatedHover();\n      });\n    });\n    /** Emits the clicked on feature. */\n    this.mapLayers().events.emitOnClick.forEach(layerId => {\n      this.mapFrameworkService.onLayerEvent('click', this.getMap(), layerId, (e) =>\n        this.queryRender(e));\n    });\n    const drawPolygonLayers = [\n      'gl-draw-polygon-stroke-inactive',\n      'gl-draw-polygon-stroke-active',\n      'gl-draw-polygon-stroke-static'\n    ].map(layer => ['.cold', '.hot']\n      .map(id => layer.concat(id)))\n      .reduce((p, ac) => ac.concat(p), []);\n    /** Sets mouse cursor on drawn features */\n    drawPolygonLayers.forEach(layerId => {\n      this.mapFrameworkService.onLayerEvent('mousemove', this.getMap(), layerId, (e) =>\n        this.mapFrameworkService.setMapCursor(this.getMap(), 'pointer'));\n      this.mapFrameworkService.onLayerEvent('mouseleave', this.getMap(), layerId, (e) => {\n        if (this.drawService.isDrawing()) {\n          this.mapFrameworkService.setMapCursor(this.getMap(), 'crosshair');\n        } else {\n          this.mapFrameworkService.setMapCursor(this.getMap(), '');\n        }\n      });\n    });\n\n    // For each layer other than select and hover layers, listen to the events of enter and exit of the mouse\n    this.mapLayers().layers.filter(l => !l.id.startsWith('arlas-select') && !l.id.startsWith('arlas-hover')).forEach(layer => {\n      /** Emits the hovered feature on mousemove. */\n      this.mapFrameworkService.onLayerEvent('mousemove', this.getMap(), layer.id, (e) => {\n        if (this.highlightLegend) {\n          this.legendService.highlightFeatures(layer.id, e.features);\n        }\n      });\n      /** Emits an empty object on mouse leaving a feature. */\n      this.mapFrameworkService.onLayerEvent('mouseleave', this.getMap(), layer.id, (e) => {\n        if (this.highlightLegend) {\n          this.legendService.highlightFeatures(layer.id, []);\n        }\n      });\n    });\n  }\n\n  /**\n   * Aggregates hovered features from all layers and emits a single event.\n   * Emits an empty object if no features are currently hovered.\n   *\n   * @param lngLat - The current cursor position. Optional since mouseleave does not always provide it.\n   */\n  private emitAggregatedHover(lngLat?: ArlasLngLat) {\n    const allFeatures = [...this.hoveredFeaturesByLayer.values()].flat();\n    if (allFeatures.length === 0 || !lngLat) {\n      this.onFeatureHover.next(undefined);\n      return;\n    }\n\n    this.onFeatureHover.next({\n      features: allFeatures,\n      point: [lngLat.lng, lngLat.lat],\n    });\n  }\n\n  /** Sets the layers order according to the current order of `visualisationSetsConfig` list*/\n  public reorderLayers() {\n    this.mapService.reorderLayers(this.visualisationSetsConfig, this.getMap());\n  }\n\n  /** @description Display the basemapswitcher */\n  public showBasemapSwitcher() {\n    this.showBasemapList = true;\n  }\n\n  /** @description Emits event notifiying that the basemap has been changed */\n  public onChangeBasemapStyle() {\n    this.onBasemapChanged.next(true);\n  }\n\n  /**\n   * Updates the visibility status of the layer and emits that update.\n   * @param visualisation visualisation set name\n   * @param l layer id\n   * @param visible whether the layer is enabled and visible in the visualisation set\n   */\n  public emitLegendVisibility(visualisation: string, l: string, visible: boolean): void {\n    // Copy the map so the pipe updates the values\n    this.visibilityStatus = new Map(this.visibilityStatus);\n    this.visibilityStatus.set(visualisation + ARLAS_VSET + l, visible);\n    this.legendVisibiltyStatus.next(this.visibilityStatus);\n  }\n\n  /**\n   * @description Emits the visible visualisation set\n   * @param visualisationName Name of the visualisation.\n   */\n  public emitVisualisations(visualisationName: string) {\n    const layers = this.mapService.updateLayoutVisibility(visualisationName, this.visualisationSetsConfig, this.getMap());\n    this.visualisations.emit(layers);\n    this.reorderLayers();\n  }\n\n  public downloadLayerSource(downaload: { layer: ArlasDataLayer; downloadType: string; }): void {\n    const downloadedSource = {\n      layerId: downaload.layer.id,\n      layerName: getLayerName(downaload.layer.id),\n      collection: downaload.layer.metadata?.collection as string,\n      sourceName: downaload.layer.source,\n      downloadType: downaload.downloadType\n    };\n    this.downloadSourceEmitter.next(downloadedSource);\n  }\n\n  /** puts the visualisation set list in the new order after dropping */\n  public drop(event: CdkDragDrop<string[]>) {\n    moveItemInArray(this.visualisationSetsConfig, event.previousIndex, event.currentIndex);\n    this.reorderLayers();\n  }\n\n  /** puts the layers list in the new order after dropping */\n  public dropLayer(event: CdkDragDrop<string[]>, visuName: string) {\n    const layers = Array.from(this.mapService.findVisualisationSetLayer(visuName, this.visualisationSetsConfig) ?? []);\n    moveItemInArray(layers, event.previousIndex, event.currentIndex);\n    this.mapService.setVisualisationSetLayers(visuName, layers, this.visualisationSetsConfig);\n    this.reorderLayers();\n  }\n  public hideBasemapSwitcher() {\n    this.showBasemapList = false;\n  }\n  /**\n   * Fit to given bounds. Options are for padding.\n   * @param bounds Bounds of the map to fit to.\n   */\n  public fitToPaddedBounds(bounds: ArlasLngLatBounds) {\n    this.getMap().fitToPaddedBounds(bounds);\n  }\n  /**\n   * Centers the map to the given latitude/longitude coordinates.\n   * @param lngLat Latitude/longitude coordinates.\n   */\n  public moveToCoordinates(lngLat: [number, number]) {\n    this.getMap().setCenter(lngLat);\n  }\n\n  /** Selects, in all data sources,the feature(s) having the given elementIdentifier */\n  private selectFeatures(elementToSelect: Array<ElementIdentifier>) {\n    this.mapService.selectFeatures(this.mapLayers(), this.getMap(), elementToSelect);\n  }\n  /** Selects, in all data sources, all the features having the given elementIdentifiers and under the given collection.\n   * @param features list of features identifiers.\n   * @param collection data collection (metadata of the data source).\n  */\n  public selectFeaturesByCollection(features: Array<ElementIdentifier>, collection: string) {\n    this.mapService.selectFeaturesByCollection(this.mapLayers(), this.getMap(), features, collection);\n  }\n\n  public static getMapJsonSchema(): Object {\n    return mapJsonSchema;\n  }\n  /** Destroys all the components subscriptions. */\n  public ngOnDestroy(): void {\n    const map = this.map();\n    if (map) {\n      map.unsubscribeEvents();\n    }\n  }\n\n  /** @description Enables bbox drawing mode.*/\n  public addGeoBox() {\n    this.drawComponent?.addGeoBox();\n  }\n\n  /**\n   * @description Removes all the aois if none of them is selected. Otherwise it removes the selected one only\n   */\n  public removeAois() {\n    this.drawComponent?.removeAois();\n  }\n\n  /** @description Deletes the selected drawn geometry. If no drawn geometry is selected, all geometries are deteleted */\n  public deleteSelectedItem() {\n    this.drawComponent?.deleteSelectedItem();\n  }\n\n\n  /**\n   * @description Switches to a drawing mode of a DRAW_POLYGON, DRAW_CIRCLE or DRAW_RADIUS_CIRCLE.\n   * @param mode Draw mode (DRAW_POLYGON, DRAW_CIRCLE or DRAW_RADIUS_CIRCLE). Default to DRAW_POLYGON\n   * @param option Mapboxdraw option.\n   */\n  public switchToDrawMode(mode?: string, option?: any) {\n    this.drawComponent?.switchToDrawMode(mode, option);\n  }\n\n  /**\n   * @description Switches to direct_select mode.\n   * @param option Mapboxdraw option.\n   */\n  public switchToDirectSelectMode(option?: { featureIds: Array<string>; allowCircleResize: boolean; }\n    | { featureId: string; allowCircleResize: boolean; }) {\n    this.drawComponent?.switchToDirectSelectMode(option);\n  }\n\n  /**\n   * @description Switches to simple_select mode.\n   * @param option Mapboxdraw option.\n   */\n  public switchToEditMode() {\n    this.drawComponent?.switchToEditMode();\n  }\n\n  /**\n   * @description Returns all the drawn polygons as wkt or geojson.\n   * @param mode 'wkt' | 'geojson'\n   * @returns Wkt string or Geojson object.\n   */\n  public getAllPolygon(mode: 'wkt' | 'geojson') {\n    return this.drawComponent?.getAllPolygon(mode);\n  }\n\n  /**\n   * @description returns the selected polygon geometry in WKT or GeoJson given the mode\n   * @param mode : 'wkt' | 'geojson'\n   * @returns Wkt string or Geojson object.\n   */\n  public getSelectedPolygon(mode: 'wkt' | 'geojson') {\n    return this.drawComponent?.getSelectedPolygon(mode);\n  }\n\n  /**\n   * @description Displays/Removes the terrain from the map\n   */\n  public toggleTerrain() {\n    const map = this.getMap();\n    if (this.terrain().enable && map) {\n      if (!this.hasTerrain()) {\n        this.terrainSources = this.mapFrameworkService.setTerrain(\n          this.terrain().source, map, this.terrain().exaggeration);\n      } else {\n        this.mapFrameworkService.removeTerrain(map);\n        for (const source of this.terrainSources) {\n          this.mapFrameworkService.removeLayer(map, source);\n          this.mapFrameworkService.removeSource(map, source);\n        }\n      }\n\n      this.hasTerrain.set(!this.hasTerrain());\n    }\n  }\n}\n","@let mapInstance = map();\n\n<div id=\"{{id}}\" class=\"map__container\">\n  @if (visualisationSetsConfig.length > 0) {\n    <div class=\"map__visu-list\">\n      <div class=\"map__legend-wrapper\">\n        <div class=\"map__legend-button\" [matTooltipPosition]=\"'left'\" matTooltip=\"{{'Manage layers' | translate}}\">\n          <mat-icon (click)=\"legendOpen=!legendOpen\" (keyDown)=\"legendOpen=!legendOpen\">layers</mat-icon>\n        </div>\n      </div>\n      @if (mapInstance) {\n      <div [hidden]=\"!legendOpen\" class=\"map__visu-list--container\" cdkDropList\n        (cdkDropListDropped)=\"drop($event)\">\n        @for (visu of visualisationSetsConfig; track visu) {\n          <div cdkDrag class=\"map__visu-item\">\n            <div cdkDragHandle class=\"map__visu-title\">\n              <span class=\"map__visu-title-text\" [class.map__visu-title-text--disabled]=\"!visu.enabled\">\n              {{visu.name | translate}}</span>\n              <mat-slide-toggle [checked]=\"visu.enabled\" (change)=\"emitVisualisations(visu.name)\"\n              [matTooltip]=\"'show_layers' | translate\" [hideIcon]=\"true\"></mat-slide-toggle>\n            </div>\n            <div class=\"map__visu-content\" cdkDropList (cdkDropListDropped)=\"dropLayer($event, visu.name)\">\n              @for (l of visu.layers; track l) {\n                @if (l | getValue: mapService.layersMap; as layer) {\n                  <div cdkDrag class=\"map__visu-layer\"\n                    [class.cdk-visually-hidden]=\"((visu.name + ':arlas_vset:' + l) | getValue:visibilityStatus) !== true\">\n                    <div cdkDragHandle class=\"map__visu-layer-drag\">\n                      <mat-icon>drag_indicator</mat-icon>\n                    </div>\n                    <arlas-legend [collection]=\"layer.metadata?.collection\" [enabled]=\"!!visu.enabled\"\n                      [layer]=\"layer\" [zoom]=\"mapInstance.zoom\"\n                      (visibilityStatus)=\"emitLegendVisibility(visu.name, l, $event)\" [legendUpdater]=\"legendUpdater\"\n                      [visibilityUpdater]=\"visibilityUpdater\" [highlightLegend]=\"highlightLegend\"\n                      (downloadSourceEmitter)=\"downloadLayerSource($event)\"></arlas-legend>\n                  </div>\n                }\n              }\n            </div>\n          </div>\n        }\n      </div>\n      }\n    </div>\n  }\n</div>\n\n@if (mapInstance) {\n  @if (displayCurrentCoordinates()) {\n    <arlas-coordinates [currentLat]=\"mapInstance.currentLat()\" [currentLng]=\"mapInstance.currentLng()\"\n      (moveToCoordinates$)=\"moveToCoordinates($event)\"></arlas-coordinates>\n  }\n\n  @if (showBasemapList) {\n    <arlas-basemap [mapSources]=\"mapSources\" [map]=\"mapInstance\" (mouseleave)=\"hideBasemapSwitcher()\"\n      (basemapChanged)=\"onChangeBasemapStyle()\"></arlas-basemap>\n  }\n  <arlas-draw #drawComponent [map]=\"mapInstance\" [emptyData]=\"emptyData\" [drawData]=\"drawData\"\n    [drawButtonEnabled]=\"drawButtonEnabled\" [drawOption]=\"drawOption\"\n    [drawPolygonVerticesLimit]=\"drawPolygonVerticesLimit\" [preserveDrawingBuffer]=\"preserveDrawingBuffer\"\n    [drawTheme]=\"drawTheme()\"\n    (onAoiChanged)=\"onAoiChanged.emit($event)\"\n    (onAoiEdit)=\"onAoiEdit.emit($event)\"></arlas-draw>\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport { BboxFormGroup } from './bbox-generator.utils';\n\n@Pipe({\n  name: 'bboxFormError'\n})\nexport class BboxFormErrorPipe implements PipeTransform {\n\n  public transform(formControl: FormControl | FormGroup): string {\n    if (formControl.hasError('required')) {\n      return marker('You must enter a coordinate');\n    } else if ((formControl as BboxFormGroup).latitudeErrors) {\n      return marker('Both corners have the same latitudes, modify one of them.');\n    }\n    return formControl.hasError('pattern') ? marker('Enter a coordinate in decimal (1.1) or sexagesimal (1° 6\\' 3\")') : '';\n  }\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { FormGroup } from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { Corner } from '../draw/draw.models';\nimport { Coordinate, PointFormGroup } from './coordinates.tools';\n\n\nexport class BboxFormGroup extends FormGroup {\n\n  private firstCornerLatitude?: string;\n  private secondCornerLatitude?: string;\n  public firstCorner: PointFormGroup;\n  public secondCorner: PointFormGroup;\n  public latitudeErrors = false;\n\n  public subscriptions = new Array<Subscription>();\n\n  public constructor(corner: Corner) {\n    const firstCorner = new PointFormGroup(corner.lat - 0.5, corner.lng - 0.5);\n    const secondCorner = new PointFormGroup(corner.lat + 0.5, corner.lng + 0.5);\n    super({\n      firstCorner,\n      secondCorner\n    });\n    this.firstCorner = firstCorner;\n    this.secondCorner = secondCorner;\n\n    const latSub = this.firstCorner.latitude.valueChanges.subscribe(v => {\n      this.firstCornerLatitude = v;\n      this.secondCornerLatitude = this.secondCorner.latitude.value;\n      if (this.firstCornerLatitude !== undefined && this.secondCornerLatitude !== undefined) {\n        if (Coordinate.parse(this.firstCornerLatitude) === Coordinate.parse(this.secondCornerLatitude)) {\n          this.latitudeErrors = true;\n        } else {\n          this.latitudeErrors = false;\n        }\n      }\n    });\n    this.subscriptions.push(latSub);\n\n    const lonSub = this.secondCorner.latitude.valueChanges.subscribe(v => {\n      this.secondCornerLatitude = v;\n      this.firstCornerLatitude = this.firstCorner.latitude.value;\n      if (this.firstCornerLatitude !== undefined && this.secondCornerLatitude !== undefined) {\n        if (Coordinate.parse(this.firstCornerLatitude) === Coordinate.parse(this.secondCornerLatitude)) {\n          this.latitudeErrors = true;\n        } else {\n          this.latitudeErrors = false;\n        }\n      }\n    });\n    this.subscriptions.push(lonSub);\n  }\n\n  public getFirstCorner(): Corner {\n    return {\n      lat: Coordinate.parse(this.firstCorner.latitude.value),\n      lng: Coordinate.parse(this.firstCorner.longitude.value)\n    };\n  }\n\n  public getSecondCorner(): Corner {\n    return {\n      lat: Coordinate.parse(this.secondCorner.latitude.value),\n      lng: Coordinate.parse(this.secondCorner.longitude.value)\n    };\n  }\n}\n\n\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { AfterViewInit, ChangeDetectorRef, Component, inject, OnDestroy } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { MatButton } from '@angular/material/button';\nimport { MAT_DIALOG_DATA, MatDialogClose, MatDialogRef } from '@angular/material/dialog';\nimport { MatError, MatFormField, MatLabel } from '@angular/material/form-field';\nimport { MatIcon } from '@angular/material/icon';\nimport { MatInput } from '@angular/material/input';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { Corner } from '../draw/draw.models';\nimport { MapboxAoiDrawService } from '../draw/draw.service';\nimport { BboxFormErrorPipe } from './bbox-form-error.pipe';\nimport { BboxFormGroup } from './bbox-generator.utils';\n\n@Component({\n  selector: 'arlas-bbox-generator',\n  templateUrl: './bbox-generator.component.html',\n  styleUrls: ['./bbox-generator.component.scss'],\n  imports: [\n    MatIcon, FormsModule, ReactiveFormsModule, MatFormField, MatLabel, MatInput,\n    MatError, MatButton, MatDialogClose, TranslatePipe, BboxFormErrorPipe]\n})\nexport class BboxGeneratorComponent implements AfterViewInit, OnDestroy {\n  /**\n   * @constant\n   */\n  public DESCRIPTION = marker('Enter coordinates in decimal or sexagesimal degrees');\n  public bboxForm: BboxFormGroup;\n  /**\n   * @constant\n   */\n  public placeHolder = marker('Decimal: 1.1 or Sexagesimal 1°6\\'3\" coordinate');\n\n  private readonly data = inject<{ initCorner: Corner; }>(MAT_DIALOG_DATA);\n\n  public constructor(\n    private readonly drawService: MapboxAoiDrawService,\n    private readonly cdr: ChangeDetectorRef,\n    private readonly dialogRef: MatDialogRef<BboxGeneratorComponent>\n  ) {\n      if (!!this.data && !this.data.initCorner) {\n        this.data.initCorner = {\n          lat: 0,\n          lng: 0\n        };\n      }\n      this.bboxForm = new BboxFormGroup(this.data.initCorner);\n  }\n\n  public ngAfterViewInit(): void {\n    this.cdr.detectChanges();\n  }\n\n  public ngOnDestroy(): void {\n    this.bboxForm.subscriptions.forEach(s => s.unsubscribe());\n  }\n\n  public close() {\n    this.dialogRef.close();\n  }\n\n  public generateBbox() {\n    this.drawService.drawBbox(this.bboxForm.getFirstCorner(), this.bboxForm.getSecondCorner());\n    this.dialogRef.close();\n  }\n\n}\n","<div class=\"wrapper\">\n  <div class=\"title-wrapper\">\n    {{'BBox generator' | translate}}\n  </div>\n  <div class=\"content\">\n    <div class=\"description\">\n      <mat-icon>info</mat-icon>\n      <span>{{DESCRIPTION | translate}}</span>\n    </div>\n    @if (bboxForm.firstCorner) {\n      <div class=\"section\" [formGroup]=\"bboxForm.firstCorner\">\n        <div class=\"title\">{{'First corner' | translate}}</div>\n        <div class=\"coordinate\">\n          <mat-form-field appearance=\"outline\" >\n            <mat-label>{{'Latitude' |translate}}</mat-label>\n            <input class=\"input\"  matInput [formControl]=\"bboxForm.firstCorner.latitude\" [placeholder]=\"placeHolder | translate\">\n            @if (bboxForm.firstCorner.latitude.invalid) {\n              <mat-error>{{bboxForm.firstCorner.latitude | bboxFormError | translate}}</mat-error>\n            }\n          </mat-form-field>\n        </div>\n        <div class=\"coordinate\">\n          <mat-form-field appearance=\"outline\">\n            <mat-label>{{'Longitude'|translate }}</mat-label>\n            <input class=\"input\"  matInput [formControl]=\"bboxForm.firstCorner.longitude\" [placeholder]=\"placeHolder | translate\">\n            @if (bboxForm.firstCorner.longitude.invalid) {\n              <mat-error>{{bboxForm.firstCorner.longitude | bboxFormError | translate}}</mat-error>\n            }\n          </mat-form-field>\n        </div>\n      </div>\n    }\n    @if (bboxForm.secondCorner) {\n      <div class=\"section\" [formGroup]=\"bboxForm.secondCorner\">\n        <div class=\"title\">{{'Second corner' | translate}}</div>\n        <div class=\"coordinate\">\n          <mat-form-field appearance=\"outline\" >\n            <mat-label>{{'Latitude' | translate}}</mat-label>\n            <input class=\"input\"  matInput [formControl]=\"bboxForm.secondCorner.latitude\" [placeholder]=\"placeHolder | translate\">\n            @if (bboxForm.secondCorner.latitude.invalid) {\n              <mat-error>{{bboxForm.secondCorner.latitude | bboxFormError | translate}} </mat-error>\n            }\n          </mat-form-field>\n        </div>\n        <div class=\"coordinate\">\n          <mat-form-field appearance=\"outline\">\n            <mat-label>{{'Longitude' | translate}}</mat-label>\n            <input class=\"input\"  matInput [formControl]=\"bboxForm.secondCorner.longitude\" [placeholder]=\"placeHolder | translate\">\n            @if (bboxForm.secondCorner.longitude.invalid) {\n              <mat-error>{{bboxForm.secondCorner.longitude | bboxFormError | translate}}</mat-error>\n            }\n          </mat-form-field>\n        </div>\n      </div>\n    }\n    @if (bboxForm.latitudeErrors) {\n      <div class=\"errors\">\n        <mat-icon>report</mat-icon>\n        <mat-error>{{bboxForm | bboxFormError | translate}}</mat-error>\n      </div>\n    }\n  </div>\n  <div class=\"actions\">\n    <button matButton=\"outlined\" [mat-dialog-close]=\"null\">{{'Close' | translate}}\n    </button>\n    <button class=\"create-action\" matButton=\"filled\" color=\"primary\" (click)=\"generateBbox()\" [disabled]=\"bboxForm.invalid || bboxForm.latitudeErrors\">\n      <span class=\"label\">{{'Generate AOI' | translate}}</span>\n    </button>\n  </div>\n</div>","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport { Feature, FeatureCollection, Geometry } from 'geojson';\nimport { AbstractArlasMapGL } from '../map/AbstractArlasMapGL';\n\nexport type DrawEvents = 'draw.create' | 'draw.delete' | 'draw.combine' | 'draw.uncombine' |\n  'draw.update' | 'draw.selectionchange' | 'draw.modechange' | 'draw.render' | 'draw.actionable' |\n  'draw.edit.saveInitialFeature' | 'draw.onClick' | 'draw.onStart' | 'draw.onStop'\n  | 'draw.invalidGeometry';\n\nexport type DrawModes = 'SIMPLE_SELECT' | 'DRAW_CIRCLE' | 'DIRECT_SELECT' |\n  'DRAW_LINE_STRING' | 'DRAW_POLYGON' | 'DRAW_POINT' | 'DRAW_RADIUS_CIRCLE' |\n  'DRAW_STRIP' | 'DIRECT_STRIP'| 'DRAW_RECTANGLE' | 'STATIC';\n\nexport interface DrawEventsInterface {\n  onDrawCreate: (...args: any[]) => void;\n  onDrawUpdate: (...args: any[]) => void;\n  onDrawDelete: (...args: any[]) => void;\n  onDrawOnClick: (...args: any[]) => void;\n  onDrawOnStart: (...args: any[]) => void;\n  onDrawOnStop: (...args: any[]) => void;\n  onDrawInvalidGeometry: (...args: any[]) => void;\n  onDrawEditSaveInitialFeature: (...args: any[]) => void;\n  onDrawSelectionchange: (...args: any[]) => void;\n  onDrawModeChange: (...args: any[]) => void;\n}\n\nexport class AbstractDraw implements DrawEventsInterface {\n  protected config;\n  public arlasMap: AbstractArlasMapGL;\n  public enabled: boolean;\n  public drawProvider: MapboxDraw;\n\n  public constructor(config: any, enabled: boolean, map: AbstractArlasMapGL) {\n    const modes = MapboxDraw.modes;\n    this.config = JSON.parse(JSON.stringify(config));\n    this.config.modes = Object.assign(modes, config.modes);\n    this.drawProvider = new MapboxDraw(this.config);\n    this.arlasMap = map;\n    this.enabled = enabled;\n  }\n\n  public onAdd(map: AbstractArlasMapGL) {\n    const controlContainer = this.drawProvider.onAdd(map);\n    if (!this.enabled) {\n      controlContainer.className += ' draw-control-disabled';\n    }\n    return controlContainer;\n  }\n\n  public onRemove(map: AbstractArlasMapGL) {\n    return this.drawProvider.onRemove(map);\n  }\n\n  public setMode(drawModes: DrawModes, replaceMode: string) {\n    this.drawProvider.modes[drawModes] = replaceMode;\n  }\n\n  public getAllFeatures() {\n    return this.getAll().features;\n  }\n\n  public onDrawCreate(fn: (e: any) => void): void {\n    this.on('draw.create', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawDelete(fn: (e: any) => void): void {\n    this.on('draw.delete', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawEditSaveInitialFeature(fn: (e: any) => void): void {\n    this.on('draw.edit.saveInitialFeature', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawInvalidGeometry(fn: (e: any) => void): void {\n    this.on('draw.invalidGeometry', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawModeChange(fn: (e: any) => void): void {\n    this.on('draw.modechange', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawOnClick(fn: (e: any) => void): void {\n    this.on('draw.onClick', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawOnStart(fn: (e: any) => void): void {\n    this.on('draw.onStart', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawOnStop(fn: (e: any) => void): void {\n    this.on('draw.onStop', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawSelectionchange(fn: (e: any) => void): void {\n    this.on('draw.selectionchange', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawUpdate(fn: (e: any) => void): void {\n    this.on('draw.update', (e) => {\n      fn(e);\n    });\n  }\n\n  public getMode(modes: DrawModes) {\n    return this.drawProvider.modes[modes];\n  }\n\n  public on(event: DrawEvents, fn: (e: any) => void): void {\n    this.arlasMap.on(event, fn);\n  }\n\n  public add(feature: Feature<Geometry> | FeatureCollection<GeoJSON.Geometry>) {\n    this.drawProvider.add(feature);\n  }\n\n  public get(featureId: string): Feature | undefined {\n    return this.drawProvider.get(featureId);\n  }\n\n  public delete(ids: string | Array<string>): this {\n    this.drawProvider.delete(ids);\n    return this;\n  }\n  public deleteAll(): this {\n    this.drawProvider.deleteAll();\n    return this;\n  }\n\n  public set(featureCollection: FeatureCollection): Array<string> {\n    return this.drawProvider.set(featureCollection);\n  }\n\n  public trash(): this {\n    this.drawProvider.trash();\n    return this;\n  }\n\n  public combineFeatures(): this {\n    this.drawProvider.combineFeatures();\n    return this;\n  }\n  public uncombineFeatures(): this {\n    this.drawProvider.uncombineFeatures();\n    return this;\n  }\n\n  public getCurrentMode(): string {\n    return this.drawProvider.getMode();\n  }\n\n  public getFeatureIdsAt(point: { x: number; y: number; }): Array<string> {\n    return this.drawProvider.getFeatureIdsAt(point);\n  }\n\n  public getSelectedIds(): Array<string> {\n    return this.drawProvider.getSelectedIds();\n  }\n\n  public getSelected() {\n    return this.drawProvider.getSelected();\n  }\n\n  public getAll() {\n    return this.drawProvider.getAll();\n  }\n\n  public getSelectedFeatures() {\n    return this.getSelected().features;\n  }\n\n  public setFeatureProperty(featureId: string, property: string, value: any): this {\n    this.drawProvider.setFeatureProperty(featureId, property, value);\n    return this;\n  }\n\n  public changeMode(mode: string, opt?: any): this {\n    this.drawProvider.changeMode(mode, opt);\n    return this;\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { CdkScrollable } from '@angular/cdk/scrolling';\nimport { Component, ElementRef, inject, Inject, input, Input, Output, ViewChild } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckbox } from '@angular/material/checkbox';\nimport { MAT_DIALOG_DATA, MatDialog, MatDialogActions, MatDialogContent, MatDialogRef, MatDialogTitle } from '@angular/material/dialog';\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\nimport { MatRadioButton, MatRadioGroup } from '@angular/material/radio';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport * as toGeoJSON from '@tmcw/togeojson';\nimport centroid from '@turf/centroid';\nimport { polygon } from '@turf/helpers';\nimport { wktToGeoJSON } from 'betterknown';\nimport { Feature, FeatureCollection, GeometryCollection, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon } from 'geojson';\nimport gpsi from 'geojson-polygon-self-intersections';\nimport { valid } from 'geojson-validation';\nimport JSZip from 'jszip';\nimport { Subject } from 'rxjs';\nimport shp from 'shpjs';\nimport { ArlasMapFrameworkService } from '../arlas-map-framework.service';\nimport { ArlasMapComponent } from '../arlas-map.component';\n\ntype SimpleGeometry = Point | LineString | Polygon;\ntype ComplexGeometry = MultiPoint | MultiLineString | MultiPolygon;\n\n@Component({\n  templateUrl: './map-import-dialog.component.html',\n  selector: 'arlas-map-import-dialog',\n  styleUrls: ['./map-import-dialog.component.scss'],\n  imports: [\n    MatDialogTitle, CdkScrollable, MatDialogContent, MatRadioGroup, FormsModule, MatRadioButton,\n    MatCheckbox, MatButtonModule, MatProgressSpinner, TranslatePipe, MatDialogActions\n  ]\n})\nexport class MapImportDialogComponent {\n  public displayError = false;\n  public isRunning = false;\n  public fitResult = false;\n  public errorMessage?: string;\n  public errorThreshold?: string;\n  public currentFile: File | null = null;\n\n  public importType: string;\n  public allowedFileExtension?: string;\n  public allowedImportType: string[];\n  public wktContent = '';\n\n  public SHP: string = marker('shp');\n  public KML: string = marker('kml');\n  public WKT: string = marker('wkt');\n  public GEOJSON: string = marker('geojson');\n\n  @Output() public file = new Subject<File | null>();\n  @Output() public importRun = new Subject<{ type: string; fitResult: boolean; wktContent: string; }>();\n  @ViewChild('fileInput', { static: false }) public fileInput?: ElementRef;\n\n  public constructor(\n    private dialogRef: MatDialogRef<MapImportDialogComponent>,\n    @Inject(MAT_DIALOG_DATA) private data: { allowedImportType: Array<string>; defaultFitResult?: boolean; }\n  ) {\n    this.fitResult = data.defaultFitResult ?? false;\n    this.allowedImportType = this.data.allowedImportType.filter(t => [this.SHP, this.KML, this.WKT, this.GEOJSON].includes(t));\n\n    if (this.allowedImportType.includes(this.SHP)) {\n      this.importType = this.SHP;\n    } else if (this.allowedImportType.includes(this.KML)) {\n      this.importType = this.KML;\n    } else if (this.allowedImportType.includes(this.WKT)) {\n      this.importType = this.WKT;\n    } else {\n      this.importType = this.GEOJSON;\n    }\n    this.changeType();\n  }\n\n  public onFileChange(files: FileList | null) {\n    const file = files === null ? null : files.item(0);\n    this.file.next(file);\n    this.currentFile = file;\n    this.displayError = false;\n  }\n\n  public import() {\n    this.importRun.next({ type: this.importType, fitResult: this.fitResult, wktContent: this.wktContent });\n  }\n\n  public onTextChange() { }\n\n  public changeType() {\n    if (this.importType === this.SHP) {\n      this.allowedFileExtension = '.zip';\n    } else if (this.importType === this.KML) {\n      this.allowedFileExtension = '.kml,.kmz';\n    } else if (this.importType === this.GEOJSON) {\n      this.allowedFileExtension = '.json,.geojson';\n    }\n  }\n\n  public onCancel() {\n    this.dialogRef.close({ cancel: true });\n  }\n}\n\nexport type AllowedImportGeometry = 'Polygon' | 'Point';\nconst SIMPLE_GEOMETRY_OBJECT = new Set(['Polygon', 'Point', 'LineString']);\n\n@Component({\n    selector: 'arlas-map-import',\n    template: '',\n    styleUrls: ['./map-import.component.scss']\n})\n/** L: a layer class/interface.\n *  S: a source class/interface.\n *  M: a Map configuration class/interface.\n */\nexport class MapImportComponent<L, S, M> {\n\n  public SHP = 'shp';\n  public KML = 'kml';\n  public WKT = 'wkt';\n  public GEOJSON = 'geojson';\n\n  public SELF_INTERSECT = marker('Geometry is not valid due to self-intersection');\n  public PARSING_ISSUE = marker('Problem parsing input file');\n  public FILE_TOO_LARGE = marker('File is too large');\n  public GEOMETRY_INVALID = marker('Geometry is not valid');\n  public TOO_MANY_VERTICES = marker('Too many vertices in a polygon');\n  public TOO_MANY_FEATURES = marker('Too many features');\n  public TIMEOUT = marker('Timeout');\n\n  public currentFile: File | null = null;\n  public dialogRef?: MatDialogRef<MapImportDialogComponent>;\n  public reader?: FileReader;\n\n  private tooManyVertex = false;\n  private fitResult = false;\n  private jszip= new JSZip();;\n  private readonly SOURCE_NAME_POLYGON_LABEL = 'polygon_label';\n  private emptyData: FeatureCollection<GeoJSON.Geometry> = {\n    'type': 'FeatureCollection',\n    'features': []\n  };\n  private featureIndex = 0;\n\n  public mapComponent = input.required<ArlasMapComponent<L, S, M>>();\n  @Input() public maxVertexByPolygon = 100;\n  @Input() public maxFeatures?: number;\n  @Input() public maxFileSize?: number;\n  @Input() public maxLoadingTime = 20000;\n  @Input() public allowedImportType = [this.SHP, this.KML, this.WKT, this.GEOJSON];\n  @Input() public allowedGeometryObjectType: Array<AllowedImportGeometry> = ['Polygon'];\n  @Output() public imported = new Subject<Feature[]>();\n  @Output() public error = new Subject<string>();\n\n  private _currentAllowedGeom = new Set<string>();\n\n  private readonly mapService = inject(ArlasMapFrameworkService<L, S, M>);\n\n  public constructor(\n    private readonly dialog: MatDialog\n  ) { }\n\n  public promiseTimeout(ms: number, promise: Promise<unknown>) {\n    // Create a promise that rejects in <ms> milliseconds\n    const timeout = new Promise((resolve, reject) => {\n      const id = setTimeout(() => {\n        clearTimeout(id);\n        reject(new Error(this.TIMEOUT));\n      }, ms);\n    });\n\n    // Returns a race between our timeout and the passed in promise\n    return Promise.race([\n      promise,\n      timeout\n    ]);\n  }\n\n  private buildAllowedGeometryForImportType(importType: string) {\n    this._currentAllowedGeom = new Set();\n    for (const allowed of this.allowedGeometryObjectType) {\n      this._currentAllowedGeom = this._currentAllowedGeom.union(this.getAllowedGeom(allowed));\n    }\n\n    if (importType === this.KML) {\n      this._currentAllowedGeom.add('GeometryCollection');\n      this._currentAllowedGeom.add('MultiGeometry');\n    } else if (importType === this.WKT) {\n      this._currentAllowedGeom.add('GeometryCollection');\n    }\n  }\n\n  private getAllowedGeom(allowed: AllowedImportGeometry): Set<string> {\n    if (allowed === 'Polygon') {\n      return new Set(['Polygon', 'MultiPolygon']);\n    }\n    if (allowed === 'Point') {\n      return new Set(['Point', 'MultiPoint']);\n    }\n    return new Set();\n  }\n\n  public openDialog(defaultFitResult?: boolean) {\n    this.dialogRef = this.dialog.open(MapImportDialogComponent,\n      { data: { allowedImportType: this.allowedImportType, defaultFitResult }, panelClass: 'map-import-dialog' });\n    this.dialogRef.componentInstance.file.subscribe(file => {\n      this.currentFile = file;\n    });\n    this.dialogRef.componentInstance.importRun.subscribe(importOptions => {\n      this.fitResult = importOptions.fitResult;\n      this.buildAllowedGeometryForImportType(importOptions.type);\n      this.import(importOptions.type, importOptions.wktContent);\n    });\n  }\n\n  public import(importType: string, content?: string) {\n    if (!this.dialogRef) {\n      return;\n    }\n\n    this.dialogRef.componentInstance.isRunning = true;\n    this.tooManyVertex = false;\n    this.jszip = new JSZip();\n    let processPromise = Promise.resolve();\n    if (importType === this.SHP) {\n      processPromise = this.processAllShape();\n    } else if (importType === this.KML) {\n      processPromise = this.processAllKml();\n    } else if (importType === this.WKT && content !== undefined) {\n      processPromise = this.processWKT(content);\n    } else if (importType === this.GEOJSON) {\n      processPromise = this.processJson();\n    }\n    this.promiseTimeout(this.maxLoadingTime, processPromise).catch(error => {\n      if (importType !== this.WKT) {\n        this.reader?.abort();\n      }\n      this.throwError(error);\n    });\n  }\n\n  public buildFeature(geom: any, feature: Feature | any, geometryType?: string, bbox?: boolean) {\n    const f: Feature = {\n      type: 'Feature',\n      geometry: {\n        coordinates: geom,\n        type: geometryType ?? geom.type\n      },\n      properties: feature.properties\n    };\n\n    if (bbox) {\n      f.geometry['bbox'] = feature.geometry.bbox;\n    }\n    return f;\n  }\n\n  public handleSimpleGeometry(feature: Feature<SimpleGeometry>, centroids: Feature<Point>[], importedGeojson: FeatureCollection) {\n    // avoid self intersect control for point\n    if (feature.geometry.type === 'Point' || (feature.geometry.type === 'Polygon' && gpsi(feature as Feature<Polygon>).length === 0)) {\n      this.addFeature(feature, centroids, importedGeojson, ++this.featureIndex);\n    } else {\n      throw new Error('Geometry is not valid due to self-intersection');\n    }\n  }\n\n  public handleMultiGeometry(feature: Feature<ComplexGeometry>,\n    centroids: Feature<Point>[], importedGeojson: FeatureCollection\n  ) {\n    // Create a new Polygon feature for each polygon in the MultiPolygon\n    // All properties of the MultiPolygon are copied in each feature created\n    const geomType = (feature.geometry.type === 'MultiPolygon') ? 'Polygon' : 'Point';\n    for (const geom of feature.geometry.coordinates) {\n      const newFeature = this.buildFeature(geom, feature, geomType, true);\n      this.handleSimpleGeometry(newFeature as Feature<SimpleGeometry>, centroids, importedGeojson);\n    }\n  }\n\n  public handleGeometryCollection(feature: Feature<GeometryCollection>, centroids: Feature<Point>[], importedGeojson: FeatureCollection) {\n    // Create a new Polygon feature for each polygon in the MultiPolygon\n    // All properties of the MultiPolygon are copied in each feature created\n    const simpleGeometry = this._currentAllowedGeom.intersection(SIMPLE_GEOMETRY_OBJECT);\n    for (const geom of feature.geometry.geometries.filter(geom => simpleGeometry.has(geom.type))) {\n      const newFeature = this.buildFeature(geom, feature) as Feature<SimpleGeometry>;\n      this.handleSimpleGeometry(newFeature, centroids, importedGeojson);\n    }\n  }\n\n  public handleFeatureCollection(feature: FeatureCollection, centroids: Feature<Point>[], importedGeojson: FeatureCollection) {\n    const features = feature.features.filter(f => this._currentAllowedGeom.has(f.geometry.type));\n    for (const f of features) {\n      const multiGeometry = this._currentAllowedGeom.difference(SIMPLE_GEOMETRY_OBJECT);\n      if (multiGeometry.has(f.geometry.type)) {\n        this.handleMultiGeometry(f as Feature<ComplexGeometry>, centroids, importedGeojson);\n      } else {\n        this.handleSimpleGeometry(f as Feature<SimpleGeometry>, centroids, importedGeojson);\n      }\n    }\n  }\n\n  /** *************/\n  /** *** KML *****/\n  /** *************/\n  public readKmlFile() {\n    return new Promise<string | ArrayBuffer>((resolve, reject) => {\n      this.reader = new FileReader();\n      const reader = this.reader;\n      reader.onload = () => {\n        if (reader.result === null) {\n          reject(new Error(marker('File has no content')));\n        } else {\n          resolve(reader.result);\n        }\n      };\n      reader.onerror = () => {\n        reader.abort();\n        reject(new Error(this.PARSING_ISSUE));\n      };\n\n      if (!this.currentFile) {\n        reject(new Error(marker('No file was given')));\n        return;\n      }\n\n      if (this.maxFileSize && this.currentFile.size > this.maxFileSize) {\n        reject(new Error(this.FILE_TOO_LARGE));\n      } else if (this.currentFile.name.split('.').pop()?.toLowerCase() === this.KML) {\n        reader.readAsText(this.currentFile);\n      } else if (this.currentFile.name.split('.').pop()?.toLowerCase() === 'kmz') {\n        reader.readAsArrayBuffer(this.currentFile);\n      } else {\n        reject(new Error(marker('Only `kml` or `zip` file is allowed')));\n      }\n    });\n  }\n\n  private resolveFileFromGzip(result: string | ArrayBuffer | null, resolve: Function, reject: Function) {\n    if (result === null) {\n      return;\n    }\n\n    this.jszip.loadAsync(result).then(kmzContent => {\n      const kmlFile = Object.keys(kmzContent.files).find(file => file.split('.').pop()?.toLowerCase() === this.KML);\n      if (kmlFile) {\n        this.jszip.file(kmlFile)?.async('text').then((data) => resolve(data));\n      } else {\n        reject(new Error(marker('kml file not found in the zip')));\n      }\n    });\n  }\n\n  public processAllKml() {\n    const readKmlFile = this.readKmlFile();\n\n    let readKmzFile = readKmlFile;\n    if (this.currentFile?.name.split('.').pop()?.toLowerCase() === 'kmz') {\n      readKmzFile = readKmlFile.then(result => new Promise<string>((resolve, reject) => {\n        this.resolveFileFromGzip(result, resolve, reject);\n      }));\n    }\n\n    const parseKml = readKmzFile.then(file => new Promise((resolve, reject) => {\n      const geojson = toGeoJSON.kml((new DOMParser()).parseFromString(file.toString(), 'text/xml'));\n      resolve(geojson);\n    }));\n    const geojsonParserPromise = parseKml.then((geojson: any) => new Promise<{ geojson: any; centroides: any; }>((resolve, reject) => {\n      this.computeGeojson(geojson, reject, resolve);\n    }));\n\n    return geojsonParserPromise.then((importedResult) => this.setImportedData(importedResult));\n  }\n\n\n  /** *************/\n  /** * GEOJSON ***/\n  /** *************/\n  public readJsonFile() {\n    return new Promise<string | ArrayBuffer>((resolve, reject) => {\n      this.reader = new FileReader();\n      const reader = this.reader;\n      reader.onload = () => {\n        if (reader.result === null) {\n          reject(new Error(marker('File has no content')));\n        } else {\n          resolve(reader.result);\n        }\n      };\n      reader.onerror = () => {\n        reader.abort();\n        reject(new Error(this.PARSING_ISSUE));\n      };\n\n      if (!this.currentFile) {\n        reject(new Error(marker('No file was given')));\n        return;\n      }\n\n      if (this.maxFileSize && this.currentFile.size > this.maxFileSize) {\n        reject(new Error(this.FILE_TOO_LARGE));\n      } else {\n        const extension = this.currentFile.name.split('.').pop()?.toLowerCase();\n        if (extension === 'json' || extension === 'geojson') {\n          reader.readAsText(this.currentFile);\n        } else {\n          reject(new Error(marker('Only `json` or `geojson` file is allowed')));\n        }\n      }\n    });\n  }\n\n  public processJson() {\n    const readJsonFile = this.readJsonFile();\n    const parseJson = readJsonFile.then(fileContent => new Promise<{ geojson: any; centroides: any; }>((resolve, reject) => {\n      const feature = JSON.parse(fileContent.toString());\n      if (valid(feature) && (this._currentAllowedGeom.has(feature.geometry) || feature.type === 'FeatureCollection')) {\n        const centroides = new Array<Feature<Point>>();\n        const importedGeojson: FeatureCollection = {\n          type: 'FeatureCollection',\n          features: []\n        };\n        try {\n          if (feature.geometry && (feature.geometry.type === 'Polygon' || feature.geometry.type === 'Point')) {\n            this.handleSimpleGeometry(feature, centroides, importedGeojson);\n          } else if (feature.geometry && (feature.geometry.type === 'MultiPolygon' || feature.geometry.type === 'MultiPoint')) {\n            this.handleMultiGeometry(feature, centroides, importedGeojson);\n          } else if (feature.type && feature.type === 'FeatureCollection') {\n            this.handleFeatureCollection(feature, centroides, importedGeojson);\n          }\n          resolve({ geojson: importedGeojson, centroides: centroides });\n        } catch (e) {\n          reject(e);\n        }\n      } else {\n        reject(new Error(this.GEOMETRY_INVALID));\n      }\n    }));\n\n    return parseJson.then((importedResult) => this.setImportedData(importedResult));\n  }\n\n  /** *************/\n  /** ** SHAPE ****/\n  /** *************/\n  public readZipFile() {\n    return new Promise<string | ArrayBuffer>((resolve, reject) => {\n      this.reader = new FileReader();\n      const reader = this.reader;\n      reader.onload = () => {\n        const resultToArray = new Uint8Array(<ArrayBuffer>reader.result);\n        if (resultToArray.length === 0 || reader.result === null) {\n          reader.abort();\n          reject(new Error(marker('File is empty')));\n        } else {\n          resolve(reader.result);\n        }\n      };\n      reader.onerror = () => {\n        reader.abort();\n        reject(new Error(this.PARSING_ISSUE));\n      };\n\n      if (!this.currentFile) {\n        reject(new Error(marker('No file was given')));\n        return;\n      }\n\n      if (this.maxFileSize && this.currentFile.size > this.maxFileSize) {\n        reject(new Error(this.FILE_TOO_LARGE));\n      } else if (this.currentFile.name.split('.').pop()?.toLowerCase() === 'zip') {\n        reader.readAsArrayBuffer(this.currentFile);\n      } else {\n        reject(new Error(marker('Only `zip` file is allowed')));\n      }\n    });\n  }\n\n  private areFilesInvalid(zipResult: JSZip): boolean {\n    const testArray = Object.keys(zipResult.files).map(fileName => fileName.split('.').pop()?.toLowerCase());\n    return (testArray.filter(elem => elem === this.SHP || elem === 'shx' || elem === 'dbf').length < 3) &&\n      (testArray.filter(elem => elem === 'json').length !== 1);\n  }\n\n  public processAllShape() {\n    const fileReaderPromise = this.readZipFile();\n\n    const zipLoaderPromise = fileReaderPromise.then(buffer => new Promise<string | ArrayBuffer>((resolve, reject) => {\n      this.jszip.loadAsync(buffer).then(zipResult => {\n        if (this.areFilesInvalid(zipResult)) {\n          reject(new Error(marker('Zip file must contain at least a `*.shp`, `*.shx` and `*.dbf` or a `*.json`')));\n        } else {\n          resolve(buffer);\n        }\n      });\n    }));\n\n    const shapeParserPromise = zipLoaderPromise\n      .then(buffer => shp(buffer));\n\n    const geojsonParserPromise = shapeParserPromise.then(geojson => new Promise<{ geojson: any; centroides: any; }>((resolve, reject) => {\n      this.computeGeojson(geojson, reject, resolve);\n    }));\n\n    return Promise.all([fileReaderPromise, zipLoaderPromise, shapeParserPromise, geojsonParserPromise])\n      .then(([a, b, c, importedResult]) => {\n        this.setImportedData(importedResult);\n      });\n  }\n\n  /** *************/\n  /** **  WKT  ****/\n  /** *************/\n  public processWKT(wkt: string) {\n    const wktParserPromise = new Promise<{ geojson: any; centroides: any; }>((resolve, reject) => {\n      const geojsonWKT = wktToGeoJSON(wkt);\n\n      const centroides = new Array<any>();\n      const importedGeojson: FeatureCollection = {\n        type: 'FeatureCollection',\n        features: []\n      };\n\n      if (geojsonWKT && valid(geojsonWKT) && this._currentAllowedGeom.has(geojsonWKT.type)) {\n        const feature: Feature = {\n          type: 'Feature',\n          geometry: geojsonWKT,\n          properties: { arlas_id: null }\n        };\n        this.handleGeom(feature, centroides, importedGeojson, reject);\n        resolve({ geojson: importedGeojson, centroides: centroides });\n      } else {\n        reject(new Error(this.GEOMETRY_INVALID));\n      }\n    });\n\n    return wktParserPromise.then((importedResult) => this.setImportedData(importedResult));\n  }\n\n  /** *************/\n  /** ** TOOLS ****/\n  /** *************/\n  public clearPolygons() {\n    // Clean source of imported polygons\n    const labelSource = this.mapService.getSource(this.SOURCE_NAME_POLYGON_LABEL, this.mapComponent().map);\n    this.featureIndex = 0;\n    this.mapComponent().onAoiChanged.next(this.emptyData);\n    if (labelSource !== undefined) {\n      this.mapService.setDataToGeojsonSource(labelSource, this.emptyData);\n    }\n  }\n\n  public addFeature(feature: any, centroides: Feature<Point>[], importedGeojson: FeatureCollection, index: number) {\n    feature.properties.arlas_id = index;\n    const cent = this.calcCentroid(feature);\n    centroides.push(cent);\n    importedGeojson.features.push(feature);\n  }\n\n  public setImportedData(importedResult: { geojson: FeatureCollection; centroides: any; }) {\n    if (!this.dialogRef) {\n      return;\n    }\n\n    if (this.tooManyVertex) {\n      throw new Error(this.TOO_MANY_VERTICES);\n    } else if (this.maxFeatures && importedResult.geojson.features.length > this.maxFeatures) {\n      throw new Error(this.TOO_MANY_FEATURES);\n    } else if (importedResult.geojson.features.length > 0) {\n      this.dialogRef.componentInstance.isRunning = false;\n      const map = this.mapComponent().map();\n      if (this.fitResult && map) {\n        this.mapComponent().fitToPaddedBounds(map.geometryToBounds(importedResult.geojson));\n      }\n      if (this.mapComponent().drawData.features.length > 0) {\n        for (const df of this.mapComponent().drawData.features) {\n          importedResult.geojson.features.push(df);\n        }\n      }\n      this.mapComponent().drawComponent?.draw.changeMode('static');\n      this.imported.next(importedResult.geojson.features);\n      this.mapComponent().onAoiChanged.next(importedResult.geojson);\n      this.dialogRef.close();\n    } else {\n      throw new Error(marker('No polygon to display in this file'));\n    }\n  }\n\n  public calcCentroid(feature: any) {\n    let cent;\n    if (feature.type === 'Point') {\n      cent = centroid(feature);\n    } else {\n      if (feature.geometry.coordinates[0].length - 1 > this.maxVertexByPolygon) {\n        this.tooManyVertex = true;\n      }\n      const poly = polygon(feature.geometry.coordinates);\n      cent = centroid(poly);\n    }\n\n    cent.properties ??= {};\n    cent.properties.arlas_id = feature.properties.arlas_id;\n    return cent;\n  }\n\n  private throwError(error: Error) {\n    if (!this.dialogRef) {\n      return;\n    }\n\n    this.dialogRef.componentInstance.displayError = true;\n    this.dialogRef.componentInstance.isRunning = false;\n    this.dialogRef.componentInstance.errorMessage = error.message;\n    switch (this.dialogRef.componentInstance.errorMessage) {\n      case this.TOO_MANY_FEATURES:\n        this.dialogRef.componentInstance.errorThreshold = this.maxFeatures?.toString();\n        break;\n      case this.TOO_MANY_VERTICES:\n        this.dialogRef.componentInstance.errorThreshold = this.maxVertexByPolygon.toString();\n        break;\n      case this.FILE_TOO_LARGE:\n        this.dialogRef.componentInstance.errorThreshold = this.formatBytes(this.maxFileSize ?? 0);\n        break;\n      case this.TIMEOUT:\n        this.dialogRef.componentInstance.errorThreshold = this.maxLoadingTime + ' ms';\n        break;\n      default:\n        this.dialogRef.componentInstance.errorThreshold = '';\n    }\n    if (this.dialogRef.componentInstance.fileInput) {\n      this.dialogRef.componentInstance.fileInput.nativeElement.value = '';\n    }\n    this.dialogRef.componentInstance.currentFile = null;\n    this.error.next(error.message);\n  }\n\n  private formatBytes(bytes: number, decimals = 2) {\n    if (bytes === 0) {\n      return '0 Bytes';\n    }\n\n    const k = 1024;\n    const dm = Math.max(0, decimals);\n    const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n    const i = Math.floor(Math.log(bytes) / Math.log(k));\n\n    return Number.parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\n  }\n\n  private computeGeojson(geojson: FeatureCollection | FeatureCollection[], reject: (reason?: any) => void,\n    resolve: (value: { geojson: any; centroides: any; } | PromiseLike<{ geojson: any; centroides: any; }>) => void) {\n    if (valid(geojson)) {\n      const centroides = new Array<any>();\n      const importedGeojson: FeatureCollection = {\n        type: 'FeatureCollection',\n        features: []\n      };\n      const features = Array.isArray(geojson) ? geojson.flatMap(fc => fc.features) : geojson.features;\n      const allowedFeatures = features.filter(feature => this._currentAllowedGeom.has(feature.geometry.type));\n      for (const feature of allowedFeatures) {\n        this.handleGeom(feature, centroides, importedGeojson, reject);\n      }\n\n      resolve({ geojson: importedGeojson, centroides: centroides });\n    } else {\n      reject(new Error('Geometry is not valid'));\n    }\n  }\n\n  private handleGeom(feature: Feature, centroides: Feature<Point>[], importedGeojson: FeatureCollection, reject: (reason?: any) => void) {\n    try {\n      if (feature.geometry.type === 'GeometryCollection') {\n        // Create a new Polygon feature for each polygon in the MultiPolygon\n        // All properties of the MultiPolygon are copied in each feature created\n        this.handleGeometryCollection(feature as Feature<GeometryCollection>, centroides, importedGeojson);\n      // eslint-disable-next-line max-len\n      } else if (feature.geometry.type === 'MultiPolygon' || feature.geometry.type === 'MultiLineString' || feature.geometry.type === 'MultiPoint') {\n        this.handleMultiGeometry(feature as Feature<ComplexGeometry>, centroides, importedGeojson);\n      } else {\n        this.handleSimpleGeometry(feature as Feature<SimpleGeometry>, centroides, importedGeojson);\n      }\n    } catch {\n      reject(new Error('Error during import'));\n    }\n  }\n}\n","<h1 mat-dialog-title class=\"mapgl-import-title\">{{ 'Import file' | translate}}</h1>\n<div mat-dialog-content class=\"mapgl-import-body\">\n  <mat-radio-group class=\"mapgl-import-radio-group\" [(ngModel)]=\"importType\" (change)=\"changeType()\">\n    @for (type of allowedImportType; track type) {\n      <mat-radio-button [value]=\"type\" class=\"mapgl-import-radio-button\">\n        {{ type | translate }}\n      </mat-radio-button>\n    }\n  </mat-radio-group>\n\n  @if (importType === WKT) {\n    <textarea class=\"mapgl-import-text-area\" [(ngModel)]=\"wktContent\" placeholder=\"{{'Paste your WKT' | translate}}\" (change)=\"onTextChange()\"></textarea>\n  } @else {\n    <div class=\"mapgl-import-upload\">\n      <button matButton=\"outlined\" color=\"primary\" class=\"mapgl-import-upload__button\" (click)=\"fileInput.click()\">{{ 'Choose file' | translate }}</button>\n      <span class=\"mapgl-import-upload__file\">\n        @if (currentFile) {\n          {{ currentFile.name }}\n        } @else {\n          {{ 'No file chosen' | translate }}\n        }\n      </span>\n\n      <input type=\"file\" class=\"mapgl-import-upload__input\" #fileInput accept=\"{{allowedFileExtension}}\" (change)=\"onFileChange($event.target.files)\">\n    </div>\n  }\n\n  <div class=\"mapgl-import-zoom\">\n    <mat-checkbox [(ngModel)]=\"fitResult\">{{ 'Zoom to result' | translate}}</mat-checkbox>\n  </div>\n  @if (displayError) {\n    <div class=\"mapgl-import-error\">\n      {{ errorMessage | translate}}\n      @if (errorThreshold !== '') {\n        - ({{'Max:' | translate }} {{errorThreshold}})\n      }\n  </div>\n}\n</div>\n\n<div class=\"mapgl-import-actions\" mat-dialog-actions>\n  <button matButton=\"outlined\" (click)=\"onCancel()\">{{ 'Cancel' | translate}}</button>\n  <button matButton=\"filled\" color=\"primary\" [disabled]=\"((importType === SHP || importType === KML || importType === GEOJSON) && !currentFile) || isRunning || (importType === WKT && wktContent === '')\"\n    (click)=\"import()\">{{ 'Import' | translate}}</button>\n  @if (isRunning) {\n    <mat-progress-spinner [color]=\"'accent'\" [diameter]=\"40\" [mode]=\"'indeterminate'\"></mat-progress-spinner>\n  }\n</div>\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { CdkScrollable } from '@angular/cdk/scrolling';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { Component, Output } from '@angular/core';\nimport { FormGroup, FormsModule, ReactiveFormsModule, UntypedFormControl, Validators } from '@angular/forms';\nimport { MatButton } from '@angular/material/button';\nimport { MatDialog, MatDialogActions, MatDialogContent, MatDialogRef, MatDialogTitle } from '@angular/material/dialog';\nimport { MatFormField, MatLabel, MatOption, MatSelect } from '@angular/material/select';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport { MarkerModule } from '@colsen1991/ngx-translate-extract-marker/extras';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { ArlasColorService, GetCollectionDisplayNamePipe } from 'arlas-web-components';\nimport { Subject, takeUntil } from 'rxjs';\n\nexport interface GeometrySelectModel {\n  path: string;\n  selected?: boolean;\n}\nexport interface OperationSelectModel {\n  operation: GeoQueryOperator;\n  selected?: boolean;\n}\nexport interface GeoQuery {\n  operation: string;\n  geometry_path: string;\n}\n\nexport enum GeoQueryOperator {\n  WITHIN = 'within',\n  NOT_WITHIN = 'notwithin',\n  INTERSECTS = 'intersects',\n  NOT_INTERSECTS = 'notintersects'\n}\n\nexport class SelectFormControl extends UntypedFormControl {\n\n  // used only for autocomplete: list of filtered options\n  public filteredOptions: Array<string> = [];\n  public syncOptions: Array<string> = [];\n\n  public constructor(\n    formState: any,\n    label: string,\n    options: Array<string>) {\n\n    super(formState, Validators.required);\n    this.setValue(formState);\n    this.setSyncOptions(options);\n\n  }\n\n  public setSyncOptions(newOptions: Array<string>) {\n    this.syncOptions = newOptions;\n    this.filteredOptions = newOptions;\n  }\n}\n\nexport interface MapSettingsService {\n  getGeoQueries(): Map<string, [Array<GeometrySelectModel>, Array<OperationSelectModel>, string]>;\n}\n\n@Component({\n  selector: 'arlas-map-settings-dialog',\n  templateUrl: './map-settings-dialog.component.html',\n  styleUrls: ['./map-settings-dialog.component.scss'],\n  imports: [\n    MatDialogTitle, CdkScrollable, MatDialogContent, FormsModule, ReactiveFormsModule, MatFormField, MatLabel,\n    MatSelect, MatOption, MatDialogActions, MatButton, TranslatePipe, GetCollectionDisplayNamePipe, NgTemplateOutlet, MarkerModule\n]\n})\nexport class MapSettingsDialogComponent {\n  /**\n   * @Output : Angular\n   * Emits the geo-query to apply. A geo-query is defined by\n   * - the operation (\"within\", \"intersects\", \"notwithin\", \"notintersects\")\n   * - the geometry field to query\n   */\n  @Output() public geoQueryEmitter: Subject<Map<string, GeoQuery>> = new Subject<Map<string, GeoQuery>>();\n  public emittedGeoQueries: Map<string, GeoQuery> = new Map();\n  /** Constants */\n  public GEO_QUERIES_DESCRIPTION = marker('Draw a bbox or a polygon that');\n\n  public geoQueriesFormGroups = new Array<FormGroup<{\n    a_operation: SelectFormControl;\n    b_geometryPath: SelectFormControl;\n    c_collection: UntypedFormControl;\n    d_displayCollectionName: UntypedFormControl;\n  }>>();\n  public collectionsColors = new Array<string>();\n  public selectionsSnapshot = new Map<string, string>();\n\n  private readonly _onDestroy$ = new Subject<boolean>();\n\n  public constructor(\n    private readonly dialogRef: MatDialogRef<MapSettingsComponent>,\n    private readonly colorGeneratorLoader: ArlasColorService) { }\n\n  public ngOnDestroy() {\n    this._onDestroy$.next(true);\n    this._onDestroy$.complete();\n  }\n\n  /** Emits the geo-query to apply */\n  public emitGeoFilter() {\n    this.geoQueryEmitter.next(this.emittedGeoQueries);\n  }\n\n  /** Closes the dialog */\n  public onClose() {\n    this.dialogRef.close();\n  }\n\n  public createGeoQueryForm(collectionName: string, displayCollectionName: string,\n      filterGeometries: Array<GeometrySelectModel>, operationsSelectModel: Array<OperationSelectModel>): void {\n    /** geometry */\n    const geometryPaths = filterGeometries.map(fg => fg.path);\n    const selectedGeometry = filterGeometries.find(fg => fg.selected);\n    const selectedGeometryPath = !!selectedGeometry ? selectedGeometry.path : '';\n    /** operation */\n    const operations = operationsSelectModel.map(osm => osm.operation);\n    const selectedOperationSelectModel = operationsSelectModel.find(osm => osm.selected);\n    const selectedOperation = !!selectedOperationSelectModel ?  selectedOperationSelectModel.operation : GeoQueryOperator.INTERSECTS;\n    const geoQueryControls = {\n      a_operation: new SelectFormControl(selectedOperation, '', operations),\n      b_geometryPath: new SelectFormControl(selectedGeometryPath, '', geometryPaths),\n      c_collection: new UntypedFormControl(collectionName),\n      d_displayCollectionName: new UntypedFormControl(displayCollectionName),\n    };\n    const geoQueryForm = new FormGroup(geoQueryControls);\n    /** snapshot defaultselections */\n    this.emittedGeoQueries.clear();\n    this.selectionsSnapshot.clear();\n    this.selectionsSnapshot.set(collectionName, selectedGeometry + selectedOperation);\n    geoQueryForm.valueChanges\n      .pipe(takeUntil(this._onDestroy$))\n      .subscribe(vc => {\n      const selectionSnapShot = vc.b_geometryPath + vc.a_operation;\n      /** ignore selection changes if the user go back to initial state of a control */\n      const ignoreChange = selectionSnapShot === this.selectionsSnapshot.get(vc.c_collection);\n      if (ignoreChange) {\n        this.emittedGeoQueries.delete(vc.c_collection);\n      } else {\n        this.emittedGeoQueries.set(vc.c_collection, {\n          geometry_path: vc.b_geometryPath,\n          operation: vc.a_operation\n        });\n      }\n    });\n    this.collectionsColors.push((this.colorGeneratorLoader.getColor(collectionName)));\n    this.geoQueriesFormGroups.push(geoQueryForm);\n  }\n}\n\n@Component({\n    selector: 'arlas-map-settings',\n    template: '',\n    styleUrls: ['./map-settings.component.scss']\n})\nexport class MapSettingsComponent {\n\n  /**\n   * @Output : Angular\n   * Emits the geo-query to apply. A geo-query is defined by\n   * - the operation (\"within\", \"intersects\", \"notwithin\", \"notintersects\")\n   * - the geometry field to query\n   */\n  @Output() public geoQueryEmitter = new Subject<Map<string, GeoQuery>>();\n\n  public dialogRef?: MatDialogRef<MapSettingsDialogComponent>;\n\n  public constructor(private readonly dialog: MatDialog) { }\n\n  public openDialog(mapSettingsService: MapSettingsService) {\n    this.dialogRef = this.dialog.open(MapSettingsDialogComponent, { data: null, panelClass: 'map-settings-dialog' });\n    const mapGeoQueries = mapSettingsService.getGeoQueries();\n    if (!!mapGeoQueries) {\n      for (const [collection, geoQueries] of mapGeoQueries.entries()) {\n        this.dialogRef.componentInstance.createGeoQueryForm(collection, geoQueries[2], geoQueries[0], geoQueries[1]);\n      }\n    }\n    this.dialogRef.componentInstance.geoQueryEmitter = this.geoQueryEmitter;\n  }\n}\n","<h1 mat-dialog-title class=\"mapgl-settings__title\">\n  {{ 'Geo-queries' | translate }}\n</h1>\n\n<div mat-dialog-content class=\"mapgl-settings\">\n  <div class=\"mapgl-settings__description\">\n    {{ GEO_QUERIES_DESCRIPTION | translate }}\n  </div>\n  @for (formGroup of geoQueriesFormGroups; track formGroup; let i = $index) {\n    <div class=\"mapgl-settings__form\" [formGroup]=\"formGroup\" [style.borderLeftColor]=\"collectionsColors[i]\">\n      <div class=\"mapgl-settings__form__steps\">\n        <div class=\"mapgl-settings__form__steps__item\">\n          <ng-container [ngTemplateOutlet]=\"select\" [ngTemplateOutletContext]=\"{ form: formGroup.controls.a_operation, name: 'a_operation' | marker }\"></ng-container>\n        </div>\n        <div class=\"mapgl-settings__form__steps__item\">\n          <ng-container [ngTemplateOutlet]=\"select\" [ngTemplateOutletContext]=\"{ form: formGroup.controls.b_geometryPath, name: 'b_geometryPath' | marker }\"></ng-container>\n        </div>\n        <div class=\"mapgl-settings__form__steps__item\">\n          <div>\n            {{ 'of_collection' | translate: { collection: (formGroup.controls.d_displayCollectionName.value | getCollectionDisplayName | translate) } }}\n          </div>\n        </div>\n      </div>\n    </div>\n  }\n</div>\n\n<div mat-dialog-actions class=\"mapgl-settings__actions\">\n  <button matButton=\"outlined\" color=\"primary\" class=\"mapgl-settings__actions--apply\"\n    (click)=\"emitGeoFilter()\">{{ 'Apply geo-queries' | translate }}</button>\n  <button matButton=\"filled\" color=\"primary\" class=\"mapgl-settings__actions--apply\"\n    (click)=\"emitGeoFilter();onClose()\">{{ 'Set geo-queries' | translate }}</button>\n  <button matButton=\"outlined\" class=\"mapgl-settings__actions--cancel\"\n    (click)=\"onClose()\">{{ 'Cancel' | translate}}</button>\n</div>\n\n<ng-template #select let-form=\"form\" let-name=\"name\">\n  <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n    <mat-label>{{ name | translate }}</mat-label>\n    <mat-select [formControl]=\"form\">\n      @for (option of form.syncOptions; track option) {\n        <mat-option [value]=\"option\">\n          {{option | translate}}\n        </mat-option>\n      }\n    </mat-select>\n  </mat-form-field>\n</ng-template>\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n\n/** All the map controls configuration\n * These interfaces are generic.\n */\n\nexport type ControlPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';\n\nexport interface IconConfig {\n  path: string;\n  recolorable?: boolean;\n}\n\nexport interface ConfigControls {\n  enable: boolean;\n  position?: ControlPosition;\n  config?: any;\n  overrideEvent?: { event: any; fn: (e: Event) => void; };\n}\n\nexport interface NavigationConfigControls extends ConfigControls {\n  config: {\n    showCompass: boolean;\n    showZoom: boolean;\n    visualizePitch: boolean;\n  };\n}\n\nexport interface ControlsOption {\n  mapAttribution?: ConfigControls;\n  scale?: ConfigControls;\n  navigationControl?: NavigationConfigControls;\n  globe?: ConfigControls;\n}\n\nexport interface DrawConfigControl extends ConfigControls {\n  name?: string;\n}\n\nexport interface DrawControlsOption {\n  draw: { control: any; position?: ControlPosition; };\n  addGeoBox: DrawConfigControl;\n  removeAois: DrawConfigControl;\n}\n\nexport class ControlButton<ArlasMap> {\n  public map: ArlasMap | undefined;\n  public btn?: HTMLButtonElement;\n  public container?: HTMLDivElement;\n  public icon?: string;\n  public name;\n  private readonly tooltip: string;\n  public btnClasses: string[] = [];\n  public containerClasses: string[] = [];\n\n  public constructor(name: string, tooltip?: string) {\n    this.name = name;\n    this.tooltip = tooltip ?? '';\n    this._buildClasses();\n  }\n\n  protected _buildClasses() {\n    this.btnClasses = [];\n    this.containerClasses = [];\n  }\n\n  public onAdd(map: ArlasMap) {\n    this.map = map;\n    this.btn = document.createElement('button');\n    this.btn.className = this.btnClasses.join(' ');\n    this.btn.type = 'button';\n    this.btn.id = 'layers_switcher_btn';\n    this.container = document.createElement('div');\n    this.container.className = this.containerClasses.join(' ');\n    this.container.setAttribute('title', this.tooltip);\n    this.container.appendChild(this.btn);\n    return this.container;\n  }\n  public onRemove() {\n    if (this.container) {\n      this.container.remove();\n    }\n    this.map = undefined;\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { ArlasPaint } from '../model/layers';\n\n/** This file describes how to style a vector layer */\n\nexport enum VectorStyleEnum {\n    circle = 'circle',\n    fill = 'fill',\n    line = 'line'\n}\n\nexport class VectorStyle {\n    public type: VectorStyleEnum;\n    public style: ArlasPaint;\n    public constructor(type: VectorStyleEnum, style: ArlasPaint) {\n        this.type = type;\n        this.style = style;\n    }\n}\n","\n/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n/*\n * Public API Surface of arlas-map\n */\n\nexport { ArlasMapFrameworkService } from './lib/arlas-map-framework.service';\nexport { ArlasMapComponent, LayerDownloadEvent } from './lib/arlas-map.component';\nexport { AbstractArlasMapService, ARLAS_RASTER_SOURCE_PREFIX, QUICKLOOK_ON_MAP_LAYER_PREFIX } from './lib/arlas-map.service';\nexport { BasemapComponent } from './lib/basemaps/basemap.component';\nexport { BasemapStyle } from './lib/basemaps/basemap.config';\nexport { BasemapService } from './lib/basemaps/basemap.service';\nexport { ArlasBasemaps } from './lib/basemaps/basemaps.model';\nexport { BboxFormErrorPipe } from './lib/bbox-generator/bbox-form-error.pipe';\nexport { BboxGeneratorComponent } from './lib/bbox-generator/bbox-generator.component';\nexport { BboxFormGroup } from './lib/bbox-generator/bbox-generator.utils';\nexport { Coordinate } from './lib/bbox-generator/coordinates.tools';\nexport { CoordinatesComponent } from './lib/coordinates/coordinates.component';\nexport { CoordinatesErrorPipe } from './lib/coordinates/coordinates.pipe';\nexport { AbstractDraw } from './lib/draw/AbstractDraw';\nexport { AoiEdition, Corner } from './lib/draw/draw.models';\nexport { MapboxAoiDrawService } from './lib/draw/draw.service';\nexport { circleMode } from './lib/draw/modes/circles/circle.mode';\nexport { radiusCircleMode } from './lib/draw/modes/circles/radius.circle.mode';\nexport { createSupplementaryPointsForCircle, dragPan } from './lib/draw/modes/circles/utils';\nexport { directModeOverride } from './lib/draw/modes/directSelectOverride';\nexport { limitVertexDirectSelectMode } from './lib/draw/modes/LimitVertexDirectSelectMode';\nexport { rectangleMode } from './lib/draw/modes/rectangleMode';\nexport { simpleSelectModeOverride } from './lib/draw/modes/simpleSelectOverride';\nexport { stripDirectSelectMode } from './lib/draw/modes/strip/strip.direct.mode';\nexport { stripMode } from './lib/draw/modes/strip/strip.mode';\nexport { validGeomDrawPolygonMode } from './lib/draw/modes/ValidGeomDrawPolygonMode';\nexport { buildDrawStyle, DrawTheme } from './lib/draw/themes/default-theme';\nexport { FormatLegendPipe } from './lib/legend/format-legend.pipe';\nexport { LayerIdToName } from './lib/legend/layer-name.pipe';\nexport { LayerIconComponent } from './lib/legend/legend-icon/layer-icon.component';\nexport { LegendItemComponent } from './lib/legend/legend-item/legend-item.component';\nexport { LegendComponent } from './lib/legend/legend.component';\nexport {\n  CircleLegend, FillLegend, HeatmapLegend, LabelLegend, Legend, LegendData, LineLegend, PROPERTY_SELECTOR_SOURCE\n} from './lib/legend/legend.config';\nexport { LegendService } from './lib/legend/legend.service';\nexport { getMax, MAX_CIRLE_RADIUS, MAX_LINE_WIDTH } from './lib/legend/legend.tools';\nexport { AllowedImportGeometry, MapImportComponent, MapImportDialogComponent } from './lib/map-import/map-import.component';\nexport {\n  GeometrySelectModel, GeoQuery, GeoQueryOperator, MapSettingsComponent, MapSettingsDialogComponent, MapSettingsService, OperationSelectModel\n} from './lib/map-settings/map-settings.component';\nexport {\n  AbstractArlasMapGL, ArlasMapOffset, ArlasMapOption, CROSS_LAYER_PREFIX,\n  GEOJSON_SOURCE_TYPE, HILLSHADE_SOURCE, LAYER_SWITCHER_TOOLTIP, MapConfig,\n  OPACITY_SUFFIX, RESET_BEARING, TERRAIN_SOURCE, ZOOM_IN, ZOOM_OUT\n} from './lib/map/AbstractArlasMapGL';\nexport {\n  ConfigControls, ControlButton, ControlPosition, ControlsOption, DrawConfigControl, DrawControlsOption, IconConfig\n} from './lib/map/model/controls';\nexport { InteractedFeature, InteractedFeatures, MapLayerMouseEvent, MapMouseEvent } from './lib/map/model/events';\nexport { MapExtent } from './lib/map/model/extent';\nexport { GET, HEATMAP_DENSITY, IN, INTERPOLATE, MATCH, NOT_IN, OTHER } from './lib/map/model/filters';\nexport * from './lib/map/model/layers';\nexport {\n  ARLAS_ID, ARLAS_VSET, ArlasDataLayer, ArlasPaint, ExternalEvent, ExternalEventLayer, FillStroke, FILLSTROKE_LAYER_PREFIX, getLayerName,\n  HOVER_LAYER_PREFIX, LayerEvents, LayerMetadata, MapLayers, MetadataHiddenProps, PaintColor, PaintValue, SCROLLABLE_ARLAS_ID, SELECT_LAYER_PREFIX\n} from './lib/map/model/layers';\nexport { ArlasLngLat, ArlasLngLatBounds, OnMoveResult } from './lib/map/model/map';\nexport { ArlasMapSource } from './lib/map/model/sources';\nexport { TerrainConfiguration } from './lib/map/model/terrain';\nexport { VectorStyle, VectorStyleEnum } from './lib/map/model/vector-style';\nexport { VisualisationSetConfig } from './lib/map/model/visualisationsets';\nexport { getAdditionalFillLayers, latLngToWKT } from './lib/map/tools';\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["Subject","i1","i1.MapboxAoiDrawService","i2","i3","i4.AbstractArlasMapService","i1.LegendService","area","i2.BasemapService","i5.LegendService","MatFormField","MatLabel","MatError","i4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;AAiBG;MAoBU,WAAW,CAAA;AACf,IAAA,GAAG;AACH,IAAA,GAAG;IAEV,WAAA,CAAmB,GAAW,EAAE,GAAW,EAAA;AACzC,QAAA,IAAI,CAAC,GAAG,GAAG,GAAG;AACd,QAAA,IAAI,CAAC,GAAG,GAAG,GAAG;IAChB;IAEO,OAAO,GAAA;QACZ,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAA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