@mapcomponents/react-maplibre 0.1.71 → 0.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -1
- package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +1 -0
- package/dist/components/MlSketchTool/LayerList/ColorPicker.d.ts +1 -1
- package/dist/index.esm.js +130 -66
- package/dist/index.esm.js.map +1 -1
- package/dist/ui_components/ColorPicker/ColorPicker.d.ts +17 -0
- package/dist/ui_components/ColorPicker/transformers.d.ts +10 -0
- package/dist/ui_components/LayerList/LayerList.stories.d.ts +3 -1
- package/package.json +3 -2
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/components/MapLibreMap/lib/MapLibreGlWrapper.ts","../src/ui_components/MapcomponentsTheme.tsx","../src/contexts/MapContext.tsx","../src/components/MapLibreMap/MapLibreMap.tsx","../src/hooks/useMapState.ts","../src/hooks/useMap.ts","../src/components/MlCenterPosition/MlCenterPosition.tsx","../src/components/MlComponentTemplate/MlComponentTemplate.tsx","../src/hooks/useExportMap/lib.ts","../src/hooks/useExportMap/index.ts","../src/components/MlCreatePdfButton/MlCreatePdfButton.tsx","../src/components/MlCreatePdfForm/lib/pdf.templates.ts","../src/components/MlCreatePdfForm/lib/PdfContext.tsx","../src/components/MlCreatePdfForm/lib/PdfPreview.tsx","../src/components/MlCreatePdfForm/lib/PdfForm.tsx","../src/components/MlCreatePdfForm/MlCreatePdfForm.tsx","../src/components/MlFeatureEditor/lib/constants.js","../src/components/MlFeatureEditor/lib/common_selectors.js","../src/components/MlFeatureEditor/lib/double_click_zoom.js","../src/components/MlFeatureEditor/lib/is_event_at_coordinates.js","../src/components/MlFeatureEditor/lib/create_vertex.js","../src/components/MlFeatureEditor/custom-polygon-mode.js","../src/components/MlFeatureEditor/lib/mouse_event_point.js","../src/components/MlFeatureEditor/lib/create_midpoint.js","../src/components/MlFeatureEditor/lib/create_supplementary_points.js","../src/components/MlFeatureEditor/lib/string_set.js","../node_modules/@mapbox/geojson-extent/index.js","../src/components/MlFeatureEditor/lib/constrain_feature_movement.js","../src/components/MlFeatureEditor/lib/move_features.js","../src/components/MlFeatureEditor/custom-select-mode.js","../src/components/MlFeatureEditor/lib/utils.js","../src/components/MlFeatureEditor/custom-direct-select-mode.js","../src/components/MlFeatureEditor/MlFeatureEditor.tsx","../src/hooks/useLayer.ts","../src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx","../src/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.ts","../src/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.ts","../src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx","../src/components/MlFollowGps/MlFollowGps.tsx","../src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx","../src/components/MlMeasureTool/MlMeasureTool.tsx","../src/components/MlNavigationCompass/assets/rotate_right.svg","../src/components/MlNavigationCompass/assets/rotate_left.svg","../src/components/MlNavigationCompass/assets/needle.svg","../src/components/MlNavigationCompass/MlNavigationCompass.tsx","../src/components/MlNavigationTools/MlNavigationTools.tsx","../src/components/MlLayer/MlLayer.tsx","../src/components/MlScaleReference/MlScaleReference.tsx","../src/components/MlLayerMagnify/MlLayerMagnify.tsx","../src/components/MlLayerSwipe/MlLayerSwipe.tsx","../src/components/MlTransitionGeoJsonLayer/util/transitionFunctions.js","../src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx","../src/components/MlMarker/MlMarker.tsx","../src/components/MlOsmLayer/MlOsmLayer.js","../src/hooks/useGpx/lib/gpxConverter.js","../src/hooks/useGpx/useGpx.tsx","../src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx","../src/hooks/useSource.ts","../src/components/MlGpxViewer/MlGpxViewer.tsx","../src/components/MlGpxViewer/util/GeoJsonContext.ts","../src/components/MlGpxViewer/util/GeoJsonProvider.tsx","../src/components/MlShareMapState/MlShareMapState.tsx","../src/components/MlSpatialElevationProfile/util/getElevationData.tsx","../src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx","../src/components/MlVectorTileLayer/MlVectorTileLayer.tsx","../src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js","../src/components/MlWmsLayer/MlWmsLayer.tsx","../src/hooks/useWms.ts","../src/components/MlWmsLoader/MlWmsLoader.tsx","../src/components/MlBasicComponent.js","../src/hooks/useCameraFollowPath/useCameraFollowPath.tsx","../src/hooks/useLayerFilter/useLayerFilter.ts","../src/hooks/useLayerEvent.js","../src/contexts/SimpleDataContext.js","../src/contexts/SimpleDataProvider.js","../src/ui_components/LayerList/LayerList.tsx","../src/ui_components/LayerList/util/input/ColorPicker.tsx","../src/ui_components/LayerList/util/LayerPropertyForm.tsx","../src/ui_components/LayerList/LayerListFolder.tsx","../src/ui_components/LayerList/util/LayerListItemVectorLayer.tsx","../src/ui_components/LayerList/LayerListItem.tsx","../src/ui_components/TopToolbar.tsx","../src/ui_components/Sidebar.tsx"],"sourcesContent":["import {\n\tMap,\n\tIControl,\n\tMapOptions as MapOptionsType,\n\tMapEventType,\n\tMapLayerEventType,\n\tStyleImageInterface,\n\tLayerSpecification,\n\tCustomLayerInterface,\n\tSourceSpecification,\n\tControlPosition,\n\tStyleImageMetadata,\n} from 'maplibre-gl';\nimport { Map as MapType, Style } from 'maplibre-gl';\n\ntype WrapperEventArgArray = [string, (arg0: unknown) => void];\ntype EventArgArray = [\n\tkeyof MapLayerEventType | keyof MapEventType,\n\tstring | ((arg0: unknown) => void),\n\t((arg0: unknown) => void)?\n];\ntype LayerState = {\n\tid: string;\n\ttype: string;\n\tvisible: boolean;\n\tbaseLayer: boolean;\n};\ntype ViewportState = {\n\tcenter: { lng: number; lat: number };\n\tzoom: number;\n\tbearing: number;\n\tpitch: number;\n};\n\n/**\n * Creates a MapLibre-gl-js instance and offers all of the native MapLibre functions and properties as well as additional functionality such as element registration & cleanup and more events.\n *\n * @param {object} props\n *\n * @class\n */\n\ninterface MapLibreGlWrapper extends MapType {\n\taddImage: (\n\t\tid: string,\n\t\timage:\n\t\t\t| HTMLImageElement\n\t\t\t| ImageBitmap\n\t\t\t| ImageData\n\t\t\t| {\n\t\t\t\t\twidth: number;\n\t\t\t\t\theight: number;\n\t\t\t\t\tdata: Uint8Array | Uint8ClampedArray;\n\t\t\t }\n\t\t\t| StyleImageInterface,\n\t\tkey?: Partial<StyleImageMetadata> | string | undefined,\n\t\tcomponentId?: string | undefined\n\t) => this;\n\taddLayer: (\n\t\tlayer:\n\t\t\t| (LayerSpecification & {\n\t\t\t\t\tsource?: string | SourceSpecification | undefined;\n\t\t\t })\n\t\t\t| (CustomLayerInterface & {\n\t\t\t\t\tsource?: string | SourceSpecification | undefined;\n\t\t\t }),\n\t\tbeforeId?: string | undefined,\n\t\tcomponentId?: string | undefined\n\t) => this;\n}\nclass MapLibreGlWrapper {\n\tregisteredElements: {\n\t\t[key: string]: {\n\t\t\tlayers: [string?];\n\t\t\tsources: [string?];\n\t\t\timages: [string?];\n\t\t\tcontrols: [(IControl | unknown)?];\n\t\t\tevents: [EventArgArray?];\n\t\t\twrapperEvents: [WrapperEventArgArray?];\n\t\t};\n\t};\n\tbaseLayers: [string?];\n\tfirstSymbolLayer: string | undefined;\n\teventHandlers: {\n\t\tlayerchange: {\n\t\t\thandler: (ev: unknown) => void;\n\t\t\toptions?: object | string;\n\t\t}[];\n\t\tviewportchange: {\n\t\t\thandler: (ev: unknown) => void;\n\t\t}[];\n\t};\n\twrapper: {\n\t\ton: (\n\t\t\teventName: string,\n\t\t\thandler: (ev: unknown) => void,\n\t\t\toptions?: object | string,\n\t\t\tcomponentId?: string\n\t\t) => void;\n\t\toff: (type: string, listener: (ev: unknown) => void) => void;\n\t\tfire: (eventName: string, context?: unknown) => void;\n\t\tlayerState: LayerState[];\n\t\tlayerStateString: string;\n\t\toldLayerStateStrings: object;\n\t\tbuildLayerObject: (layer: ReturnType<Style['getLayer']>) => LayerState;\n\t\tbuildLayerObjects: () => LayerState[];\n\t\trefreshLayerState: () => void;\n\t\tviewportState: ViewportState;\n\t\tviewportStateString: string;\n\t\toldViewportStateString: string;\n\t\tgetViewport: () => {\n\t\t\tcenter: { lng: number; lat: number };\n\t\t\tzoom: number;\n\t\t\tbearing: number;\n\t\t\tpitch: number;\n\t\t};\n\t\trefreshViewport: () => void;\n\t};\n\tinitRegisteredElements: (componentId: string, force?: boolean | undefined) => void;\n\taddNativeMaplibreFunctionsAndProps: () => void;\n\tmap: MapType;\n\tstyle: Style;\n\n\tstyleJson: object;\n\taddSource: (id: string, source: SourceSpecification, componentId?: string | undefined) => this;\n\taddControl: (\n\t\tcontrol: IControl | unknown,\n\t\tposition?: ControlPosition | undefined,\n\t\tcomponentId?: string | undefined\n\t) => this;\n\ton: (\n\t\ttype: keyof MapLayerEventType | keyof MapEventType | string,\n\t\tlayerId: string | ((ev: unknown) => void),\n\t\thandler?: ((ev: MapEventType & unknown) => Map | void) | string,\n\t\tcomponentId?: string | undefined\n\t) => this;\n\tcleanup: (componentId: string) => void;\n\n\tconstructor(props: {\n\t\tmapOptions: MapOptionsType;\n\t\tonReady: (map: MapType, context: unknown) => void;\n\t}) {\n\t\t// closure variable to safely point to the object context of the current MapLibreGlWrapper instance\n\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias\n\t\tconst self = this;\n\n\t\t// element registration and cleanup on a component level is experimental\n\t\tthis.registeredElements = {};\n\n\t\t// array of base layer ids, all layers that have been added by the style passed to the MapLibreGl coonstructor\n\t\tthis.baseLayers = [];\n\n\t\t// layer id of the first symbol layer\n\t\tthis.firstSymbolLayer = undefined;\n\n\t\t// event handlers registered in MapLibreGlWrapper\n\t\tthis.eventHandlers = {\n\t\t\tlayerchange: [],\n\t\t\tviewportchange: [],\n\t\t};\n\n\t\t// functions and properties provided by the wrapper\n\t\t// Add new functions and properties introduced by the wrapper to this object to prevent collisions due to future MapLibre API changes\n\t\tthis.wrapper = {\n\t\t\t/**\n\t\t\t * Subscribe the given event handler to an event\n\t\t\t *\n\t\t\t * @param {string} eventName\n\t\t\t * @param {function} handler\n\t\t\t * @param {object} options\n\t\t\t * @param {string} componentId\n\t\t\t * @returns {undefined}\n\t\t\t */\n\t\t\ton: (\n\t\t\t\teventName: string,\n\t\t\t\thandler: (ev: unknown) => void,\n\t\t\t\toptions?: object | string,\n\t\t\t\tcomponentId?: string\n\t\t\t) => {\n\t\t\t\tif (!self.eventHandlers[eventName]) return;\n\n\t\t\t\tif (typeof options === 'string') {\n\t\t\t\t\tcomponentId = options;\n\t\t\t\t\toptions = {};\n\t\t\t\t}\n\n\t\t\t\tself.eventHandlers[eventName].push({ handler, options });\n\n\t\t\t\tconst _arguments: WrapperEventArgArray = [eventName, handler];\n\t\t\t\tif (componentId && typeof componentId === 'string') {\n\t\t\t\t\tself.initRegisteredElements(componentId);\n\t\t\t\t\tself.registeredElements[componentId].wrapperEvents.push(_arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/**\n\t\t\t * Unsubscribes the given event handler from an event\n\t\t\t *\n\t\t\t * @param {string} eventName\n\t\t\t * @param {function} handler\n\t\t\t * @returns {undefined}\n\t\t\t */\n\t\t\toff: (eventName, handler) => {\n\t\t\t\tif (!self.eventHandlers[eventName]) return;\n\n\t\t\t\tself.eventHandlers[eventName] = self.eventHandlers[eventName].filter(\n\t\t\t\t\t(item: WrapperEventArgArray) => {\n\t\t\t\t\t\tif (!Object.is(item[1], handler)) {\n\t\t\t\t\t\t\treturn item;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Calls all event handlers that have been subscribed to the given eventName\n\t\t\t *\n\t\t\t * @param {string} eventName\n\t\t\t * @param {object} context\n\t\t\t * @returns {undefined}\n\t\t\t */\n\t\t\tfire: (eventName, context) => {\n\t\t\t\tif (!self.eventHandlers[eventName]) return;\n\n\t\t\t\tconst scope = context || window;\n\t\t\t\tconst event = new Event(eventName);\n\n\t\t\t\tself.eventHandlers[eventName].forEach(function (\n\t\t\t\t\titem:\n\t\t\t\t\t\t| MapLibreGlWrapper['eventHandlers']['layerchange'][0]\n\t\t\t\t\t\t| MapLibreGlWrapper['eventHandlers']['viewportchange'][0]\n\t\t\t\t) {\n\t\t\t\t\titem.handler.call(scope, event, self);\n\t\t\t\t});\n\t\t\t},\n\t\t\t/**\n\t\t\t * Array containing an object for each layer in the MapLibre instance providing information on visibility, loading state, order, paint & layout properties\n\t\t\t */\n\t\t\tlayerState: [],\n\t\t\t/**\n\t\t\t * Maps layerIds to layerState in JSON string form for quick deep comparisons\n\t\t\t */\n\t\t\tlayerStateString: '',\n\t\t\t/**\n\t\t\t * Previous Version of layerStateString\n\t\t\t */\n\t\t\toldLayerStateStrings: {},\n\t\t\t/**\n\t\t\t * Builds the layer info object for a given layer id\n\t\t\t *\n\t\t\t * @param {string} layer\n\t\t\t * @returns object\n\t\t\t */\n\t\t\tbuildLayerObject: (layer: ReturnType<Style['getLayer']>) => {\n\t\t\t\t//if (self.baseLayers.indexOf(layer.id) === -1) {\n\t\t\t\t//let paint = {};\n\t\t\t\t//let values = layer.paint?._values;\n\t\t\t\t//Object.keys(values || {}).map((propName) => {\n\t\t\t\t//\tpaint[propName] =\n\t\t\t\t//\t\ttypeof values[propName].value !== \"undefined\"\n\t\t\t\t//\t\t\t? values[propName].value.value\n\t\t\t\t//\t\t\t: values[propName];\n\t\t\t\t//});\n\t\t\t\t//let layout = {};\n\t\t\t\t//values = layer.layout?._values;\n\t\t\t\t//Object.keys(values || {}).map((propName) => {\n\t\t\t\t//\tlayout[propName] =\n\t\t\t\t//\t\ttypeof values[propName].value !== \"undefined\"\n\t\t\t\t//\t\t\t? values[propName].value.value\n\t\t\t\t//\t\t\t: values[propName];\n\t\t\t\t//});\n\t\t\t\treturn {\n\t\t\t\t\tid: layer.id,\n\t\t\t\t\ttype: layer.type,\n\t\t\t\t\tvisible: layer.visibility === 'none' ? false : true,\n\t\t\t\t\tbaseLayer: self.baseLayers.indexOf(layer.id) !== -1,\n\t\t\t\t\t//paint,\n\t\t\t\t\t//layout,\n\t\t\t\t\t//filter: layers[layerId].filter,\n\t\t\t\t\t//layout: layers[layerId].layout,\n\t\t\t\t\t//maxzoom: layers[layerId].maxzoom,\n\t\t\t\t\t//metadata: layers[layerId].metadata,\n\t\t\t\t\t//minzoom: layers[layerId].minzoom,\n\t\t\t\t\t//paint: layers[layerId].paint.get(),\n\t\t\t\t\t//source: layers[layerId].source,\n\t\t\t\t\t//sourceLayer: layers[layerId].sourceLayer,\n\t\t\t\t};\n\t\t\t\t//}\n\t\t\t},\n\t\t\t/**\n\t\t\t * Returns an array of layer state info objects for all layers in the MapLibre instance\n\t\t\t *\n\t\t\t * @returns array\n\t\t\t */\n\t\t\tbuildLayerObjects: () => {\n\t\t\t\treturn self.map.style._order\n\t\t\t\t\t.map((layerId: string) => {\n\t\t\t\t\t\treturn self.wrapper.buildLayerObject(self.map.style._layers[layerId]);\n\t\t\t\t\t})\n\t\t\t\t\t.filter((n) => typeof n !== 'undefined');\n\t\t\t},\n\t\t\t/**\n\t\t\t * Updates layer state info objects\n\t\t\t */\n\t\t\trefreshLayerState: () => {\n\t\t\t\tself.wrapper.layerState = self.wrapper.buildLayerObjects();\n\t\t\t\tif (JSON.stringify(self.wrapper.layerState) !== self.wrapper.layerStateString) {\n\t\t\t\t\tself.wrapper.fire('layerchange');\n\t\t\t\t\tself.wrapper.layerStateString = JSON.stringify(self.wrapper.layerState);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/**\n\t\t\t * Object containing information on the current viewport state\n\t\t\t */\n\t\t\tviewportState: {\n\t\t\t\tcenter: { lng: 0, lat: 0 },\n\t\t\t\tzoom: 0,\n\t\t\t\tbearing: 0,\n\t\t\t\tpitch: 0,\n\t\t\t},\n\t\t\t/**\n\t\t\t * The same data as viewportState in JSON string form for quick deep comparisons\n\t\t\t */\n\t\t\tviewportStateString: '{}',\n\t\t\t/**\n\t\t\t * Previous version of viewportStateString\n\t\t\t */\n\t\t\toldViewportStateString: '{}',\n\t\t\tgetViewport: () =>\n\t\t\t\ttypeof self.map.getCenter === 'function'\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcenter: (({ lng, lat }) => ({ lng, lat }))(self.map.getCenter()),\n\t\t\t\t\t\t\tzoom: self.map.getZoom(),\n\t\t\t\t\t\t\tbearing: self.map.getBearing(),\n\t\t\t\t\t\t\tpitch: self.map.getPitch(),\n\t\t\t\t\t }\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tcenter: { lng: 0, lat: 0 },\n\t\t\t\t\t\t\tzoom: 0,\n\t\t\t\t\t\t\tbearing: 0,\n\t\t\t\t\t\t\tpitch: 0,\n\t\t\t\t\t },\n\t\t\trefreshViewport: () => {\n\t\t\t\tself.wrapper.viewportState = self.wrapper.getViewport();\n\t\t\t},\n\t\t};\n\n\t\t/**\n\t\t * Initializes an empty registered elements object for the given componentId\n\t\t *\n\t\t * @param {string} componentId\n\t\t * @param {boolean} force\n\t\t */\n\t\tthis.initRegisteredElements = (componentId: string, force?: boolean | undefined) => {\n\t\t\tif (\n\t\t\t\ttypeof self.registeredElements[componentId] === 'undefined' ||\n\t\t\t\t(typeof force !== 'undefined' && force)\n\t\t\t) {\n\t\t\t\tself.registeredElements[componentId] = {\n\t\t\t\t\tlayers: [],\n\t\t\t\t\tsources: [],\n\t\t\t\t\timages: [],\n\t\t\t\t\tevents: [],\n\t\t\t\t\tcontrols: [],\n\t\t\t\t\twrapperEvents: [],\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Overrides MapLibre-gl-js addLayer function providing an additional componentId parameter for the wrapper element registration.\n\t\t *\n\t\t * @param {object} layer\n\t\t * @param {string} beforeId\n\t\t * @param {string} componentId\n\t\t */\n\t\tthis.addLayer = (layer, beforeId, componentId) => {\n\t\t\tif (!self.map.style) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tif (componentId && typeof componentId === 'string' && typeof layer.id !== 'undefined') {\n\t\t\t\tself.initRegisteredElements(componentId);\n\t\t\t\tself.registeredElements[componentId].layers.push(layer.id);\n\n\t\t\t\tif (layer?.source && typeof layer?.source !== 'string') {\n\t\t\t\t\tself.registeredElements[componentId].sources.push(layer.id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tself.map.addLayer(layer, beforeId);\n\t\t\treturn this;\n\t\t};\n\n\t\t/**\n\t\t * Overrides MapLibre-gl-js addSource function providing an additional componentId parameter for the wrapper element registration.\n\t\t *\n\t\t * @param {string} sourceId\n\t\t * @param {object} source\n\t\t * @param {object} options\n\t\t * @param {string} componentId\n\t\t * @returns {undefined}\n\t\t */\n\t\tthis.addSource = (sourceId, source, componentId) => {\n\t\t\tif (!self.map.style) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tif (componentId && typeof componentId === 'string' && typeof sourceId !== 'undefined') {\n\t\t\t\tself.initRegisteredElements(componentId);\n\t\t\t\tself.registeredElements[componentId].sources.push(sourceId);\n\t\t\t}\n\n\t\t\tself.map.addSource(sourceId, source);\n\t\t\treturn this;\n\t\t};\n\n\t\t/**\n\t\t * Overrides MapLibre-gl-js addImage function providing an additional componentId parameter for the wrapper element registration.\n\t\t *\n\t\t * @param {string} id\n\t\t * @param {*} image\n\t\t * @param {*} ref\n\t\t * @param {string} componentId\n\t\t */\n\t\tthis.addImage = (id, image, meta, componentId) => {\n\t\t\tif (!self.map.style) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tif (typeof meta === 'string' && typeof componentId === 'undefined') {\n\t\t\t\treturn self.addImage(id, image, undefined, meta);\n\t\t\t}\n\t\t\tif (componentId && typeof componentId === 'string' && typeof id !== 'undefined') {\n\t\t\t\tself.initRegisteredElements(componentId);\n\t\t\t\tself.registeredElements[componentId].images.push(id);\n\t\t\t}\n\n\t\t\tself.map.addImage(id, image, meta as Partial<StyleImageMetadata> | undefined);\n\t\t\treturn this;\n\t\t};\n\n\t\t/**\n\t\t * Overrides MapLibre-gl-js on function providing an additional componentId parameter for the wrapper element registration.\n\t\t *\n\t\t * @param {string} type\n\t\t * @param {string} layerId\n\t\t * @param {function} handler\n\t\t * @param {string} componentId\n\t\t */\n\t\tthis.on = (\n\t\t\ttype: keyof MapLayerEventType | keyof MapEventType,\n\t\t\tlayerId: string | ((ev: unknown) => void),\n\t\t\thandler: (ev: MapEventType & unknown) => Map | void,\n\t\t\tcomponentId?: string\n\t\t) => {\n\t\t\tif (typeof handler === 'string' && typeof layerId === 'function') {\n\t\t\t\treturn self.on.call(self, type, undefined, layerId, handler);\n\t\t\t}\n\n\t\t\tlet _arguments: EventArgArray = [type, layerId, handler];\n\t\t\tif (!layerId) {\n\t\t\t\t_arguments = [type, handler];\n\t\t\t}\n\n\t\t\tif (componentId && typeof componentId === 'string') {\n\t\t\t\tself.initRegisteredElements(componentId);\n\t\t\t\tself.registeredElements[componentId].events.push(_arguments);\n\t\t\t}\n\n\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t// @ts-ignore\n\t\t\tself.map.on(..._arguments);\n\t\t\treturn this;\n\t\t};\n\n\t\t/**\n\t\t * Overrides MapLibre-gl-js addControl function providing an additional componentId parameter for the wrapper element registration.\n\t\t *\n\t\t * @param {object} control\n\t\t * @param {string} position\n\t\t * @param {string} componentId\n\t\t */\n\t\tthis.addControl = (control, position, componentId) => {\n\t\t\tif (componentId && typeof componentId === 'string') {\n\t\t\t\tself.initRegisteredElements(componentId);\n\t\t\t\tself.registeredElements[componentId].controls.push(control);\n\t\t\t}\n\n\t\t\tself.map.addControl(control as IControl, position);\n\t\t\treturn this;\n\t\t};\n\n\t\t/**\n\t\t * Removes anything that has been added to the maplibre instance referenced with componentId\n\t\t *\n\t\t * @param {string} componentId\n\t\t */\n\t\tthis.cleanup = (componentId: string) => {\n\t\t\tif (self.map.style && typeof self.registeredElements[componentId] !== 'undefined') {\n\t\t\t\t// cleanup layers\n\t\t\t\tself.registeredElements[componentId].layers.forEach((item: string) => {\n\t\t\t\t\tif (self.map.style.getLayer(item)) {\n\t\t\t\t\t\tself.map.style.removeLayer(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// cleanup sources\n\t\t\t\tself.registeredElements[componentId].sources.forEach((item: string) => {\n\t\t\t\t\tif (self.map.style.getSource(item)) {\n\t\t\t\t\t\tself.map.style.removeSource(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// cleanup images\n\t\t\t\tself.registeredElements[componentId].images.forEach((item: string) => {\n\t\t\t\t\tif (self.map.hasImage(item)) {\n\t\t\t\t\t\tself.map.style.removeImage(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// cleanup events\n\t\t\t\tself.registeredElements[componentId].events.forEach((item: EventArgArray) => {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tself.map.off(...item);\n\t\t\t\t});\n\n\t\t\t\t// cleanup controls\n\t\t\t\tself.registeredElements[componentId].controls.forEach((item: IControl | unknown) => {\n\t\t\t\t\tself.map.removeControl(item as IControl);\n\t\t\t\t});\n\n\t\t\t\t// cleanup wrapper events\n\t\t\t\tself.registeredElements[componentId].wrapperEvents.forEach((item: WrapperEventArgArray) => {\n\t\t\t\t\tself.wrapper.off(...item);\n\t\t\t\t});\n\n\t\t\t\tself.initRegisteredElements(componentId, true);\n\t\t\t}\n\t\t};\n\n\t\t// add style prop functions that require map._update to be called afterwards\n\t\tconst updatingStyleFunctions = [\n\t\t\t'moveLayer',\n\t\t\t'removeLayer',\n\t\t\t'removeSource',\n\t\t\t'setPaintProperty',\n\t\t\t'setLayoutProperty',\n\t\t];\n\t\tupdatingStyleFunctions.forEach((item) => {\n\t\t\tthis[item] = (...props: any[]) => {\n\t\t\t\tif (self.map && self.map.style && typeof self.map.style[item] === 'function') {\n\t\t\t\t\tself.map.style[item](...props);\n\t\t\t\t}\n\t\t\t\treturn self.map._update ? self.map._update(true) : undefined;\n\t\t\t};\n\t\t});\n\n\t\t// add style prop functions\n\t\tconst styleFunctions = [\n\t\t\t'getLayer',\n\t\t\t'getSource',\n\t\t\t'listImages',\n\t\t\t'getPaintProperty',\n\t\t\t'getLayoutProperty',\n\t\t\t'removeImage',\n\t\t];\n\t\tstyleFunctions.forEach((item) => {\n\t\t\tthis[item] = (...props: any[]) => {\n\t\t\t\tif (self.map && self.map.style) {\n\t\t\t\t\treturn self.map.style[item](...props);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\t\t});\n\n\t\tthis.addNativeMaplibreFunctionsAndProps = () => {\n\t\t\t//\tadd MapLibre-gl functions\n\t\t\tObject.getOwnPropertyNames(Object.getPrototypeOf(this.map)).forEach((item) => {\n\t\t\t\tif (typeof this[item] === 'undefined') {\n\t\t\t\t\tthis[item] = (...props: any[]) => self.map[item](...props);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//\tadd MapLibre-gl properties\n\t\t\tObject.keys(this.map).forEach((item) => {\n\t\t\t\tif (typeof this[item] === 'undefined') {\n\t\t\t\t\tthis[item] = self.map[item];\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// add functions that are missing on the MapLibre instances prototype\n\t\tconst missingFunctions = [\n\t\t\t'getZoom',\n\t\t\t'setZoom',\n\t\t\t'getCenter',\n\t\t\t'setCenter',\n\t\t\t'getBearing',\n\t\t\t'setBearing',\n\t\t\t'getPitch',\n\t\t\t'setPitch',\n\t\t\t'jumpTo',\n\t\t\t'flyTo',\n\t\t\t'panTo',\n\t\t\t'panBy',\n\t\t\t'panBy',\n\t\t\t'zoomTo',\n\t\t\t'zoomIn',\n\t\t\t'zoomOut',\n\t\t\t'getPadding',\n\t\t\t'setPadding',\n\t\t\t'rotateTo',\n\t\t\t'resetNorth',\n\t\t\t'resetNorthPitch',\n\t\t\t'snapToNorth',\n\t\t\t'cameraForBounds',\n\t\t\t'fitBounds',\n\t\t\t'fitScreenCoordinates',\n\t\t\t'getFreeCameraOptions',\n\t\t\t'setFreeCameraOptions',\n\t\t\t'easeTo',\n\t\t\t'stop',\n\t\t];\n\t\tmissingFunctions.forEach((item) => {\n\t\t\tthis[item] = (...props: any[]) => {\n\t\t\t\tif (typeof self.map[item] === 'function') {\n\t\t\t\t\treturn self.map[item].call(self.map, ...props);\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t};\n\t\t});\n\n\t\t// initialize the MapLibre-gl instance\n\t\tconst initializeMapLibre = async () => {\n\t\t\t// if mapOptions style URL is given and if it is not a mapbox URL fetch the json and initialize the mapbox object\n\t\t\tif (\n\t\t\t\ttypeof props.mapOptions.style === 'string' &&\n\t\t\t\tprops.mapOptions.style.indexOf('mapbox://') === -1\n\t\t\t) {\n\t\t\t\tawait fetch(props.mapOptions.style)\n\t\t\t\t\t.then((response) => {\n\t\t\t\t\t\tif (response.ok) {\n\t\t\t\t\t\t\treturn response.json();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Error('error loading map style.json');\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.then((styleJson) => {\n\t\t\t\t\t\tstyleJson.layers.forEach((item: any) => {\n\t\t\t\t\t\t\tself.baseLayers.push(item.id);\n\t\t\t\t\t\t\tif (!self.firstSymbolLayer && item.type === 'symbol') {\n\t\t\t\t\t\t\t\tself.firstSymbolLayer = item.id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tself.styleJson = styleJson;\n\t\t\t\t\t\tprops.mapOptions.style = styleJson;\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\tself.map = new Map(props.mapOptions) as MapType;\n\t\t\twindow['_map'] = self.map;\n\n\t\t\tself.addNativeMaplibreFunctionsAndProps();\n\t\t\tself.wrapper.refreshViewport();\n\t\t\tself.wrapper.fire('viewportchange');\n\n\t\t\tself.map.on('load', () => {\n\t\t\t\tself.addNativeMaplibreFunctionsAndProps();\n\t\t\t});\n\n\t\t\tself.map.on('move', () => {\n\t\t\t\tself.wrapper.viewportState = self.wrapper.getViewport();\n\t\t\t\tself.wrapper.fire('viewportchange');\n\t\t\t});\n\t\t\tself.map.on('idle', () => {\n\t\t\t\tself.wrapper.refreshLayerState();\n\t\t\t});\n\t\t\tself.map.on('data', () => {\n\t\t\t\tself.wrapper.refreshLayerState();\n\t\t\t});\n\t\t\tif (typeof props.onReady === 'function') {\n\t\t\t\tprops.onReady(self.map, self);\n\t\t\t}\n\t\t};\n\t\tinitializeMapLibre();\n\t}\n}\nexport default MapLibreGlWrapper;\n\nexport type { LayerState, ViewportState };\n","import { createTheme } from '@mui/material/styles';\nimport { Theme } from '@mui/system';\n\ndeclare module '@mui/material/Button' {\n\tinterface ButtonPropsVariantOverrides {\n\t\tnavtools: true;\n\t}\n}\n\nconst lightDefault = createTheme({\n\tpalette: {\n\t\tmode: 'light',\n\t},\n});\nconst darkDefault = createTheme({\n\tpalette: {\n\t\tmode: 'dark',\n\t},\n});\n\nconst getDesignTokens = (mode: 'light' | 'dark') => ({\n\t...(mode === 'light' ? lightDefault : darkDefault),\n\tpalette: {\n\t\tmode,\n\t\t...(mode === 'dark'\n\t\t\t? {\n\t\t\t\t\tprimary: {\n\t\t\t\t\t\tmain: '#009FE3',\n\t\t\t\t\t},\n\t\t\t\t\tbackground: {\n\t\t\t\t\t\tdefault: '#222222',\n\t\t\t\t\t\tpaper: '#414141',\n\t\t\t\t\t\ticon: '#525252',\n\t\t\t\t\t},\n\t\t\t\t\ttext: {\n\t\t\t\t\t\tsecondary: '#fff',\n\t\t\t\t\t\tcontrast: '#121212',\n\t\t\t\t\t},\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tprimary: {\n\t\t\t\t\t\tmain: '#009FE3',\n\t\t\t\t\t},\n\n\t\t\t\t\tbackground: {\n\t\t\t\t\t\tdefault: '#fff',\n\t\t\t\t\t\tpaper: '#fdfdfd',\n\t\t\t\t\t\ticon: '#bdbdbd',\n\t\t\t\t\t},\n\t\t\t\t\ttext: {\n\t\t\t\t\t\tprimary: '#111',\n\t\t\t\t\t\tsecondary: '#121212',\n\t\t\t\t\t\tcontrast: '#fff',\n\t\t\t\t\t},\n\t\t\t }),\n\t},\n});\nconst getTheme = (mode: 'light' | 'dark') => {\n\tconst theme: Theme = getDesignTokens(mode);\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\treturn createTheme(theme, {\n\t\tcomponents: {\n\t\t\tMuiTypography: {\n\t\t\t\tstyleOverrides: {\n\t\t\t\t\troot: {},\n\t\t\t\t},\n\t\t\t},\n\t\t\tMuiAppBar: {\n\t\t\t\tstyleOverrides: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\tbackgroundColor: theme.palette.background.default,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tMuiIconButton: {\n\t\t\t\tstyleOverrides: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\tcolor: theme.palette.text.primary,\n\t\t\t\t\t\tbackgroundColor: theme.palette.background.icon,\n\t\t\t\t\t\t':hover': {\n\t\t\t\t\t\t\tbackgroundColor: theme.palette.background.icon,\n\t\t\t\t\t\t\tcolor: theme.palette.primary.main,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tMuiButton: {\n\t\t\t\tstyleOverrides: {\n\t\t\t\t\tcontained: {\n\t\t\t\t\t\tcolor: '#fff',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tvariants: [\n\t\t\t\t\t{\n\t\t\t\t\t\tprops: { variant: 'navtools' },\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tminWidth: '20px',\n\t\t\t\t\t\t\tminHeight: '20px',\n\t\t\t\t\t\t\tfontWeight: 600,\n\t\t\t\t\t\t\t[theme.breakpoints.down('md')]: {\n\t\t\t\t\t\t\t\twidth: '50px',\n\t\t\t\t\t\t\t\theight: '50px',\n\t\t\t\t\t\t\t\tfontSize: '1.4em',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t[theme.breakpoints.up('md')]: {\n\t\t\t\t\t\t\t\twidth: '30px',\n\t\t\t\t\t\t\t\theight: '30px',\n\t\t\t\t\t\t\t\tfontSize: '1.2em',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbackgroundColor: theme.palette.background.icon,\n\t\t\t\t\t\t\tborderRadius: '23%',\n\t\t\t\t\t\t\t//border: \"1px solid #bbb\",\n\t\t\t\t\t\t\t//boxShadow: \"0px 0px 4px rgba(0,0,0,.5)\",\n\t\t\t\t\t\t\tmargin: '0.15px',\n\t\t\t\t\t\t\tmarginTop: '4px',\n\t\t\t\t\t\t\t':hover': {\n\t\t\t\t\t\t\t\tcolor: theme.palette.primary.main,\n\t\t\t\t\t\t\t\tbackgroundColor: theme.palette.background.icon,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcolor: theme.palette.text.secondary,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t});\n};\n\nexport default getTheme;\n","import React, { useState, useRef, ReactNode } from 'react';\nimport MapLibreGlWrapper from '../components/MapLibreMap/lib/MapLibreGlWrapper';\n\nimport { ThemeProvider as MUIThemeProvider } from '@mui/material/styles';\nimport getTheme from '../ui_components/MapcomponentsTheme';\n\nexport interface MapContextType {\n\tmapIds: string[];\n\tmapExists: (map_id: string | undefined) => boolean;\n\tmaps: MapLibreGlWrapper[];\n\tmap: MapLibreGlWrapper | undefined;\n\tgetMap: (map_id: string | undefined) => MapLibreGlWrapper;\n\tsetMap: (map: MapLibreGlWrapper) => void;\n\tremoveMap: (map_id: string | undefined) => void;\n\tregisterMap: (map_id: string | undefined, map: MapLibreGlWrapper) => void;\n}\nconst MapContext = React.createContext({} as MapContextType);\n\n/**\n * MapComponentsProvider must be imported and wrapped around component where at least one of its child nodes requires access to a MapLibre-gl or openlayers instance that is registered in this mapContext.\nMapComponentsProvider must be used one level higher than the first use of MapContext.\n *\n * MapComponentsProvider requires at least one use of the MapLibreMap component somewhere down the component tree that will create the MapLibre-gl object and set the reference at MapContext.map. For MapLibre maps it is a good idea to provide a mapId attribute to the MapLibreMap Component even if you are only using a single map instance at start. It will make a later transition to using multiple instances within the same project much easier.\n */\n\nconst MapComponentsProvider = ({ children }: { children: ReactNode }) => {\n\tconst [map, setMap] = useState<MapLibreGlWrapper | undefined>(undefined);\n\tconst [mapIds, setMapIds] = useState<[...string[]]>([]);\n\tconst mapIds_raw = useRef<[...string[]]>([]);\n\tconst maps = useRef<{ [key: string]: MapLibreGlWrapper }>({});\n\n\tconst removeMap = (mapId: string) => {\n\t\tif (mapId) {\n\t\t\tif (typeof maps.current[mapId] !== 'undefined') {\n\t\t\t\tdelete maps.current[mapId];\n\t\t\t}\n\t\t\tconst mapIdIndex = mapIds_raw.current.indexOf(mapId);\n\t\t\tif (mapIdIndex > -1) {\n\t\t\t\tmapIds_raw.current.splice(mapIdIndex, 1);\n\t\t\t}\n\t\t\tsetMapIds([...mapIds_raw.current]);\n\n\t\t\tif (mapIds.length === 1 && map) {\n\t\t\t\tsetMap(undefined);\n\t\t\t}\n\t\t} else {\n\t\t\tsetMap(undefined);\n\t\t\tremoveMap('anonymous_map');\n\t\t}\n\t};\n\n\tconst setMapHandler = (mapInstance: MapLibreGlWrapper) => {\n\t\tsetMap(mapInstance);\n\n\t\tif (mapIds.length === 0) {\n\t\t\tconst mapId = 'anonymous_map';\n\t\t\tsetMapIds([...mapIds, mapId]);\n\t\t\tmaps.current[mapId] = mapInstance;\n\t\t}\n\t};\n\n\tconst value = {\n\t\tmap: map,\n\t\tsetMap: setMapHandler,\n\t\tmaps: maps.current,\n\t\tmapIds: mapIds,\n\t\tregisterMap: (mapId: string, mapInstance: MapLibreGlWrapper) => {\n\t\t\tif (mapId && mapInstance) {\n\t\t\t\tmaps.current[mapId] = mapInstance;\n\t\t\t\tmapIds_raw.current.push(mapId);\n\t\t\t\tsetMapIds([...mapIds_raw.current]);\n\n\t\t\t\tif (!map) {\n\t\t\t\t\tsetMap(mapInstance);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tremoveMap,\n\t\tmapExists: (mapId: string) => {\n\t\t\tif (mapId && Object.keys(maps.current).indexOf(mapId) === -1) {\n\t\t\t\treturn false;\n\t\t\t} else if (!mapId && !map) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\tgetMap: (mapId: string): MapLibreGlWrapper | null => {\n\t\t\tif (mapId && mapIds.indexOf(mapId) !== -1) {\n\t\t\t\treturn maps.current[mapId];\n\t\t\t} else if (!mapId && map) {\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t},\n\t} as unknown as MapContextType;\n\n\treturn (\n\t\t<MapContext.Provider value={value}>\n\t\t\t<MUIThemeProvider theme={getTheme('light')}>{children}</MUIThemeProvider>\n\t\t</MapContext.Provider>\n\t);\n};\n\nexport { MapComponentsProvider };\nexport default MapContext;\n","import React, { useRef, useEffect, useContext, FC, RefObject } from 'react';\n\nimport MapContext, { MapContextType } from '../../contexts/MapContext';\nimport MapLibreGlWrapper from './lib/MapLibreGlWrapper';\n\nimport { MapOptions as MapOptionsType, Map } from 'maplibre-gl';\nimport 'maplibre-gl/dist/maplibre-gl.css';\n\ntype MapLibreMapProps = {\n\t/**\n\t * Id of the MapLibreGl(Wrapper) instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Config object that is passed to the MapLibreGl constructor as first parameter.\n\t * See https://maplibre.org/maplibre-gl-js-docs/api/map/ for a formal documentation of al\n\t * available properties.\n\t */\n\toptions?: Partial<MapOptionsType>;\n\t/**\n\t * css style definition passed to the map container DOM element\n\t */\n\tstyle?: object;\n};\n\nconst defaultProps: MapLibreMapProps = {\n\tmapId: undefined,\n\toptions: {\n\t\tcenter: { lng: 8.607, lat: 53.1409349 },\n\t\tzoom: 11,\n\t\tcontainer: '',\n\t\tstyle: {\n\t\t\tversion: 8,\n\t\t\tname: 'blank',\n\t\t\tcenter: [0, 0],\n\t\t\tzoom: 0,\n\t\t\tsources: {},\n\t\t\tsprite: 'https://wms.wheregroup.com/tileserver/sprites/osm-bright',\n\t\t\tglyphs: 'https://wms.wheregroup.com/tileserver/fonts/{fontstack}/{range}.pbf',\n\t\t\tlayers: [\n\t\t\t\t{\n\t\t\t\t\tid: '_background',\n\t\t\t\t\ttype: 'background',\n\t\t\t\t\tpaint: {\n\t\t\t\t\t\t'background-color': 'rgba(0,0,0,0)',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n};\n\n/**\n * Creates a MapLibreGlWrapper instance and registers it in MapContext\n * after the MapLibre-gl load event has fired.\n *\n * MapLibreMap returns the html node that will be used by MapLibre-gl to render the map.\n * This Component must be kept unaware of any related components that interact with the MapLibre-gl\n * instance.\n *\n * @category Map components\n */\nconst MapLibreMap: FC<MapLibreMapProps> = (props: MapLibreMapProps) => {\n\tconst map = useRef<MapLibreGlWrapper>();\n\tconst mapContainer = useRef<HTMLDivElement>();\n\n\tconst mapContext = useContext<MapContextType>(MapContext);\n\n\tconst mapIdRef = useRef(props.mapId);\n\tconst initializedRef = useRef(false);\n\tconst currentStyle = useRef(props.options?.style);\n\n\tuseEffect(() => {\n\t\tconst mapId = mapIdRef.current;\n\n\t\treturn () => {\n\t\t\tinitializedRef.current = false;\n\t\t\tmapContext.removeMap(mapId);\n\t\t\tmap.current?.map?.remove?.();\n\t\t\tmap.current = undefined;\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (initializedRef.current) return;\n\n\t\tif (mapContainer.current) {\n\t\t\tinitializedRef.current = true;\n\t\t\tmap.current = new MapLibreGlWrapper({\n\t\t\t\tmapOptions: {\n\t\t\t\t\tstyle: '',\n\t\t\t\t\t...props.options,\n\t\t\t\t\t...(props?.options?.style ? {} : { style: defaultProps?.options?.style }),\n\t\t\t\t\tcontainer: mapContainer.current,\n\t\t\t\t},\n\t\t\t\tonReady: (map: Map, wrapper: MapLibreGlWrapper) => {\n\t\t\t\t\tmap.once('load', () => {\n\t\t\t\t\t\tif (props.mapId) {\n\t\t\t\t\t\t\tmapContext.registerMap(props.mapId, wrapper);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmapContext.setMap(wrapper);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}, [props.options, props.mapId]);\n\n\tuseEffect(() => {\n\t\tif (map.current?.map && props?.options?.style && currentStyle.current !== props.options.style) {\n\t\t\tconsole.log('set style');\n\t\t\tcurrentStyle.current = props.options.style;\n\t\t\tmap.current.map.setStyle(props.options.style);\n\t\t}\n\t}, [props?.options?.style]);\n\n\treturn (\n\t\t<div\n\t\t\tref={mapContainer as RefObject<HTMLDivElement>}\n\t\t\tclassName=\"mapContainer\"\n\t\t\tstyle={props.style}\n\t\t/>\n\t);\n};\n\nMapLibreMap.defaultProps = defaultProps;\n\nexport default MapLibreMap;\n","import { useContext, useCallback, useState, useEffect, useRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport MapContext, { MapContextType } from \"../contexts/MapContext\";\nimport MapLibreGlWrapper, {\n\tLayerState,\n\tViewportState,\n} from \"../components/MapLibreMap/lib/MapLibreGlWrapper\";\n\ntype useMapStateType = {\n\tlayers: (LayerState | undefined)[];\n\tviewport: ViewportState | undefined;\n};\n\n/**\n * React hook that allows subscribing to map state changes\n *\n * @component\n */\nfunction useMapState(props: {\n\tmapId?: string;\n\twatch?: {\n\t\tlayers?: boolean;\n\t\tsources?: boolean;\n\t\tviewport?: boolean;\n\t};\n\tfilter?: {\n\t\tincludeBaseLayers?: boolean;\n\t\tmatchLayerIds?: RegExp | string;\n\t\tmatchSourceIds?: RegExp | string;\n\t};\n}): useMapStateType {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tconst mapContext = useContext<MapContextType>(MapContext);\n\n\tconst initializedRef = useRef(false);\n\tconst mapRef = useRef<MapLibreGlWrapper>();\n\n\tconst [viewport, setViewport] = useState<ViewportState | undefined>();\n\tconst viewportRef = useRef(undefined);\n\n\tconst [layers, setLayers] = useState<(LayerState | undefined)[]>([]);\n\tconst layersRef = useRef<string>();\n\t//const mapRef = useRef(props.map);\n\tconst componentId = useRef(uuidv4());\n\n\t/**\n\t * returns the element if it matches the defined filter criteria\n\t * to be used as filter function on the layers array\n\t *\n\t * @param {object} layer\n\t */\n\tconst layerIdFilter = useCallback(\n\t\t(layer:LayerState) => {\n\t\t\tif (!props?.filter?.includeBaseLayers && layer?.baseLayer) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (typeof props.filter?.matchLayerIds !== \"undefined\") {\n\t\t\t\tif (props.filter.matchLayerIds instanceof RegExp) {\n\t\t\t\t\treturn props.filter.matchLayerIds.test(layer.id);\n\t\t\t\t} else {\n\t\t\t\t\treturn layer.id.includes(props.filter.matchLayerIds);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\t\t[props.filter]\n\t);\n\n\tconst refreshLayerState = useCallback(() => {\n\t\tif (!mapRef.current) return;\n\n\t\tconst _layerState = mapRef.current.wrapper.layerState.filter(layerIdFilter);\n\t\tconst _layerStateString = JSON.stringify(_layerState);\n\t\tif (layersRef.current !== _layerStateString) {\n\t\t\tlayersRef.current = _layerStateString;\n\t\t\tsetLayers(_layerState);\n\t\t}\n\t}, [layerIdFilter]);\n\n\tuseEffect(() => {\n\t\tconst _componentId = componentId.current;\n\n\t\treturn () => {\n\t\t\t// cleanup all event listeners\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.cleanup(_componentId);\n\t\t\t\tmapRef.current = undefined;\n\t\t\t}\n\t\t\tinitializedRef.current = false;\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!mapContext.mapExists(props.mapId) || initializedRef.current) return;\n\t\t// the MapLibre-gl instance (mapContext.getMap(props.mapId)) is accessible here\n\t\t// initialize the layer and add it to the MapLibre-gl instance or do something else with it\n\t\tinitializedRef.current = true;\n\t\tmapRef.current = mapContext.getMap(props.mapId);\n\n\t\tif (!mapRef.current) {\n\t\t\tinitializedRef.current = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (props?.watch?.viewport) {\n\t\t\tsetViewport(mapRef.current.wrapper.viewportState);\n\n\t\t\t// register viewportchange event handler\n\t\t\tmapRef.current.wrapper.on(\n\t\t\t\t\"viewportchange\",\n\t\t\t\t() => {\n\t\t\t\t\tif (viewportRef.current !== mapRef.current?.wrapper.viewportStateString) {\n\t\t\t\t\t\tsetViewport(mapRef.current?.wrapper.viewportState);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tcomponentId.current\n\t\t\t);\n\t\t}\n\n\t\t// register layerchange event handler\n\t\tif (props?.watch?.layers) {\n\t\t\trefreshLayerState();\n\n\t\t\tmapRef.current.wrapper.on(\n\t\t\t\t\"layerchange\",\n\t\t\t\trefreshLayerState,\n\t\t\t\t{\n\t\t\t\t\tincludeBaseLayers: props?.filter?.includeBaseLayers,\n\t\t\t\t\tmatchLayerIds: props?.filter?.matchLayerIds,\n\t\t\t\t},\n\t\t\t\tcomponentId.current\n\t\t\t);\n\t\t}\n\t}, [mapContext.mapIds, mapContext, props.mapId, refreshLayerState, props]);\n\n\treturn {\n\t\tlayers,\n\t\tviewport,\n\t};\n}\n\nuseMapState.defaultProps = {\n\tmapId: undefined,\n\twatch: {\n\t\tlayers: true,\n\t\tsources: false,\n\t\tviewport: false,\n\t},\n\tfilter: {\n\t\tincludeBaseLayers: false,\n\t},\n};\n\nuseMapState.propTypes = {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId: PropTypes.string,\n\t/**\n\t * Defines map Resources to watch\n\t */\n\twatch: PropTypes.shape({\n\t\tlayers: PropTypes.bool,\n\t\tsources: PropTypes.bool,\n\t\tviewport: PropTypes.bool,\n\t}),\n\t/**\n\t * Filter string or RegExp to more explicitly define the elements watched and increase performance\n\t * strings will be matched using layerId.includes(matchString)\n\t * RegExps will be matched using matchRegExp.test(layerId)\n\t */\n\tfilter: PropTypes.shape({\n\t\tincludeBaseLayers: PropTypes.bool,\n\t\tmatchLayerIds: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(RegExp)]),\n\t\tmatchSourceIds: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(RegExp)]),\n\t}),\n};\n\nexport default useMapState;\n","import { useContext, useState, useEffect, useRef } from \"react\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport MapContext, { MapContextType } from \"../contexts/MapContext\";\nimport useMapState from \"./useMapState\";\nimport MapLibreGlWrapper, { LayerState } from \"../components/MapLibreMap/lib/MapLibreGlWrapper\";\n\ntype useMapType = {\n\tmap: MapLibreGlWrapper | undefined;\n\tmapIsReady: boolean;\n\tcomponentId: string;\n\tlayers: (LayerState | undefined)[];\n\tcleanup: () => void;\n};\n\nfunction useMap(props?: { mapId?: string; waitForLayer?: string }): useMapType {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tconst mapContext: MapContextType = useContext(MapContext);\n\tconst [map, setMap] = useState<MapLibreGlWrapper>();\n\n\tconst mapState = useMapState({\n\t\tmapId: props?.mapId,\n\t\twatch: {\n\t\t\tviewport: false,\n\t\t\tlayers: props?.waitForLayer ? true : false,\n\t\t\tsources: false,\n\t\t},\n\t\tfilter: {\n\t\t\tincludeBaseLayers: true,\n\t\t},\n\t});\n\n\tconst initializedRef = useRef(false);\n\n\tconst mapRef = useRef<MapLibreGlWrapper>();\n\n\tconst componentId = useRef(uuidv4());\n\n\tconst [mapIsReady, setMapIsReady] = useState(false);\n\n\tconst cleanup = () => {\n\t\tif (mapRef.current) {\n\t\t\tmapRef.current.cleanup(componentId.current);\n\t\t}\n\t\tinitializedRef.current = false;\n\t};\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tcleanup();\n\t\t\tsetMapIsReady(false);\n\t\t\tmapRef.current = undefined;\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!mapContext.mapExists(props?.mapId) || initializedRef.current) return;\n\n\t\t// check if waitForLayer (string, layer id of the layer this hook is supposed to wait for)\n\t\t// exists as layer in the MapLibre instance\n\t\tif (props?.waitForLayer) {\n\t\t\tlet layerFound = false;\n\n\t\t\tmapState?.layers?.forEach((layer: any) => {\n\t\t\t\tif (layer.id === props?.waitForLayer) {\n\t\t\t\t\tlayerFound = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (!layerFound) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// the MapLibre-gl instance (mapContext.getMap(props.mapId)) is accessible here\n\t\t// initialize the layer and add it to the MapLibre-gl instance or do something else with it\n\t\tinitializedRef.current = true;\n\t\tmapRef.current = mapContext.getMap(props?.mapId);\n\t\tsetMap(mapRef.current);\n\t\tsetMapIsReady(true);\n\t}, [mapContext.mapIds, mapState.layers, mapContext, props]);\n\n\treturn {\n\t\tmap: map,\n\t\tmapIsReady,\n\t\tcomponentId: componentId.current,\n\t\tlayers: mapState.layers,\n\t\tcleanup,\n\t};\n}\n\nexport default useMap;\n\nexport type { useMapType };\n","import React, { useState, useCallback } from \"react\";\nimport useMap from \"../../hooks/useMap\";\nimport { Button, SxProps, Theme } from '@mui/material';\nimport GpsFixedIcon from '@mui/icons-material/GpsFixed';\n\nexport interface MlCenterPositionProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Id of an existing layer in the mapLibre instance to help specify the layer order\n\t * This layer will be visually beneath the layer with the \"insertBeforeLayer\" id.\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Active button font color\n\t */\n\tonColor?: string;\n\t/**\n\t * Inactive button font color\n\t */\n\toffColor?: string;\n\t/**\n\t * CSS style object that is applied to the button component\n\t */\n\tstyle?: SxProps<Theme> | undefined;\n}\n\n/**\n * Component template\n *\n */\nconst MlCenterPosition = (props: MlCenterPositionProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst [locationAccessDenied, setLocationAccessDenied] = useState(false);\n\n\tconst centerCurrentLocation = () => {\n\t\tnavigator.geolocation.getCurrentPosition(getLocationSuccess, getLocationError);\n\t};\n\n\tconst getLocationSuccess = useCallback(\n\t\t(location: GeolocationPosition) => {\n\t\t\tmapHook.map?.map.setCenter?.([location.coords.longitude, location.coords.latitude]);\n\t\t},\n\t\t[mapHook.map]\n\t);\n\n\tconst getLocationError = () => {\n\t\tconsole.log('Access of user location denied');\n\t\tsetLocationAccessDenied(true);\n\t};\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"navtools\"\n\t\t\t\tsx={{\n\t\t\t\t\tzIndex: 1002,\n\t\t\t\t\tcolor: !locationAccessDenied ? props.onColor : props.offColor,\n\t\t\t\t}}\n\t\t\t\tonClick={centerCurrentLocation}\n\t\t\t\tdisabled={locationAccessDenied}\n\t\t\t>\n\t\t\t\t<GpsFixedIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />\n\t\t\t</Button>\n\t\t</>\n\t);\n};\n\nMlCenterPosition.defaultProps = {\n\tmapId: undefined,\n\tonColor: '#ececec',\n\toffColor: '#666',\n};\nexport default MlCenterPosition;\n","import React from \"react\";\nimport useMap from \"../../hooks/useMap\";\n\nexport interface MlComponentTemplateProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n}\n\n/**\n * Component description\n *\n */\nconst MlComponentTemplate = (props: MlComponentTemplateProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t});\n\tconsole.log(mapHook.componentId + \" remove this log\");\n\n\treturn <></>;\n};\n\nMlComponentTemplate.defaultProps = {\n\tmapId: undefined,\n};\nexport default MlComponentTemplate;\n","import { Map } from 'maplibre-gl';\nimport jsPDF from 'jspdf';\nimport MapLibreGlWrapper from '../../components/MapLibreMap/lib/MapLibreGlWrapper';\n\nimport { BBox } from '@turf/turf';\n\ninterface createExportOptions {\n\tmap: MapLibreGlWrapper;\n\twidth: number;\n\theight: number;\n\tbbox: BBox;\n\tbboxUnrotated: BBox;\n\tbearing: number;\n\tformat: string;\n\torientation: string;\n}\nexport type { createExportOptions };\n\nconst createExport = (options: createExportOptions) => {\n\tconst width = options.width;\n\tconst height = options.height;\n\n\t// Create map container\n\tconst hiddenContainer = document.createElement('div');\n\thiddenContainer.className = 'hidden-map';\n\thiddenContainer.style.width = '0px';\n\thiddenContainer.style.height = '0px';\n\thiddenContainer.style.overflow = 'hidden';\n\tdocument.body.appendChild(hiddenContainer);\n\tconst container = document.createElement('div');\n\tcontainer.style.width = width + 'px';\n\tcontainer.style.height = height + 'px';\n\thiddenContainer.appendChild(container);\n\n\tconst style = options.map.map.getStyle();\n\n\t// delete undefined source properties\n\tfor (const name in style.sources) {\n\t\tconst src = style.sources[name];\n\n\t\tObject.keys(src).forEach((key) => {\n\t\t\t// delete property if value is undefined.\n\t\t\t// for instance, raster-dem might have undefined value in \"url\" and \"bounds\"\n\t\t\tif (!src[key]) {\n\t\t\t\tdelete src[key];\n\t\t\t}\n\t\t});\n\t}\n\n\t// Create a new MapLibre-gl instance\n\tconst renderMap = new Map({\n\t\tcontainer: container,\n\t\tcenter: options.map.map.getCenter(),\n\t\tzoom: options.map.map.getZoom(),\n\t\tbearing: 0,\n\t\tpitch: 0,\n\t\tinteractive: false,\n\t\tpreserveDrawingBuffer: true,\n\t\tfadeDuration: 0,\n\t\tattributionControl: false,\n\t\tstyle: style,\n\t});\n\n\tconst bboxCamera = renderMap._cameraForBoxAndBearing(\n\t\t[options.bboxUnrotated[0], options.bboxUnrotated[1]],\n\t\t[options.bboxUnrotated[2], options.bboxUnrotated[3]],\n\t\toptions.bearing + options.map.map.getBearing()\n\t);\n\n\trenderMap._fitInternal(bboxCamera);\n\treturn new Promise<createExportResolverParams>((resolve) => {\n\t\tconsole.log('before idle');\n\n\t\trenderMap.once('idle', function () {\n\t\t\tconst params: createExportResolverParams = {\n\t\t\t\t...options,\n\t\t\t\trenderMap,\n\t\t\t\thiddenContainer,\n\t\t\t\tcreatePdf: (_options?: createJsPdfOptions) =>\n\t\t\t\t\tcreateJsPdf({ ...options, renderMap, hiddenContainer, ..._options }),\n\t\t\t\tcreatePng: (_options?: createPngOptions) =>\n\t\t\t\t\tcreatePng({ ...options, renderMap, hiddenContainer, ..._options }),\n\t\t\t};\n\n\t\t\tresolve(params);\n\t\t});\n\t});\n};\n\ninterface createExportResolverParams extends createExportOptions {\n\tcreatePdf: (_options?: createJsPdfOptions) => Promise<createPdfResolverParams>;\n\tcreatePng: (_options?: createPngOptions) => Promise<createPngResolverParams>;\n\trenderMap: Map;\n\thiddenContainer: HTMLDivElement;\n}\nexport type { createExportResolverParams };\n\ninterface createJsPdfOptions extends createExportOptions {\n\trenderMap: Map;\n\thiddenContainer: HTMLDivElement;\n}\n\nexport type { createJsPdfOptions };\n\nfunction createJsPdf(options: createJsPdfOptions) {\n\tconst pdf = new jsPDF({\n\t\torientation: options?.orientation === 'portrait' ? 'p' : 'l',\n\t\tunit: 'mm',\n\t\tcompress: true,\n\t\tformat: options.format,\n\t});\n\tObject.defineProperty(window, 'devicePixelRatio', {\n\t\tget: function () {\n\t\t\treturn 300 / 96;\n\t\t},\n\t});\n\n\treturn new Promise<createPdfResolverParams>((resolve) => {\n\t\t//Render map image\n\t\tpdf.addImage(\n\t\t\toptions.renderMap.getCanvas().toDataURL('image/png'),\n\t\t\t'png',\n\t\t\t0,\n\t\t\t0,\n\t\t\tpdf.internal.pageSize.getWidth(),\n\t\t\tpdf.internal.pageSize.getHeight(),\n\t\t\tundefined,\n\t\t\t'FAST'\n\t\t);\n\n\t\t// remove DOM Elements\n\t\toptions.renderMap.remove();\n\t\toptions.hiddenContainer.parentNode?.removeChild(options.hiddenContainer);\n\n\t\tconst params: createPdfResolverParams = {\n\t\t\t...options,\n\t\t\tpdf,\n\t\t\tdownloadPdf: (_options?: downloadPdfOptions) => downloadPdf({ ...params, ..._options }),\n\t\t};\n\n\t\tresolve(params);\n\t});\n}\ninterface createPdfResolverParams extends createJsPdfOptions {\n\tpdf: jsPDF;\n\tdownloadPdf: (_options?: downloadPdfOptions) => Promise<downloadPdfOptions>;\n}\n\ninterface downloadPdfOptions extends createJsPdfOptions {\n\tpdf: jsPDF;\n}\n\nfunction downloadPdf(options: downloadPdfOptions) {\n\toptions.pdf.save('Map.pdf');\n\n\treturn new Promise<downloadPdfOptions>(function (resolve) {\n\t\tresolve({ ...options });\n\t});\n}\n\nexport type { createPdfResolverParams };\n\nfunction createPng(options: createPngOptions) {\n\treturn new Promise<createPngResolverParams>((resolve) => {\n\t\tconst png = options.renderMap.getCanvas().toDataURL('image/png');\n\t\tconst params: createPngResolverParams = {\n\t\t\t...options,\n\t\t\tpng,\n\t\t\tdownloadPng: (_options?: downloadPngOptions) => downloadPng({ ...params, ..._options }),\n\t\t};\n\n\t\tresolve(params);\n\t});\n}\n\ninterface createPngOptions extends createExportOptions {\n\trenderMap: Map;\n\thiddenContainer: HTMLDivElement;\n}\n\nexport type { createPngOptions };\n\ninterface createPngResolverParams extends createPngOptions {\n\tpng: string;\n\tdownloadPng: (_options?: downloadPngOptions) => Promise<downloadPngOptions>;\n}\n\nexport type { createPngResolverParams };\n\ninterface downloadPngOptions extends createPngOptions {\n\t// png image as data url\n\tpng: string;\n\t// filename of the downloaded png\n\tname?: string;\n}\n\nfunction downloadPng(options: downloadPngOptions) {\n\tconst _a = document.createElement('a');\n\t_a.download = options?.name ? options.name + '.png' : 'map.png';\n\t_a.href = options.png;\n\tdocument.body.appendChild(_a);\n\t_a.click();\n\tdocument.body.removeChild(_a);\n\n\treturn new Promise<downloadPngOptions>(function (resolve) {\n\t\tresolve({ ...options });\n\t});\n}\n\nexport { createExport };\n","import { useMemo } from 'react';\nimport useMap from '../useMap';\nimport { createExport, createExportOptions } from './lib';\nimport MapLibreGlWrapper from '../../components/MapLibreMap/lib/MapLibreGlWrapper';\n\ninterface exportMapProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n}\n\nexport default function useExportMap(props: exportMapProps) {\n\tconst mapHook = useMap({ mapId: props.mapId });\n\n\tconst _createExport = useMemo(() => {\n\t\tif (mapHook.map) {\n\t\t\treturn (\n\t\t\t\toptions: Omit<createExportOptions, 'map'> & Partial<Pick<createExportOptions, 'map'>>\n\t\t\t) => {\n\t\t\t\treturn createExport({ map: mapHook.map as MapLibreGlWrapper, ...options });\n\t\t\t};\n\t\t}\n\t\treturn;\n\t}, [mapHook.map]);\n\n\treturn {\n\t\tcreateExport: _createExport,\n\t};\n}\n","import React from 'react';\nimport useMap from '../../hooks/useMap';\nimport PrinterIcon from '@mui/icons-material/Print';\nimport Button from '@mui/material/Button';\nimport { CircularProgress } from '@mui/material';\nimport useExportMap from '../../hooks/useExportMap';\nimport { BBox } from '@turf/turf';\nimport { createExportOptions } from 'src/hooks/useExportMap/lib';\n\nexport interface MlCreatePdfButtonProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Option overrides for the createExport function\n\t */\n\texportOptions?: createExportOptions\n}\n\n/**\n * Renders a button that will create a PDF version of the current map view (dimensions adjusted to fit Din A4 Paper).\n */\nconst MlCreatePdfButton = (props: MlCreatePdfButtonProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t});\n\tconst exportMap = useExportMap({ mapId: props.mapId });\n\tconst [loading, setLoading] = React.useState(false);\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tcolor=\"primary\"\n\t\t\t\tvariant=\"contained\"\n\t\t\t\tonClick={() => {\n\t\t\t\t\tif (mapHook.map && exportMap?.createExport) {\n\t\t\t\t\t\tsetLoading(true);\n\t\t\t\t\t\tconst bounds = mapHook.map.getBounds();\n\t\t\t\t\t\tconst bbox: BBox = [\n\t\t\t\t\t\t\tbounds.getWest(),\n\t\t\t\t\t\t\tbounds.getSouth(),\n\t\t\t\t\t\t\tbounds.getEast(),\n\t\t\t\t\t\t\tbounds.getNorth(),\n\t\t\t\t\t\t];\n\t\t\t\t\t\texportMap\n\t\t\t\t\t\t\t.createExport({\n\t\t\t\t\t\t\t\twidth: 595 * 1.4,\n\t\t\t\t\t\t\t\theight: 842 * 1.4,\n\t\t\t\t\t\t\t\tbbox: bbox,\n\t\t\t\t\t\t\t\tbboxUnrotated: bbox,\n\t\t\t\t\t\t\t\tbearing: mapHook.map.getBearing(),\n\t\t\t\t\t\t\t\tformat: 'a4',\n\t\t\t\t\t\t\t\torientation: 'portrait',\n\t\t\t\t\t\t\t\t...props.exportOptions\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.then((res) => res.createPdf())\n\t\t\t\t\t\t\t.then((res) => {\n\t\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t\t\treturn res.downloadPdf();\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{loading ? (\n\t\t\t\t\t<CircularProgress\n\t\t\t\t\t\tsize={24}\n\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\tcolor: 'text.contrast',\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<PrinterIcon />\n\t\t\t\t)}\n\t\t\t</Button>\n\t\t</>\n\t);\n};\n\nMlCreatePdfButton.defaultProps = {\n\tmapId: undefined,\n};\n\nexport default MlCreatePdfButton;\n","interface PdfTemplateType{\n\twidth: number;\n\theight: number;\n};\ninterface PdfTemplateObject{\n\t[key:string]:({[key:string]:PdfTemplateType});\n};\n\nconst PdfTemplates:PdfTemplateObject = {\n\tA4: {\n\t\t'300dpi': {\n\t\t\twidth: 2480,\n\t\t\theight: 3508,\n\t\t},\n\t\t'150dpi': {\n\t\t\twidth: 1240,\n\t\t\theight: 1754,\n\t\t},\n\t\t'72dpi': {\n\t\t\twidth: 595,\n\t\t\theight: 842,\n\t\t},\n\t},\n\tA3: {\n\t\t'300dpi': {\n\t\t\twidth: 3505,\n\t\t\theight: 4961,\n\t\t},\n\t\t'150dpi': {\n\t\t\twidth: 1754,\n\t\t\theight: 2480,\n\t\t},\n\t\t'72dpi': {\n\t\t\twidth: 842,\n\t\t\theight: 1191,\n\t\t},\n\t},\n\tA2: {\n\t\t'300dpi': {\n\t\t\twidth: 4961,\n\t\t\theight: 7016,\n\t\t},\n\t\t'150dpi': {\n\t\t\twidth: 2480,\n\t\t\theight: 3508,\n\t\t},\n\t\t'72dpi': {\n\t\t\twidth: 1191,\n\t\t\theight: 1684,\n\t\t},\n\t},\n\tA1: {\n\t\t'300dpi': {\n\t\t\twidth: 7016,\n\t\t\theight: 9933,\n\t\t},\n\t\t'150dpi': {\n\t\t\twidth: 3508,\n\t\t\theight: 4967,\n\t\t},\n\t\t'72dpi': {\n\t\t\twidth: 1684,\n\t\t\theight: 2384,\n\t\t},\n\t},\n\tA0: {\n\t\t'300dpi': {\n\t\t\twidth: 9933,\n\t\t\theight: 14043,\n\t\t},\n\t\t'150dpi': {\n\t\t\twidth: 4967,\n\t\t\theight: 7022,\n\t\t},\n\t\t'72dpi': {\n\t\t\twidth: 2384,\n\t\t\theight: 3370,\n\t\t},\n\t},\n};\n\nexport default PdfTemplates;","import React, { useState, useRef, useMemo } from 'react';\nimport templates from './pdf.templates';\nimport { PdfContextInterface, PdfPreviewOptions } from './pdfContext';\n\n\nconst PdfContext = React.createContext<PdfContextInterface>({} as PdfContextInterface);\n\nconst defaultTemplate = templates['A4']['72dpi'];\nconst PdfContextProvider = ({ children }: { children: React.ReactNode }) => {\n\tconst [format, setFormat] = useState('A4');\n\tconst [quality, setQuality] = useState('72dpi');\n\tconst [options, setOptions] = useState<PdfPreviewOptions>({\n\t\tcenter: undefined,\n\t\tscale: undefined,\n\t\trotate: 0,\n\t\twidth: 210,\n\t\theight: 297,\n\t\torientation: 'portrait',\n\t\tfixedScale: 0,\n\t});\n\n\tconst geojsonRef = useRef();\n\n\tconst template = useMemo(() => {\n\t\tif (typeof templates[format][quality] !== 'undefined') {\n\t\t\treturn options.orientation === 'portrait'\n\t\t\t\t? templates[format][quality]\n\t\t\t\t: {\n\t\t\t\t\t\twidth: templates[format][quality].height,\n\t\t\t\t\t\theight: templates[format][quality].width,\n\t\t\t\t };\n\t\t}\n\t\treturn defaultTemplate;\n\t}, [format, quality, options.orientation]);\n\n\tconst value = {\n\t\toptions,\n\t\tsetOptions,\n\t\tformat,\n\t\tsetFormat,\n\t\tquality,\n\t\tsetQuality,\n\t\tgeojsonRef,\n\t\ttemplate,\n\t};\n\n\treturn <PdfContext.Provider value={value}>{children}</PdfContext.Provider>;\n};\n\nexport { PdfContextProvider };\nexport default PdfContext;\n","import React, { useRef, useEffect, useMemo } from 'react';\nimport ReactDOM from 'react-dom';\nimport Moveable from 'react-moveable';\nimport useMap from '../../../hooks/useMap';\nimport useMapState from '../../../hooks/useMapState';\nimport * as turf from '@turf/turf';\nimport { PdfPreviewOptions } from './pdfContext';\nimport { LngLatLike, Map as MapType, PointLike } from 'maplibre-gl';\nimport { Feature, Units } from '@turf/turf';\n\ntype Props = {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Polygon GeoJson Feature representing the printing area\n\t */\n\tgeojsonRef: React.MutableRefObject<\n\t\t| Feature\n\t\t| undefined\n\t>;\n\t/**\n\t * a state variable containing the PDF previews current state\n\t */\n\toptions: PdfPreviewOptions;\n\t/**\n\t * setter function to update the current PDF preview state\n\t */\n\tsetOptions: (arg1: (val: PdfPreviewOptions) => PdfPreviewOptions) => void;\n};\n\nfunction getTargetRotationAngle(target: HTMLDivElement) {\n\tconst el_style = window.getComputedStyle(target, null);\n\tconst el_transform = el_style.getPropertyValue('transform');\n\n\tlet deg = 0;\n\n\tif (el_transform !== 'none') {\n\t\tconst values = el_transform.split('(')[1].split(')')[0].split(',');\n\t\tconst a = parseFloat(values[0]);\n\t\tconst b = parseFloat(values[1]);\n\t\tdeg = Math.round(Math.atan2(b, a) * (180 / Math.PI));\n\t}\n\n\treturn deg < 0 ? deg + 360 : deg;\n}\n\nfunction calcElemTransformedPoint(\n\tel: HTMLDivElement,\n\tpoint: [number, number],\n\ttransformOrigin: [number, number]\n): PointLike {\n\tconst style = getComputedStyle(el);\n\tconst p = [point[0] - transformOrigin[0], point[1] - transformOrigin[1]];\n\n\tconst matrix = new DOMMatrixReadOnly(style.transform);\n\n\t// transform pixel coordinates according to the css transform state of \"el\" (target)\n\treturn [\n\t\tp[0] * matrix.a + p[1] * matrix.c + matrix.e + transformOrigin[0],\n\t\tp[0] * matrix.b + p[1] * matrix.d + matrix.f + transformOrigin[1],\n\t];\n}\n\n// measure distance in pixels that is used to determine the current css transform.scale relative to the maps viewport.zoom\nconst scaleAnchorInPixels = 10;\n\n// used to determine the MapZoomScale modifier which is multiplied with props.options.scale to relate the scale to the current map viewport.zoom\nfunction getMapZoomScaleModifier(point: [number, number], _map: MapType) {\n\tconst left = _map.unproject(point);\n\tconst right = _map.unproject([point[0] + scaleAnchorInPixels, point[1]]);\n\tconst maxMeters = left.distanceTo(right);\n\treturn scaleAnchorInPixels / maxMeters;\n}\n\n/**\n * PdfPreview component renders a transformable (drag, scale, rotate) preview of the desired export or print content\n */\nexport default function PdfPreview(props: Props) {\n\tconst mapState = useMapState({ mapId: props.mapId, watch: { layers: false, viewport: true } });\n\tconst targetRef = useRef<HTMLDivElement>(null);\n\tconst fixedScaleRef = useRef<number | undefined>();\n\tconst moveableRef = useRef<Moveable>(null);\n\tconst mapContainerRef = useRef<HTMLDivElement>(document.querySelector('.mapContainer'));\n\t//const [transform, setTransform] = useState('translate(452.111px, 15.6148px)');\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t});\n\n\tuseEffect(() => {\n\t\tif (!mapState?.viewport?.zoom || !mapHook.map) return;\n\t\t// if the component was initialized with scale or center as undefined derive those values from the current map view state\n\n\t\t//initialize props if not defined\n\t\tconst _centerX = Math.round(mapHook.map.map._container.clientWidth / 2);\n\t\tconst _centerY = Math.round(mapHook.map.map._container.clientHeight / 2);\n\n\t\tif (!props.options.scale) {\n\t\t\t//const scale = parseFloat(/(14/mapState.viewport.zoom));\n\t\t\tconst scale = 1 / getMapZoomScaleModifier([_centerX, _centerY], mapHook.map.map);\n\n\t\t\tprops.setOptions((val: PdfPreviewOptions) => ({ ...val, scale: [scale, scale] }));\n\t\t}\n\t\tif (!props.options.center) {\n\t\t\tconst _center = mapHook.map.map.unproject([_centerX, _centerY]);\n\t\t\tprops.setOptions((val: PdfPreviewOptions) => ({\n\t\t\t\t...val,\n\t\t\t\tcenter: [_center.lng, _center.lat],\n\t\t\t}));\n\t\t}\n\t}, [mapHook.map, mapState.viewport?.zoom]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tmapHook.map.map.setPitch(0);\n\t\tconst _maxPitch = mapHook.map.map.getMaxPitch();\n\t\tmapHook.map.map.setMaxPitch(0);\n\t\treturn () => {\n\t\t\tmapHook.map?.map.setMaxPitch(_maxPitch);\n\t\t};\n\t}, [mapHook.map]);\n\n\tconst transformOrigin = useMemo<[number, number]>(() => {\n\t\tif (props.options.orientation === 'portrait') {\n\t\t\treturn [props.options.width / 2, props.options.height / 2];\n\t\t} else {\n\t\t\treturn [props.options.height / 2, props.options.width / 2];\n\t\t}\n\t}, [props.options.orientation, props.options.width, props.options.height]);\n\n\tconst transform = useMemo(() => {\n\t\tif (!mapHook.map || !props.options.scale) return 'none';\n\n\t\tconst centerInPixels = mapHook.map.map.project(props.options.center as LngLatLike);\n\n\t\tconst x = centerInPixels.x;\n\t\tconst y = centerInPixels.y;\n\t\tconst scale = props.options.scale[0] * getMapZoomScaleModifier([x, y], mapHook.map.map);\n\n\t\tconst viewportBearing = mapState?.viewport?.bearing ? mapState.viewport?.bearing : 0;\n\n\t\tconst _transform = `translate(${Math.floor(\n\t\t\tcenterInPixels.x - transformOrigin[0]\n\t\t)}px,${Math.floor(centerInPixels.y - transformOrigin[1])}px) rotate(${\n\t\t\tprops.options.rotate - viewportBearing\n\t\t}deg) scale(${scale},${scale})`;\n\n\t\tif (targetRef.current) targetRef.current.style.transform = _transform;\n\n\t\treturn _transform;\n\t}, [\n\t\tmapHook.map,\n\t\tmapState.viewport,\n\t\tprops.options.scale,\n\t\tprops.options.rotate,\n\t\tprops.options.center,\n\t\ttransformOrigin,\n\t]);\n\n\tuseEffect(() => {\n\t\tmoveableRef.current?.updateTarget();\n\t}, [transform]);\n\n\tuseEffect(() => {\n\t\t// update props.options.scale if fixedScale was changed\n\t\tif (\n\t\t\t!mapHook.map ||\n\t\t\t!props.options.center ||\n\t\t\t!props.options.fixedScale ||\n\t\t\t(typeof props.options.fixedScale !== 'undefined' &&\n\t\t\t\tfixedScaleRef.current === props.options.fixedScale)\n\t\t)\n\t\t\treturn;\n\n\t\tfixedScaleRef.current = props.options.fixedScale;\n\t\tconst point = turf.point(props.options.center);\n\t\tconst distance = props.options.fixedScale * (props.options.width / 1000);\n\n\t\tconst bearing = 90;\n\t\tconst options = { units: 'meters' as Units };\n\t\tconst destination = turf.destination(point, distance, bearing, options);\n\n\t\tconst centerInPixels = mapHook.map.map.project(point.geometry.coordinates as LngLatLike);\n\t\tconst destinationInPixels = mapHook.map.map.project(\n\t\t\tdestination.geometry.coordinates as LngLatLike\n\t\t);\n\n\t\tconst scaleFactor =\n\t\t\t(Math.round(destinationInPixels.x - centerInPixels.x) / props.options.width) *\n\t\t\t(1 / getMapZoomScaleModifier([centerInPixels.x, centerInPixels.y], mapHook.map.map));\n\t\tprops.setOptions((val: PdfPreviewOptions) => ({ ...val, scale: [scaleFactor, scaleFactor] }));\n\t}, [mapHook.map, props.options.width, props.options.center, props.options.fixedScale]);\n\n\t// update props.geoJsonRef\n\tuseEffect(() => {\n\t\tif (targetRef.current && mapHook.map) {\n\t\t\t// apply orientation\n\t\t\tlet _width = props.options.width;\n\t\t\tlet _height = props.options.height;\n\t\t\tif (props.options.orientation === 'portrait') {\n\t\t\t\ttargetRef.current.style.width = props.options.width + 'px';\n\t\t\t\ttargetRef.current.style.height = props.options.height + 'px';\n\t\t\t} else {\n\t\t\t\ttargetRef.current.style.width = props.options.height + 'px';\n\t\t\t\ttargetRef.current.style.height = props.options.width + 'px';\n\t\t\t\t_width = props.options.height;\n\t\t\t\t_height = props.options.width;\n\t\t\t}\n\t\t\tmoveableRef.current?.updateTarget();\n\n\t\t\tconst topLeft = mapHook.map.map.unproject(\n\t\t\t\tcalcElemTransformedPoint(targetRef.current, [0, 0], transformOrigin)\n\t\t\t);\n\t\t\tconst topRight = mapHook.map.map.unproject(\n\t\t\t\tcalcElemTransformedPoint(targetRef.current, [_width, 0], transformOrigin)\n\t\t\t);\n\t\t\tconst bottomLeft = mapHook.map.map.unproject(\n\t\t\t\tcalcElemTransformedPoint(targetRef.current, [0, _height], transformOrigin)\n\t\t\t);\n\t\t\tconst bottomRight = mapHook.map.map.unproject(\n\t\t\t\tcalcElemTransformedPoint(targetRef.current, [_width, _height], transformOrigin)\n\t\t\t);\n\n\t\t\tconst _geoJson = {\n\t\t\t\ttype: 'Feature',\n\t\t\t\tbbox: [topLeft.lng, topLeft.lat, bottomRight.lng, bottomRight.lat],\n\t\t\t\tgeometry: {\n\t\t\t\t\ttype: 'Polygon',\n\t\t\t\t\tcoordinates: [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t[topLeft.lng, topLeft.lat],\n\t\t\t\t\t\t\t[topRight.lng, topRight.lat],\n\t\t\t\t\t\t\t[bottomRight.lng, bottomRight.lat],\n\t\t\t\t\t\t\t[bottomLeft.lng, bottomLeft.lat],\n\t\t\t\t\t\t\t[topLeft.lng, topLeft.lat],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\tproperties: { bearing: getTargetRotationAngle(targetRef.current) },\n\t\t\t} as Feature;\n\t\t\tprops.geojsonRef.current = _geoJson;\n\t\t}\n\n\t\treturn undefined;\n\t}, [\n\t\tmapHook,\n\t\ttransform,\n\t\tprops.options.orientation,\n\t\tprops.geojsonRef,\n\t\tmapState,\n\t\ttargetRef.current,\n\t\ttransformOrigin,\n\t]);\n\n\treturn mapContainerRef.current ? ReactDOM.createPortal(\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName=\"target\"\n\t\t\t\tref={targetRef}\n\t\t\t\tstyle={{ transform: transform, transformOrigin: 'center center' }}\n\t\t\t></div>\n\t\t\t<Moveable\n\t\t\t\t// eslint-disable-next-line\n\t\t\t\t// @ts-ignore:\n\t\t\t\tref={moveableRef}\n\t\t\t\ttarget={targetRef}\n\t\t\t\tcontainer={null}\n\t\t\t\torigin={true}\n\t\t\t\tkeepRatio={true}\n\t\t\t\t/* draggable */\n\t\t\t\tdraggable={true}\n\t\t\t\tonDrag={(e) => {\n\t\t\t\t\tif (mapHook.map) {\n\n\t\t\t\t\t\tlet _transformParts = e.transform.split('translate(');\n\t\t\t\t\t\t_transformParts = _transformParts[1].split('px)')[0].split('px, ');\n\t\t\t\t\t\tconst _center = mapHook.map?.map.unproject([\n\t\t\t\t\t\t\tparseInt(_transformParts[0]) + transformOrigin[0],\n\t\t\t\t\t\t\tparseInt(_transformParts[1]) + transformOrigin[1],\n\t\t\t\t\t\t]);\n\t\t\t\t\t\tprops.setOptions((val: PdfPreviewOptions) => ({\n\t\t\t\t\t\t\t...val,\n\t\t\t\t\t\t\tcenter: [_center.lng, _center.lat],\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\t/* scalable */\n\t\t\t\tscalable={props.options.fixedScale ? false : true}\n\t\t\t\tonScale={(e) => {\n\t\t\t\t\tif (mapHook.map) {\n\t\t\t\t\t\tlet _transformParts = e.drag.transform.split('scale(');\n\t\t\t\t\t\t_transformParts = _transformParts[1].split(')')[0].split(', ');\n\n\t\t\t\t\t\tconst centerInPixels = mapHook.map.map.project(props.options.center as LngLatLike);\n\n\t\t\t\t\t\tconst x = centerInPixels.x;\n\t\t\t\t\t\tconst y = centerInPixels.y;\n\n\t\t\t\t\t\tconst scale =\n\t\t\t\t\t\t\tparseFloat(_transformParts[0]) *\n\t\t\t\t\t\t\t(1 / getMapZoomScaleModifier([x, y], mapHook.map.map));\n\n\n\t\t\t\t\t\tprops.setOptions((val: PdfPreviewOptions) => ({ ...val, scale: [scale, scale] }));\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\t/* rotatable */\n\t\t\t\trotatable={true}\n\t\t\t\tonRotate={(e) => {\n\t\t\t\t\tif (mapHook.map && mapState.viewport) {\n\t\t\t\t\t\tconst _transformParts = e.drag.transform.split('rotate(');\n\t\t\t\t\t\tconst _transformPartString = _transformParts[1].split('deg)')[0];\n\t\t\t\t\t\tconst viewportBearing = mapState?.viewport?.bearing ? mapState.viewport.bearing : 0;\n\n\t\t\t\t\t\tprops.setOptions((val: PdfPreviewOptions) => ({\n\t\t\t\t\t\t\t...val,\n\t\t\t\t\t\t\trotate: parseFloat(_transformPartString) + viewportBearing,\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>,\n\t\tmapContainerRef.current\n\t):<></>;\n}\n","import React, { useContext, useMemo, useCallback, useState } from 'react';\nimport PdfContext from './PdfContext';\nimport PdfPreview from './PdfPreview';\nimport {\n\tFormControl,\n\tMenuItem,\n\tSelect,\n\tInputLabel,\n\tButton,\n\tFormLabel,\n\tFormControlLabel,\n\tRadio,\n\tRadioGroup,\n\tCircularProgress,\n} from '@mui/material';\n\nimport useMap from '../../../hooks/useMap';\nimport useExportMap from '../../../hooks/useExportMap';\nimport { createPdfResolverParams } from '../../../hooks/useExportMap/lib';\n\nimport * as turf from '@turf/turf';\n\nimport templates from './pdf.templates';\nimport { PdfPreviewOptions } from './pdfContext';\n\nconst scaleOptions = [\n\t{\n\t\tvalue: 0,\n\t\tlabel: 'free scale',\n\t},\n\t{\n\t\tvalue: 250,\n\t\tlabel: '1/250',\n\t},\n\t{\n\t\tvalue: 500,\n\t\tlabel: '1/500',\n\t},\n\t{\n\t\tvalue: 750,\n\t\tlabel: '1/750',\n\t},\n\t{\n\t\tvalue: 1000,\n\t\tlabel: '1/1000',\n\t},\n\t{\n\t\tvalue: 1500,\n\t\tlabel: '1/1500',\n\t},\n\t{\n\t\tvalue: 2000,\n\t\tlabel: '1/2000',\n\t},\n\t{\n\t\tvalue: 10000,\n\t\tlabel: '1/10000',\n\t},\n\t{\n\t\tvalue: 100000,\n\t\tlabel: '1/100000',\n\t},\n];\nconst qualityOptions = [\n\t{\n\t\tvalue: '72dpi',\n\t\tlabel: 'Draft (72dpi)',\n\t},\n\t{\n\t\tvalue: '150dpi',\n\t\tlabel: 'Medium (150dpi)',\n\t},\n\t{\n\t\tvalue: '300dpi',\n\t\tlabel: 'High (300dpi)',\n\t},\n];\n\ninterface PdfFormProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\tonCreatePdf?: (options: createPdfResolverParams) => createPdfResolverParams;\n}\n\nexport default function PdfForm(props: PdfFormProps) {\n\tconst [loading, setLoading] = useState(false);\n\tconst pdfContext = useContext(PdfContext);\n\tconst mapHook = useMap({\n\t\t// eslint-disable-next-line react/prop-types\n\t\tmapId: props.mapId,\n\t});\n\tconst mapExporter = useExportMap({ mapId: props.mapId });\n\n\tconst createPdfHandler = useCallback(() => {\n\t\tif (\n\t\t\tmapHook.map &&\n\t\t\tmapExporter.createExport &&\n\t\t\tpdfContext.template &&\n\t\t\tpdfContext.format &&\n\t\t\tpdfContext.options?.orientation &&\n\t\t\tpdfContext.geojsonRef?.current?.bbox &&\n\t\t\tpdfContext.geojsonRef?.current\n\t\t) {\n\t\t\tsetLoading(true);\n\t\t\tconst bbox = turf.bbox(pdfContext.geojsonRef.current);\n\n\t\t\tmapExporter\n\t\t\t\t.createExport({\n\t\t\t\t\twidth: pdfContext.template.width,\n\t\t\t\t\theight: pdfContext.template.height,\n\t\t\t\t\tbbox: bbox,\n\t\t\t\t\tbboxUnrotated: pdfContext.geojsonRef.current.bbox,\n\t\t\t\t\tbearing: (pdfContext.geojsonRef.current?.properties?.bearing as number) || 0,\n\t\t\t\t\tformat: pdfContext.format.toLowerCase(),\n\t\t\t\t\torientation: pdfContext.options.orientation,\n\t\t\t\t})\n\t\t\t\t.then((res) => res.createPdf())\n\t\t\t\t.then((res) => {\n\t\t\t\t\tif (typeof props.onCreatePdf === 'function') {\n\t\t\t\t\t\tprops.onCreatePdf(res);\n\t\t\t\t\t}\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t\treturn res.downloadPdf();\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t});\n\t\t}\n\t}, [mapHook.map, pdfContext]);\n\n\tconst formControlStyles = useMemo(\n\t\t() => {\n\t\t\treturn {\n\t\t\t\tmargin: '5px 0 15px 0 ',\n\t\t\t\t//...props.formControlStyles,\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\t/*props.formControlStyles*/\n\t\t]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<FormControl fullWidth sx={formControlStyles}>\n\t\t\t\t<InputLabel id=\"format-select-label\">Format</InputLabel>\n\t\t\t\t<Select\n\t\t\t\t\tlabelId=\"format-select-label\"\n\t\t\t\t\tid=\"format-select\"\n\t\t\t\t\tlabel=\"Format\"\n\t\t\t\t\tvalue={pdfContext.format}\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tpdfContext.setFormat?.(event.target.value);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{Object.keys(templates).map((el) => (\n\t\t\t\t\t\t<MenuItem key={el} value={el}>\n\t\t\t\t\t\t\t{el}\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t))}\n\t\t\t\t</Select>\n\t\t\t</FormControl>\n\t\t\t<FormControl fullWidth sx={formControlStyles}>\n\t\t\t\t<FormLabel id=\"orientation-radio-buttons-group-label\">Orientation</FormLabel>\n\t\t\t\t<RadioGroup\n\t\t\t\t\trow\n\t\t\t\t\taria-labelledby=\"orientation-radio-buttons-group-label\"\n\t\t\t\t\tname=\"orientation-radio-buttons-group\"\n\t\t\t\t\tvalue={pdfContext.options?.orientation}\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tif (!pdfContext.setOptions) return;\n\n\t\t\t\t\t\tpdfContext.setOptions((val: PdfPreviewOptions) => ({\n\t\t\t\t\t\t\t...val,\n\t\t\t\t\t\t\torientation: event.target.value as 'landscape' | 'portrait',\n\t\t\t\t\t\t}));\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<FormControlLabel value=\"portrait\" control={<Radio />} label=\"Portrait\" />\n\t\t\t\t\t<FormControlLabel value=\"landscape\" control={<Radio />} label=\"Landscape\" />\n\t\t\t\t</RadioGroup>\n\t\t\t</FormControl>\n\t\t\t<FormControl fullWidth sx={formControlStyles}>\n\t\t\t\t<InputLabel id=\"quality-select-label\">Quality</InputLabel>\n\t\t\t\t<Select\n\t\t\t\t\tlabelId=\"quality-select-label\"\n\t\t\t\t\tid=\"quality-select\"\n\t\t\t\t\tlabel=\"Quality\"\n\t\t\t\t\tvalue={pdfContext.quality}\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tpdfContext.setQuality?.(event.target.value);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{qualityOptions.map((el) => (\n\t\t\t\t\t\t<MenuItem key={el.value} value={el.value}>\n\t\t\t\t\t\t\t{el.label}\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t))}\n\t\t\t\t</Select>\n\t\t\t</FormControl>\n\t\t\t<FormControl fullWidth sx={formControlStyles}>\n\t\t\t\t<InputLabel id=\"scale-select-label\">Scale</InputLabel>\n\t\t\t\t<Select\n\t\t\t\t\tlabelId=\"scale-select-label\"\n\t\t\t\t\tid=\"scale-select\"\n\t\t\t\t\tlabel=\"Scale\"\n\t\t\t\t\tvalue={pdfContext?.options?.fixedScale}\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tpdfContext.setOptions?.((val) => ({\n\t\t\t\t\t\t\t...val,\n\t\t\t\t\t\t\tfixedScale: event.target.value as number,\n\t\t\t\t\t\t}));\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{scaleOptions.map((el, idx) => (\n\t\t\t\t\t\t<MenuItem key={idx} value={el.value}>\n\t\t\t\t\t\t\t{el.label}\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t))}\n\t\t\t\t</Select>\n\t\t\t</FormControl>\n\t\t\t<FormControl fullWidth sx={formControlStyles}>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"contained\"\n\t\t\t\t\tclassName=\"createPdfButton\"\n\t\t\t\t\tonClick={createPdfHandler}\n\t\t\t\t\tdisabled={loading}\n\t\t\t\t>\n\t\t\t\t\tcreate PDF\n\t\t\t\t</Button>\n\t\t\t\t{loading && (\n <CircularProgress\n size={24}\n sx={{\n color: 'primary.main',\n position: 'absolute',\n top: '50%',\n left: '50%',\n marginTop: '-12px',\n marginLeft: '-12px',\n }}\n />\n )}\n\t\t\t</FormControl>\n\t\t\t{pdfContext.options && pdfContext.setOptions && (\n\t\t\t\t<PdfPreview\n\t\t\t\t\toptions={pdfContext.options}\n\t\t\t\t\tsetOptions={pdfContext.setOptions}\n\t\t\t\t\tgeojsonRef={pdfContext.geojsonRef}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</>\n\t);\n}\n","import React from 'react';\nimport PdfForm from './lib/PdfForm';\nimport { PdfContextProvider } from './lib/PdfContext';\nimport { createPdfResolverParams } from '../../hooks/useExportMap/lib';\nimport { SxProps } from '@mui/material';\n\ninterface MlCreatePdfFormProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * sx props that will be applied to the form control components\n\t */\n\tformControlStyles?: SxProps;\n\t/**\n\t * Function that will be called before the PDF is created. \n\t * Allowing to access and manipulate the jspdf instance before the PDF is created.\n\t */\n\tonCreatePdf?: (options:createPdfResolverParams) => createPdfResolverParams;\n}\n\nexport type { MlCreatePdfFormProps };\n\n/**\n * Create PDF Form Component\n *\n */\nconst MlCreatePdfForm = (props: MlCreatePdfFormProps) => {\n\treturn (\n\t\t<>\n\t\t\t<PdfContextProvider>\n\t\t\t\t<PdfForm {...props} />\n\t\t\t</PdfContextProvider>\n\t\t</>\n\t);\n};\n\nMlCreatePdfForm.defaultProps = {\n\tmapId: undefined,\n};\nexport default MlCreatePdfForm;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nexport const classes = {\n\tCONTROL_BASE: 'mapboxgl-ctrl',\n\tCONTROL_PREFIX: 'mapboxgl-ctrl-',\n\tCONTROL_BUTTON: 'mapbox-gl-draw_ctrl-draw-btn',\n\tCONTROL_BUTTON_LINE: 'mapbox-gl-draw_line',\n\tCONTROL_BUTTON_POLYGON: 'mapbox-gl-draw_polygon',\n\tCONTROL_BUTTON_POINT: 'mapbox-gl-draw_point',\n\tCONTROL_BUTTON_TRASH: 'mapbox-gl-draw_trash',\n\tCONTROL_BUTTON_COMBINE_FEATURES: 'mapbox-gl-draw_combine',\n\tCONTROL_BUTTON_UNCOMBINE_FEATURES: 'mapbox-gl-draw_uncombine',\n\tCONTROL_GROUP: 'mapboxgl-ctrl-group',\n\tATTRIBUTION: 'mapboxgl-ctrl-attrib',\n\tACTIVE_BUTTON: 'active',\n\tBOX_SELECT: 'mapbox-gl-draw_boxselect'\n};\n\nexport const sources = {\n\tHOT: 'mapbox-gl-draw-hot',\n\tCOLD: 'mapbox-gl-draw-cold'\n};\n\nexport const cursors = {\n\tADD: 'add',\n\tMOVE: 'move',\n\tDRAG: 'drag',\n\tPOINTER: 'pointer',\n\tNONE: 'none'\n};\n\nexport const types = {\n\tPOLYGON: 'polygon',\n\tLINE: 'line_string',\n\tPOINT: 'point'\n};\n\nexport const geojsonTypes = {\n\tFEATURE: 'Feature',\n\tPOLYGON: 'Polygon',\n\tLINE_STRING: 'LineString',\n\tPOINT: 'Point',\n\tFEATURE_COLLECTION: 'FeatureCollection',\n\tMULTI_PREFIX: 'Multi',\n\tMULTI_POINT: 'MultiPoint',\n\tMULTI_LINE_STRING: 'MultiLineString',\n\tMULTI_POLYGON: 'MultiPolygon'\n};\n\nexport const modes = {\n\tDRAW_LINE_STRING: 'draw_line_string',\n\tDRAW_POLYGON: 'draw_polygon',\n\tDRAW_POINT: 'draw_point',\n\tSIMPLE_SELECT: 'simple_select',\n\tDIRECT_SELECT: 'direct_select',\n\tSTATIC: 'static'\n};\n\nexport const events = {\n\tCREATE: 'draw.create',\n\tDELETE: 'draw.delete',\n\tUPDATE: 'draw.update',\n\tSELECTION_CHANGE: 'draw.selectionchange',\n\tMODE_CHANGE: 'draw.modechange',\n\tACTIONABLE: 'draw.actionable',\n\tRENDER: 'draw.render',\n\tCOMBINE_FEATURES: 'draw.combine',\n\tUNCOMBINE_FEATURES: 'draw.uncombine'\n};\n\nexport const updateActions = {\n\tMOVE: 'move',\n\tCHANGE_COORDINATES: 'change_coordinates'\n};\n\nexport const meta = {\n\tFEATURE: 'feature',\n\tMIDPOINT: 'midpoint',\n\tVERTEX: 'vertex'\n};\n\nexport const activeStates = {\n\tACTIVE: 'true',\n\tINACTIVE: 'false'\n};\n\nexport const interactions = [\n\t'scrollZoom',\n\t'boxZoom',\n\t'dragRotate',\n\t'dragPan',\n\t'keyboard',\n\t'doubleClickZoom',\n\t'touchZoomRotate'\n];\n\nexport const LAT_MIN = -90;\nexport const LAT_RENDERED_MIN = -85;\nexport const LAT_MAX = 90;\nexport const LAT_RENDERED_MAX = 85;\nexport const LNG_MIN = -270;\nexport const LNG_MAX = 270;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport * as Constants from \"./constants\";\n\nexport function isOfMetaType(type) {\n\treturn function (e) {\n\t\tconst featureTarget = e.featureTarget;\n\t\tif (!featureTarget) return false;\n\t\tif (!featureTarget.properties) return false;\n\t\treturn featureTarget.properties.meta === type;\n\t};\n}\n\nexport function isShiftMousedown(e) {\n\tif (!e.originalEvent) return false;\n\tif (!e.originalEvent.shiftKey) return false;\n\treturn e.originalEvent.button === 0;\n}\n\nexport function isActiveFeature(e) {\n\tif (!e.featureTarget) return false;\n\tif (!e.featureTarget.properties) return false;\n\treturn (\n\t\te.featureTarget.properties.active === Constants.activeStates.ACTIVE &&\n\t\te.featureTarget.properties.meta === Constants.meta.FEATURE\n\t);\n}\n\nexport function isInactiveFeature(e) {\n\tif (!e.featureTarget) return false;\n\tif (!e.featureTarget.properties) return false;\n\treturn (\n\t\te.featureTarget.properties.active === Constants.activeStates.INACTIVE &&\n\t\te.featureTarget.properties.meta === Constants.meta.FEATURE\n\t);\n}\n\nexport function noTarget(e) {\n\treturn e.featureTarget === undefined;\n}\n\nexport function isFeature(e) {\n\tif (!e.featureTarget) return false;\n\tif (!e.featureTarget.properties) return false;\n\treturn e.featureTarget.properties.meta === Constants.meta.FEATURE;\n}\n\nexport function isVertex(e) {\n\tconst featureTarget = e.featureTarget;\n\tif (!featureTarget) return false;\n\tif (!featureTarget.properties) return false;\n\treturn featureTarget.properties.meta === Constants.meta.VERTEX;\n}\n\nexport function isShiftDown(e) {\n\tif (!e.originalEvent) return false;\n\treturn e.originalEvent.shiftKey === true;\n}\n\nexport function isEscapeKey(e) {\n\treturn e.keyCode === 27;\n}\n\nexport function isEnterKey(e) {\n\treturn e.keyCode === 13;\n}\n\nexport function isTrue() {\n\treturn true;\n}\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nconst doubleClickZoom = {\n\tenable(ctx) {\n\t\tsetTimeout(() => {\n\t\t\t// First check we've got a map and some context.\n\t\t\tif (\n\t\t\t\t!ctx.map ||\n\t\t\t\t!ctx.map.doubleClickZoom ||\n\t\t\t\t!ctx._ctx ||\n\t\t\t\t!ctx._ctx.store ||\n\t\t\t\t!ctx._ctx.store.getInitialConfigValue\n\t\t\t)\n\t\t\t\treturn;\n\t\t\t// Now check initial state wasn't false (we leave it disabled if so)\n\t\t\tif (!ctx._ctx.store.getInitialConfigValue(\"doubleClickZoom\")) return;\n\t\t\tctx.map.doubleClickZoom.enable();\n\t\t}, 0);\n\t},\n\tdisable(ctx) {\n\t\tsetTimeout(() => {\n\t\t\tif (!ctx.map || !ctx.map.doubleClickZoom) return;\n\t\t\t// Always disable here, as it's necessary in some cases.\n\t\t\tctx.map.doubleClickZoom.disable();\n\t\t}, 0);\n\t},\n};\nexport default doubleClickZoom;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nfunction isEventAtCoordinates(event, coordinates) {\n\tif (!event.lngLat) return false;\n\treturn event.lngLat.lng === coordinates[0] && event.lngLat.lat === coordinates[1];\n}\n\nexport default isEventAtCoordinates;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport * as Constants from \"./constants\";\n\n/**\n * Returns GeoJSON for a Point representing the\n * vertex of another feature.\n *\n * @param {string} parentId\n * @param {Array<number>} coordinates\n * @param {string} path - Dot-separated numbers indicating exactly\n *\t where the point exists within its parent feature's coordinates.\n * @param {boolean} selected\n * @return {GeoJSON} Point\n */\nconst create_vertex = function (parentId, coordinates, path, selected) {\n\treturn {\n\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\tproperties: {\n\t\t\tmeta: Constants.meta.VERTEX,\n\t\t\tparent: parentId,\n\t\t\tcoord_path: path,\n\t\t\tactive: selected\n\t\t\t\t? Constants.activeStates.ACTIVE\n\t\t\t\t: Constants.activeStates.INACTIVE,\n\t\t},\n\t\tgeometry: {\n\t\t\ttype: Constants.geojsonTypes.POINT,\n\t\t\tcoordinates,\n\t\t},\n\t};\n};\nexport default create_vertex;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport * as CommonSelectors from \"./lib/common_selectors.js\";\nimport doubleClickZoom from \"./lib/double_click_zoom.js\";\nimport * as Constants from \"./lib/constants.js\";\nimport isEventAtCoordinates from \"./lib/is_event_at_coordinates.js\";\nimport createVertex from \"./lib/create_vertex.js\";\n\nconst CustomPolygonMode = {};\n\nCustomPolygonMode.onSetup = function () {\n\tconsole.log(\"Change mode: custom polygon\");\n\n\tconst polygon = this.newFeature({\n\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\tproperties: {},\n\t\tgeometry: {\n\t\t\ttype: Constants.geojsonTypes.POLYGON,\n\t\t\tcoordinates: [[]],\n\t\t},\n\t});\n\n\tthis.addFeature(polygon);\n\n\tthis.clearSelectedFeatures();\n\tdoubleClickZoom.disable(this);\n\tthis.updateUIClasses({ mouse: Constants.cursors.ADD });\n\tthis.activateUIButton(Constants.types.POLYGON);\n\tthis.setActionableState({\n\t\ttrash: true,\n\t});\n\n\treturn {\n\t\tpolygon,\n\t\tcurrentVertexPosition: 0,\n\t};\n};\n\nCustomPolygonMode.clickAnywhere = function (state, e) {\n\tif (\n\t\tstate.currentVertexPosition > 0 &&\n\t\tisEventAtCoordinates(\n\t\t\te,\n\t\t\tstate.polygon.coordinates[0][state.currentVertexPosition - 1]\n\t\t)\n\t) {\n\t\treturn this.changeMode(\"custom_select\", {\n\t\t\tfeatureIds: [state.polygon.id],\n\t\t});\n\t}\n\tthis.updateUIClasses({ mouse: Constants.cursors.ADD });\n\tstate.polygon.updateCoordinate(\n\t\t`0.${state.currentVertexPosition}`,\n\t\te.lngLat.lng,\n\t\te.lngLat.lat\n\t);\n\tstate.currentVertexPosition++;\n\tstate.polygon.updateCoordinate(\n\t\t`0.${state.currentVertexPosition}`,\n\t\te.lngLat.lng,\n\t\te.lngLat.lat\n\t);\n\n\tthis.map.fire(Constants.events.CREATE, {\n\t\tfeatures: [state.polygon.toGeoJSON()],\n\t});\n};\n\nCustomPolygonMode.clickOnVertex = function (state) {\n\treturn this.changeMode(\"custom_select\", {\n\t\tfeatureIds: [state.polygon.id],\n\t});\n};\n\nCustomPolygonMode.onMouseMove = function (state, e) {\n\tstate.polygon.updateCoordinate(\n\t\t`0.${state.currentVertexPosition}`,\n\t\te.lngLat.lng,\n\t\te.lngLat.lat\n\t);\n\n\tif (CommonSelectors.isVertex(e)) {\n\t\tthis.updateUIClasses({ mouse: Constants.cursors.POINTER });\n\t}\n};\n\nCustomPolygonMode.onTap = CustomPolygonMode.onClick = function (state, e) {\n\tif (CommonSelectors.isVertex(e)) return this.clickOnVertex(state, e);\n\treturn this.clickAnywhere(state, e);\n};\n\nCustomPolygonMode.onKeyUp = function (state, e) {\n\tif (CommonSelectors.isEscapeKey(e)) {\n\t\tthis.deleteFeature([state.polygon.id], { silent: true });\n\t\tthis.changeMode(\"custom_select\");\n\t} else if (CommonSelectors.isEnterKey(e)) {\n\t\tthis.changeMode(\"custom_select\", {\n\t\t\tfeatureIds: [state.polygon.id],\n\t\t});\n\t}\n};\n\nCustomPolygonMode.onStop = function (state) {\n\tthis.updateUIClasses({ mouse: Constants.cursors.NONE });\n\tdoubleClickZoom.enable(this);\n\tthis.activateUIButton();\n\n\t// check to see if we've deleted this feature\n\tif (this.getFeature(state.polygon.id) === undefined) return;\n\n\t//remove last added coordinate\n\tstate.polygon.removeCoordinate(`0.${state.currentVertexPosition}`);\n\tif (state.polygon.isValid()) {\n\t\tthis.map.fire(Constants.events.CREATE, {\n\t\t\tfeatures: [state.polygon.toGeoJSON()],\n\t\t});\n\t} else {\n\t\tthis.deleteFeature([state.polygon.id], { silent: true });\n\t\tthis.changeMode(\"custom_select\", {}, { silent: true });\n\t}\n};\n\nCustomPolygonMode.toDisplayFeatures = function (state, geojson, display) {\n\tconst isActivePolygon = geojson.properties.id === state.polygon.id;\n\tgeojson.properties.active = isActivePolygon\n\t\t? Constants.activeStates.ACTIVE\n\t\t: Constants.activeStates.INACTIVE;\n\tif (!isActivePolygon) return display(geojson);\n\n\t// Don't render a polygon until it has two positions\n\t// (and a 3rd which is just the first repeated)\n\tif (geojson.geometry.coordinates.length === 0) return;\n\n\tconst coordinateCount = geojson.geometry.coordinates[0].length;\n\t// 2 coordinates after selecting a draw type\n\t// 3 after creating the first point\n\tif (coordinateCount < 3) {\n\t\treturn;\n\t}\n\tgeojson.properties.meta = Constants.meta.FEATURE;\n\tdisplay(\n\t\tcreateVertex(state.polygon.id, geojson.geometry.coordinates[0][0], \"0.0\", false)\n\t);\n\tif (coordinateCount > 3) {\n\t\t// Add a start position marker to the map, clicking on this will finish the feature\n\t\t// This should only be shown when we're in a valid spot\n\t\tconst endPos = geojson.geometry.coordinates[0].length - 3;\n\t\tdisplay(\n\t\t\tcreateVertex(\n\t\t\t\tstate.polygon.id,\n\t\t\t\tgeojson.geometry.coordinates[0][endPos],\n\t\t\t\t`0.${endPos}`,\n\t\t\t\tfalse\n\t\t\t)\n\t\t);\n\t}\n\tif (coordinateCount <= 4) {\n\t\t// If we've only drawn two positions (plus the closer),\n\t\t// make a LineString instead of a Polygon\n\t\tconst lineCoordinates = [\n\t\t\t[geojson.geometry.coordinates[0][0][0], geojson.geometry.coordinates[0][0][1]],\n\t\t\t[geojson.geometry.coordinates[0][1][0], geojson.geometry.coordinates[0][1][1]],\n\t\t];\n\t\t// create an initial vertex so that we can track the first point on mobile devices\n\t\tdisplay({\n\t\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\t\tproperties: geojson.properties,\n\t\t\tgeometry: {\n\t\t\t\tcoordinates: lineCoordinates,\n\t\t\t\ttype: Constants.geojsonTypes.LINE_STRING,\n\t\t\t},\n\t\t});\n\t\tif (coordinateCount === 3) {\n\t\t\treturn;\n\t\t}\n\t}\n\t// render the Polygon\n\treturn display(geojson);\n};\n\nCustomPolygonMode.onTrash = function (state) {\n\tthis.deleteFeature([state.polygon.id], { silent: true });\n\tthis.changeMode(\"custom_select\");\n};\n\nexport default CustomPolygonMode;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport Point from '@mapbox/point-geometry';\n\n/**\n * Returns a Point representing a mouse event's position\n * relative to a containing element.\n *\n * @param {MouseEvent} mouseEvent\n * @param {Node} container\n * @returns {Point}\n */\nfunction mouseEventPoint(mouseEvent, container) {\n\tconst rect = container.getBoundingClientRect();\n\treturn new Point(\n\t\tmouseEvent.clientX - rect.left - (container.clientLeft || 0),\n\t\tmouseEvent.clientY - rect.top - (container.clientTop || 0)\n\t);\n}\n\nexport default mouseEventPoint;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport * as Constants from \"./constants\";\n\nconst create_midpoint = function (parent, startVertex, endVertex) {\n\tconst startCoord = startVertex.geometry.coordinates;\n\tconst endCoord = endVertex.geometry.coordinates;\n\n\t// If a coordinate exceeds the projection, we can't calculate a midpoint,\n\t// so run away\n\tif (\n\t\tstartCoord[1] > Constants.LAT_RENDERED_MAX ||\n\t\tstartCoord[1] < Constants.LAT_RENDERED_MIN ||\n\t\tendCoord[1] > Constants.LAT_RENDERED_MAX ||\n\t\tendCoord[1] < Constants.LAT_RENDERED_MIN\n\t) {\n\t\treturn null;\n\t}\n\n\tconst mid = {\n\t\tlng: (startCoord[0] + endCoord[0]) / 2,\n\t\tlat: (startCoord[1] + endCoord[1]) / 2,\n\t};\n\n\treturn {\n\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\tproperties: {\n\t\t\tmeta: Constants.meta.MIDPOINT,\n\t\t\tparent,\n\t\t\tlng: mid.lng,\n\t\t\tlat: mid.lat,\n\t\t\tcoord_path: endVertex.properties.coord_path,\n\t\t},\n\t\tgeometry: {\n\t\t\ttype: Constants.geojsonTypes.POINT,\n\t\t\tcoordinates: [mid.lng, mid.lat],\n\t\t},\n\t};\n};\nexport default create_midpoint;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport createVertex from \"./create_vertex\";\nimport createMidpoint from \"./create_midpoint\";\nimport * as Constants from \"./constants\";\n\nfunction createSupplementaryPoints(geojson, options = {}, basePath = null) {\n\tconst { type, coordinates } = geojson.geometry;\n\tconst featureId = geojson.properties && geojson.properties.id;\n\n\tlet supplementaryPoints = [];\n\n\tif (type === Constants.geojsonTypes.POINT) {\n\t\t// For points, just create a vertex\n\t\tsupplementaryPoints.push(\n\t\t\tcreateVertex(featureId, coordinates, basePath, isSelectedPath(basePath))\n\t\t);\n\t} else if (type === Constants.geojsonTypes.POLYGON) {\n\t\t// Cycle through a Polygon's rings and\n\t\t// process each line\n\t\tcoordinates.forEach((line, lineIndex) => {\n\t\t\tprocessLine(\n\t\t\t\tline,\n\t\t\t\tbasePath !== null ? `${basePath}.${lineIndex}` : String(lineIndex)\n\t\t\t);\n\t\t});\n\t} else if (type === Constants.geojsonTypes.LINE_STRING) {\n\t\tprocessLine(coordinates, basePath);\n\t} else if (type.indexOf(Constants.geojsonTypes.MULTI_PREFIX) === 0) {\n\t\tprocessMultiGeometry();\n\t}\n\n\tfunction processLine(line, lineBasePath) {\n\t\tlet firstPointString = \"\";\n\t\tlet lastVertex = null;\n\t\tline.forEach((point, pointIndex) => {\n\t\t\tconst pointPath =\n\t\t\t\tlineBasePath !== undefined && lineBasePath !== null\n\t\t\t\t\t? `${lineBasePath}.${pointIndex}`\n\t\t\t\t\t: String(pointIndex);\n\t\t\tconst vertex = createVertex(\n\t\t\t\tfeatureId,\n\t\t\t\tpoint,\n\t\t\t\tpointPath,\n\t\t\t\tisSelectedPath(pointPath)\n\t\t\t);\n\n\t\t\t// If we're creating midpoints, check if there was a\n\t\t\t// vertex before this one. If so, add a midpoint\n\t\t\t// between that vertex and this one.\n\t\t\tif (options.midpoints && lastVertex) {\n\t\t\t\tconst midpoint = createMidpoint(featureId, lastVertex, vertex);\n\t\t\t\tif (midpoint) {\n\t\t\t\t\tsupplementaryPoints.push(midpoint);\n\t\t\t\t}\n\t\t\t}\n\t\t\tlastVertex = vertex;\n\n\t\t\t// A Polygon line's last point is the same as the first point. If we're on the last\n\t\t\t// point, we want to draw a midpoint before it but not another vertex on it\n\t\t\t// (since we already a vertex there, from the first point).\n\t\t\tconst stringifiedPoint = JSON.stringify(point);\n\t\t\tif (firstPointString !== stringifiedPoint) {\n\t\t\t\tsupplementaryPoints.push(vertex);\n\t\t\t}\n\t\t\tif (pointIndex === 0) {\n\t\t\t\tfirstPointString = stringifiedPoint;\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction isSelectedPath(path) {\n\t\tif (!options.selectedPaths) return false;\n\t\treturn options.selectedPaths.indexOf(path) !== -1;\n\t}\n\n\t// Split a multi-geometry into constituent\n\t// geometries, and accumulate the supplementary points\n\t// for each of those constituents\n\tfunction processMultiGeometry() {\n\t\tconst subType = type.replace(Constants.geojsonTypes.MULTI_PREFIX, \"\");\n\t\tcoordinates.forEach((subCoordinates, index) => {\n\t\t\tconst subFeature = {\n\t\t\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\t\t\tproperties: geojson.properties,\n\t\t\t\tgeometry: {\n\t\t\t\t\ttype: subType,\n\t\t\t\t\tcoordinates: subCoordinates,\n\t\t\t\t},\n\t\t\t};\n\t\t\tsupplementaryPoints = supplementaryPoints.concat(\n\t\t\t\tcreateSupplementaryPoints(subFeature, options, index)\n\t\t\t);\n\t\t});\n\t}\n\n\treturn supplementaryPoints;\n}\n\nexport default createSupplementaryPoints;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nfunction StringSet(items) {\n\tthis._items = {};\n\tthis._nums = {};\n\tthis._length = items ? items.length : 0;\n\tif (!items) return;\n\tfor (let i = 0, l = items.length; i < l; i++) {\n\t\tthis.add(items[i]);\n\t\tif (items[i] === undefined) continue;\n\t\tif (typeof items[i] === 'string') this._items[items[i]] = i;\n\t\telse this._nums[items[i]] = i;\n\n\t}\n}\n\nStringSet.prototype.add = function(x) {\n\tif (this.has(x)) return this;\n\tthis._length++;\n\tif (typeof x === 'string') this._items[x] = this._length;\n\telse this._nums[x] = this._length;\n\treturn this;\n};\n\nStringSet.prototype.delete = function(x) {\n\tif (this.has(x) === false) return this;\n\tthis._length--;\n\tdelete this._items[x];\n\tdelete this._nums[x];\n\treturn this;\n};\n\nStringSet.prototype.has = function(x) {\n\tif (typeof x !== 'string' && typeof x !== 'number') return false;\n\treturn this._items[x] !== undefined || this._nums[x] !== undefined;\n};\n\nStringSet.prototype.values = function() {\n\tconst values = [];\n\tObject.keys(this._items).forEach((k) => {\n\t\tvalues.push({ k, v: this._items[k] });\n\t});\n\tObject.keys(this._nums).forEach((k) => {\n\t\tvalues.push({ k: JSON.parse(k), v: this._nums[k] });\n\t});\n\n\treturn values.sort((a, b) => a.v - b.v).map(a => a.k);\n};\n\nStringSet.prototype.clear = function() {\n\tthis._length = 0;\n\tthis._items = {};\n\tthis._nums = {};\n\treturn this;\n};\n\nexport default StringSet;\n","var geojsonCoords = require('@mapbox/geojson-coords'),\n traverse = require('traverse'),\n extent = require('@mapbox/extent');\n\nvar geojsonTypesByDataAttributes = {\n features: ['FeatureCollection'],\n coordinates: ['Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon'],\n geometry: ['Feature'],\n geometries: ['GeometryCollection']\n}\n\nvar dataAttributes = Object.keys(geojsonTypesByDataAttributes);\n\nmodule.exports = function(_) {\n return getExtent(_).bbox();\n};\n\nmodule.exports.polygon = function(_) {\n return getExtent(_).polygon();\n};\n\nmodule.exports.bboxify = function(_) {\n return traverse(_).map(function(value) {\n if (!value) return ;\n\n var isValid = dataAttributes.some(function(attribute){\n if(value[attribute]) {\n return geojsonTypesByDataAttributes[attribute].indexOf(value.type) !== -1;\n }\n return false;\n });\n\n if(isValid){\n value.bbox = getExtent(value).bbox();\n this.update(value);\n }\n\n });\n};\n\nfunction getExtent(_) {\n var ext = extent(),\n coords = geojsonCoords(_);\n for (var i = 0; i < coords.length; i++) ext.include(coords[i]);\n return ext;\n}\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport extent from \"@mapbox/geojson-extent\";\nimport * as Constants from \"./constants\";\n\nconst {\n\tLAT_MIN,\n\tLAT_MAX,\n\tLAT_RENDERED_MIN,\n\tLAT_RENDERED_MAX,\n\tLNG_MIN,\n\tLNG_MAX,\n} = Constants;\n\n// Ensure that we do not drag north-south far enough for\n// - any part of any feature to exceed the poles\n// - any feature to be completely lost in the space between the projection's\n//\t edge and the poles, such that it couldn't be re-selected and moved back\nconst constrain_feature_movement = function (geojsonFeatures, delta) {\n\t// \"inner edge\" = a feature's latitude closest to the equator\n\tlet northInnerEdge = LAT_MIN;\n\tlet southInnerEdge = LAT_MAX;\n\t// \"outer edge\" = a feature's latitude furthest from the equator\n\tlet northOuterEdge = LAT_MIN;\n\tlet southOuterEdge = LAT_MAX;\n\n\tlet westEdge = LNG_MAX;\n\tlet eastEdge = LNG_MIN;\n\n\tgeojsonFeatures.forEach((feature) => {\n\t\tconst bounds = extent(feature);\n\t\tconst featureSouthEdge = bounds[1];\n\t\tconst featureNorthEdge = bounds[3];\n\t\tconst featureWestEdge = bounds[0];\n\t\tconst featureEastEdge = bounds[2];\n\t\tif (featureSouthEdge > northInnerEdge) northInnerEdge = featureSouthEdge;\n\t\tif (featureNorthEdge < southInnerEdge) southInnerEdge = featureNorthEdge;\n\t\tif (featureNorthEdge > northOuterEdge) northOuterEdge = featureNorthEdge;\n\t\tif (featureSouthEdge < southOuterEdge) southOuterEdge = featureSouthEdge;\n\t\tif (featureWestEdge < westEdge) westEdge = featureWestEdge;\n\t\tif (featureEastEdge > eastEdge) eastEdge = featureEastEdge;\n\t});\n\n\t// These changes are not mutually exclusive: we might hit the inner\n\t// edge but also have hit the outer edge and therefore need\n\t// another readjustment\n\tconst constrainedDelta = delta;\n\tif (northInnerEdge + constrainedDelta.lat > LAT_RENDERED_MAX) {\n\t\tconstrainedDelta.lat = LAT_RENDERED_MAX - northInnerEdge;\n\t}\n\tif (northOuterEdge + constrainedDelta.lat > LAT_MAX) {\n\t\tconstrainedDelta.lat = LAT_MAX - northOuterEdge;\n\t}\n\tif (southInnerEdge + constrainedDelta.lat < LAT_RENDERED_MIN) {\n\t\tconstrainedDelta.lat = LAT_RENDERED_MIN - southInnerEdge;\n\t}\n\tif (southOuterEdge + constrainedDelta.lat < LAT_MIN) {\n\t\tconstrainedDelta.lat = LAT_MIN - southOuterEdge;\n\t}\n\tif (westEdge + constrainedDelta.lng <= LNG_MIN) {\n\t\tconstrainedDelta.lng += Math.ceil(Math.abs(constrainedDelta.lng) / 360) * 360;\n\t}\n\tif (eastEdge + constrainedDelta.lng >= LNG_MAX) {\n\t\tconstrainedDelta.lng -= Math.ceil(Math.abs(constrainedDelta.lng) / 360) * 360;\n\t}\n\n\treturn constrainedDelta;\n};\n\nexport default constrain_feature_movement;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport constrainFeatureMovement from \"./constrain_feature_movement\";\nimport * as Constants from \"./constants\";\n\nvar move_features = function (features, delta) {\n\tconst constrainedDelta = constrainFeatureMovement(\n\t\tfeatures.map((feature) => feature.toGeoJSON()),\n\t\tdelta\n\t);\n\n\tfeatures.forEach((feature) => {\n\t\tconst currentCoordinates = feature.getCoordinates();\n\n\t\tconst moveCoordinate = (coord) => {\n\t\t\tconst point = {\n\t\t\t\tlng: coord[0] + constrainedDelta.lng,\n\t\t\t\tlat: coord[1] + constrainedDelta.lat,\n\t\t\t};\n\t\t\treturn [point.lng, point.lat];\n\t\t};\n\t\tconst moveRing = (ring) => ring.map((coord) => moveCoordinate(coord));\n\t\tconst moveMultiPolygon = (multi) => multi.map((ring) => moveRing(ring));\n\n\t\tlet nextCoordinates;\n\t\tif (feature.type === Constants.geojsonTypes.POINT) {\n\t\t\tnextCoordinates = moveCoordinate(currentCoordinates);\n\t\t} else if (\n\t\t\tfeature.type === Constants.geojsonTypes.LINE_STRING ||\n\t\t\tfeature.type === Constants.geojsonTypes.MULTI_POINT\n\t\t) {\n\t\t\tnextCoordinates = currentCoordinates.map(moveCoordinate);\n\t\t} else if (\n\t\t\tfeature.type === Constants.geojsonTypes.POLYGON ||\n\t\t\tfeature.type === Constants.geojsonTypes.MULTI_LINE_STRING\n\t\t) {\n\t\t\tnextCoordinates = currentCoordinates.map(moveRing);\n\t\t} else if (feature.type === Constants.geojsonTypes.MULTI_POLYGON) {\n\t\t\tnextCoordinates = currentCoordinates.map(moveMultiPolygon);\n\t\t}\n\n\t\tfeature.incomingCoords(nextCoordinates);\n\t});\n};\nexport default move_features;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport * as CommonSelectors from \"./lib/common_selectors.js\";\nimport doubleClickZoom from \"./lib/double_click_zoom.js\";\nimport * as Constants from \"./lib/constants.js\";\nimport mouseEventPoint from \"./lib/mouse_event_point.js\";\nimport createSupplementaryPoints from \"./lib/create_supplementary_points.js\";\nimport StringSet from \"./lib/string_set.js\";\nimport moveFeatures from \"./lib/move_features.js\";\n\nconst CustomSelectMode = {};\nCustomSelectMode.onSetup = function (opts) {\n\tconsole.log(\"Change mode: custom select\");\n\n\t// turn the opts into state.\n\tconst state = {\n\t\tdragMoveLocation: null,\n\t\tboxSelectStartLocation: null,\n\t\tboxSelectElement: undefined,\n\t\tboxSelecting: false,\n\t\tcanBoxSelect: false,\n\t\tdragMoving: false,\n\t\tcanDragMove: false,\n\t\tinitiallySelectedFeatureIds: opts.featureIds || [],\n\t};\n\n\tthis.setSelected(\n\t\tstate.initiallySelectedFeatureIds.filter(\n\t\t\t(id) => this.getFeature(id) !== undefined\n\t\t)\n\t);\n\tthis.fireActionable();\n\n\tthis.setActionableState({\n\t\tcombineFeatures: true,\n\t\tuncombineFeatures: true,\n\t\ttrash: true,\n\t});\n\n\treturn state;\n};\n\nCustomSelectMode.fireUpdate = function () {\n\tthis.map.fire(Constants.events.UPDATE, {\n\t\taction: Constants.updateActions.MOVE,\n\t\tfeatures: this.getSelected().map((f) => f.toGeoJSON()),\n\t});\n};\n\nCustomSelectMode.fireActionable = function () {\n\tconst selectedFeatures = this.getSelected();\n\n\tconst multiFeatures = selectedFeatures.filter((feature) =>\n\t\tthis.isInstanceOf(\"MultiFeature\", feature)\n\t);\n\n\tlet combineFeatures = false;\n\n\tif (selectedFeatures.length > 1) {\n\t\tcombineFeatures = true;\n\t\tconst featureType = selectedFeatures[0].type.replace(\"Multi\", \"\");\n\t\tselectedFeatures.forEach((feature) => {\n\t\t\tif (feature.type.replace(\"Multi\", \"\") !== featureType) {\n\t\t\t\tcombineFeatures = false;\n\t\t\t}\n\t\t});\n\t}\n\n\tconst uncombineFeatures = multiFeatures.length > 0;\n\tconst trash = selectedFeatures.length > 0;\n\n\tthis.setActionableState({\n\t\tcombineFeatures,\n\t\tuncombineFeatures,\n\t\ttrash,\n\t});\n};\n\nCustomSelectMode.getUniqueIds = function (allFeatures) {\n\tif (!allFeatures.length) return [];\n\tconst ids = allFeatures\n\t\t.map((s) => s.properties.id)\n\t\t.filter((id) => id !== undefined)\n\t\t.reduce((memo, id) => {\n\t\t\tmemo.add(id);\n\t\t\treturn memo;\n\t\t}, new StringSet());\n\n\treturn ids.values();\n};\n\nCustomSelectMode.stopExtendedInteractions = function (state) {\n\tif (state.boxSelectElement) {\n\t\tif (state.boxSelectElement.parentNode)\n\t\t\tstate.boxSelectElement.parentNode.removeChild(state.boxSelectElement);\n\t\tstate.boxSelectElement = null;\n\t}\n\n\tthis.map.dragPan.enable();\n\n\tstate.boxSelecting = false;\n\tstate.canBoxSelect = false;\n\tstate.dragMoving = false;\n\tstate.canDragMove = false;\n};\n\nCustomSelectMode.onStop = function () {\n\tdoubleClickZoom.enable(this);\n};\n\nCustomSelectMode.onMouseMove = function (state) {\n\t// On mousemove that is not a drag, stop extended interactions.\n\t// This is useful if you drag off the canvas, release the button,\n\t// then move the mouse back over the canvas --- we don't allow the\n\t// interaction to continue then, but we do let it continue if you held\n\t// the mouse button that whole time\n\treturn this.stopExtendedInteractions(state);\n};\n\nCustomSelectMode.onMouseOut = function (state) {\n\t// As soon as you mouse leaves the canvas, update the feature\n\tif (state.dragMoving) return this.fireUpdate();\n};\n\nCustomSelectMode.onTap = CustomSelectMode.onClick = function (state, e) {\n\t// Click (with or without shift) on no feature\n\tif (CommonSelectors.noTarget(e)) return this.clickAnywhere(state, e); // also tap\n\tif (CommonSelectors.isOfMetaType(Constants.meta.VERTEX)(e))\n\t\treturn this.clickOnVertex(state, e); //tap\n\tif (CommonSelectors.isFeature(e)) return this.clickOnFeature(state, e);\n};\n\nCustomSelectMode.clickAnywhere = function (state) {\n\t// Clear the re-render selection\n\tconst wasSelected = this.getSelectedIds();\n\tif (wasSelected.length) {\n\t\tthis.clearSelectedFeatures();\n\t\twasSelected.forEach((id) => this.doRender(id));\n\t}\n\tdoubleClickZoom.enable(this);\n\tthis.stopExtendedInteractions(state);\n};\n\nCustomSelectMode.clickOnVertex = function (state, e) {\n\t// Enter direct select mode\n\tthis.changeMode(\"custom_direct_select\", {\n\t\tfeatureId: e.featureTarget.properties.parent,\n\t\tcoordPath: e.featureTarget.properties.coord_path,\n\t\tstartPos: e.lngLat,\n\t\t//\t\tgroupMove_vertices: matchingVertices,\n\t});\n\tthis.updateUIClasses({ mouse: Constants.cursors.MOVE });\n};\n\nCustomSelectMode.startOnActiveFeature = function (state, e) {\n\t// Stop any already-underway extended interactions\n\tthis.stopExtendedInteractions(state);\n\n\t// Disable map.dragPan immediately so it can't start\n\tthis.map.dragPan.disable();\n\n\t// Re-render it and enable drag move\n\tthis.doRender(e.featureTarget.properties.id);\n\n\t// Set up the state for drag moving\n\tstate.canDragMove = true;\n\tstate.dragMoveLocation = e.lngLat;\n};\n\nCustomSelectMode.clickOnFeature = function (state, e) {\n\t// Stop everything\n\tdoubleClickZoom.disable(this);\n\tthis.stopExtendedInteractions(state);\n\n\tconst isShiftClick = CommonSelectors.isShiftDown(e);\n\tconst selectedFeatureIds = this.getSelectedIds();\n\tconst featureId = e.featureTarget.properties.id;\n\tconst isFeatureSelected = this.isSelected(featureId);\n\n\t// Click (without shift) on any selected feature but a point\n\tif (\n\t\t!isShiftClick &&\n\t\tisFeatureSelected &&\n\t\tthis.getFeature(featureId).type !== Constants.geojsonTypes.POINT\n\t) {\n\t\t// Enter direct select mode\n\t\treturn this.changeMode(\"custom_direct_select\", {\n\t\t\tfeatureId,\n\t\t});\n\t}\n\n\t// Shift-click on a selected feature\n\tif (isFeatureSelected && isShiftClick) {\n\t\t// Deselect it\n\t\tthis.deselect(featureId);\n\t\tthis.updateUIClasses({ mouse: Constants.cursors.POINTER });\n\t\tif (selectedFeatureIds.length === 1) {\n\t\t\tdoubleClickZoom.enable(this);\n\t\t}\n\t\t// Shift-click on an unselected feature\n\t} else if (!isFeatureSelected && isShiftClick) {\n\t\t// Add it to the selection\n\t\tthis.select(featureId);\n\t\tthis.updateUIClasses({ mouse: Constants.cursors.MOVE });\n\t\t// Click (without shift) on an unselected feature\n\t} else if (!isFeatureSelected && !isShiftClick) {\n\t\t// Make it the only selected feature\n\t\tselectedFeatureIds.forEach((id) => this.doRender(id));\n\t\tthis.setSelected(featureId);\n\t\tthis.updateUIClasses({ mouse: Constants.cursors.MOVE });\n\t}\n\n\t// No matter what, re-render the clicked feature\n\tthis.doRender(featureId);\n};\n\nCustomSelectMode.onMouseDown = function (state, e) {\n\tif (CommonSelectors.isActiveFeature(e)) return this.startOnActiveFeature(state, e);\n\tif (this.drawConfig.boxSelect && CommonSelectors.isShiftMousedown(e))\n\t\treturn this.startBoxSelect(state, e);\n};\n\nCustomSelectMode.startBoxSelect = function (state, e) {\n\tthis.stopExtendedInteractions(state);\n\tthis.map.dragPan.disable();\n\t// Enable box select\n\tstate.boxSelectStartLocation = mouseEventPoint(\n\t\te.originalEvent,\n\t\tthis.map.getContainer()\n\t);\n\tstate.canBoxSelect = true;\n};\n\nCustomSelectMode.onTouchStart = function (state, e) {\n\tif (CommonSelectors.isActiveFeature(e)) return this.startOnActiveFeature(state, e);\n};\n\nCustomSelectMode.onDrag = function (state, e) {\n\tif (state.canDragMove) return this.dragMove(state, e);\n\tif (this.drawConfig.boxSelect && state.canBoxSelect)\n\t\treturn this.whileBoxSelect(state, e);\n};\n\nCustomSelectMode.whileBoxSelect = function (state, e) {\n\tstate.boxSelecting = true;\n\tthis.updateUIClasses({ mouse: Constants.cursors.ADD });\n\n\t// Create the box node if it doesn't exist\n\tif (!state.boxSelectElement) {\n\t\tstate.boxSelectElement = document.createElement(\"div\");\n\t\tstate.boxSelectElement.classList.add(Constants.classes.BOX_SELECT);\n\t\tthis.map.getContainer().appendChild(state.boxSelectElement);\n\t}\n\n\t// Adjust the box node's width and xy position\n\tconst current = mouseEventPoint(e.originalEvent, this.map.getContainer());\n\tconst minX = Math.min(state.boxSelectStartLocation.x, current.x);\n\tconst maxX = Math.max(state.boxSelectStartLocation.x, current.x);\n\tconst minY = Math.min(state.boxSelectStartLocation.y, current.y);\n\tconst maxY = Math.max(state.boxSelectStartLocation.y, current.y);\n\tconst translateValue = `translate(${minX}px, ${minY}px)`;\n\tstate.boxSelectElement.style.transform = translateValue;\n\tstate.boxSelectElement.style.WebkitTransform = translateValue;\n\tstate.boxSelectElement.style.width = `${maxX - minX}px`;\n\tstate.boxSelectElement.style.height = `${maxY - minY}px`;\n};\n\nCustomSelectMode.dragMove = function (state, e) {\n\t// Dragging when drag move is enabled\n\tstate.dragMoving = true;\n\te.originalEvent.stopPropagation();\n\n\tconst delta = {\n\t\tlng: e.lngLat.lng - state.dragMoveLocation.lng,\n\t\tlat: e.lngLat.lat - state.dragMoveLocation.lat,\n\t};\n\n\tmoveFeatures(this.getSelected(), delta);\n\n\tstate.dragMoveLocation = e.lngLat;\n};\n\nCustomSelectMode.onMouseUp = function (state, e) {\n\t// End any extended interactions\n\tif (state.dragMoving) {\n\t\tthis.fireUpdate();\n\t} else if (state.boxSelecting) {\n\t\tconst bbox = [\n\t\t\tstate.boxSelectStartLocation,\n\t\t\tmouseEventPoint(e.originalEvent, this.map.getContainer()),\n\t\t];\n\t\tconst featuresInBox = this.featuresAt(null, bbox, \"click\");\n\t\tconst idsToSelect = this.getUniqueIds(featuresInBox).filter(\n\t\t\t(id) => !this.isSelected(id)\n\t\t);\n\n\t\tif (idsToSelect.length) {\n\t\t\tthis.select(idsToSelect);\n\t\t\tidsToSelect.forEach((id) => this.doRender(id));\n\t\t\tthis.updateUIClasses({ mouse: Constants.cursors.MOVE });\n\t\t}\n\t}\n\tthis.stopExtendedInteractions(state);\n};\n\nCustomSelectMode.toDisplayFeatures = function (state, geojson, display) {\n\tgeojson.properties.active = this.isSelected(geojson.properties.id)\n\t\t? Constants.activeStates.ACTIVE\n\t\t: Constants.activeStates.INACTIVE;\n\tdisplay(geojson);\n\tthis.fireActionable();\n\tif (\n\t\tgeojson.properties.active !== Constants.activeStates.ACTIVE ||\n\t\tgeojson.geometry.type === Constants.geojsonTypes.POINT\n\t)\n\t\treturn;\n\tcreateSupplementaryPoints(geojson).forEach(display);\n};\n\nCustomSelectMode.onTrash = function () {\n\tthis.deleteFeature(this.getSelectedIds());\n\tthis.fireActionable();\n};\n\nCustomSelectMode.onCombineFeatures = function () {\n\tconst selectedFeatures = this.getSelected();\n\n\tif (selectedFeatures.length === 0 || selectedFeatures.length < 2) return;\n\n\tconst coordinates = [],\n\t\tfeaturesCombined = [];\n\tconst featureType = selectedFeatures[0].type.replace(\"Multi\", \"\");\n\n\tfor (let i = 0; i < selectedFeatures.length; i++) {\n\t\tconst feature = selectedFeatures[i];\n\n\t\tif (feature.type.replace(\"Multi\", \"\") !== featureType) {\n\t\t\treturn;\n\t\t}\n\t\tif (feature.type.includes(\"Multi\")) {\n\t\t\tfeature.getCoordinates().forEach((subcoords) => {\n\t\t\t\tcoordinates.push(subcoords);\n\t\t\t});\n\t\t} else {\n\t\t\tcoordinates.push(feature.getCoordinates());\n\t\t}\n\n\t\tfeaturesCombined.push(feature.toGeoJSON());\n\t}\n\n\tif (featuresCombined.length > 1) {\n\t\tconst multiFeature = this.newFeature({\n\t\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\t\tproperties: featuresCombined[0].properties,\n\t\t\tgeometry: {\n\t\t\t\ttype: `Multi${featureType}`,\n\t\t\t\tcoordinates,\n\t\t\t},\n\t\t});\n\n\t\tthis.addFeature(multiFeature);\n\t\tthis.deleteFeature(this.getSelectedIds(), { silent: true });\n\t\tthis.setSelected([multiFeature.id]);\n\n\t\tthis.map.fire(Constants.events.COMBINE_FEATURES, {\n\t\t\tcreatedFeatures: [multiFeature.toGeoJSON()],\n\t\t\tdeletedFeatures: featuresCombined,\n\t\t});\n\t}\n\tthis.fireActionable();\n};\n\nCustomSelectMode.onUncombineFeatures = function () {\n\tconst selectedFeatures = this.getSelected();\n\tif (selectedFeatures.length === 0) return;\n\n\tconst createdFeatures = [];\n\tconst featuresUncombined = [];\n\n\tfor (let i = 0; i < selectedFeatures.length; i++) {\n\t\tconst feature = selectedFeatures[i];\n\n\t\tif (this.isInstanceOf(\"MultiFeature\", feature)) {\n\t\t\tfeature.getFeatures().forEach((subFeature) => {\n\t\t\t\tthis.addFeature(subFeature);\n\t\t\t\tsubFeature.properties = feature.properties;\n\t\t\t\tcreatedFeatures.push(subFeature.toGeoJSON());\n\t\t\t\tthis.select([subFeature.id]);\n\t\t\t});\n\t\t\tthis.deleteFeature(feature.id, { silent: true });\n\t\t\tfeaturesUncombined.push(feature.toGeoJSON());\n\t\t}\n\t}\n\n\tif (createdFeatures.length > 1) {\n\t\tthis.map.fire(Constants.events.UNCOMBINE_FEATURES, {\n\t\t\tcreatedFeatures,\n\t\t\tdeletedFeatures: featuresUncombined,\n\t\t});\n\t}\n\tthis.fireActionable();\n};\n\nexport default CustomSelectMode;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nconst drawUtils = {\n\tgetMatchingVertices: (vertex, featureId, allFeatures, map) => {\n\t\t// number of decimals should probably be dynamic depending on zoom level\n\t\tlet decimals = 5;\n\t\tlet matchingVertices = [];\n\n\t\tlet v_lng = vertex[0].toFixed(decimals);\n\t\tlet v_lat = vertex[1].toFixed(decimals);\n\n\t\tfor (var i = 0; i < allFeatures.length; i++) {\n\t\t\tif (allFeatures[i].id !== featureId) {\n\t\t\t\tfor (var k = 0; k < allFeatures[i].geometry.coordinates.length; k++) {\n\t\t\t\t\tfor (var m = 0; m < allFeatures[i].geometry.coordinates[k].length; m++) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tv_lng ===\n\t\t\t\t\t\t\t\tallFeatures[i].geometry.coordinates[k][m][0].toFixed(decimals) &&\n\t\t\t\t\t\t\tv_lat ===\n\t\t\t\t\t\t\t\tallFeatures[i].geometry.coordinates[k][m][1].toFixed(decimals)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tmatchingVertices.push({\n\t\t\t\t\t\t\t\tfeatureId: allFeatures[i].id,\n\t\t\t\t\t\t\t\tcoord_path: k + \".\" + m,\n\t\t\t\t\t\t\t\t//feature: map.getFeature(allFeatures[i].id),\n\t\t\t\t\t\t\t\tlng: allFeatures[i].geometry.coordinates[k][m][0],\n\t\t\t\t\t\t\t\tlat: allFeatures[i].geometry.coordinates[k][m][1],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn matchingVertices;\n\t},\n\tgetDrawInstance: (map) => {\n\t\tfor (var i = map._controls.length - 1; i >= 0; i--) {\n\t\t\tif (\n\t\t\t\tmap._controls[i]?.modes?.SIMPLE_SELECT === \"simple_select\"\n\t\t\t) {\n\t\t\t\treturn map._controls[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t},\n};\n\nexport default drawUtils;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport {\n\tnoTarget,\n\tisOfMetaType,\n\tisActiveFeature,\n\tisInactiveFeature,\n\tisShiftDown,\n} from \"./lib/common_selectors.js\";\nimport createSupplementaryPoints from \"./lib/create_supplementary_points.js\";\nimport constrainFeatureMovement from \"./lib/constrain_feature_movement.js\";\nimport doubleClickZoom from \"./lib/double_click_zoom.js\";\nimport * as Constants from \"./lib/constants.js\";\nimport moveFeatures from \"./lib/move_features.js\";\nimport drawUtils from \"./lib/utils.js\";\n\nconst isVertex = isOfMetaType(Constants.meta.VERTEX);\nconst isMidpoint = isOfMetaType(Constants.meta.MIDPOINT);\n\nconst DirectSelect = {};\n\n// INTERNAL FUNCTIONS\n\nDirectSelect.fireUpdate = function () {\n\tthis.map.fire(Constants.events.UPDATE, {\n\t\taction: Constants.updateActions.CHANGE_COORDINATES,\n\t\tfeatures: this.getSelected().map((f) => f.toGeoJSON()),\n\t});\n};\n\nDirectSelect.fireActionable = function (state) {\n\tthis.setActionableState({\n\t\tcombineFeatures: false,\n\t\tuncombineFeatures: false,\n\t\ttrash: state.selectedCoordPaths.length > 0,\n\t});\n};\n\nDirectSelect.startDragging = function (state, e) {\n\tthis.map.dragPan.disable();\n\tstate.canDragMove = true;\n\tstate.dragMoveLocation = e.lngLat;\n};\n\nDirectSelect.stopDragging = function (state) {\n\tthis.map.dragPan.enable();\n\tstate.dragMoving = false;\n\tstate.canDragMove = false;\n\tstate.dragMoveLocation = null;\n};\n\nDirectSelect.onVertex = function (state, e) {\n\tthis.startDragging(state, e);\n\tconst about = e.featureTarget.properties;\n\tconst selectedIndex = state.selectedCoordPaths.indexOf(about.coord_path);\n\tif (!isShiftDown(e) && selectedIndex === -1) {\n\t\tstate.selectedCoordPaths = [about.coord_path];\n\t} else if (isShiftDown(e) && selectedIndex === -1) {\n\t\tstate.selectedCoordPaths.push(about.coord_path);\n\t}\n\n\t// currently this work with single selected vertices only\n\tlet allFeatures = drawUtils.getDrawInstance(this.map).getAll();\n\n\tlet matchingVertices = drawUtils.getMatchingVertices(\n\t\te.featureTarget._geometry.coordinates,\n\t\te.featureTarget.properties.parent,\n\t\tallFeatures.features,\n\t\tthis.map\n\t);\n\tstate.groupMove_vertices = matchingVertices;\n\n\tfor (let i = 0; i < state.groupMove_vertices.length; i++) {\n\t\tstate.groupMove_vertices[i].feature = this.getFeature(\n\t\t\tstate.groupMove_vertices[i].featureId\n\t\t);\n\t}\n\n\tconst selectedCoordinates = this.pathsToCoordinates(\n\t\tstate.featureId,\n\t\tstate.selectedCoordPaths\n\t);\n\tthis.setSelectedCoordinates(selectedCoordinates);\n};\n\nDirectSelect.onMidpoint = function (state, e) {\n\tthis.startDragging(state, e);\n\tconst about = e.featureTarget.properties;\n\tstate.feature.addCoordinate(about.coord_path, about.lng, about.lat);\n\tthis.fireUpdate();\n\tstate.selectedCoordPaths = [about.coord_path];\n};\n\nDirectSelect.pathsToCoordinates = function (featureId, paths) {\n\treturn paths.map((coord_path) => ({ feature_id: featureId, coord_path }));\n};\n\nDirectSelect.onFeature = function (state, e) {\n\tif (state.selectedCoordPaths.length === 0) this.startDragging(state, e);\n\telse this.stopDragging(state);\n};\n\nDirectSelect.dragFeature = function (state, e, delta) {\n\tmoveFeatures(this.getSelected(), delta);\n\tstate.dragMoveLocation = e.lngLat;\n};\n\nDirectSelect.dragVertex = function (state, e, delta) {\n\tconst selectedCoords = state.selectedCoordPaths.map((coord_path) =>\n\t\tstate.feature.getCoordinate(coord_path)\n\t);\n\tconst selectedCoordPoints = selectedCoords.map((coords) => ({\n\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\tproperties: {},\n\t\tgeometry: {\n\t\t\ttype: Constants.geojsonTypes.POINT,\n\t\t\tcoordinates: coords,\n\t\t},\n\t}));\n\n\tconst constrainedDelta = constrainFeatureMovement(selectedCoordPoints, delta);\n\tfor (let i = 0; i < selectedCoords.length; i++) {\n\t\tconst coord = selectedCoords[i];\n\t\tstate.feature.updateCoordinate(\n\t\t\tstate.selectedCoordPaths[i],\n\t\t\tcoord[0] + constrainedDelta.lng,\n\t\t\tcoord[1] + constrainedDelta.lat\n\t\t);\n\n\t\tfor (let k = 0; k < state.groupMove_vertices.length; k++) {\n\t\t\tlet coord_path_m = state.groupMove_vertices[k].coord_path.split(\".\");\n\t\t\tif (\n\t\t\t\ttypeof coord_path_m[0] !== \"undefined\" &&\n\t\t\t\ttypeof coord_path_m[1] !== \"undefined\" &&\n\t\t\t\ttypeof state.groupMove_vertices[k].feature.coordinates[coord_path_m[0]] !==\n\t\t\t\t\t\"undefined\" &&\n\t\t\t\ttypeof state.groupMove_vertices[k].feature.coordinates[coord_path_m[0]][\n\t\t\t\t\tcoord_path_m[1]\n\t\t\t\t] !== \"undefined\"\n\t\t\t) {\n\t\t\t\tlet coord_m =\n\t\t\t\t\tstate.groupMove_vertices[k].feature.coordinates[coord_path_m[0]][\n\t\t\t\t\t\tcoord_path_m[1]\n\t\t\t\t\t];\n\t\t\t\tstate.groupMove_vertices[k].feature.updateCoordinate(\n\t\t\t\t\tstate.groupMove_vertices[k].coord_path,\n\t\t\t\t\tcoord_m[0] + constrainedDelta.lng,\n\t\t\t\t\tcoord_m[1] + constrainedDelta.lat\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n};\n\nDirectSelect.clickNoTarget = function () {\n\tthis.changeMode(\"custom_select\");\n};\n\nDirectSelect.clickInactive = function () {\n\tthis.changeMode(\"custom_select\");\n};\n\nDirectSelect.clickActiveFeature = function (state) {\n\tstate.selectedCoordPaths = [];\n\tthis.clearSelectedCoordinates();\n\tstate.feature.changed();\n};\n\n// EXTERNAL FUNCTIONS\n\nDirectSelect.onSetup = function (opts) {\n\tconst featureId = opts.featureId;\n\tconst feature = this.getFeature(featureId);\n\n\tif (!feature) {\n\t\tthrow new Error(\"You must provide a featureId to enter direct_select mode\");\n\t}\n\n\tif (feature.type === Constants.geojsonTypes.POINT) {\n\t\tthrow new TypeError(\"direct_select mode doesn't handle point features\");\n\t}\n\n\tconst state = {\n\t\tfeatureId,\n\t\tfeature,\n\t\tdragMoveLocation: opts.startPos || null,\n\t\tdragMoving: false,\n\t\tcanDragMove: false,\n\t\tselectedCoordPaths: opts.coordPath ? [opts.coordPath] : [],\n\t\tgroupMove_vertices: opts.groupMove_vertices ? opts.groupMove_vertices : [],\n\t};\n\n\tthis.setSelectedCoordinates(\n\t\tthis.pathsToCoordinates(featureId, state.selectedCoordPaths)\n\t);\n\tthis.setSelected(featureId);\n\tdoubleClickZoom.disable(this);\n\n\tthis.setActionableState({\n\t\ttrash: true,\n\t});\n\n\treturn state;\n};\n\nDirectSelect.onStop = function () {\n\tdoubleClickZoom.enable(this);\n\tthis.clearSelectedCoordinates();\n};\n\nDirectSelect.toDisplayFeatures = function (state, geojson, push) {\n\tif (state.featureId === geojson.properties.id) {\n\t\tgeojson.properties.active = Constants.activeStates.ACTIVE;\n\t\tpush(geojson);\n\t\tcreateSupplementaryPoints(geojson, {\n\t\t\tmap: this.map,\n\t\t\tmidpoints: true,\n\t\t\tselectedPaths: state.selectedCoordPaths,\n\t\t}).forEach(push);\n\t} else {\n\t\tgeojson.properties.active = Constants.activeStates.INACTIVE;\n\t\tpush(geojson);\n\t}\n\tthis.fireActionable(state);\n};\n\nDirectSelect.onTrash = function (state) {\n\t// Uses number-aware sorting to make sure '9' < '10'. Comparison is reversed because we want them\n\t// in reverse order so that we can remove by index safely.\n\tstate.selectedCoordPaths\n\t\t.sort((a, b) => b.localeCompare(a, \"en\", { numeric: true }))\n\t\t.forEach((id) => state.feature.removeCoordinate(id));\n\tthis.fireUpdate();\n\tstate.selectedCoordPaths = [];\n\tthis.clearSelectedCoordinates();\n\tthis.fireActionable(state);\n\tif (state.feature.isValid() === false) {\n\t\tthis.deleteFeature([state.featureId]);\n\t\tthis.changeMode(\"custom_select\", {});\n\t}\n};\n\nDirectSelect.onMouseMove = function (state, e) {\n\t// On mousemove that is not a drag, stop vertex movement.\n\tconst isFeature = isActiveFeature(e);\n\tconst onVertex = isVertex(e);\n\tconst noCoords = state.selectedCoordPaths.length === 0;\n\tif (isFeature && noCoords) this.updateUIClasses({ mouse: Constants.cursors.MOVE });\n\telse if (onVertex && !noCoords)\n\t\tthis.updateUIClasses({ mouse: Constants.cursors.MOVE });\n\telse this.updateUIClasses({ mouse: Constants.cursors.NONE });\n\tthis.stopDragging(state);\n};\n\nDirectSelect.onMouseOut = function (state) {\n\t// As soon as you mouse leaves the canvas, update the feature\n\tif (state.dragMoving) this.fireUpdate();\n};\n\nDirectSelect.onTouchStart = DirectSelect.onMouseDown = function (state, e) {\n\tif (isVertex(e)) return this.onVertex(state, e);\n\tif (isActiveFeature(e)) return this.onFeature(state, e);\n\tif (isMidpoint(e)) return this.onMidpoint(state, e);\n};\n\nDirectSelect.onDrag = function (state, e) {\n\tif (state.canDragMove !== true) return;\n\tstate.dragMoving = true;\n\te.originalEvent.stopPropagation();\n\n\tconst delta = {\n\t\tlng: e.lngLat.lng - state.dragMoveLocation.lng,\n\t\tlat: e.lngLat.lat - state.dragMoveLocation.lat,\n\t};\n\tif (state.selectedCoordPaths.length > 0) this.dragVertex(state, e, delta);\n\telse this.dragFeature(state, e, delta);\n\n\tstate.dragMoveLocation = e.lngLat;\n};\n\nDirectSelect.onClick = function (state, e) {\n\tif (noTarget(e)) return this.clickNoTarget(state, e);\n\tif (isActiveFeature(e)) return this.clickActiveFeature(state, e);\n\tif (isInactiveFeature(e)) return this.clickInactive(state, e);\n\tthis.stopDragging(state);\n};\n\nDirectSelect.onTap = function (state, e) {\n\tif (noTarget(e)) return this.clickNoTarget(state, e);\n\tif (isActiveFeature(e)) return this.clickActiveFeature(state, e);\n\tif (isInactiveFeature(e)) return this.clickInactive(state, e);\n};\n\nDirectSelect.onTouchEnd = DirectSelect.onMouseUp = function (state) {\n\tif (state.dragMoving) {\n\t\tthis.fireUpdate();\n\t}\n\tthis.stopDragging(state);\n};\n\nexport default DirectSelect;\n","import React, { useState, useEffect, useRef } from 'react';\nimport './MlFeatureEditor.css';\n\nimport '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport CustomPolygonMode from './custom-polygon-mode.js';\nimport CustomSelectMode from './custom-select-mode.js';\nimport CustomDirectSelectMode from './custom-direct-select-mode.js';\n\nimport useMap from '../../hooks/useMap';\nimport { GeoJSONObject, Feature } from '@turf/turf';\n\ninterface MlFeatureEditorProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Id of an existing layer in the mapLibre instance to help specify the layer order\n\t * This layer will be visually beneath the layer with the \"insertBeforeLayer\" id.\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Input GeoJson data at initialization\n\t */\n\tgeojson?: Feature;\n\t/**\n\t * Callback function that is called each time the GeoJson data within has changed within MlFeatureEditor.\n\t * First parameter is the new GeoJson feature.\n\t */\n\tonChange?: (para: GeoJSONObject[]) => void;\n\t/**\n\t * Callback function that is called each time the GeoJson data within has been finished within MlFeatureEditor.\n\t * First parameter is the new GeoJson feature.\n\t */\n\tonFinish?: () => void;\n\t/**\n\t * Feature editor mode:\n\t * - \"custom_select\" edit features\n\t * - \"custom_polygon\" draw Polygon\n\t * - \"draw_point\" draw Point\n\t * - \"draw_line_string\" draw LineString\n\t */\n\tmode?: string;\n}\n\n/**\n * GeoJson Feature editor that allows to create or manipulate GeoJson data\n */\nconst MlFeatureEditor = (props: MlFeatureEditorProps) => {\n\tconst draw = useRef<MapboxDraw>();\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst drawToolsInitialized = useRef(false);\n\tconst [drawToolsReady, setDrawToolsReady] = useState(false);\n\n\tconst modeChangeHandler = (e: any) => {\n\t\tconsole.log('MlFeatureEditor mode change to ' + e.mode);\n\t\t//setDrawMode(e.mode);\n\t\tif (\n\t\t\ttypeof props.onFinish === 'function' &&\n\t\t\t(e.mode === 'custom_select' || e.mode === 'simple_select')\n\t\t) {\n\t\t\tprops.onFinish();\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (mapHook.map && !drawToolsInitialized.current) {\n\t\t\tdrawToolsInitialized.current = true;\n\n\t\t\tif (\n\t\t\t\tmapHook.map.map.style &&\n\t\t\t\tmapHook.map.map.getSource('mapbox-gl-draw-cold') &&\n\t\t\t\tdraw.current\n\t\t\t) {\n\t\t\t\t// remove old Mapbox-gl-Draw from Mapbox instance when hot-reloading this component during development\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t// @ts-ignore\n\t\t\t\tdraw.current?.remove();\n\t\t\t}\n\n\t\t\tdraw.current = new MapboxDraw({\n\t\t\t\tdisplayControlsDefault: false,\n\t\t\t\tdefaultMode: props.mode || 'custom_select',\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t// @ts-ignore\n\t\t\t\tmodes: Object.assign(\n\t\t\t\t\t{\n\t\t\t\t\t\tcustom_polygon: CustomPolygonMode,\n\t\t\t\t\t\tcustom_select: CustomSelectMode,\n\t\t\t\t\t\tcustom_direct_select: CustomDirectSelectMode,\n\t\t\t\t\t},\n\t\t\t\t\tMapboxDraw.modes\n\t\t\t\t),\n\t\t\t});\n\n\t\t\tmapHook.map.addControl(draw.current, 'top-left', mapHook.componentId);\n\t\t\tmapHook.map.on('draw.modechange', modeChangeHandler, mapHook.componentId);\n\n\t\t\tsetDrawToolsReady(true);\n\t\t}\n\t}, [mapHook.map, props, drawToolsInitialized]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !drawToolsReady) return;\n\n\t\tconst changeHandler = () => {\n\t\t\tif (draw.current) {\n\t\t\t\t// update drawnFeatures state object\n\t\t\t\tif (typeof props.onChange === 'function') {\n\t\t\t\t\tconst currentFeatureCollection = draw.current.getAll?.();\n\t\t\t\t\tprops.onChange(currentFeatureCollection?.features);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tmapHook.map.on('mouseup', changeHandler);\n\n\t\tmapHook.map.on('touchend', changeHandler);\n\n\t\treturn () => {\n\t\t\tif (!mapHook.map) return;\n\n\t\t\tmapHook.map.map.off('mouseup', changeHandler);\n\t\t\tmapHook.map.map.off('touchend', changeHandler);\n\t\t};\n\t}, [drawToolsReady, mapHook.map]);\n\n\tuseEffect(() => {\n\t\tif (draw.current && props.geojson?.geometry) {\n\t\t\tdraw.current.set({ type: 'FeatureCollection', features: [props.geojson as any] });\n\t\t}\n\t}, [props.geojson, drawToolsReady]);\n\n\tuseEffect(() => {\n\t\tif (props.mode && draw.current) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t// @ts-ignore\n\t\t\tdraw.current.changeMode(props.mode);\n\t\t}\n\t}, [props.mode]);\n\n\treturn <></>;\n};\n\nexport default MlFeatureEditor;\n","import { useState, useEffect, useCallback, useRef } from 'react';\n\nimport useMap, { useMapType } from './useMap';\n\nimport {\n\tSourceSpecification,\n\tLayerSpecification,\n\tMapMouseEvent,\n\tGeoJSONFeature,\n\tStyle,\n\tMapEventType,\n\tMap\n} from 'maplibre-gl';\n\nimport MapLibreGlWrapper from '../components/MapLibreMap/lib/MapLibreGlWrapper';\n\nimport { GeoJSONObject } from '@turf/turf';\n\ntype getLayerType = Style['getLayer'];\n\ntype useLayerType = {\n\tmap: MapLibreGlWrapper | undefined;\n\tlayer: ReturnType<getLayerType> | undefined;\n\tlayerId: string;\n\tcomponentId: string;\n\tmapHook: useMapType;\n};\n\nexport type MapEventHandler = (\n\tev: MapMouseEvent & {\n\t\tfeatures?: GeoJSONFeature[] | undefined;\n\t} & Record<string, unknown>\n) => void;\n\nexport interface useLayerProps {\n\tmapId?: string;\n\tlayerId?: string;\n\tidPrefix?: string;\n\tinsertBeforeLayer?: string;\n\tinsertBeforeFirstSymbolLayer?: boolean;\n\tgeojson?: GeoJSONObject;\n\tsource?: SourceSpecification | string;\n\toptions: Partial<LayerSpecification>;\n\tonHover?: (ev: MapEventType & unknown) => Map | void;\n\tonClick?: (ev: MapEventType & unknown) => Map | void;\n\tonLeave?: (ev: MapEventType & unknown) => Map | void;\n}\n\nconst legalLayerTypes = [\n\t'fill',\n\t'line',\n\t'symbol',\n\t'circle',\n\t'heatmap',\n\t'fill-extrusion',\n\t'raster',\n\t'hillshade',\n\t'background',\n];\n\nfunction useLayer(props: useLayerProps): useLayerType {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst layerTypeRef = useRef<string>('');\n\tconst layerPaintConfRef = useRef<string>('');\n\tconst layerLayoutConfRef = useRef<string>('');\n\n\tconst [layer, setLayer] = useState<ReturnType<getLayerType>>();\n\n\tconst initializedRef = useRef<boolean>(false);\n\tconst layerId = useRef(\n\t\tprops.layerId || (props.idPrefix ? props.idPrefix : 'Layer-') + mapHook.componentId\n\t);\n\n\tconst createLayer = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tif (mapHook.map.map.getLayer(layerId.current)) {\n\t\t\tmapHook.cleanup();\n\t\t}\n\t\tif (mapHook.map.map.getSource(layerId.current)) {\n\t\t\tmapHook.map.map.removeSource(layerId.current);\n\t\t}\n\n\t\tif (typeof props.source === 'string') {\n\t\t\tif (props.source === '' || !mapHook.map.map.getSource(props.source)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(typeof props.options.type === 'undefined'){\n\t\t\treturn;\n\t\t}\n\n\t\tinitializedRef.current = true;\n\n\t\tmapHook.map.addLayer(\n\t\t\t{\n\t\t\t\t...props.options,\n\t\t\t\t...(props.geojson && !props.source\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tsource: {\n\t\t\t\t\t\t\t\ttype: 'geojson',\n\t\t\t\t\t\t\t\tdata: props.geojson,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }\n\t\t\t\t\t: {}),\n\t\t\t\t...(props.source\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tsource: props.source,\n\t\t\t\t\t }\n\t\t\t\t\t: {}),\n\t\t\t\tid: layerId.current,\n\t\t\t} as LayerSpecification,\n\t\t\tprops.insertBeforeLayer\n\t\t\t\t? props.insertBeforeLayer\n\t\t\t\t: props.insertBeforeFirstSymbolLayer\n\t\t\t\t? mapHook.map.firstSymbolLayer\n\t\t\t\t: undefined,\n\t\t\tmapHook.componentId\n\t\t);\n\n\t\tsetLayer(() => mapHook.map?.map.getLayer(layerId.current));\n\n\t\tif (typeof props.onHover !== 'undefined') {\n\t\t\tmapHook.map.on('mousemove', layerId.current, props.onHover, mapHook.componentId);\n\t\t}\n\n\t\tif (typeof props.onClick !== 'undefined') {\n\t\t\tmapHook.map.on('click', layerId.current, props.onClick, mapHook.componentId);\n\t\t}\n\n\t\tif (typeof props.onLeave !== 'undefined') {\n\t\t\tmapHook.map.on('mouseleave', layerId.current, props.onLeave, mapHook.componentId);\n\t\t}\n\n\t\t// recreate layer if style has changed\n\t\tmapHook.map.on(\n\t\t\t'styledata',\n\t\t\t() => {\n\t\t\t\tif (initializedRef.current && !mapHook.map?.map.getLayer(layerId.current)) {\n\t\t\t\t\tconsole.log('Recreate Layer');\n\t\t\t\t\tcreateLayer();\n\t\t\t\t}\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\n\t\tlayerPaintConfRef.current = JSON.stringify(props.options?.paint);\n\t\tlayerLayoutConfRef.current = JSON.stringify(props.options?.layout);\n\t\tlayerTypeRef.current = props.options.type as LayerSpecification['type'];\n\t}, [props, mapHook.map]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tif (\n\t\t\tinitializedRef.current &&\n\t\t\t(legalLayerTypes.indexOf(props.options.type as LayerSpecification['type']) === -1 ||\n\t\t\t\t(legalLayerTypes.indexOf(props.options.type as LayerSpecification['type']) !== -1 &&\n\t\t\t\t\tprops.options.type === layerTypeRef.current))\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tcreateLayer();\n\t}, [mapHook.map, props.options, createLayer]);\n\n\tuseEffect(() => {\n\t\tif (!initializedRef.current || !mapHook.map?.map?.getSource(layerId.current)) return;\n\n\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t//@ts-ignore setData only exists on GeoJsonSource\n\t\tmapHook.map.map.getSource(layerId.current)?.setData?.(props.geojson);\n\t}, [props.geojson, mapHook.map, props.options.type]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\t!mapHook.map ||\n\t\t\t!mapHook.map?.map?.getLayer?.(layerId.current) ||\n\t\t\t!initializedRef.current ||\n\t\t\tprops.options.type !== layerTypeRef.current\n\t\t)\n\t\t\treturn;\n\n\t\tlet key;\n\n\t\tconst layoutString = JSON.stringify(props.options.layout);\n\t\tif (props.options.layout && layoutString !== layerLayoutConfRef.current) {\n\t\t\tconst oldLayout = JSON.parse(layerLayoutConfRef.current);\n\n\t\t\tfor (key in props.options.layout) {\n\t\t\t\tif (props.options.layout?.[key] && props.options.layout[key] !== oldLayout[key]) {\n\t\t\t\t\tmapHook.map.map.setLayoutProperty(layerId.current, key, props.options.layout[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tlayerLayoutConfRef.current = layoutString;\n\t\t}\n\n\t\tconst paintString = JSON.stringify(props.options.paint);\n\t\tif (paintString !== layerPaintConfRef.current) {\n\t\t\tconst oldPaint = JSON.parse(layerPaintConfRef.current);\n\t\t\tfor (key in props.options.paint) {\n\t\t\t\tif (props.options.paint?.[key] && props.options.paint[key] !== oldPaint[key]) {\n\t\t\t\t\tmapHook.map.map.setPaintProperty(layerId.current, key, props.options.paint[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tlayerPaintConfRef.current = paintString;\n\t\t}\n\t}, [props.options, mapHook.map]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tinitializedRef.current = false;\n\t\t\tmapHook.cleanup();\n\t\t};\n\t}, []);\n\n\treturn {\n\t\tmap: mapHook.map,\n\t\tlayer: layer,\n\t\tlayerId: layerId.current,\n\t\tcomponentId: mapHook.componentId,\n\t\tmapHook: mapHook,\n\t};\n}\n\nuseLayer.defaultProps = {\n\n}\n\nexport default useLayer;\n","import React from \"react\";\n\nimport { v4 as uuidv4 } from \"uuid\";\nimport useLayer from \"../../hooks/useLayer\";\n\ninterface MlFillExtrusionLayerProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Id of the layer that will be added by this component\n\t */\n\tlayerId?: string;\n\t/**\n\t * Paint properties of the config object that is passed to the MapLibreGl.addLayer call. All\n\t * available properties are documented in the MapLibreGl documentation\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill-extrusion\n\t */\n\tpaint?: object;\n\t/**\n\t * Source id of a vector tile source containing the geometries to use for this fill-extrusion\n\t * layer.\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#source-layer\n\t */\n\tsourceId?: string;\n\t/**\n\t * Layer id from a vector tile source containing the geometries to use for this fill-extrusion\n\t * layer.\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#source-layer\n\t */\n\tsourceLayer?: string;\n\t/**\n\t * This layer will be hidden for zoom levels lower than defined on this property\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#minzoom\n\t */\n\tminZoom?: number;\n}\n\n/**\n * Adds a fill extrusion layer to the MapLibre instance reference by props.mapId\n *\n */\nconst MlFillExtrusionLayer = (props: MlFillExtrusionLayerProps) => {\n\tuseLayer({\n\t\tmapId: props.mapId,\n\t\tlayerId: props.layerId || \"MlFillExtrusionLayer-\" + uuidv4(),\n\t\toptions: {\n\t\t\tid: \"\",\n\t\t\ttype: \"fill-extrusion\",\n\t\t\tsource: props.sourceId || \"openmaptiles\",\n\t\t\t\"source-layer\": props.sourceLayer || \"building\",\n\t\t\tminzoom: props.minZoom || 14,\n\t\t\tpaint: {\n\t\t\t\t...props.paint,\n\t\t\t},\n\t\t},\n\t\tinsertBeforeFirstSymbolLayer: true,\n\t});\n\n\treturn <></>;\n};\n\nMlFillExtrusionLayer.defaultProps = {\n\tmapId: undefined,\n\tpaint: {\n\t\t\"fill-extrusion-color\": \"hsl(196, 61%, 83%)\",\n\t\t\"fill-extrusion-height\": {\n\t\t\tproperty: \"render_height\",\n\t\t\ttype: \"identity\",\n\t\t},\n\t\t\"fill-extrusion-base\": {\n\t\t\tproperty: \"render_min_height\",\n\t\t\ttype: \"identity\",\n\t\t},\n\t\t\"fill-extrusion-opacity\": 1,\n\t},\n};\n\nexport default MlFillExtrusionLayer;\n","import { LayerSpecification, RasterLayerSpecification } from 'maplibre-gl';\n\nconst getDefaultPaintPropsByType = (\n\ttype: string,\n\tdefaultPaintOverrides?: { [key: string]: unknown }\n): Exclude<LayerSpecification['paint'], RasterLayerSpecification['paint']> => {\n\tswitch (type) {\n\t\tcase 'fill':\n\t\t\tif (defaultPaintOverrides?.fill) {\n\t\t\t\treturn defaultPaintOverrides.fill;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t'fill-color': 'rgba(10,240,256,0.6)',\n\t\t\t};\n\t\tcase 'line':\n\t\t\tif (defaultPaintOverrides?.line) {\n\t\t\t\treturn defaultPaintOverrides.line;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t'line-color': 'rgb(203,211,2)',\n\t\t\t\t'line-width': 5,\n\t\t\t\t'line-blur': 0,\n\t\t\t};\n\t\tcase 'circle':\n\t\tdefault:\n\t\t\tif (defaultPaintOverrides?.circle) {\n\t\t\t\treturn defaultPaintOverrides.circle;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t'circle-color': 'rgba(10,240,256,0.8)',\n\t\t\t\t'circle-stroke-color': '#fff',\n\t\t\t\t'circle-stroke-width': 2,\n\t\t\t};\n\t}\n};\n\nexport default getDefaultPaintPropsByType;\n","import { Feature, FeatureCollection } from \"@turf/turf\";\nimport { LayerSpecification } from \"maplibre-gl\";\n\nconst mapGeometryTypesToLayerTypes = {\n\tPosition: \"circle\",\n\tPoint: \"circle\",\n\tMultiPoint: \"circle\",\n\tLineString: \"line\",\n\tMultiLineString: \"line\",\n\tPolygon: \"fill\",\n\tMultiPolygon: \"fill\",\n\tGeometryCollection: \"circle\",\n};\n\nconst getDefaulLayerTypeByGeometry: Function = (\n\tgeojson: Feature | FeatureCollection\n): LayerSpecification['type'] => {\n\tif (geojson?.type === \"Feature\") {\n\t\treturn mapGeometryTypesToLayerTypes?.[geojson?.geometry?.type]\n\t\t\t? mapGeometryTypesToLayerTypes[geojson.geometry.type]\n\t\t\t: \"circle\";\n\t}\n\tif (geojson?.type === \"FeatureCollection\") {\n\t\tif (geojson.features.length) {\n\t\t\treturn getDefaulLayerTypeByGeometry(geojson.features[0]);\n\t\t}\n\t\treturn \"circle\";\n\t}\n\treturn \"fill\";\n};\nexport default getDefaulLayerTypeByGeometry;\n","import React from 'react';\n\nimport useLayer from '../../hooks/useLayer';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport getDefaultPaintPropsByType from './util/getDefaultPaintPropsByType';\nimport getDefaulLayerTypeByGeometry from './util/getDefaultLayerTypeByGeometry';\nimport { Feature, FeatureCollection } from '@turf/turf';\nimport { useLayerProps } from '../../hooks/useLayer';\n\nimport {\n\tLineLayerSpecification,\n\tCircleLayerSpecification,\n\tFillLayerSpecification,\n\tLayerSpecification,\n\tRasterLayerSpecification,\n} from 'maplibre-gl';\n\nexport type MlGeoJsonLayerProps = {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Id of an existing layer in the mapLibre instance to help specify the layer order\n\t * This layer will be visually beneath the layer with the \"insertBeforeLayer\" id.\n\t * This layer will not be added to the maplibre-gl instance until a layer with an\n\t * id that matches the value of insertBeforeLayer is created.\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Id of the new layer and source that are added to the MapLibre instance\n\t */\n\tlayerId?: string;\n\t/**\n\t * GeoJSON data that is supposed to be rendered by this component.\n\t */\n\tgeojson: Feature | FeatureCollection | undefined;\n\t/**\n\t * Type of the layer that will be added to the MapLibre instance.\n\t * All types from LayerSpecification union type are supported except the type from\n\t * RasterLayerSpecification\n\t */\n\ttype?: Exclude<LayerSpecification['type'], RasterLayerSpecification['type']>;\n\t/**\n\t * Paint property object, that is passed to the addLayer call.\n\t * Possible props depend on the layer type.\n\t * See https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/\n\t * Some examples are:\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill\n\t * All paint types from LayerSpecification union type are supported except the paint type from\n\t * RasterLayerSpecification\n\t */\n\n\tpaint?: Exclude<LayerSpecification['paint'], RasterLayerSpecification['paint']>;\n\t/**\n\t * Layout property object, that is passed to the addLayer call.\n\t * Possible props depend on the layer type.\n\t * See https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/\n\t * Some examples are:\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill\n\t * All layout types from LayerSpecification union type are supported except the layout type from\n\t * RasterLayerSpecification\n\n\t */\n\tlayout?: Exclude<LayerSpecification['layout'], RasterLayerSpecification['layout']>;\n\n\t/**\n\t * Javascript object that is spread into the addLayer commands first parameter.\n\t */\n\toptions?: Exclude<LayerSpecification, RasterLayerSpecification>;\n\t/**\n\t * Javascript object with optional properties \"fill\", \"line\", \"circle\" to override implicit layer type default paint properties.\n\t */\n\tdefaultPaintOverrides?: {\n\t\tcircle?: CircleLayerSpecification['paint'];\n\t\tfill?: FillLayerSpecification['paint'];\n\t\tline?: LineLayerSpecification['paint'];\n\t};\n\t/**\n\t * Hover event handler that is executed whenever a geometry rendered by this component is hovered.\n\t */\n\tonHover?: useLayerProps['onHover'];\n\t/**\n\t * Click event handler that is executed whenever a geometry rendered by this component is clicked.\n\t */\n\tonClick?: useLayerProps['onClick'];\n\t/**\n\t * Leave event handler that is executed whenever a geometry rendered by this component is\n\t * left/unhovered.\n\t */\n\tonLeave?: useLayerProps['onLeave'];\n};\n\n/**\n * Adds source and layer to display GeoJSON data on the map.\n *\n * @component\n */\n\nconst MlGeoJsonLayer = (props: MlGeoJsonLayerProps) => {\n\tconst layerType = props.type || getDefaulLayerTypeByGeometry(props.geojson);\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tuseLayer({\n\t\tmapId: props.mapId,\n\t\tlayerId: props.layerId || 'MlGeoJsonLayer-' + uuidv4(),\n\t\tgeojson: props.geojson,\n\t\toptions: {\n\t\t\tpaint: props.paint || getDefaultPaintPropsByType(layerType, props.defaultPaintOverrides),\n\t\t\tlayout: props.layout || {},\n\t\t\t...props.options,\n\t\t\ttype: layerType as LayerSpecification['type'],\n\t\t} as Partial<LayerSpecification>,\n\t\tinsertBeforeLayer: props.insertBeforeLayer,\n\t\tonHover: props.onHover,\n\t\tonClick: props.onClick,\n\t\tonLeave: props.onLeave,\n\t});\n\n\treturn <></>;\n};\n\nexport default MlGeoJsonLayer;\n","import React, { useRef, useEffect, useState, useCallback, useMemo } from \"react\";\nimport useMap from \"../../hooks/useMap\";\nimport MlGeoJsonLayer from \"../MlGeoJsonLayer/MlGeoJsonLayer\";\n\nimport { Button } from '@mui/material';\nimport GpsFixedIcon from '@mui/icons-material/GpsFixed';\n\nimport { point, circle, lineArc, Feature, Point } from '@turf/turf';\nimport { CircleLayerSpecification, FillLayerSpecification } from 'maplibre-gl';\n\ninterface MlFollowGpsProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * By default a dot will be shown on the map at the user's location. Set to false to disable.\n\t */\n\tshowUserLocation?: boolean;\n\t/**\n\t * By default a cone will be shown on the map at the user's location to indicate the device's orientation.\n\t * Set to false to disable.\n\t */\n\tshowOrientation?: boolean;\n\t/**\n\t * By default, if showUserLocation is true, a transparent circle will be drawn around the user location\n\t * indicating the accuracy (95% confidence level) of the user's location. Set to false to disable.\n\t */\n\tshowAccuracyCircle?: boolean;\n\t/**\n\t * Use the MapLibre.flyTo function to center the map to the current users position if true.\n\t * Otherwise the MapLibre.setCenter function is used.\n\t */\n\tuseFlyTo?: boolean;\n\t/**\n\t * Center map to current position once updated location data is recieved.\n\t * \"false\" will center the map once on component activation and then display the updated user location on the map.\n\t */\n\tcenterUserPosition?: boolean;\n\t/**\n\t * Orientation cone paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the orientation cone polygon.\n\t * Use any available paint prop from layer type \"fill\".\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill\n\t */\n\torientationConePaint?: FillLayerSpecification['paint'];\n\t/**\n\t * Position circle paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the position circle.\n\t * Use any available paint prop from layer type \"circle\".\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle\n\t */\n\tcirclePaint?: CircleLayerSpecification['paint'];\n\t/**\n\t * Active button font color\n\t */\n\tonColor?: string;\n\t/**\n\t * Inactive button font color\n\t */\n\toffColor?: string;\n\t/**\n\t * Accuracy paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy polygon.\n\t * Use any available paint prop from layer type \"fill\".\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill\n\t */\n\taccuracyPaint?: FillLayerSpecification['paint'];\n}\n\n/**\n * Adds a button that makes the map follow the users GPS position using\n * navigator.geolocation.watchPosition if activated\n *\n */\nconst MlFollowGps = (props: MlFollowGpsProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst [isFollowed, setIsFollowed] = useState(false);\n\tconst [userLocationGeoJson, setUserLocationGeoJson] = useState<Feature<Point>>();\n\tconst [locationAccessDenied, setLocationAccessDenied] = useState(false);\n\tconst [accuracyGeoJson, setAccuracyGeoJson] = useState<Feature>();\n\tconst [deviceOrientation, setDeviceOrientation] = useState(0);\n\tconst initiallyCentered = useRef(false);\n\n\tconst getLocationSuccess = useCallback(\n\t\t(pos: GeolocationPosition) => {\n\t\t\tif (!mapHook.map) return;\n\n\t\t\tif ((!props.centerUserPosition && !initiallyCentered.current) || props.centerUserPosition) {\n\t\t\t\tif (props.useFlyTo) {\n\t\t\t\t\tmapHook.map.map.flyTo({\n\t\t\t\t\t\tcenter: [pos.coords.longitude, pos.coords.latitude],\n\t\t\t\t\t\tzoom: 18,\n\t\t\t\t\t\tspeed: 1,\n\t\t\t\t\t\tcurve: 1,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tmapHook.map.map.setCenter([pos.coords.longitude, pos.coords.latitude]);\n\t\t\t\t}\n\n\t\t\t\tinitiallyCentered.current = true;\n\t\t\t}\n\t\t\tif (!props.showUserLocation) return;\n\t\t\tconst geoJsonPoint = point([pos.coords.longitude, pos.coords.latitude]);\n\t\t\tsetUserLocationGeoJson(geoJsonPoint);\n\t\t\tsetAccuracyGeoJson(circle(geoJsonPoint, pos.coords.accuracy / 1000));\n\t\t},\n\t\t[mapHook.map, props]\n\t);\n\n\tconst getLocationError = () => {\n\t\tconsole.log('Access of user location denied');\n\t\tsetLocationAccessDenied(true);\n\t};\n\n\tconst orientationCone = useMemo(() => {\n\t\tif (!userLocationGeoJson) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst radius = 0.02;\n\t\tconst bearing1 = deviceOrientation - 15;\n\t\tconst bearing2 = deviceOrientation + 15;\n\t\tconst options = { steps: 65 };\n\t\tconst arc = lineArc(userLocationGeoJson, radius, bearing1, bearing2, options);\n\t\tconst copy = arc;\n\t\tcopy.geometry.coordinates.push(userLocationGeoJson.geometry.coordinates);\n\t\tcopy.geometry.coordinates.slice(0, 0);\n\t\treturn copy;\n\t}, [deviceOrientation, userLocationGeoJson]);\n\n\tconst handleOrientation = (event: DeviceOrientationEvent) => {\n\t\tif (event?.alpha) {\n\t\t\tsetDeviceOrientation(-event.alpha);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (isFollowed) {\n\t\t\tconst _handleOrientation = handleOrientation;\n\t\t\twindow.addEventListener('deviceorientation', _handleOrientation);\n\t\t\treturn () => {\n\t\t\t\twindow.removeEventListener('deviceorientation', _handleOrientation);\n\t\t\t};\n\t\t} else {\n\t\t\tinitiallyCentered.current = false;\n\t\t}\n\t\treturn;\n\t}, [isFollowed]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tif (isFollowed) {\n\t\t\tconst _watchId = navigator.geolocation.watchPosition(getLocationSuccess, getLocationError);\n\n\t\t\treturn () => {\n\t\t\t\tnavigator.geolocation.clearWatch(_watchId);\n\t\t\t};\n\t\t}\n\t\treturn;\n\t}, [mapHook.map, isFollowed, getLocationSuccess]);\n\n\treturn (\n\t\t<>\n\t\t\t{isFollowed && userLocationGeoJson && (\n\t\t\t\t<MlGeoJsonLayer\n\t\t\t\t\tgeojson={accuracyGeoJson}\n\t\t\t\t\ttype={'fill'}\n\t\t\t\t\tpaint={{\n\t\t\t\t\t\t'fill-color': '#cbd300',\n\t\t\t\t\t\t'fill-opacity': 0.3,\n\t\t\t\t\t\t...props.accuracyPaint,\n\t\t\t\t\t}}\n\t\t\t\t\tinsertBeforeLayer={props.insertBeforeLayer}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{isFollowed && orientationCone && (\n\t\t\t\t<MlGeoJsonLayer\n\t\t\t\t\tgeojson={orientationCone}\n\t\t\t\t\ttype={'fill'}\n\t\t\t\t\tpaint={{\n\t\t\t\t\t\t'fill-color': '#0000ff',\n\t\t\t\t\t\t'fill-antialias': false,\n\t\t\t\t\t\t'fill-opacity': 0.3,\n\t\t\t\t\t\t...props.orientationConePaint,\n\t\t\t\t\t}}\n\t\t\t\t\tinsertBeforeLayer={props.insertBeforeLayer}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{isFollowed && userLocationGeoJson && (\n\t\t\t\t<MlGeoJsonLayer\n\t\t\t\t\tgeojson={userLocationGeoJson}\n\t\t\t\t\ttype={'circle'}\n\t\t\t\t\tpaint={{\n\t\t\t\t\t\t'circle-color': '#009ee0',\n\t\t\t\t\t\t'circle-radius': 5,\n\t\t\t\t\t\t'circle-stroke-color': '#fafaff',\n\t\t\t\t\t\t'circle-stroke-width': 1,\n\t\t\t\t\t\t...props.circlePaint,\n\t\t\t\t\t}}\n\t\t\t\t\tinsertBeforeLayer={props.insertBeforeLayer}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t<Button\n\t\t\t\tvariant=\"navtools\"\n\t\t\t\tsx={{\n\t\t\t\t\tzIndex: 1002,\n\t\t\t\t\tcolor: isFollowed ? props.onColor : props.offColor,\n\t\t\t\t}}\n\t\t\t\tdisabled={locationAccessDenied}\n\t\t\t\tonClick={() => {\n\t\t\t\t\tsetIsFollowed(!isFollowed);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<GpsFixedIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />\n\t\t\t</Button>\n\t\t</>\n\t);\n};\n\nMlFollowGps.defaultProps = {\n\tmapId: undefined,\n\tonColor: '#ececec',\n\toffColor: '#666',\n\tshowAccuracyCircle: true,\n\tshowUserLocation: true,\n\tshowOrientation: true,\n\tcenterUserPosition: true,\n\tuseFlyTo: false,\n};\n\nexport default MlFollowGps;\n","import React, { useRef, useEffect, useState } from 'react';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLayer from '../../hooks/useLayer';\nimport useMap from '../../hooks/useMap';\nimport { SymbolLayerSpecification } from 'maplibre-gl';\nimport { Feature, FeatureCollection } from '@turf/turf';\n\nexport interface MlImageMarkerLayerProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Id of the layer that will be added by this component to the maplibre-gl instance\n\t */\n\tlayerId?: string;\n\t/**\n\t * Id of the image that will be added by this component to the maplibre-gl instance\n\t */\n\timageId?: string;\n\t/**\n\t * Path or URL to a supported raster image\n\t */\n\timgSrc?: string;\n\t/**\n\t * Javascript object that is passed the addLayer command as first parameter.\n\t */\n\toptions?: {\n\t\tsource?: { type?: string | undefined; data: Feature | FeatureCollection | undefined };\n\t\tlayout?: SymbolLayerSpecification['layout'];\n\t\tpaint?: SymbolLayerSpecification['paint'];\n\t};\n}\n\nconst MlImageMarkerLayer = (props: MlImageMarkerLayerProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst [imageId, setImageId] = useState<string>();\n\tconst imageIdRef = useRef(props.imageId || 'img_' + uuidv4());\n\tconst layerId = useRef(props.layerId || 'MlImageMarkerLayer-' + mapHook.componentId);\n\n\tuseLayer({\n\t\tgeojson: props.options?.source?.data,\n\t\tlayerId: layerId.current,\n\t\toptions: {\n\t\t\ttype: 'symbol',\n\t\t\tlayout: {\n\t\t\t\t...props.options?.layout,\n\t\t\t\t'icon-image': imageId || imageIdRef.current,\n\t\t\t},\n\t\t\tpaint: {\n\t\t\t\t...props.options?.paint,\n\t\t\t},\n\t\t},\n\t});\n\n\tconst createImage = (mapHook: ReturnType<typeof useMap>, props: MlImageMarkerLayerProps) => {\n\t\tif (!mapHook.map) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (props.imgSrc && !mapHook.map.map.hasImage(imageIdRef.current)) {\n\t\t\tmapHook.map.map.loadImage(props.imgSrc, function (error, image) {\n\t\t\t\tif (error) throw error;\n\n\t\t\t\tif (!mapHook.map || mapHook.map.map.hasImage(imageIdRef.current)) return;\n\n\t\t\t\tmapHook.map.addImage(\n\t\t\t\t\timageIdRef.current,\n\t\t\t\t\timage as unknown as ImageData,\n\t\t\t\t\tmapHook.componentId\n\t\t\t\t);\n\n\t\t\t\tsetImageId(imageIdRef.current);\n\t\t\t});\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tif (props.imgSrc) {\n\t\t\tcreateImage(mapHook, props);\n\t\t}\n\t}, [props, mapHook]);\n\n\treturn <></>;\n};\n\nexport default MlImageMarkerLayer;\n","import React, { useEffect, useState } from \"react\";\nimport MlFeatureEditor from \"../MlFeatureEditor/MlFeatureEditor\";\nimport * as turf from \"@turf/turf\";\n\ninterface MlMeasureToolProps {\n\t/**\n\t * String that specify if the Tool measures an area (\"polygon\") or length (\"line\")\n\t */\n\tmeasureType?: string;\n\t/**\n\t * String that dictates which unit of measurement is used\n\t */\n\tunit?: turf.Units;\n}\n\n//const unitSquareConvert = {\n//\tkilometers: 1,\n//\tmiles: 1 / 2.58998811,\n//};\nfunction getUnitSquareMultiplier(measureType:string | undefined) {\n\treturn measureType === \"miles\" ? 1 / 2.58998811 : 1;\n}\nfunction getUnitLabel(measureType:string | undefined) {\n\treturn measureType === \"miles\" ? 'mi' : 'km';\n}\n\nconst MlMeasureTool = (props: MlMeasureToolProps) => {\n\tconst [length, setLength] = useState(0);\n\tconst [currentFeatures, setCurrentFeatures] = useState([undefined]);\n\n\tuseEffect(() => {\n\t\tif (currentFeatures[0]) {\n\t\t\tsetLength(\n\t\t\t\tprops.measureType === \"polygon\"\n\t\t\t\t\t? (turf.area(currentFeatures[0]) / 1000000) * getUnitSquareMultiplier(props.unit)\n\t\t\t\t\t: turf.length(currentFeatures[0], { units: props.unit })\n\t\t\t);\n\t\t}\n\t}, [props.unit, currentFeatures]);\n\n\treturn (\n\t\t<>\n\t\t\t<MlFeatureEditor\n\t\t\t\tonChange={(features:any) => {\n\t\t\t\t\tsetCurrentFeatures(features);\n\t\t\t\t}}\n\t\t\t\tmode={props.measureType === \"polygon\" ? \"custom_polygon\" : \"draw_line_string\"}\n\t\t\t/>\n\t\t\t{length.toFixed(2)} {getUnitLabel(props.unit)}\n\t\t\t{props.measureType === \"polygon\" ? \"²\" : \"\"}\n\t\t</>\n\t);\n};\n\nMlMeasureTool.defaultProps = {\n\tmapId: undefined,\n\tmeasureType: \"line\",\n\tunit: \"kilometers\",\n};\nexport default MlMeasureTool;\n","export default \"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20%20%20width%3D%2239.675098mm%22%20%20%20height%3D%22104.27064mm%22%20%20%20viewBox%3D%220%200%2039.675098%20104.27064%22%20%20%20version%3D%221.1%22%20%20%20%3E%20%20%3Cg%20%20%20%20%20transform%3D%22translate%28-86.019554%2C-58.032633%29%22%3E%20%20%20%20%3Cpath%20%20%20%20%20%20%20style%3D%22stroke-width%3A0.744756%22%20%20%20%20%20%20%20d%3D%22m%20442.74023%2C219.33594%20-117.62695%2C32.32422%2054.71094%2C31.12304%20c%20-21.99397%2C41.5931%20-32.8507%2C84.88283%20-38.33008%2C127.89649%20-6.86182%2C50.94051%20-5.95715%2C103.99765%2020.23828%2C155.46484%205.97246%2C11.72776%2013.65817%2C23.59773%2024.38867%2C35.06641%202.6597%2C2.84073%205.65602%2C5.75455%209.12891%2C8.68164%200.87557%2C0.7378%201.85363%2C1.52609%202.95117%2C2.35547%200.29669%2C0.22563%200.63616%2C0.47742%201.02149%2C0.75586%20l%200.58203%2C0.42578%2034.57812%2C-15.12305%20-0.33789%2C-0.2207%20c%20-0.0265%2C-0.0151%20-0.0842%2C-0.0587%20-0.18359%2C-0.13086%20-0.46723%2C-0.34885%20-0.9819%2C-0.76796%20-1.56055%2C-1.25%20-2.29757%2C-1.91343%20-4.46539%2C-4.04643%20-6.64062%2C-6.33985%20-8.80052%2C-9.27114%20-15.30333%2C-19.4993%20-20.83985%2C-30.13867%20-24.42289%2C-46.90715%20-24.77465%2C-97.03535%20-18.58008%2C-146.68164%204.94388%2C-37.37493%2013.65299%2C-74.4847%2030.20508%2C-109.92969%20l%2058.6211%2C33.34766%20z%22%20%20%20%20%20%20%20transform%3D%22scale%280.26458333%29%22%20%2F%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E\"","export default \"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20%20%20width%3D%2239.675098mm%22%20%20%20height%3D%22104.27064mm%22%20%20%20viewBox%3D%220%200%2039.675098%20104.27064%22%20%20%20version%3D%221.1%22%20%20%20%3E%20%20%3Cg%20%20%20%20%20transform%3D%22translate%28-86.019554%2C-58.032633%29%22%3E%20%20%20%20%3Cpath%20%20%20%20%20%20%20d%3D%22m%2094.572523%2C58.032633%2031.122127%2C8.55245%20-14.4756%2C8.234638%20c%205.81924%2C11.004841%208.69175%2C22.458582%2010.1415%2C33.839279%201.81552%2C13.47801%201.57616%2C27.51604%20-5.35471%2C41.13341%20-1.58021%2C3.10296%20-3.61373%2C6.24356%20-6.45284%2C9.27798%20-0.70371%2C0.75161%20-1.49649%2C1.52256%20-2.41535%2C2.29702%20-0.23167%2C0.19521%20-0.49044%2C0.40378%20-0.78083%2C0.62322%20-0.0785%2C0.0597%20-0.16832%2C0.12632%20-0.27027%2C0.19999%20l%20-0.154%2C0.11265%20-9.148793%2C-4.00131%200.0894%2C-0.0584%20c%200.007%2C-0.004%200.02228%2C-0.0155%200.04857%2C-0.0346%200.123621%2C-0.0923%200.259794%2C-0.20319%200.412895%2C-0.33073%200.607899%2C-0.50626%201.181468%2C-1.07062%201.756997%2C-1.67742%202.328481%2C-2.45299%204.049011%2C-5.15919%205.513881%2C-7.97419%206.46189%2C-12.41085%206.55496%2C-25.67394%204.91598%2C-38.80952%20-1.30807%2C-9.888781%20-3.61235%2C-19.707408%20-7.99176%2C-29.085561%20l%20-15.510171%2C8.823235%20z%22%20%2F%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E\"","export default \"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20%20%20width%3D%2275.967445mm%22%20%20%20height%3D%22234.71339mm%22%20%20%20viewBox%3D%220%200%2075.967445%20234.71339%22%20%20%20version%3D%221.1%22%20%20%20%3E%20%20%3Cg%20%20%20%20%20transform%3D%22translate%28-76.705281%2C-29.77268%29%22%3E%20%20%20%20%3Cpath%20%20%20%20%20%20%20d%3D%22m%20114.68901%2C29.77268%2037.98372%2C117.3567%20H%2076.705281%20Z%22%20%20%20%20%20%20%20%20%2F%3E%20%20%20%20%3Cpath%20%20%20%20%20%20%20d%3D%22m%20114.68901%2C264.48608%2037.98372%2C-117.3567%20H%2076.705281%20Z%22%20%20%20%20%20%20%20%20%2F%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E\"","import React, { useState, useEffect } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { ReactComponent as RotateRightIcon } from \"./assets/rotate_right.svg\";\nimport { ReactComponent as RotateLeftIcon } from \"./assets/rotate_left.svg\";\nimport { ReactComponent as NeedleIcon } from \"./assets/needle.svg\";\n\nimport styled from \"@emotion/styled\";\nimport { css } from \"@emotion/css\";\nimport useMap from \"../../hooks/useMap\";\n\nconst NeedleButton = styled.div`\n\twidth: 40%;\n\tdisplay: flex;\n\talign-items: center;\n\n\t&:hover {\n\t\tcursor: pointer;\n\t}\n\tpath {\n\t\tfilter: drop-shadow(0px 0px 15px rgba(0, 0, 0, 0.2));\n\t}\n\t&:hover path {\n\t\tfilter: drop-shadow(0px 0px 13px rgba(255, 255, 255, 0.1));\n\t}\n\tpath:nth-of-type(2) {\n\t\tfill: #343434;\n\t}\n\t&:hover path:nth-of-type(2) {\n\t\tfill: #434343;\n\t}\n\tpath:nth-of-type(1) {\n\t\tfill: #e90318;\n\t}\n\t&:hover path:nth-of-type(1) {\n\t\tfill: #fb4052;\n\t}\n`;\nconst NeedleContainer = styled.div`\n\tpointer-events: none;\n\tdisplay: flex;\n\tz-index: 1002;\n\tposition: absolute;\n\talign-items: center;\n\n\tmargin-left: -30%;\n\tpath:nth-of-type(2) {\n\t}\n\tsvg g {\n\t\ttransform: translate(-76.7053, -29.7727) scale(2, 1);\n\t}\n\tsvg {\n\t\tz-index: 9990;\n\t\theight: 150px;\n\t\twidth: 200px;\n\t}\n`;\nconst RotateButton = styled.div`\n\twidth: 30%;\n\tmargin-top: 14px;\n\tz-index: 999;\n\tdisplay: flex;\n\n\tsvg:hover {\n\t\tcursor: pointer;\n\t}\n\tsvg:hover path {\n\t\tfill: #ececec;\n\t\tfilter: drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.1));\n\t}\n\tpath {\n\t\tfill: #bbb;\n\t}\n\tsvg {\n\t\ttransform: scale(0.6);\n\t\tz-index: 9990;\n\t\theight: 172px;\n\t}\n`;\n\ninterface MlNavigationCompassProps {\n\tmapId?: string;\n\tinsertBeforeLayer?: string;\n\tstyle?: any;\n\tbackgroundStyle?: any;\n\tneedleStyle?: any;\n\trotateRightStyle?: any;\n\trotateLeftStyle?: any;\n}\n/**\n * Navigation component that displays a compass component which indicates the current oriantation of the map it is registered for and offers controls to turn the bearing 90° left/right or reset north to point up.\n *\n * All style props are applied using @emotion/css to allow more complex css selectors.\n *\n * @component\n */\nconst MlNavigationCompass = (props: MlNavigationCompassProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\tconst [bearing, setBearing] = useState(0);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tlet _updateBearing = () => {\n\t\t\tif (!mapHook.map?.map?.getBearing) return;\n\t\t\tsetBearing(Math.round(mapHook.map.map.getBearing()));\n\t\t};\n\n\t\tmapHook.map.on(\"rotate\", _updateBearing, mapHook.componentId);\n\t\t_updateBearing();\n\n\t\treturn () => {\n\t\t\tmapHook.map?.map.off(\"rotate\", _updateBearing);\n\t\t};\n\t}, [mapHook.map, props.mapId]);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={css({\n\t\t\t\t\tzIndex: 1000,\n\t\t\t\t\ttop: 0,\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t...props.style,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName={css({\n\t\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t\tborder: \"10px solid #bcbcbc\",\n\t\t\t\t\t\tbackgroundColor: \"#717171\",\n\t\t\t\t\t\tbackground: \"radial-gradient(#717171, #414141)\",\n\t\t\t\t\t\theight: \"200px\",\n\t\t\t\t\t\twidth: \"200px\",\n\t\t\t\t\t\tborderRadius: \"50%\",\n\t\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\t\tjustifyContent: \"center\",\n\t\t\t\t\t\ttransform: \"scale(0.2) translateX(-448px) translateY(-448px)\",\n\t\t\t\t\t\t...props.backgroundStyle,\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t<RotateButton className={css({ ...props.rotateRightStyle })}>\n\t\t\t\t\t\t<RotateRightIcon\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tif(!mapHook.map)return;\n\n\t\t\t\t\t\t\t\tlet bearing = Math.round(mapHook.map.map.getBearing());\n\t\t\t\t\t\t\t\tlet rest = Math.round(bearing % 90);\n\t\t\t\t\t\t\t\tif (bearing > 0) {\n\t\t\t\t\t\t\t\t\trest = 90 - rest;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (rest === 0) {\n\t\t\t\t\t\t\t\t\trest = 90;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmapHook.map.map.setBearing(Math.round(bearing + Math.abs(rest)));\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t></RotateRightIcon>\n\t\t\t\t\t</RotateButton>\n\t\t\t\t\t<NeedleButton\n\t\t\t\t\t\tclassName={css({ ...props.needleStyle })}\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tmapHook.map?.map.setBearing(0);\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<NeedleContainer\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\ttransform: \"rotate(\" + (bearing>0?\"-\"+bearing:-1*bearing) + \"deg)\",\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<NeedleIcon />\n\t\t\t\t\t\t</NeedleContainer>\n\t\t\t\t\t</NeedleButton>\n\t\t\t\t\t<RotateButton className={css({ ...props.rotateLeftStyle })}>\n\t\t\t\t\t\t<RotateLeftIcon\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tif(!mapHook.map)return;\n\n\t\t\t\t\t\t\t\tlet bearing = Math.round(mapHook.map.map.getBearing());\n\t\t\t\t\t\t\t\tlet rest = Math.round(bearing % 90);\n\t\t\t\t\t\t\t\tif (bearing < 0) {\n\t\t\t\t\t\t\t\t\trest = 90 + rest;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (rest === 0) {\n\t\t\t\t\t\t\t\t\trest = 90;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmapHook.map.map.setBearing(Math.round(bearing - Math.abs(rest)));\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t></RotateLeftIcon>\n\t\t\t\t\t</RotateButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nMlNavigationCompass.propTypes = {\n\t/**\n\t * Component id prefix\n\t */\n\tidPrefix: PropTypes.string,\n\t/**\n\t * Style object to adjust css definitions of the component.\n\t */\n\tstyle: PropTypes.object,\n\t/**\n\t * Style object to adjust css definitions of the background.\n\t */\n\tbackgroundStyle: PropTypes.object,\n\t/**\n\t * Style object to adjust css definitions of the compass needle.\n\t */\n\tneedleStyle: PropTypes.object,\n\t/**\n\t * Style object to adjust css definitions of the rotate right button.\n\t */\n\trotateRightStyle: PropTypes.object,\n\t/**\n\t * Style object to adjust css definitions of the rotate left button.\n\t */\n\trotateLeftStyle: PropTypes.object,\n};\n\nexport default MlNavigationCompass;\n","import React, { useEffect, useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport ControlPointIcon from \"@mui/icons-material/ControlPoint\";\nimport RemoveCircleOutlineIcon from \"@mui/icons-material/RemoveCircleOutline\";\nimport Box from \"@mui/material/Box\";\nimport { SxProps } from \"@mui/material\";\n\nimport MlNavigationCompass from \"../MlNavigationCompass/MlNavigationCompass\";\nimport MlFollowGps from \"../MlFollowGps/MlFollowGps\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport useMap from \"../../hooks/useMap\";\nimport MlCenterPosition from \"../MlCenterPosition/MlCenterPosition\";\n\ninterface MlNavigationToolsProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Show 3D button\n\t */\n\tshow3DButton?: boolean;\n\t/**\n\t * Show zoom button\n\t */\n\tshowZoomButtons?: boolean;\n\t/**\n\t * Show follow GPS button\n\t */\n\tshowFollowGpsButton?: boolean;\n\t/**\n\t * Show center on current position button\n\t */\n\tshowCenterLocationButton?: boolean;\n\t/**\n\t * Additional JSX Elements to be rendered below MlNavigationTools buttons\n\t */\n\tchildren?: JSX.Element;\n\t/**\n\t * Style attribute for NavigationTools container\n\t */\n\tsx?: SxProps;\n\t/**\n\t * Style attribute for NavigationTools container\n\t */\n\tmediaIsMobile?: boolean;\n}\n\n/**\n * @component\n */\n\nconst MlNavigationTools = (props: MlNavigationToolsProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst [pitch, setPitch] = useState(0);\n\tconst mediaIsMobile = useMediaQuery('(max-width:900px)');\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tmapHook.map.on(\n\t\t\t'pitchend',\n\t\t\t() => {\n\t\t\t\tif (!mapHook.map) return;\n\n\t\t\t\tsetPitch(mapHook.map.map.getPitch());\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\t\tsetPitch(mapHook.map.map.getPitch());\n\t}, [mapHook.map, props.mapId]);\n\n\tconst zoomIn = () => {\n\t\tif (!mapHook.map) return;\n\n\t\tif (mapHook.map.map.transform._zoom + 0.5 <= mapHook.map.map.transform._maxZoom) {\n\t\t\tmapHook.map.map.easeTo({ zoom: mapHook.map.map.transform._zoom + 0.5 });\n\t\t}\n\t};\n\n\tconst zoomOut = () => {\n\t\tif (!mapHook.map) return;\n\n\t\tif (mapHook.map.map.transform._zoom - 0.5 >= mapHook.map.map.transform._minZoom) {\n\t\t\tmapHook.map.map.easeTo({ zoom: mapHook.map.map.transform._zoom - 0.5 });\n\t\t}\n\t};\n\n\tconst adjustPitch = () => {\n\t\tif (!mapHook.map) return;\n\n\t\tlet targetPitch = 60;\n\t\tif (mapHook.map.map.getPitch() !== 0) {\n\t\t\ttargetPitch = 0;\n\t\t}\n\t\tmapHook.map.map.easeTo({ pitch: targetPitch });\n\t};\n\n\treturn (\n\t\t<Box\n\t\t\tsx={{\n\t\t\t\tzIndex: 501,\n\t\t\t\tposition: 'absolute',\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tflexDirection: 'column',\n\t\t\t\t...(mediaIsMobile ? { margin: '20px 10px 20px 10px' } : {}),\n\t\t\t\t...props.sx,\n\t\t\t}}\n\t\t>\n\t\t\t<MlNavigationCompass\n\t\t\t\tstyle={{\n\t\t\t\t\twidth: '31px',\n\t\t\t\t\tposition: 'relative',\n\t\t\t\t\theight: mediaIsMobile ? '55px' : '45px',\n\t\t\t\t\tmarginLeft: mediaIsMobile ? '3px' : '-5px',\n\t\t\t\t\ttransform: mediaIsMobile ? 'scale(1.6)' : 'scale(1)',\n\t\t\t\t}}\n\t\t\t\tbackgroundStyle={{\n\t\t\t\t\tboxShadow: '0px 0px 18px rgba(0,0,0,.5)',\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t{props.show3DButton && (\n\t\t\t\t<Button variant=\"navtools\" onClick={adjustPitch}>\n\t\t\t\t\t{pitch ? '2D' : '3D'}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t\t{props.showFollowGpsButton && <MlFollowGps />}\n\t\t\t{props.showCenterLocationButton && <MlCenterPosition />}\n\t\t\t<ButtonGroup\n\t\t\t\torientation=\"vertical\"\n\t\t\t\tsx={{\n\t\t\t\t\twidth: '50px',\n\t\t\t\t\tborder: 'none',\n\t\t\t\t\tButton: { minWidth: '20px !important'},\n\t\t\t\t\t'Button:hover': { border: 'none' },\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{props.showZoomButtons && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Button variant=\"navtools\" onClick={zoomIn}>\n\t\t\t\t\t\t\t<ControlPointIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button variant=\"navtools\" onClick={zoomOut}>\n\t\t\t\t\t\t\t<RemoveCircleOutlineIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</ButtonGroup>\n\t\t\t{props.children && React.cloneElement(props.children, {})}\n\t\t</Box>\n\t);\n};\n\nMlNavigationTools.defaultProps = {\n\tmapId: undefined,\n\tshow3DButton: true,\n\tshowFollowGpsButton: true,\n\tshowCenterLocationButton: false,\n\tshowZoomButtons: true,\n\tsx: {\n\t\tright: \"5px\",\n\t\tbottom: \"20px\",\n\t},\n};\n\nexport default MlNavigationTools;\n","import React from \"react\";\n\nimport useLayer from \"../../hooks/useLayer\";\nimport { Feature, FeatureCollection } from \"@turf/turf\";\n\ninterface MlLayerProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Id of the layer that will be added by this component to the maplibre-gl instance\n\t */\n\tlayerId?: string;\n\t/**\n\t * Javascript object that is passed the addLayer command as first parameter.\n\t */\n\toptions?: any;\n\t/**\n\t * GeoJSON data that is supposed to be rendered by this component.\n\t */\n\tgeojson?: Feature | FeatureCollection | undefined;\n}\n\n/**\n * Basic layer component that create a layer in a MapLibre-gl instance and keeps it updated according to it attribute configuration.\n * \n * @category Map components \n */\nconst MlLayer = (props: MlLayerProps) => {\n\tuseLayer({\n\t\tidPrefix: 'MlLayer-',\n\t\tlayerId: props.layerId,\n\t\tmapId: props.mapId,\n\t\tgeojson: props.geojson,\n\t\toptions: {\n\t\t\ttype: \"background\",\n\t\t\tpaint: {\n\t\t\t\t\"background-color\": \"rgba(0,0,0,0)\",\n\t\t\t},\n\t\t\t...props.options,\n\t\t},\n\t\tinsertBeforeLayer: props.insertBeforeLayer,\n\t});\n\n\treturn <></>;\n};\n\nexport default MlLayer;\n","import React, { useRef, useEffect, useState, useCallback } from 'react';\nimport useMap from '../../hooks/useMap';\n\nexport interface MlScaleReferenceProps {\n\tmapId?: string;\n\tinsertBeforeLayer?: string | undefined;\n\tmaxWidth?: number;\n\tunit?: string;\n}\n\nconst MlScaleReference = (props: MlScaleReferenceProps) => {\n\tconst zoomRef = useRef(0);\n\tconst mapHook = useMap({ mapId: props.mapId, waitForLayer: props.insertBeforeLayer });\n\n\tconst [pxWidth, setPxWidth] = useState(0);\n\tconst [text, setText] = useState('');\n\n\tconst updateScale = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\t\tif (mapHook.map?.map.getZoom() === zoomRef.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tzoomRef.current = mapHook.map?.map.getZoom();\n\t\t// Calculation from MapLibre\n\t\t// A horizontal scale is imagined to be present at center of the map\n\t\t// Using spherical law of cosines approximation, the real distance is\n\t\t// found between the two coordinates.\n\t\tconst maxWidth = props.maxWidth || 100;\n\n\t\tconst y = mapHook.map.map._container.clientHeight / 2;\n\t\tconst left = mapHook.map.map.unproject([0, y]);\n\t\tconst right = mapHook.map.map.unproject([maxWidth, y]);\n\t\tconst maxMeters = left.distanceTo(right);\n\t\t// The real distance corresponding to 100px scale length is rounded off to\n\t\t// near pretty number and the scale length for the same is found out.\n\t\t// Default unit of the scale is based on User's locale.\n\t\tif (props.unit === 'imperial') {\n\t\t\tconst maxFeet = 3.2808 * maxMeters;\n\t\t\tif (maxFeet > 5280) {\n\t\t\t\tconst maxMiles = maxFeet / 5280;\n\t\t\t\tsetScale(maxWidth, maxMiles, mapHook.map.map._getUIString('ScaleControl.Miles'));\n\t\t\t} else {\n\t\t\t\tsetScale(maxWidth, maxFeet, mapHook.map.map._getUIString('ScaleControl.Feet'));\n\t\t\t}\n\t\t} else if (props.unit === 'nautical') {\n\t\t\tconst maxNauticals = maxMeters / 1852;\n\t\t\tsetScale(maxWidth, maxNauticals, mapHook.map.map._getUIString('ScaleControl.NauticalMiles'));\n\t\t} else if (maxMeters >= 1000) {\n\t\t\tsetScale(maxWidth, maxMeters / 1000, mapHook.map.map._getUIString('ScaleControl.Kilometers'));\n\t\t} else {\n\t\t\tsetScale(maxWidth, maxMeters, mapHook.map.map._getUIString('ScaleControl.Meters'));\n\t\t}\n\t}, [mapHook.map, props.unit, props.maxWidth]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tconst _updateScale = updateScale;\n\t\tmapHook.map.on('move', _updateScale, mapHook.componentId);\n\t\tupdateScale();\n\n\t\treturn () => {\n\t\t\tmapHook.map?.map.off('move', _updateScale);\n\t\t};\n\t}, [mapHook.map, updateScale]);\n\n\tconst setScale = (maxWidth: number, maxDistance: number, unit: string) => {\n\t\tconst distance = getRoundNum(maxDistance);\n\t\tconst ratio = distance / maxDistance;\n\t\tsetPxWidth(maxWidth * ratio);\n\t\tsetText(distance + ' ' + unit);\n\t};\n\n\tconst getDecimalRoundNum = (d: number) => {\n\t\tconst multiplier = Math.pow(10, Math.ceil(-Math.log(d) / Math.LN10));\n\t\treturn Math.round(d * multiplier) / multiplier;\n\t};\n\n\tconst getRoundNum = (num: number) => {\n\t\tconst pow10 = Math.pow(10, `${Math.floor(num)}`.length - 1);\n\t\tlet d = num / pow10;\n\n\t\td = d >= 10 ? 10 : d >= 5 ? 5 : d >= 3 ? 3 : d >= 2 ? 2 : d >= 1 ? 1 : getDecimalRoundNum(d);\n\n\t\treturn pow10 * d;\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tbackgroundColor: 'hsla(0,0%,100%,.75)',\n\t\t\t\t\tfontSize: '10px',\n\t\t\t\t\tborder: '2px solid #333',\n\t\t\t\t\tborderTop: '#333',\n\t\t\t\t\tpadding: '0 5px',\n\t\t\t\t\tcolor: '#333',\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\twidth: pxWidth + 'px',\n\t\t\t\t\tfontFamily: 'sans-serif',\n\t\t\t\t}}\n\t\t\t\tdangerouslySetInnerHTML={{ __html: text }}\n\t\t\t></div>\n\t\t</>\n\t);\n};\n\nexport default MlScaleReference;\n","import React, { useContext, useCallback, useRef, useEffect, useState, useMemo } from 'react';\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport syncMove from '@mapbox/mapbox-gl-sync-move';\nimport './style.css';\nimport MapContext, { MapContextType } from '../../contexts/MapContext';\n\nexport interface MlLayerMagnifyProps {\n\t/**\n\t * Id of the first MapLibre instance\n\t */\n\tmap1Id: string;\n\t/**\n\t * Id of the second MapLibre instance\n\t */\n\tmap2Id: string;\n\t/**\n\t * Size of the \"magnifier\"-circle\n\t */\n\tmagnifierRadius?: number;\n\t/**\n\t * object (React.CSSProperties) that is added to the magnifier default style\n\t */\n\tmagnifierStyle: React.CSSProperties | undefined;\n}\n\n/**\n *\n * Hides the MapLibreMap referenced by props.map2Id except for the \"magnifier\"-circle that reveals\n * the map and can be dragged around on top of the MapLibreMap referenced by props.map1Id\n */\nconst MlLayerMagnify = (props: MlLayerMagnifyProps) => {\n\tconst mapContext: MapContextType = useContext(MapContext);\n\tconst syncMoveInitializedRef = useRef(false);\n\tconst syncCleanupFunctionRef = useRef(() => {});\n\n\tconst [swipeX, setSwipeX] = useState(50);\n\tconst swipeXRef = useRef(50);\n\tconst [swipeY, setSwipeY] = useState(50);\n\tconst swipeYRef = useRef(50);\n\n\tconst magnifierRadius = useMemo(() => {\n\t\treturn props.magnifierRadius || 200;\n\t}, [props.magnifierRadius]);\n\n\tconst mapExists = useCallback(() => {\n\t\tif (!props.map1Id || !props.map2Id) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!mapContext.getMap(props.map1Id) || !mapContext.getMap(props.map2Id)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}, [props, mapContext]);\n\n\tconst onResize = useRef(() => {\n\t\tif (!mapExists()) return;\n\n\t\tonMove({\n\t\t\tclientX: swipeXRef.current,\n\t\t\tclientY: swipeYRef.current,\n\t\t} as (TouchEvent & MouseEvent));\n\t});\n\n\tuseEffect(() => {\n\t\twindow.addEventListener('resize', onResize.current);\n\t\tconst _onResize = onResize.current;\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('resize', _onResize);\n\t\t\tsyncCleanupFunctionRef.current();\n\t\t};\n\t}, []);\n\n\tconst onMove = useCallback(\n\t\t(e:(TouchEvent & MouseEvent)) => {\n\t\t\tif (!mapExists()) return;\n\n\t\t\tconst bounds = mapContext.maps[props.map1Id].getCanvas().getBoundingClientRect();\n\t\t\tlet clientX =\n\t\t\t\te?.clientX ||\n\t\t\t\t(typeof e?.touches !== 'undefined' && typeof e?.touches[0] !== 'undefined'\n\t\t\t\t\t? e?.touches[0].clientX\n\t\t\t\t\t: 0);\n\t\t\tlet clientY =\n\t\t\t\te?.clientY ||\n\t\t\t\t(typeof e.touches !== 'undefined' && typeof e.touches[0] !== 'undefined'\n\t\t\t\t\t? e.touches[0].clientY\n\t\t\t\t\t: 0);\n\n\t\t\tclientX -= bounds.x;\n\t\t\tclientY -= bounds.y;\n\t\t\tconst swipeX_tmp = parseFloat(((clientX / bounds.width) * 100).toFixed(2));\n\t\t\tconst swipeY_tmp = parseFloat(((clientY / bounds.height) * 100).toFixed(2));\n\n\t\t\tif (swipeXRef.current !== swipeX_tmp || swipeYRef.current !== swipeY_tmp) {\n\t\t\t\tsetSwipeX(swipeX_tmp);\n\t\t\t\tswipeXRef.current = swipeX_tmp;\n\t\t\t\tsetSwipeY(swipeY_tmp);\n\t\t\t\tswipeYRef.current = swipeY_tmp;\n\n\t\t\t\tmapContext.maps[props.map2Id].getContainer().style.clipPath =\n\t\t\t\t\t`circle(${magnifierRadius}px at ` +\n\t\t\t\t\t(swipeXRef.current * bounds.width) / 100 +\n\t\t\t\t\t'px ' +\n\t\t\t\t\t(swipeYRef.current * bounds.height) / 100 +\n\t\t\t\t\t'px)';\n\t\t\t}\n\t\t},\n\t\t[mapContext, mapExists, props, magnifierRadius]\n\t);\n\n\tuseEffect(() => {\n\t\tif (!mapExists() || syncMoveInitializedRef.current) return;\n\n\t\tsyncMoveInitializedRef.current = true;\n\t\tsyncCleanupFunctionRef.current = syncMove(\n\t\t\tmapContext.getMap(props.map1Id).map,\n\t\t\tmapContext.getMap(props.map2Id).map\n\t\t);\n\n\t\tonMove({\n\t\t\tclientX: swipeXRef.current,\n\t\t\tclientY: swipeYRef.current,\n\t\t} as (TouchEvent & MouseEvent));\n\t\t/*\n\t\tautomatically adjust radius for small screens\n\t\tif (\n\t\t\tmapContext.maps[props.map1Id].getCanvas().clientWidth >\n\t\t\t\tmapContext.maps[props.map1Id].getCanvas().clientHeight &&\n\t\t\tmagnifierRadius * 2 >\n\t\t\t\tmapContext.maps[props.map1Id].getCanvas().clientHeight\n\t\t) {\n\t\t\tmagnifierRadius = Math.floor(\n\t\t\t\tmapContext.maps[props.map1Id].getCanvas().clientHeight / 2\n\t\t\t);\n\t\t\tsetMagnifierRadius(magnifierRadius);\n\t\t}\n\n\t\tif (\n\t\t\tmapContext.maps[props.map1Id].getCanvas().clientHeight >\n\t\t\t\tmapContext.maps[props.map1Id].getCanvas().clientWidth &&\n\t\t\tmagnifierRadius * 2 >\n\t\t\t\tmapContext.maps[props.map1Id].getCanvas().clientWidth\n\t\t) {\n\t\t\tmagnifierRadius = Math.floor(\n\t\t\t\tmapContext.maps[props.map1Id].getCanvas().clientWidth / 2\n\t\t\t);\n\t\t\tsetMagnifierRadius(magnifierRadius);\n\t\t}\n\t\t*/\n\n\t\tonMove({\n\t\t\tclientX: mapContext.maps[props.map1Id].getCanvas().clientWidth / 2,\n\t\t\tclientY: mapContext.maps[props.map1Id].getCanvas().clientHeight / 2,\n\t\t} as (TouchEvent & MouseEvent));\n\t}, [mapContext.mapIds, mapContext, mapExists, props, onMove]);\n\n\tconst onDown = (e: React.MouseEvent | React.TouchEvent) => {\n\t\tif (e.nativeEvent instanceof TouchEvent) {\n\t\t\tdocument.addEventListener('touchmove', onMove);\n\t\t\tdocument.addEventListener('touchend', onTouchEnd);\n\t\t} else {\n\t\t\tdocument.addEventListener('mousemove', onMove);\n\t\t\tdocument.addEventListener('mouseup', onMouseUp);\n\t\t}\n\t};\n\n\tconst onTouchEnd = () => {\n\t\tdocument.removeEventListener('touchmove', onMove);\n\t\tdocument.removeEventListener('touchend', onTouchEnd);\n\t};\n\n\tconst onMouseUp = () => {\n\t\tdocument.removeEventListener('mousemove', onMove);\n\t\tdocument.removeEventListener('mouseup', onMouseUp);\n\t};\n\n\tconst onWheel = (e: React.WheelEvent) => {\n\t\tconst evCopy = new WheelEvent(e.type, e as unknown as WheelEventInit);\n\t\tmapContext.map?.map.getCanvas().dispatchEvent(evCopy);\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tposition: 'absolute',\n\t\t\t\tleft: swipeX + '%',\n\t\t\t\ttop: swipeY + '%',\n\t\t\t\tborderRadius: '50%',\n\t\t\t\twidth: magnifierRadius * 2 - 2 + 'px',\n\t\t\t\theight: magnifierRadius * 2 - 2 + 'px',\n\t\t\t\tbackground: 'rgba(0,0,0,0)',\n\t\t\t\tborder: '2px solid #fafafa',\n\t\t\t\tboxShadow: '1px 2px 2px rgba(19, 19, 19, .5), inset 1px 1px 1px rgba(19, 19, 19, .2)',\n\t\t\t\tcursor: 'pointer',\n\t\t\t\tzIndex: '110',\n\t\t\t\tmarginLeft: magnifierRadius * -1 - 1 + 'px',\n\t\t\t\tmarginTop: magnifierRadius * -1 - 1 + 'px',\n\t\t\t\ttextAlign: 'center',\n\t\t\t\tlineHeight: '91px',\n\t\t\t\tfontSize: '2em',\n\t\t\t\tcolor: '#fafafa',\n\t\t\t\tuserSelect: 'none',\n\t\t\t\t...props.magnifierStyle,\n\t\t\t}}\n\t\t\tonTouchStart={onDown}\n\t\t\tonMouseDown={onDown}\n\t\t\tonWheel={onWheel}\n\t\t></div>\n\t);\n};\n\nMlLayerMagnify.defaultProps = {\n\tmagnifierRadius: 200,\n\tmagnifierStyle: {},\n};\n\nexport default MlLayerMagnify;\n","import React, { useContext, useCallback, useRef, useEffect, useState } from 'react';\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport syncMove from '@mapbox/mapbox-gl-sync-move';\nimport './style.css';\nimport MapContext, { MapContextType } from '../../contexts/MapContext';\n\nexport interface MlLayerSwipeProps {\n\t/**\n\t * Id of the first MapLibre instance.\n\t */\n\tmap1Id: string;\n\t/**\n\t * Id of the second MapLibre instance.\n\t */\n\tmap2Id: string;\n\t/**\n\t * object (React.CSSProperties) that is added to the button default style\n\t */\n\tbuttonStyle: React.CSSProperties | undefined;\n}\n\n/**\n *\tcreates a split view of 2 synchronised maplibre instances\n */\nconst MlLayerSwipe = (props: MlLayerSwipeProps) => {\n\tconst mapContext: MapContextType = useContext(MapContext);\n\tconst initializedRef = useRef(false);\n\n\tconst [swipeX, setSwipeX] = useState(50);\n\tconst swipeXRef = useRef(0);\n\n\tconst syncCleanupFunctionRef = useRef(() => {});\n\n\tconst mapExists = useCallback(() => {\n\t\tif (!props.map1Id || !props.map2Id) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!mapContext.getMap(props.map1Id) || !mapContext.getMap(props.map2Id)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}, [mapContext, props.map1Id, props.map2Id]);\n\n\tconst cleanup = () => {\n\t\tsyncCleanupFunctionRef.current();\n\t};\n\n\tconst onMove = useCallback(\n\t\t(e:(TouchEvent & MouseEvent)) => {\n\t\t\tif (!mapExists()) return;\n\n\t\t\tconst bounds = mapContext.maps[props.map1Id].getCanvas().getBoundingClientRect();\n\t\t\tlet clientX =\n\t\t\t\te.clientX ||\n\t\t\t\t(typeof e.touches !== 'undefined' && typeof e.touches[0] !== 'undefined'\n\t\t\t\t\t? e.touches[0].clientX\n\t\t\t\t\t: 0);\n\n\t\t\tclientX -= bounds.x;\n\t\t\tconst swipeX_tmp = parseFloat(((clientX / bounds.width) * 100).toFixed(2));\n\n\t\t\tif (swipeXRef.current !== swipeX_tmp) {\n\t\t\t\tsetSwipeX(swipeX_tmp);\n\t\t\t\tswipeXRef.current = swipeX_tmp;\n\n\t\t\t\tconst clipA = 'rect(0, ' + (swipeXRef.current * bounds.width) / 100 + 'px, 999em, 0)';\n\n\t\t\t\tmapContext.maps[props.map2Id].getContainer().style.clip = clipA;\n\t\t\t}\n\t\t},\n\t\t[mapContext, mapExists, props.map1Id, props.map2Id]\n\t);\n\n\tuseEffect(() => {\n\t\treturn cleanup;\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!mapExists() || initializedRef.current) return;\n\n\t\tinitializedRef.current = true;\n\t\tsyncCleanupFunctionRef.current = syncMove(\n\t\t\tmapContext.getMap(props.map1Id).map,\n\t\t\tmapContext.getMap(props.map2Id).map\n\t\t);\n\t\tonMove({\n\t\t\tclientX: mapContext.maps[props.map1Id].getCanvas().clientWidth / 2,\n\t\t} as (TouchEvent & MouseEvent));\n\t}, [mapContext.mapIds, mapContext, props, onMove, mapExists]);\n\n\tconst onDown = (e: React.MouseEvent | React.TouchEvent) => {\n\t\tif (e.nativeEvent instanceof TouchEvent) {\n\t\t\tdocument.addEventListener('touchmove', onMove);\n\t\t\tdocument.addEventListener('touchend', onTouchEnd);\n\t\t} else {\n\t\t\tdocument.addEventListener('mousemove', onMove);\n\t\t\tdocument.addEventListener('mouseup', onMouseUp);\n\t\t}\n\t};\n\n\tconst onTouchEnd = () => {\n\t\tdocument.removeEventListener('touchmove', onMove);\n\t\tdocument.removeEventListener('touchend', onTouchEnd);\n\t};\n\n\tconst onMouseUp = () => {\n\t\tdocument.removeEventListener('mousemove', onMove);\n\t\tdocument.removeEventListener('mouseup', onMouseUp);\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tposition: 'absolute',\n\t\t\t\tleft: swipeX + '%',\n\t\t\t\ttop: '50%',\n\t\t\t\tborderRadius: '50%',\n\t\t\t\twidth: '100px',\n\t\t\t\theight: '100px',\n\t\t\t\tbackground: '#0066ff',\n\t\t\t\tborder: '3px solid #eaebf1',\n\t\t\t\tcursor: 'pointer',\n\t\t\t\tzIndex: '110',\n\t\t\t\tmarginLeft: '-50px',\n\t\t\t\tmarginTop: '-50px',\n\t\t\t\ttextAlign: 'center',\n\t\t\t\tlineHeight: '91px',\n\t\t\t\tfontSize: '2em',\n\t\t\t\tcolor: '#fafafa',\n\t\t\t\tuserSelect: 'none',\n\t\t\t\t...props.buttonStyle,\n\t\t\t}}\n\t\t\tonTouchStart={onDown}\n\t\t\tonMouseDown={onDown}\n\t\t></div>\n\t);\n};\n\nMlLayerSwipe.defaultProps = {\n\tbuttonStyle: {},\n};\n\nexport default MlLayerSwipe;\n","import * as turf from \"@turf/turf\";\n\nconst _showNextTransitionSegment = function (\n\tprops,\n\tmap,\n\ttransitionInProgressRef,\n\ttransitionGeojsonDataRef,\n\ttransitionGeojsonCommonDataRef,\n\tcurrentTransitionStepRef,\n\tmsPerStep,\n\ttransitionTimeoutRef,\n\tsetDisplayGeojson\n) {\n\tif (typeof transitionGeojsonDataRef.current[currentTransitionStepRef.current] !== \"undefined\") {\n\t\t// if at last transition step set to target geojson\n\t\t// else to an assembled LineString from common geometry and the current transition step geometry\n\t\tlet newData =\n\t\t\tcurrentTransitionStepRef.current + 1 === transitionGeojsonDataRef.current.length\n\t\t\t\t? props.geojson\n\t\t\t\t: turf.lineString([\n\t\t\t\t\t\t...transitionGeojsonCommonDataRef.current,\n\t\t\t\t\t\t...transitionGeojsonDataRef.current[currentTransitionStepRef.current].geometry\n\t\t\t\t\t\t\t.coordinates,\n\t\t\t\t\t]);\n\n\t\tsetDisplayGeojson(newData);\n\n\t\tif (typeof props.onTransitionFrame === \"function\") {\n\t\t\tprops.onTransitionFrame(newData);\n\t\t}\n\n\t\tcurrentTransitionStepRef.current++;\n\t\tif (\n\t\t\ttransitionInProgressRef.current &&\n\t\t\tcurrentTransitionStepRef.current < transitionGeojsonDataRef.current.length\n\t\t) {\n\t\t\ttransitionTimeoutRef.current = setTimeout(\n\t\t\t\t() => _showNextTransitionSegment(...arguments),\n\t\t\t\tmsPerStep\n\t\t\t);\n\t\t} else {\n\t\t\tif (typeof props.onTransitionEnd === \"function\") {\n\t\t\t\tprops.onTransitionEnd(props.geojson);\n\t\t\t}\n\t\t\ttransitionInProgressRef.current = false;\n\t\t}\n\t}\n};\n\nconst _transitionToGeojson = (\n\tprops,\n\ttransitionGeojsonCommonDataRef,\n\ttransitionGeojsonDataRef,\n\ttransitionInProgressRef,\n\toldGeojsonRef,\n\tmsPerStep,\n\tcurrentTransitionStepRef,\n\tmap,\n\ttransitionTimeoutRef,\n\tsetDisplayGeojson\n) => {\n\t// create the transition geojson between oldGeojsonRef.current and props.geojson\n\n\t// create a geojson that contains no common point between the two line features\n\tlet transitionCoordinatesShort = [];\n\tlet transitionCoordinatesLong = [];\n\tlet targetCoordinates = [];\n\tlet srcCoordinates = [];\n\ttransitionGeojsonCommonDataRef.current = [];\n\tlet sourceGeojson = oldGeojsonRef.current || {\n\t\tgeometry: {\n\t\t\ttype: \"LineString\",\n\t\t\tcoordinates: [],\n\t\t},\n\t\tproperties: {},\n\t\ttype: \"Feature\",\n\t};\n\n\tlet targetGeojson = props.geojson;\n\n\tlet longerGeojson = targetGeojson;\n\tlet shorterGeojson = sourceGeojson;\n\tlet reverseOrder = false;\n\t// In case one geojson is missing completely use the first two coordinates of the other geojson\n\tif (\n\t\ttypeof longerGeojson.geometry === \"undefined\" &&\n\t\ttypeof shorterGeojson.geometry !== \"undefined\" &&\n\t\tshorterGeojson.geometry.coordinates.length > 1\n\t) {\n\t\tlongerGeojson = turf.lineString(shorterGeojson.geometry.coordinates.slice(0, 2));\n\t} else if (\n\t\ttypeof shorterGeojson.geometry === \"undefined\" &&\n\t\ttypeof longerGeojson.geometry !== \"undefined\" &&\n\t\tlongerGeojson.geometry.coordinates.length > 1\n\t) {\n\t\tshorterGeojson = turf.lineString(longerGeojson.geometry.coordinates.slice(0, 2));\n\t} else if (\n\t\ttypeof shorterGeojson.geometry === \"undefined\" &&\n\t\ttypeof longerGeojson.geometry === \"undefined\"\n\t) {\n\t\treturn;\n\t}\n\n\tif (longerGeojson.geometry.coordinates.length < shorterGeojson.geometry.coordinates.length) {\n\t\tlongerGeojson = sourceGeojson;\n\t\tshorterGeojson = targetGeojson;\n\t\treverseOrder = true;\n\t}\n\n\tif (longerGeojson && shorterGeojson) {\n\t\tfor (var i = 0, len = longerGeojson.geometry.coordinates.length; i < len; i++) {\n\t\t\tif (\n\t\t\t\ttypeof shorterGeojson.geometry.coordinates[i] !== \"undefined\" &&\n\t\t\t\tlongerGeojson.geometry.coordinates[i][0] === shorterGeojson.geometry.coordinates[i][0] &&\n\t\t\t\tlongerGeojson.geometry.coordinates[i][1] === shorterGeojson.geometry.coordinates[i][1]\n\t\t\t) {\n\t\t\t\t// if coordinates are equal\n\t\t\t\ttransitionGeojsonCommonDataRef.current.push(longerGeojson.geometry.coordinates[i]);\n\t\t\t} else {\n\t\t\t\tif (typeof longerGeojson.geometry.coordinates[i] !== \"undefined\") {\n\t\t\t\t\ttransitionCoordinatesLong.push(longerGeojson.geometry.coordinates[i]);\n\t\t\t\t}\n\t\t\t\tif (typeof shorterGeojson.geometry.coordinates[i] !== \"undefined\") {\n\t\t\t\t\ttransitionCoordinatesShort.push(shorterGeojson.geometry.coordinates[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (reverseOrder) {\n\t\ttargetCoordinates = transitionCoordinatesShort;\n\t\tsrcCoordinates = transitionCoordinatesLong;\n\t} else {\n\t\ttargetCoordinates = transitionCoordinatesLong;\n\t\tsrcCoordinates = transitionCoordinatesShort;\n\t}\n\n\tif (targetCoordinates.length < 2 && srcCoordinates < 2) return;\n\t// create props.transitionTime / msPerStep (=: transitionSteps) Versions of transitionGeojsonCommonDataRef.current + transitionCoordinates making the transitionCoordinates transitionCoordinatesDistance / transitionSteps longer on each step\n\n\tlet transitionSteps = props.transitionTime / msPerStep;\n\tlet srcCoordinatesDistance =\n\t\tsrcCoordinates.length > 1 ? Math.round(turf.length(turf.lineString(srcCoordinates))) : 0;\n\tlet targetCoordinatesDistance =\n\t\ttargetCoordinates.length > 1 ? Math.round(turf.length(turf.lineString(targetCoordinates))) : 0;\n\tlet transitionDistance = targetCoordinatesDistance + srcCoordinatesDistance;\n\n\tlet srcCoordinatesShare = srcCoordinatesDistance / transitionDistance;\n\tlet srcTransitionSteps = Math.round(transitionSteps * srcCoordinatesShare);\n\tlet srcPerStepDistance = Math.round((srcCoordinatesDistance / srcTransitionSteps) * 100) / 100;\n\n\tlet targetCoordinatesShare = targetCoordinatesDistance / transitionDistance;\n\tlet targetTransitionSteps = Math.round(transitionSteps * targetCoordinatesShare);\n\tlet targetPerStepDistance =\n\t\tMath.round((targetCoordinatesDistance / targetTransitionSteps) * 100) / 100;\n\n\t// use srcPerStepDistance as src coordinates are always animated backwards\n\tlet loopStepDistance = srcCoordinatesDistance;\n\tif (loopStepDistance <= 0) {\n\t\tloopStepDistance = 0.1;\n\t}\n\n\t// create transition step data as an array of all required FeatureCollection states until the transition is complete\n\tlet transitionStepData;\n\n\ttransitionStepData = [\n\t\t...createTransitionSteps(srcCoordinates, srcPerStepDistance, srcTransitionSteps),\n\t];\n\ttransitionStepData.reverse();\n\n\ttransitionStepData = [\n\t\t...transitionStepData,\n\t\t...createTransitionSteps(targetCoordinates, targetPerStepDistance, targetTransitionSteps),\n\t];\n\n\ttransitionStepData.push(targetGeojson);\n\n\ttransitionGeojsonDataRef.current = transitionStepData;\n\n\tcurrentTransitionStepRef.current = 1;\n\ttransitionInProgressRef.current = true;\n\ttransitionTimeoutRef.current = setTimeout(\n\t\t() =>\n\t\t\t_showNextTransitionSegment(\n\t\t\t\tprops,\n\t\t\t\tmap,\n\t\t\t\ttransitionInProgressRef,\n\t\t\t\ttransitionGeojsonDataRef,\n\t\t\t\ttransitionGeojsonCommonDataRef,\n\t\t\t\tcurrentTransitionStepRef,\n\t\t\t\tmsPerStep,\n\t\t\t\ttransitionTimeoutRef,\n\t\t\t\tsetDisplayGeojson\n\t\t\t),\n\t\tmsPerStep\n\t);\n};\n\nlet createTransitionSteps = (linestringCoordinates, perStepDistance, stepCnt) => {\n\tlet transitionSteps = [];\n\n\tif (linestringCoordinates.length > 1) {\n\t\tlet tmpChunks = turf.lineChunk(turf.lineString(linestringCoordinates), perStepDistance);\n\t\t// tmpLineString contains all coordinates of all previous plus current loop iteration\n\t\tlet tmpLinestring = tmpChunks.features[0];\n\t\tfor (let i = 0; i < stepCnt; i++) {\n\t\t\ttransitionSteps.push(tmpLinestring);\n\t\t\tif (typeof tmpChunks.features[i] !== \"undefined\") {\n\t\t\t\ttmpLinestring = turf.lineString([\n\t\t\t\t\t...tmpLinestring.geometry.coordinates,\n\t\t\t\t\t...tmpChunks.features[i].geometry.coordinates,\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn transitionSteps;\n};\n\nexport { _showNextTransitionSegment, _transitionToGeojson };\n","import React, { useState, useRef, useEffect, useCallback } from 'react';\nimport * as turf from '@turf/turf';\nimport useMap from '../../hooks/useMap';\nimport { _transitionToGeojson } from './util/transitionFunctions';\nimport MlGeoJsonLayer from '../MlGeoJsonLayer/MlGeoJsonLayer';\nimport { Feature, FeatureCollection } from '@turf/turf';\nimport { MlGeoJsonLayerProps } from '../MlGeoJsonLayer/MlGeoJsonLayer';\n\nconst msPerStep = 50;\n\ntype MlTransitionGeoJsonLayerProps = MlGeoJsonLayerProps & {\n\ttransitionTime: number;\n};\n\n/**\n * Adds source and layer of types \"line\", \"fill\" or \"circle\" to display GeoJSON data on the map.\n */\nconst MlTransitionGeoJsonLayer = (props: MlTransitionGeoJsonLayerProps) => {\n\t// ignore eslint. Only using `geojson` for destructuring\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tconst { geojson, ...restProps } = props;\n\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\tconst initializedRef = useRef(false);\n\n\t// transition effect variables\n\tconst oldGeojsonRef = useRef<Feature | FeatureCollection>();\n\tconst transitionInProgressRef = useRef(false);\n\tconst transitionTimeoutRef = useRef(undefined);\n\tconst currentTransitionStepRef = useRef(false);\n\tconst transitionGeojsonDataRef = useRef([]);\n\tconst transitionGeojsonCommonDataRef = useRef([]);\n\tconst [displayGeojson, setDisplayGeojson] = useState(turf.featureCollection([]));\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\t// This is the cleanup function, it is called when this react component is removed from react-dom\n\t\t\tif (transitionTimeoutRef.current) {\n\t\t\t\tclearTimeout(transitionTimeoutRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\tconst transitionToGeojson = useCallback(() => {\n\t\t_transitionToGeojson(\n\t\t\tprops,\n\t\t\ttransitionGeojsonCommonDataRef,\n\t\t\ttransitionGeojsonDataRef,\n\t\t\ttransitionInProgressRef,\n\t\t\toldGeojsonRef,\n\t\t\tmsPerStep,\n\t\t\tcurrentTransitionStepRef,\n\t\t\tmapHook.map,\n\t\t\ttransitionTimeoutRef,\n\t\t\tsetDisplayGeojson\n\t\t);\n\t}, [props, mapHook.map]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !initializedRef.current) return;\n\n\t\tif (\n\t\t\ttypeof props.transitionTime !== 'undefined' &&\n\t\t\tprops.type === 'line' &&\n\t\t\toldGeojsonRef.current\n\t\t) {\n\t\t\ttransitionInProgressRef.current = false;\n\t\t\tcurrentTransitionStepRef.current = false;\n\t\t\ttransitionGeojsonDataRef.current = [];\n\t\t\ttransitionGeojsonCommonDataRef.current = [];\n\t\t\ttransitionToGeojson();\n\t\t}\n\t\toldGeojsonRef.current = props.geojson;\n\t}, [mapHook.map, transitionToGeojson, props]);\n\n\tconst startTransition = useCallback(() => {\n\t\tif (\n\t\t\tprops.type === 'line' &&\n\t\t\ttypeof props.transitionTime !== 'undefined' &&\n\t\t\tprops.transitionTime &&\n\t\t\ttypeof props.geojson !== 'undefined' &&\n\t\t\tJSON.stringify(oldGeojsonRef.current) !== JSON.stringify(props.geojson)\n\t\t) {\n\t\t\ttransitionToGeojson();\n\t\t\toldGeojsonRef.current = props.geojson;\n\t\t}\n\t}, [props, transitionToGeojson]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.mapIsReady || !props.geojson) return;\n\n\t\tinitializedRef.current = true;\n\n\t\tstartTransition();\n\t}, [mapHook.mapIsReady, startTransition, props]);\n\n\treturn (\n\t\t<>\n\t\t\t<MlGeoJsonLayer {...restProps} geojson={displayGeojson} />\n\t\t</>\n\t);\n};\n\nexport default MlTransitionGeoJsonLayer;\n","import React, { useRef, useState, useEffect } from \"react\";\nimport MlGeoJsonLayer from \"../MlGeoJsonLayer/MlGeoJsonLayer\";\nimport Paper from \"@mui/material/Paper\";\nimport useMapState from \"../../hooks/useMapState\";\nimport useMap from \"../../hooks/useMap\";\n\nimport Point from \"@mapbox/point-geometry\";\n\ninterface MlMarkerProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Longitude of the marker position\n\t */\n\tlng: number;\n\t/**\n\t * Latitude of the marker position\n\t */\n\tlat: number;\n\t/**\n\t * Content of the description popup\n\t */\n\tcontent?: string;\n}\n\n/**\n * Adds a marker to the map and displays the contents of the \"content\" property in an iframe next to it\n */\nconst MlMarker = (props: MlMarkerProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst mapState = useMapState({\n\t\tmapId: props.mapId,\n\t\twatch: { viewport: true },\n\t});\n\n\tconst iframe = useRef<HTMLIFrameElement>(null);\n\n\tconst [iframeDimensions, setIframeDimensions] = useState({\n\t\twidth: \"400px\",\n\t\theight: \"500px\",\n\t});\n\n\tconst [markerPixelPos, setMarkerPixelPos] = useState<Point>();\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map?.map?.project) return;\n\n\t\tconst _pixelPos = mapHook.map.map.project([props.lng, props.lat]);\n\n\t\tsetMarkerPixelPos(_pixelPos);\n\t}, [mapHook.map, props.lng, props.lat, mapState.viewport]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\t!mapHook.map ||\n\t\t\t!iframe.current?.contentWindow?.document?.body?.scrollHeight\n\t\t)\n\t\t\treturn;\n\n\t\tlet mapHeight = mapHook.map.map._container.clientHeight;\n\n\t\tconst _pixelPos = mapHook.map.map.project([props.lng, props.lat]);\n\t\tlet pixelToBottom = mapHeight - _pixelPos.y;\n\t\tlet iframeHeight =\n\t\t\tiframe.current?.contentWindow?.document?.body?.scrollHeight;\n\t\tlet iframeWidth =\n\t\t\tiframe.current?.contentWindow?.document?.body?.scrollWidth;\n\n\t\tsetIframeDimensions({\n\t\t\twidth: iframeWidth + \"px\",\n\t\t\theight:\n\t\t\t\t(pixelToBottom < iframeHeight ? pixelToBottom : iframeHeight) + \"px\",\n\t\t});\n\t}, [props.lng, props.lat, props.content]);\n\n\treturn (\n\t\t<>\n\t\t\t<MlGeoJsonLayer\n\t\t\t\tgeojson={{\n\t\t\t\t\ttype: \"Feature\",\n\t\t\t\t\tgeometry: {\n\t\t\t\t\t\ttype: \"Point\",\n\t\t\t\t\t\tcoordinates: [props.lng, props.lat],\n\t\t\t\t\t},\n\t\t\t\t\tproperties: {},\n\t\t\t\t}}\n\t\t\t\tpaint={{\n\t\t\t\t\t\"circle-radius\": 14,\n\t\t\t\t\t\"circle-color\": \"rgba(40,200,20,0.5)\",\n\t\t\t\t}}\n\t\t\t\ttype=\"circle\"\n\t\t\t\tmapId={props.mapId}\n\t\t\t></MlGeoJsonLayer>\n\t\t\t{markerPixelPos && (\n\t\t\t\t<Paper\n\t\t\t\t\tsx={{\n\t\t\t\t\t\topacity: 0.7,\n\t\t\t\t\t\tposition: \"fixed\",\n\t\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\t\t/** TODO: fix positioning delay when moving the map */\n\t\t\t\t\t\tleft: markerPixelPos.x,\n\t\t\t\t\t\ttop: markerPixelPos.y,\n\t\t\t\t\t\twidth: iframeDimensions.width,\n\t\t\t\t\t\theight: iframeDimensions.height,\n\t\t\t\t\t\t\"&:hover\": {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tzIndex: -1,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<iframe\n\t\t\t\t\t\tstyle={{ width: \"100%\" }}\n\t\t\t\t\t\tsrcDoc={props.content}\n\t\t\t\t\t\tref={iframe}\n\t\t\t\t\t\tsandbox=\"allow-same-origin allow-popups-to-escape-sandbox\"\n\t\t\t\t\t\tframeBorder=\"0\"\n\t\t\t\t\t\ttitle={mapHook.componentId}\n\t\t\t\t\t></iframe>\n\t\t\t\t</Paper>\n\t\t\t)}\n\t\t</>\n\t);\n};\n\nMlMarker.defaultProps = {\n\tmapId: undefined,\n};\n\nexport default MlMarker;\n","import React, { useRef, useEffect, useState } from \"react\";\n\nimport PropTypes from \"prop-types\";\nimport useMap from \"../../hooks/useMap\";\n\n/**\n * Adds a standard OSM tile layer to the maplibre-gl instancereference by\n * props.mapId\n *\n * @component\n */\nconst MlOsmLayer = (props) => {\n\tconst mapHook = useMap({ mapId: props.mapId, waitForLayer: props.insertBeforeLayer });\n\n\tconst layerId = useRef(props.layerId || \"MlOsmLayer-\" + mapHook.componentId);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tmapHook.map.addSource(\n\t\t\tlayerId.current,\n\t\t\t{\n\t\t\t\ttype: \"raster\",\n\t\t\t\ttileSize: 256,\n\t\t\t\t...props.sourceOptions,\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\t\tmapHook.map.addLayer(\n\t\t\t{\n\t\t\t\tid: layerId.current,\n\t\t\t\ttype: \"raster\",\n\t\t\t\tsource: layerId.current,\n\t\t\t\tminzoom: 0,\n\t\t\t\tmaxzoom: 22,\n\t\t\t\t...props.layerOptions,\n\t\t\t},\n\t\t\tprops.insertBeforeLayer,\n\t\t\tmapHook.componentId\n\t\t);\n\t}, [props, mapHook.map]);\n\n\treturn <></>;\n};\n\nMlOsmLayer.propTypes = {\n\t/**\n\t * Id of the target MapLibre instance in mapHook\n\t */\n\tmapId: PropTypes.string,\n\t/**\n\t * Prefix of the component id this component uses when adding elements to the MapLibreGl-instance\n\t */\n\tidPrefix: PropTypes.string,\n\t/**\n\t * Options object that will be used as first parameter on the MapLibreGl.addSource call see MapLibre source options documentation.\n\t */\n\tsourceOptions: PropTypes.object,\n\t/**\n\t * Options object that will be used as first parameter on the MapLibreGl.addLayer call see MapLibre layer options documentation.\n\t *\n\t */\n\tlayerOptions: PropTypes.object,\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer: PropTypes.string,\n};\n\nexport default MlOsmLayer;\n","/**\n * https://github.com/mapbox/togeojson\n *\n * Copyright (c) 2016 Mapbox All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar toGeoJSON = (function () {\n\tvar removeSpace = /\\s*/g,\n\t\ttrimSpace = /^\\s*|\\s*$/g,\n\t\tsplitSpace = /\\s+/;\n\t// generate a short, numeric hash of a string\n\tfunction okhash(x) {\n\t\tif (!x || !x.length) return 0;\n\t\tfor (var i = 0, h = 0; i < x.length; i++) {\n\t\t\th = ((h << 5) - h + x.charCodeAt(i)) | 0;\n\t\t}\n\t\treturn h;\n\t}\n\t// all Y children of X\n\tfunction get(x, y) {\n\t\treturn x.getElementsByTagName(y);\n\t}\n\tfunction attr(x, y) {\n\t\treturn x.getAttribute(y);\n\t}\n\tfunction attrf(x, y) {\n\t\treturn parseFloat(attr(x, y));\n\t}\n\t// one Y child of X, if any, otherwise null\n\tfunction get1(x, y) {\n\t\tvar n = get(x, y);\n\t\treturn n.length ? n[0] : null;\n\t}\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Node.normalize\n\tfunction norm(el) {\n\t\tif (el.normalize) {\n\t\t\tel.normalize();\n\t\t}\n\t\treturn el;\n\t}\n\t// cast array x into numbers\n\tfunction numarray(x) {\n\t\tfor (var j = 0, o = []; j < x.length; j++) {\n\t\t\to[j] = parseFloat(x[j]);\n\t\t}\n\t\treturn o;\n\t}\n\t// get the content of a text node, if any\n\tfunction nodeVal(x) {\n\t\tif (x) {\n\t\t\tnorm(x);\n\t\t}\n\t\treturn (x && x.textContent) || \"\";\n\t}\n\t// get the contents of multiple text nodes, if present\n\tfunction getMulti(x, ys) {\n\t\tvar o = {},\n\t\t\tn,\n\t\t\tk;\n\t\tfor (k = 0; k < ys.length; k++) {\n\t\t\tn = get1(x, ys[k]);\n\t\t\tif (n) o[ys[k]] = nodeVal(n);\n\t\t}\n\t\treturn o;\n\t}\n\t// add properties of Y to X, overwriting if present in both\n\tfunction extend(x, y) {\n\t\tfor (var k in y) x[k] = y[k];\n\t}\n\t// get one coordinate from a coordinate array, if any\n\tfunction coord1(v) {\n\t\treturn numarray(v.replace(removeSpace, \"\").split(\",\"));\n\t}\n\t// get all coordinates from a coordinate array as [[],[]]\n\tfunction coord(v) {\n\t\tvar coords = v.replace(trimSpace, \"\").split(splitSpace),\n\t\t\to = [];\n\t\tfor (var i = 0; i < coords.length; i++) {\n\t\t\to.push(coord1(coords[i]));\n\t\t}\n\t\treturn o;\n\t}\n\tfunction coordPair(x) {\n\t\tvar ll = [attrf(x, \"lon\"), attrf(x, \"lat\")],\n\t\t\tele = get1(x, \"ele\"),\n\t\t\t// handle namespaced attribute in browser\n\t\t\theartRate = get1(x, \"gpxtpx:hr\") || get1(x, \"hr\"),\n\t\t\ttime = get1(x, \"time\"),\n\t\t\te;\n\t\tif (ele) {\n\t\t\te = parseFloat(nodeVal(ele));\n\t\t\tif (!isNaN(e)) {\n\t\t\t\tll.push(e);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tcoordinates: ll,\n\t\t\ttime: time ? nodeVal(time) : null,\n\t\t\theartRate: heartRate ? parseFloat(nodeVal(heartRate)) : null,\n\t\t};\n\t}\n\n\t// create a new feature collection parent object\n\tfunction fc() {\n\t\treturn {\n\t\t\ttype: \"FeatureCollection\",\n\t\t\tfeatures: [],\n\t\t};\n\t}\n\n\tvar serializer;\n\tif (typeof XMLSerializer !== \"undefined\") {\n\t\t/* istanbul ignore next */\n\t\tserializer = new XMLSerializer();\n\t} else {\n\t\tvar isNodeEnv = typeof process === \"object\" && !process.browser;\n\t\tvar isTitaniumEnv = typeof Titanium === \"object\";\n\t\tif (typeof exports === \"object\" && (isNodeEnv || isTitaniumEnv)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-var-requires, no-undef\n\t\t\tserializer = new (require(\"xmldom\").XMLSerializer)();\n\t\t} else {\n\t\t\tthrow new Error(\"Unable to initialize serializer\");\n\t\t}\n\t}\n\tfunction xml2str(str) {\n\t\t// IE9 will create a new XMLSerializer but it'll crash immediately.\n\t\t// This line is ignored because we don't run coverage tests in IE9\n\t\t/* istanbul ignore next */\n\t\tif (str.xml !== undefined) return str.xml;\n\t\treturn serializer.serializeToString(str);\n\t}\n\n\tvar t = {\n\t\tkml: function (doc) {\n\t\t\tvar gj = fc(),\n\t\t\t\t// styleindex keeps track of hashed styles in order to match features\n\t\t\t\tstyleIndex = {},\n\t\t\t\tstyleByHash = {},\n\t\t\t\t// stylemapindex keeps track of style maps to expose in properties\n\t\t\t\tstyleMapIndex = {},\n\t\t\t\t// atomic geospatial types supported by KML - MultiGeometry is\n\t\t\t\t// handled separately\n\t\t\t\tgeotypes = [\"Polygon\", \"LineString\", \"Point\", \"Track\", \"gx:Track\"],\n\t\t\t\t// all root placemarks in the file\n\t\t\t\tplacemarks = get(doc, \"Placemark\"),\n\t\t\t\tstyles = get(doc, \"Style\"),\n\t\t\t\tstyleMaps = get(doc, \"StyleMap\");\n\n\t\t\tfor (var k = 0; k < styles.length; k++) {\n\t\t\t\tvar hash = okhash(xml2str(styles[k])).toString(16);\n\t\t\t\tstyleIndex[\"#\" + attr(styles[k], \"id\")] = hash;\n\t\t\t\tstyleByHash[hash] = styles[k];\n\t\t\t}\n\t\t\tfor (var l = 0; l < styleMaps.length; l++) {\n\t\t\t\tstyleIndex[\"#\" + attr(styleMaps[l], \"id\")] = okhash(xml2str(styleMaps[l])).toString(16);\n\t\t\t\tvar pairs = get(styleMaps[l], \"Pair\");\n\t\t\t\tvar pairsMap = {};\n\t\t\t\tfor (var m = 0; m < pairs.length; m++) {\n\t\t\t\t\tpairsMap[nodeVal(get1(pairs[m], \"key\"))] = nodeVal(get1(pairs[m], \"styleUrl\"));\n\t\t\t\t}\n\t\t\t\tstyleMapIndex[\"#\" + attr(styleMaps[l], \"id\")] = pairsMap;\n\t\t\t}\n\t\t\tfor (var j = 0; j < placemarks.length; j++) {\n\t\t\t\tgj.features = gj.features.concat(getPlacemark(placemarks[j]));\n\t\t\t}\n\t\t\tfunction kmlColor(v) {\n\t\t\t\tvar color, opacity;\n\t\t\t\tv = v || \"\";\n\t\t\t\tif (v.substr(0, 1) === \"#\") {\n\t\t\t\t\tv = v.substr(1);\n\t\t\t\t}\n\t\t\t\tif (v.length === 6 || v.length === 3) {\n\t\t\t\t\tcolor = v;\n\t\t\t\t}\n\t\t\t\tif (v.length === 8) {\n\t\t\t\t\topacity = parseInt(v.substr(0, 2), 16) / 255;\n\t\t\t\t\tcolor = \"#\" + v.substr(6, 2) + v.substr(4, 2) + v.substr(2, 2);\n\t\t\t\t}\n\t\t\t\treturn [color, isNaN(opacity) ? undefined : opacity];\n\t\t\t}\n\t\t\tfunction gxCoord(v) {\n\t\t\t\treturn numarray(v.split(\" \"));\n\t\t\t}\n\t\t\tfunction gxCoords(root) {\n\t\t\t\tvar elems = get(root, \"coord\", \"gx\"),\n\t\t\t\t\tcoords = [],\n\t\t\t\t\ttimes = [];\n\t\t\t\tif (elems.length === 0) elems = get(root, \"gx:coord\");\n\t\t\t\tfor (var i = 0; i < elems.length; i++) coords.push(gxCoord(nodeVal(elems[i])));\n\t\t\t\tvar timeElems = get(root, \"when\");\n\t\t\t\tfor (var j = 0; j < timeElems.length; j++) times.push(nodeVal(timeElems[j]));\n\t\t\t\treturn {\n\t\t\t\t\tcoords: coords,\n\t\t\t\t\ttimes: times,\n\t\t\t\t};\n\t\t\t}\n\t\t\tfunction getGeometry(root) {\n\t\t\t\tvar geomNode,\n\t\t\t\t\tgeomNodes,\n\t\t\t\t\ti,\n\t\t\t\t\tj,\n\t\t\t\t\tk,\n\t\t\t\t\tgeoms = [],\n\t\t\t\t\tcoordTimes = [];\n\t\t\t\tif (get1(root, \"MultiGeometry\")) {\n\t\t\t\t\treturn getGeometry(get1(root, \"MultiGeometry\"));\n\t\t\t\t}\n\t\t\t\tif (get1(root, \"MultiTrack\")) {\n\t\t\t\t\treturn getGeometry(get1(root, \"MultiTrack\"));\n\t\t\t\t}\n\t\t\t\tif (get1(root, \"gx:MultiTrack\")) {\n\t\t\t\t\treturn getGeometry(get1(root, \"gx:MultiTrack\"));\n\t\t\t\t}\n\t\t\t\tfor (i = 0; i < geotypes.length; i++) {\n\t\t\t\t\tgeomNodes = get(root, geotypes[i]);\n\t\t\t\t\tif (geomNodes) {\n\t\t\t\t\t\tfor (j = 0; j < geomNodes.length; j++) {\n\t\t\t\t\t\t\tgeomNode = geomNodes[j];\n\t\t\t\t\t\t\tif (geotypes[i] === \"Point\") {\n\t\t\t\t\t\t\t\tgeoms.push({\n\t\t\t\t\t\t\t\t\ttype: \"Point\",\n\t\t\t\t\t\t\t\t\tcoordinates: coord1(nodeVal(get1(geomNode, \"coordinates\"))),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else if (geotypes[i] === \"LineString\") {\n\t\t\t\t\t\t\t\tgeoms.push({\n\t\t\t\t\t\t\t\t\ttype: \"LineString\",\n\t\t\t\t\t\t\t\t\tcoordinates: coord(nodeVal(get1(geomNode, \"coordinates\"))),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else if (geotypes[i] === \"Polygon\") {\n\t\t\t\t\t\t\t\tvar rings = get(geomNode, \"LinearRing\"),\n\t\t\t\t\t\t\t\t\tcoords = [];\n\t\t\t\t\t\t\t\tfor (k = 0; k < rings.length; k++) {\n\t\t\t\t\t\t\t\t\tcoords.push(coord(nodeVal(get1(rings[k], \"coordinates\"))));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tgeoms.push({\n\t\t\t\t\t\t\t\t\ttype: \"Polygon\",\n\t\t\t\t\t\t\t\t\tcoordinates: coords,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else if (geotypes[i] === \"Track\" || geotypes[i] === \"gx:Track\") {\n\t\t\t\t\t\t\t\tvar track = gxCoords(geomNode);\n\t\t\t\t\t\t\t\tgeoms.push({\n\t\t\t\t\t\t\t\t\ttype: \"LineString\",\n\t\t\t\t\t\t\t\t\tcoordinates: track.coords,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tif (track.times.length) coordTimes.push(track.times);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tgeoms: geoms,\n\t\t\t\t\tcoordTimes: coordTimes,\n\t\t\t\t};\n\t\t\t}\n\t\t\tfunction getPlacemark(root) {\n\t\t\t\tvar geomsAndTimes = getGeometry(root),\n\t\t\t\t\ti,\n\t\t\t\t\tproperties = {},\n\t\t\t\t\tname = nodeVal(get1(root, \"name\")),\n\t\t\t\t\taddress = nodeVal(get1(root, \"address\")),\n\t\t\t\t\tstyleUrl = nodeVal(get1(root, \"styleUrl\")),\n\t\t\t\t\tdescription = nodeVal(get1(root, \"description\")),\n\t\t\t\t\ttimeSpan = get1(root, \"TimeSpan\"),\n\t\t\t\t\ttimeStamp = get1(root, \"TimeStamp\"),\n\t\t\t\t\textendedData = get1(root, \"ExtendedData\"),\n\t\t\t\t\tlineStyle = get1(root, \"LineStyle\"),\n\t\t\t\t\tpolyStyle = get1(root, \"PolyStyle\"),\n\t\t\t\t\tvisibility = get1(root, \"visibility\");\n\n\t\t\t\tif (!geomsAndTimes.geoms.length) return [];\n\t\t\t\tif (name) properties.name = name;\n\t\t\t\tif (address) properties.address = address;\n\t\t\t\tif (styleUrl) {\n\t\t\t\t\tif (styleUrl[0] !== \"#\") {\n\t\t\t\t\t\tstyleUrl = \"#\" + styleUrl;\n\t\t\t\t\t}\n\n\t\t\t\t\tproperties.styleUrl = styleUrl;\n\t\t\t\t\tif (styleIndex[styleUrl]) {\n\t\t\t\t\t\tproperties.styleHash = styleIndex[styleUrl];\n\t\t\t\t\t}\n\t\t\t\t\tif (styleMapIndex[styleUrl]) {\n\t\t\t\t\t\tproperties.styleMapHash = styleMapIndex[styleUrl];\n\t\t\t\t\t\tproperties.styleHash = styleIndex[styleMapIndex[styleUrl].normal];\n\t\t\t\t\t}\n\t\t\t\t\t// Try to populate the lineStyle or polyStyle since we got the style hash\n\t\t\t\t\tvar style = styleByHash[properties.styleHash];\n\t\t\t\t\tif (style) {\n\t\t\t\t\t\tif (!lineStyle) lineStyle = get1(style, \"LineStyle\");\n\t\t\t\t\t\tif (!polyStyle) polyStyle = get1(style, \"PolyStyle\");\n\t\t\t\t\t\tvar iconStyle = get1(style, \"IconStyle\");\n\t\t\t\t\t\tif (iconStyle) {\n\t\t\t\t\t\t\tvar icon = get1(iconStyle, \"Icon\");\n\t\t\t\t\t\t\tif (icon) {\n\t\t\t\t\t\t\t\tvar href = nodeVal(get1(icon, \"href\"));\n\t\t\t\t\t\t\t\tif (href) properties.icon = href;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (description) properties.description = description;\n\t\t\t\tif (timeSpan) {\n\t\t\t\t\tvar begin = nodeVal(get1(timeSpan, \"begin\"));\n\t\t\t\t\tvar end = nodeVal(get1(timeSpan, \"end\"));\n\t\t\t\t\tproperties.timespan = { begin: begin, end: end };\n\t\t\t\t}\n\t\t\t\tif (timeStamp) {\n\t\t\t\t\tproperties.timestamp = nodeVal(get1(timeStamp, \"when\"));\n\t\t\t\t}\n\t\t\t\tif (lineStyle) {\n\t\t\t\t\tvar linestyles = kmlColor(nodeVal(get1(lineStyle, \"color\"))),\n\t\t\t\t\t\tcolor = linestyles[0],\n\t\t\t\t\t\topacity = linestyles[1],\n\t\t\t\t\t\twidth = parseFloat(nodeVal(get1(lineStyle, \"width\")));\n\t\t\t\t\tif (color) properties.stroke = color;\n\t\t\t\t\tif (!isNaN(opacity)) properties[\"stroke-opacity\"] = opacity;\n\t\t\t\t\tif (!isNaN(width)) properties[\"stroke-width\"] = width;\n\t\t\t\t}\n\t\t\t\tif (polyStyle) {\n\t\t\t\t\tvar polystyles = kmlColor(nodeVal(get1(polyStyle, \"color\"))),\n\t\t\t\t\t\tpcolor = polystyles[0],\n\t\t\t\t\t\tpopacity = polystyles[1],\n\t\t\t\t\t\tfill = nodeVal(get1(polyStyle, \"fill\")),\n\t\t\t\t\t\toutline = nodeVal(get1(polyStyle, \"outline\"));\n\t\t\t\t\tif (pcolor) properties.fill = pcolor;\n\t\t\t\t\tif (!isNaN(popacity)) properties[\"fill-opacity\"] = popacity;\n\t\t\t\t\tif (fill) properties[\"fill-opacity\"] = fill === \"1\" ? properties[\"fill-opacity\"] || 1 : 0;\n\t\t\t\t\tif (outline)\n\t\t\t\t\t\tproperties[\"stroke-opacity\"] = outline === \"1\" ? properties[\"stroke-opacity\"] || 1 : 0;\n\t\t\t\t}\n\t\t\t\tif (extendedData) {\n\t\t\t\t\tvar datas = get(extendedData, \"Data\"),\n\t\t\t\t\t\tsimpleDatas = get(extendedData, \"SimpleData\");\n\n\t\t\t\t\tfor (i = 0; i < datas.length; i++) {\n\t\t\t\t\t\tproperties[datas[i].getAttribute(\"name\")] = nodeVal(get1(datas[i], \"value\"));\n\t\t\t\t\t}\n\t\t\t\t\tfor (i = 0; i < simpleDatas.length; i++) {\n\t\t\t\t\t\tproperties[simpleDatas[i].getAttribute(\"name\")] = nodeVal(simpleDatas[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (visibility) {\n\t\t\t\t\tproperties.visibility = nodeVal(visibility);\n\t\t\t\t}\n\t\t\t\tif (geomsAndTimes.coordTimes.length) {\n\t\t\t\t\tproperties.coordTimes =\n\t\t\t\t\t\tgeomsAndTimes.coordTimes.length === 1\n\t\t\t\t\t\t\t? geomsAndTimes.coordTimes[0]\n\t\t\t\t\t\t\t: geomsAndTimes.coordTimes;\n\t\t\t\t}\n\t\t\t\tvar feature = {\n\t\t\t\t\ttype: \"Feature\",\n\t\t\t\t\tgeometry:\n\t\t\t\t\t\tgeomsAndTimes.geoms.length === 1\n\t\t\t\t\t\t\t? geomsAndTimes.geoms[0]\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\ttype: \"GeometryCollection\",\n\t\t\t\t\t\t\t\t\tgeometries: geomsAndTimes.geoms,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\tproperties: properties,\n\t\t\t\t};\n\t\t\t\tif (attr(root, \"id\")) feature.id = attr(root, \"id\");\n\t\t\t\treturn [feature];\n\t\t\t}\n\t\t\treturn gj;\n\t\t},\n\t\tgpx: function (doc) {\n\t\t\tvar i,\n\t\t\t\ttracks = get(doc, \"trk\"),\n\t\t\t\troutes = get(doc, \"rte\"),\n\t\t\t\twaypoints = get(doc, \"wpt\"),\n\t\t\t\t// a feature collection\n\t\t\t\tgj = fc(),\n\t\t\t\tfeature;\n\t\t\tfor (i = 0; i < tracks.length; i++) {\n\t\t\t\tfeature = getTrack(tracks[i]);\n\t\t\t\tif (feature) gj.features.push(feature);\n\t\t\t}\n\t\t\tfor (i = 0; i < routes.length; i++) {\n\t\t\t\tfeature = getRoute(routes[i]);\n\t\t\t\tif (feature) gj.features.push(feature);\n\t\t\t}\n\t\t\tfor (i = 0; i < waypoints.length; i++) {\n\t\t\t\tgj.features.push(getPoint(waypoints[i]));\n\t\t\t}\n\t\t\tfunction initializeArray(arr, size) {\n\t\t\t\tfor (var h = 0; h < size; h++) {\n\t\t\t\t\tarr.push(null);\n\t\t\t\t}\n\t\t\t\treturn arr;\n\t\t\t}\n\t\t\tfunction getPoints(node, pointname) {\n\t\t\t\tvar pts = get(node, pointname),\n\t\t\t\t\tline = [],\n\t\t\t\t\ttimes = [],\n\t\t\t\t\theartRates = [],\n\t\t\t\t\tl = pts.length;\n\t\t\t\tif (l < 2) return {}; // Invalid line in GeoJSON\n\t\t\t\tfor (var i = 0; i < l; i++) {\n\t\t\t\t\tvar c = coordPair(pts[i]);\n\t\t\t\t\tline.push(c.coordinates);\n\t\t\t\t\tif (c.time) times.push(c.time);\n\t\t\t\t\tif (c.heartRate || heartRates.length) {\n\t\t\t\t\t\tif (!heartRates.length) initializeArray(heartRates, i);\n\t\t\t\t\t\theartRates.push(c.heartRate || null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tline: line,\n\t\t\t\t\ttimes: times,\n\t\t\t\t\theartRates: heartRates,\n\t\t\t\t};\n\t\t\t}\n\t\t\tfunction getTrack(node) {\n\t\t\t\tvar segments = get(node, \"trkseg\"),\n\t\t\t\t\ttrack = [],\n\t\t\t\t\ttimes = [],\n\t\t\t\t\theartRates = [],\n\t\t\t\t\tline;\n\t\t\t\tfor (var i = 0; i < segments.length; i++) {\n\t\t\t\t\tline = getPoints(segments[i], \"trkpt\");\n\t\t\t\t\tif (line) {\n\t\t\t\t\t\tif (line.line) track.push(line.line);\n\t\t\t\t\t\tif (line.times && line.times.length) times.push(line.times);\n\t\t\t\t\t\tif (heartRates.length || (line.heartRates && line.heartRates.length)) {\n\t\t\t\t\t\t\tif (!heartRates.length) {\n\t\t\t\t\t\t\t\tfor (var s = 0; s < i; s++) {\n\t\t\t\t\t\t\t\t\theartRates.push(initializeArray([], track[s].length));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (line.heartRates && line.heartRates.length) {\n\t\t\t\t\t\t\t\theartRates.push(line.heartRates);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\theartRates.push(initializeArray([], line.line.length || 0));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (track.length === 0) return;\n\t\t\t\tvar properties = getProperties(node);\n\t\t\t\textend(properties, getLineStyle(get1(node, \"extensions\")));\n\t\t\t\tif (times.length) properties.coordTimes = track.length === 1 ? times[0] : times;\n\t\t\t\tif (heartRates.length)\n\t\t\t\t\tproperties.heartRates = track.length === 1 ? heartRates[0] : heartRates;\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Feature\",\n\t\t\t\t\tproperties: properties,\n\t\t\t\t\tgeometry: {\n\t\t\t\t\t\ttype: track.length === 1 ? \"LineString\" : \"MultiLineString\",\n\t\t\t\t\t\tcoordinates: track.length === 1 ? track[0] : track,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t\tfunction getRoute(node) {\n\t\t\t\tvar line = getPoints(node, \"rtept\");\n\t\t\t\tif (!line.line) return;\n\t\t\t\tvar prop = getProperties(node);\n\t\t\t\textend(prop, getLineStyle(get1(node, \"extensions\")));\n\t\t\t\tvar routeObj = {\n\t\t\t\t\ttype: \"Feature\",\n\t\t\t\t\tproperties: prop,\n\t\t\t\t\tgeometry: {\n\t\t\t\t\t\ttype: \"LineString\",\n\t\t\t\t\t\tcoordinates: line.line,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn routeObj;\n\t\t\t}\n\t\t\tfunction getPoint(node) {\n\t\t\t\tvar prop = getProperties(node);\n\t\t\t\textend(prop, getMulti(node, [\"sym\"]));\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Feature\",\n\t\t\t\t\tproperties: prop,\n\t\t\t\t\tgeometry: {\n\t\t\t\t\t\ttype: \"Point\",\n\t\t\t\t\t\tcoordinates: coordPair(node).coordinates,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t\tfunction getLineStyle(extensions) {\n\t\t\t\tvar style = {};\n\t\t\t\tif (extensions) {\n\t\t\t\t\tvar lineStyle = get1(extensions, \"line\");\n\t\t\t\t\tif (lineStyle) {\n\t\t\t\t\t\tvar color = nodeVal(get1(lineStyle, \"color\")),\n\t\t\t\t\t\t\topacity = parseFloat(nodeVal(get1(lineStyle, \"opacity\"))),\n\t\t\t\t\t\t\twidth = parseFloat(nodeVal(get1(lineStyle, \"width\")));\n\t\t\t\t\t\tif (color) style.stroke = color;\n\t\t\t\t\t\tif (!isNaN(opacity)) style[\"stroke-opacity\"] = opacity;\n\t\t\t\t\t\t// GPX width is in mm, convert to px with 96 px per inch\n\t\t\t\t\t\tif (!isNaN(width)) style[\"stroke-width\"] = (width * 96) / 25.4;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn style;\n\t\t\t}\n\t\t\tfunction getProperties(node) {\n\t\t\t\tvar prop = getMulti(node, [\"name\", \"cmt\", \"desc\", \"type\", \"time\", \"keywords\"]),\n\t\t\t\t\tlinks = get(node, \"link\");\n\t\t\t\tif (links.length) prop.links = [];\n\t\t\t\tfor (var i = 0, link; i < links.length; i++) {\n\t\t\t\t\tlink = { href: attr(links[i], \"href\") };\n\t\t\t\t\textend(link, getMulti(links[i], [\"text\", \"type\"]));\n\t\t\t\t\tprop.links.push(link);\n\t\t\t\t}\n\t\t\t\treturn prop;\n\t\t\t}\n\t\t\treturn gj;\n\t\t},\n\t};\n\treturn t;\n})();\n\nexport default toGeoJSON;\n","import { useState, useEffect } from 'react';\nimport toGeoJSON from './lib/gpxConverter';\nimport { FeatureCollection } from '@turf/turf';\n\ninterface useGpxProps {\n\t/**\n\t * a string containing GPX data that is supposed to be parsed and converted to GeoJSON by this hook\n\t */\n\tdata?: string;\n}\n\nexport interface MetadataType {\n\ttitle: string;\n\tvalue: string;\n\tid: number;\n}\n\n/**\n * useGpx hook converts GPX data to GeoJSON\n *\n */\nconst useGpx = (props: useGpxProps) => {\n\tconst [geojson, setGeojson] = useState<FeatureCollection | undefined>();\n\tconst [metadata, setMetadata] = useState<MetadataType[]>([]);\n\n\tconst parseGpx = (gpxAsString: string) => {\n\t\ttry {\n\t\t\tsetMetadata([]);\n\t\t\tconst domParser = new DOMParser();\n\t\t\tconst gpxDoc = domParser.parseFromString(gpxAsString, 'application/xml');\n\t\t\tconst metadata = gpxDoc.querySelector('metadata');\n\t\t\tmetadata?.childNodes.forEach((node: Element) => {\n\t\t\t\tlet value = node.textContent;\n\t\t\t\tconst title = node.nodeName;\n\n\t\t\t\tif (node.nodeName === 'link') {\n\t\t\t\t\tvalue = node.getAttribute('href');\n\t\t\t\t}\n\t\t\t\tif (value?.trim().length) {\n\t\t\t\t\tconst metaDataEntry = {\n\t\t\t\t\t\ttitle: title,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tid: new Date().getTime(),\n\t\t\t\t\t};\n\t\t\t\t\tsetMetadata((prevState) => [...prevState, metaDataEntry]);\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst data = toGeoJSON.gpx(gpxDoc);\n\t\t\tsetGeojson(data as FeatureCollection);\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (!props.data) return;\n\n\t\tparseGpx(props.data);\n\t}, [props.data]);\n\n\treturn {\n\t\tgeojson,\n\t\tmetadata,\n\t};\n};\n\nuseGpx.defaultProps = {\n\tdata: undefined,\n};\nexport default useGpx;\n","import React, { useRef, useEffect } from 'react';\nimport useMap from '../../hooks/useMap';\nimport { GeoJSONFeature } from 'maplibre-gl';\nimport {\n\tLngLatLike,\n\tPopup,\n\tMapEventType,\n} from 'maplibre-gl';\n\ninterface useLayerHoverPopupProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Id of an existing layer in the mapLibre instance this event will be registered to\n\t */\n\tlayerId?: string;\n\tgetPopupContent: (feature: GeoJSONFeature) => string;\n}\n\n/**\n * useLayerHoverPopup hook registers a mouseenter event to display feature properties in a MapLibre popup if a feature on the configured layer is hovered\n *\n */\nconst useLayerHoverPopup = (props: useLayerHoverPopupProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.layerId,\n\t});\n\tconst popup = useRef(\n\t\tnew Popup({\n\t\t\tcloseButton: false,\n\t\t\tcloseOnClick: true,\n\t\t})\n\t);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !props.layerId) return;\n\t\tmapHook.map.on(\n\t\t\t'mouseenter',\n\t\t\tprops.layerId,\n\t\t\t(\n\t\t\t\te: MapEventType & {\n\t\t\t\t\tfeatures?: ({[key:string]:string} & { geometry:{coordinates:[number,number]}})[] | undefined;\n\t\t\t\t\tlngLat: { lng: number; lat: number };\n\t\t\t\t}\n\t\t\t) => {\n\t\t\t\tif (!mapHook.map) return;\n\t\t\t\t// Change the cursor style as a UI indicator.\n\n\t\t\t\tconst coordinates = e?.features?.[0].geometry.coordinates.slice();\n\t\t\t\t//const description = e.features[0].properties.desc;\n\t\t\t\tlet content = '';\n\t\t\t\tif (e?.features?.[0] && typeof props.getPopupContent === 'function') {\n\t\t\t\t\tcontent = props.getPopupContent(e.features[0] as unknown as GeoJSONFeature);\n\t\t\t\t}\n\n\t\t\t\tif (coordinates?.[0]) {\n\t\t\t\t\t// Ensure that if the map is zoomed out such that multiple\n\t\t\t\t\t// copies of the feature are visible, the popup appears\n\t\t\t\t\t// over the copy being pointed to.\n\t\t\t\t\twhile (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {\n\t\t\t\t\t\tcoordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Populate the popup and set its coordinates\n\n\t\t\t\t\t// based on the feature found.\n\t\t\t\t\tpopup.current.setLngLat(coordinates as LngLatLike).setHTML(content).addTo(mapHook.map.map);\n\t\t\t\t}\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\t}, [mapHook.map]);\n\n\treturn <></>;\n};\n\nuseLayerHoverPopup.defaultProps = {\n\tmapId: undefined,\n};\nexport default useLayerHoverPopup;\n","import { useEffect, useRef, useCallback, useState } from \"react\";\nimport useMap, { useMapType } from \"./useMap\";\nimport MapLibreGlWrapper from \"../components/MapLibreMap/lib/MapLibreGlWrapper\";\nimport { Source, SourceSpecification } from \"maplibre-gl\";\n\ntype useSourceType = {\n\tmap: MapLibreGlWrapper | undefined;\n\tsource: Source | undefined;\n\tcomponentId: string;\n\tmapHook: useMapType;\n};\ninterface useSourceProps {\n\tmapId?: string;\n\tidPrefix?: string;\n\tsource: SourceSpecification;\n\tsourceId: string;\n}\n\nfunction useSource(props: useSourceProps): useSourceType {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t});\n\n\tconst initializedRef = useRef<boolean>(false);\n\tconst [source, setSource] = useState<Source>();\n\tconst sourceId = useRef(\n\t\tprops.sourceId || (props.idPrefix ? props.idPrefix : \"Source-\") + mapHook.componentId\n\t);\n\n\tconst createSource = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\t\tinitializedRef.current = true;\n\n\t\tif (mapHook.map.map.getSource(sourceId.current)) {\n\t\t\tmapHook.cleanup();\n\t\t}\n\n\t\tmapHook.map?.addSource(sourceId.current, {\n\t\t\t...props.source,\n\t\t}, mapHook.componentId);\n\n\t\tsetSource(mapHook.map.map.getSource(sourceId.current));\n\t}, [props, mapHook.map]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || initializedRef.current) return;\n\t\tcreateSource();\n\t}, [mapHook.map, props, createSource]);\n\n\tuseEffect(() => {\n\t\tif (!initializedRef.current || !mapHook.map?.map?.getSource(props.sourceId)) return;\n\n\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t//@ts-ignore setData only exists on GeoJsonSource\n\t\tmapHook.map.map.getSource(props.sourceId)?.setData?.(props.source.data);\n\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t//@ts-ignore data only exists on GeoJsonSource\n\t}, [props.source?.data]);\n\n\t//cleanup\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tinitializedRef.current = false;\n\t\t\tif (mapHook.map && mapHook.map?.map?.style?._layers) {\n\t\t\t\tfor (const [layerId, layer] of Object.entries(mapHook.map.map.style._layers)) {\n\t\t\t\t\tif (layer.source === sourceId.current) {\n\t\t\t\t\t\tmapHook.map.map.removeLayer(layerId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmapHook.map.map.removeSource(sourceId.current);\n\t\t\t}\n\t\t};\n\t}, [mapHook.map]);\n\n\treturn {\n\t\tmap: mapHook.map,\n\t\tsource: source,\n\t\tcomponentId: mapHook.componentId,\n\t\tmapHook: mapHook,\n\t};\n}\n\nexport default useSource;\n","import React, { useEffect, useRef } from 'react';\nimport { bbox, featureCollection, FeatureCollection } from '@turf/turf';\nimport { LngLatBoundsLike } from 'maplibre-gl';\nimport useMap from '../../hooks/useMap';\nimport useGpx, { MetadataType } from '../../hooks/useGpx/useGpx';\nimport useLayerHoverPopup from '../../hooks/useLayerHoverPopup/useLayerHoverPopup';\nimport useSource from '../../hooks/useSource';\nimport useLayer from '../../hooks/useLayer';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport interface MlGpxViewerProps {\n\t/**\n\t * Id of the target MapLibre instance in mapHook\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Prefix of the component id this component uses when adding elements to the MapLibreGl-instance\n\t */\n\tidPrefix?: string;\n\tgpxData: string | undefined;\n\tonParseGpxData: (arg0: {\n\t\tgeojson: FeatureCollection | undefined;\n\t\tmetadata: MetadataType[];\n\t}) => void;\n}\n\n/**\n * MlGpxViewer visualizes a given GPX Track on the map\n */\nconst MlGpxViewer = (props: MlGpxViewerProps) => {\n\tconst parsedGpx = useGpx({ data: props.gpxData });\n\tconst mapHook = useMap({ mapId: props.mapId, waitForLayer: props.insertBeforeLayer });\n\tconst sourceName = useRef('gpx-viewer-source-' + uuidv4());\n\tconst layerNameLines = useRef('importer-layer-lines-' + uuidv4());\n\tconst layerNamePoints = useRef('importer-layer-points-' + uuidv4());\n\n\tuseLayerHoverPopup({\n\t\tlayerId: layerNamePoints.current,\n\t\tgetPopupContent: (feature) => feature?.properties?.name,\n\t});\n\n\tuseSource({\n\t\tmapId: props.mapId,\n\t\tsourceId: sourceName.current,\n\t\tsource: {\n\t\t\ttype: 'geojson',\n\t\t\tdata: parsedGpx.geojson || featureCollection([]),\n\t\t},\n\t});\n\n\tuseLayer({\n\t\tlayerId: layerNameLines.current,\n\t\tsource: sourceName.current,\n\t\toptions: {\n\t\t\ttype: 'line',\n\t\t\tpaint: {\n\t\t\t\t'line-width': 4,\n\t\t\t\t'line-color': 'rgba(212, 55, 23,0.5)',\n\t\t\t},\n\t\t},\n\t\tinsertBeforeLayer: props.insertBeforeLayer,\n\t});\n\n\tuseLayer({\n\t\tlayerId: layerNamePoints.current,\n\t\tsource: sourceName.current,\n\t\toptions: {\n\t\t\ttype: 'circle',\n\t\t\tpaint: {\n\t\t\t\t'circle-color': 'rgba(72, 77, 99,0.5)',\n\t\t\t\t'circle-radius': 7,\n\t\t\t},\n\t\t\tfilter: ['==', '$type', 'Point'],\n\t\t},\n\t\tinsertBeforeLayer: props.insertBeforeLayer,\n\t});\n\n\tuseEffect(() => {\n\n\t if (!mapHook.map || !parsedGpx.geojson) return;\n\n\t\tif (typeof props.onParseGpxData === 'function') {\n\t\t\tprops.onParseGpxData(parsedGpx);\n\t\t}\n\t\t\n\t\t// fit map view to GeoJSON bbox\n\t\t\n\t\tconst bounds = bbox(parsedGpx.geojson);\n\t\tmapHook.map.map.fitBounds(bounds as LngLatBoundsLike);\n\t\t\t\t\n\t}, [parsedGpx]);\n\n\treturn <></>;\n};\n\nMlGpxViewer.defaultProps = {};\n\nexport default MlGpxViewer;\n","import React from \"react\";\nimport { FeatureCollection } from '@turf/turf';\n\ntype ContextProps = { \n\t\tdata: FeatureCollection,\n\t\tsetData: Function,\n\t\tgetEmptyFeatureCollection: Function\n\t};\n\nconst GeoJsonContext = React.createContext<Partial<ContextProps>>({});\n\nexport const GeoJsonContextProvider = GeoJsonContext.Provider;\nexport default GeoJsonContext;\n","import React, { useState } from \"react\";\nimport { GeoJsonContextProvider } from \"./GeoJsonContext\";\nimport { FeatureCollection } from '@turf/turf';\n\nconst GeoJsonProvider = ({ children }:{children:JSX.Element}) => {\n\tconst [data, setData] = useState<FeatureCollection>({\n\t\ttype: \"FeatureCollection\",\n\t\tfeatures: [],\n\t});\n\tconst getEmptyFeatureCollection = () => {\n\t\treturn {\n\t\t\ttype: \"FeatureCollection\",\n\t\t\tfeatures: [],\n\t\t};\n\t};\n\tconst value = {\n\t\tdata,\n\t\tsetData,\n\t\tgetEmptyFeatureCollection,\n\t};\n\n\treturn <GeoJsonContextProvider value={value}>{children}</GeoJsonContextProvider>;\n};\n\nexport default GeoJsonProvider;\n","import React, { useRef, useEffect, useContext, useState, useCallback } from 'react';\nimport PropTypes from 'prop-types';\n\nimport MapContext from '../../contexts/MapContext';\nimport { v4 as uuidv4 } from 'uuid';\nimport useMapState from '../../hooks/useMapState';\nimport MapLibreGlWrapper from '../MapLibreMap/lib/MapLibreGlWrapper';\n\nexport interface MapState {\n\tlat?: number;\n\tlng?: number;\n\tzoom?: number;\n\tbearing?: number;\n\tpitch?: number;\n\tlayers?: {\n\t\tvisible: boolean;\n\t\tid: string;\n\t}[];\n}\n\nconst getCurrentUrlParameters = (): MapState => {\n\tconst currentParams = Object.fromEntries(new URLSearchParams(window.location.search));\n\tcurrentParams.layers = JSON.parse(currentParams?.layers ? currentParams.layers : '[]');\n\n\treturn currentParams;\n};\n\nconst initialUrlParams = getCurrentUrlParameters();\n\n/**\n * TODO: Add short & useful description\n *\n * @param {object} props\n * @param {string} props.mapId Id of the target MapLibre instance in mapContext\n *\n * @component\n */\n\nexport interface MlShareMapStateProps {\n\t//\n\tmapId?: string;\n\tidPrefix?: string;\n\tactive?: boolean;\n}\n\nexport interface LayerStatesInterface {\n\t//\n\t[key: string]: boolean;\n}\n\nconst MlShareMapState = (props: MlShareMapStateProps) => {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tconst mapContext = useContext(MapContext);\n\tconst initializedRef = useRef(false);\n\tconst mapRef = useRef<MapLibreGlWrapper | undefined>();\n\tconst [map, setMap] = useState<MapLibreGlWrapper | undefined>(undefined);\n\tconst layersFromUrlParamsRef = useRef({});\n\tconst componentId = useRef((props.idPrefix ? props.idPrefix : 'MlShareMapState-') + uuidv4());\n\tconst mapState = useMapState({\n\t\twatch: {\n\t\t\tviewport: false,\n\t\t\tlayers: true,\n\t\t\tsources: false,\n\t\t},\n\t\tfilter: {\n\t\t\tincludeBaseLayers: false,\n\t\t},\n\t});\n\n\tconst allStatesRestoredRef = useRef(false);\n\tconst layerStatesRestored = useRef<LayerStatesInterface>();\n\tconst restoredStatesRef = useRef({\n\t\tviewport: {\n\t\t\tcenter: false,\n\t\t\tbearing: false,\n\t\t\tpitch: false,\n\t\t\tzoom: false,\n\t\t},\n\t\tlayers: {\n\t\t\t...layersFromUrlParamsRef,\n\t\t},\n\t});\n\n\t// initial URL-Params\n\tconst mapStateRef = useRef<MapState>({});\n\n\tconst refreshUrlParameters = useCallback(() => {\n\t\tif (!props.active) return;\n\n\t\tconst mapLayers = [];\n\t\tfor (const x in mapState.layers) {\n\t\t\tmapLayers.push({\n\t\t\t\tid: mapState.layers[x]?.id,\n\t\t\t\ttype: mapState.layers[x]?.type,\n\t\t\t\tvisible: mapState.layers[x]?.visible,\n\t\t\t});\n\t\t}\n\t\trefreshMapState();\n\t\tconst urlParams = new URLSearchParams({\n\t\t\t...(getCurrentUrlParameters() as Record<string, string>),\n\t\t\t...(mapStateRef.current as Record<string, string>),\n\t\t\tlayers: JSON.stringify(mapLayers),\n\t\t});\n\t\tJSON.parse(Object.fromEntries(urlParams).layers).forEach((el: { id: number }) => {\n\t\t\t// is iD a number?\n\t\t\tlayersFromUrlParamsRef.current[el.id] = false;\n\t\t});\n\n\t\tconst currentParams = new URLSearchParams(window.location.search);\n\t\tif (urlParams.toString() !== currentParams.toString()) {\n\t\t\twindow.history.pushState(\n\t\t\t\t{ ...mapStateRef.current },\n\t\t\t\tdocument.title,\n\t\t\t\t'?' + urlParams.toString()\n\t\t\t);\n\t\t}\n\t}, [mapState.layers, props.active]);\n\n\tuseEffect(() => {\n\t\tconst _componentId = componentId.current;\n\n\t\tmapStateRef.current = getCurrentUrlParameters();\n\n\t\treturn () => {\n\t\t\t// This is the cleanup function, it is called when this react component is removed from react-dom\n\t\t\t// try to remove anything this component has added to the MapLibre-gl instance\n\t\t\t// e.g.: remove the layer\n\t\t\t// mapContext.getMap(props.mapId).removeLayer(layerRef.current);\n\t\t\t// check for the existence of map.style before calling getLayer or getSource\n\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.cleanup(_componentId);\n\t\t\t\tmapRef.current = undefined;\n\t\t\t}\n\t\t\tinitializedRef.current = false;\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!mapRef.current) return;\n\n\t\trefreshUrlParameters();\n\t}, [refreshUrlParameters]);\n\n\tuseEffect(() => {\n\t\tif (!mapRef.current) return;\n\n\t\tconst _refreshUrlParameters = refreshUrlParameters;\n\n\t\tmapRef.current.on('moveend', _refreshUrlParameters, componentId.current);\n\n\t\treturn () => {\n\t\t\tmapRef.current?.map.off('moveend', _refreshUrlParameters);\n\t\t};\n\t}, [refreshUrlParameters, map]);\n\n\tuseEffect(() => {\n\t\tif (!mapContext?.mapExists?.(props.mapId) || initializedRef.current) return;\n\t\t// the MapLibre-gl instance (mapContext.getMap(props.mapId)) is accessible here\n\t\t// initialize the layer and add it to the MapLibre-gl instance or do something else with it\n\t\tinitializedRef.current = true;\n\t\tmapRef.current = mapContext.getMap(props.mapId);\n\t\tsetMap(mapRef.current);\n\t\tif (mapStateRef.current.lat && mapStateRef.current.lng) {\n\t\t\trestoreViewportState();\n\t\t}\n\t}, [mapContext.mapIds, mapContext, props.mapId, props.active]);\n\n\tuseEffect(() => {\n\t\tif (!mapState?.layers?.length) return;\n\n\t\tif (typeof layerStatesRestored.current === 'undefined') {\n\t\t\tlayerStatesRestored.current = undefined;\n\t\t\tinitialUrlParams?.layers?.forEach((layer: { id: string }) => {\n\t\t\t\tif (layerStatesRestored.current?.[layer.id]) {\n\t\t\t\t\tlayerStatesRestored.current[layer.id] = false;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfor (const key in layerStatesRestored.current) {\n\t\t\tlet _allDone = true;\n\t\t\tif (layerStatesRestored.current[key] === false) {\n\t\t\t\t_allDone = false;\n\t\t\t}\n\t\t\tif (_allDone) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (initialUrlParams.layers) {\n\t\t\tinitialUrlParams.layers.forEach((layer) => {\n\t\t\t\tif (\n\t\t\t\t\tmapRef.current?.map.getLayer(layer.id) && //number oder str?\n\t\t\t\t\tlayerStatesRestored.current?.[layer.id] === false\n\t\t\t\t) {\n\t\t\t\t\tlayerStatesRestored.current[layer.id] = true;\n\t\t\t\t\tmapRef.current.map\n\t\t\t\t\t\t?.getLayer(layer.id)\n\t\t\t\t\t\t?.setLayoutProperty('visibility', layer.visible ? 'visible' : 'none');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}, [mapState.layers, props.mapId, props.active]);\n\n\tuseEffect(() => {\n\t\tif (!map) return;\n\t\tif (!mapState.layers) return;\n\n\t\tif (!props.active) {\n\t\t\tmap.cleanup(componentId.current);\n\t\t}\n\t}, [props.active, map, mapState.layers]);\n\n\t//ist .current?.map. richtig?\n\n\tconst refreshMapState = () => {\n\t\tmapStateRef.current.lat = mapRef.current?.map.getCenter().lat;\n\t\tmapStateRef.current.lng = mapRef.current?.map.getCenter().lng;\n\t\tmapStateRef.current.zoom = mapRef.current?.map.getZoom();\n\t\tmapStateRef.current.bearing = mapRef.current?.map.getBearing();\n\t\tmapStateRef.current.pitch = mapRef.current?.map.getPitch();\n\t};\n\n\tconst restoreViewportState = () => {\n\t\tif (!restoredStatesRef.current.viewport.center) {\n\t\t\trestoredStatesRef.current.viewport.center = true;\n\n\t\t\tif (mapStateRef.current.lng && mapStateRef.current.lat) {\n\t\t\t\tmapRef.current?.map.setCenter([mapStateRef.current.lng, mapStateRef.current.lat]);\n\t\t\t}\n\t\t\tif (mapStateRef.current.zoom) {\n\t\t\t\tmapRef.current?.map.setZoom(mapStateRef.current.zoom);\n\t\t\t}\n\t\t\tif (mapStateRef.current.bearing) {\n\t\t\t\tmapRef.current?.map.setBearing(mapStateRef.current.bearing);\n\t\t\t}\n\t\t\tif (mapStateRef.current.pitch) {\n\t\t\t\tmapRef.current?.map.setPitch(mapStateRef.current.pitch);\n\t\t\t}\n\t\t}\n\n\t\tallStatesRestoredRef.current = true;\n\t};\n\n\twindow.onpopstate = (event) => {\n\t\tif (event.state && event.state.lng && event.state.lat && event.state.zoom) {\n\t\t\tmapRef.current?.map.easeTo({\n\t\t\t\t// so möglich?\n\t\t\t\tzoom: event.state.zoom,\n\t\t\t\tcenter: [event.state.lng, event.state.lat],\n\t\t\t});\n\t\t}\n\t};\n\n\treturn <></>;\n};;\n\nMlShareMapState.defaultProps = {\n\tmapId: undefined,\n};\n\nMlShareMapState.propTypes = {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId: PropTypes.string,\n};\nexport default MlShareMapState;\n","import { distance, lineOffset } from '@turf/turf';\nimport { polygon, lineString, featureCollection} from '@turf/helpers';\nimport { GeoJSONFeature } from 'maplibre-gl';\n\ninterface geometry{\ncoordinates: Array<number>\n}\ninterface line {\ngeometry: geometry\n}\ninterface _geojsonInfo {\nline: line, \nmin: number\n}\n\n\n\nexport default function getElevationData(_geojsonInfo: _geojsonInfo, elevationFactor: number) {\n\n const createStep = (x: number, y: number, z: number, x2: number, y2: number) => {\n //const summand = 0.0002;\n const line = lineString([\n [x, y],\n [x2, y2],\n ]);\n const offsetLine = lineOffset(line, 5, { units: 'meters' });\n const x3 = offsetLine.geometry.coordinates[0][0];\n const y3 = offsetLine.geometry.coordinates[0][1];\n const x4 = offsetLine.geometry.coordinates[1][0];\n const y4 = offsetLine.geometry.coordinates[1][1];\n \n return polygon(\n [\n [\n [x, y],\n [x2, y2],\n \n [x4, y4],\n [x3, y3],\n [x, y],\n ],\n ],\n { height: z * elevationFactor }\n );\n };\n \n const lerp = (x: number, y: number, a: number) => x * (1 - a) + y * a;\n\t\tconst points: GeoJSONFeature[] = [];\n\n\t\t_geojsonInfo.line.geometry.coordinates.forEach((coordinate: number, index: number) => {\n\t\t\t//const point = createPoint(coordinate[0],coordinate[1],coordinate[2]-min);\n\t\t\t//points.push(point);\n\t\t\tif (_geojsonInfo.line.geometry.coordinates[index + 1]) {\n\t\t\t\tconst wayLength = distance(\n\t\t\t\t\t[coordinate[0], coordinate[1]],\n\t\t\t\t\t[\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][0],\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][1],\n\t\t\t\t\t],\n\t\t\t\t\t{ units: 'kilometers' }\n\t\t\t\t);\n\t\t\t\tlet listLength = ~~((wayLength * 1000) / 10);\n\t\t\t\tlistLength = listLength < 1 ? 1 : listLength;\n\t\t\t\tfor (let i = 0; i < listLength; i++) {\n\t\t\t\t\tconst x = lerp(\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index][0],\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][0],\n\t\t\t\t\t\ti / listLength\n\t\t\t\t\t);\n\t\t\t\t\tconst y = lerp(\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index][1],\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][1],\n\t\t\t\t\t\ti / listLength\n\t\t\t\t\t);\n\t\t\t\t\tconst z = lerp(\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index][2] - _geojsonInfo.min,\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][2] - _geojsonInfo.min,\n\t\t\t\t\t\ti / listLength\n\t\t\t\t\t);\n\n\t\t\t\t\tconst x2 = lerp(\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index][0],\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][0],\n\t\t\t\t\t\t(i + 1) / listLength\n\t\t\t\t\t);\n\t\t\t\t\tconst y2 = lerp(\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index][1],\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][1],\n\t\t\t\t\t\t(i + 1) / listLength\n\t\t\t\t\t);\n\n\t\t\t\t\tconst point = createStep(x, y, z, x2, y2);\n\t\t\t\t\tpoints.push(point as unknown as GeoJSONFeature);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tconst output = featureCollection(points);\n\n\t\treturn output;\n \n}\n\n","import React, { useRef, useMemo } from 'react';\nimport { featureCollection } from '@turf/helpers';\nimport { Feature, FeatureCollection } from '@turf/turf';\nimport { v4 as uuidv4 } from 'uuid';\nimport useSource from '../../hooks/useSource';\nimport useLayer from '../../hooks/useLayer';\nimport getElevationData from './util/getElevationData';\nimport { Coordinates, DataDrivenPropertyValueSpecification } from 'maplibre-gl';\n\nconst defaultFillExtrusionColor: (string | number | string[])[] = [\n\t'interpolate',\n\t['linear'],\n\t['get', 'height'],\n\t0,\n\t'rgba(0, 0, 255, 0)',\n\t0.1,\n\t'royalblue',\n\t0.3,\n\t'cyan',\n\t0.5,\n\t'lime',\n\t0.7,\n\t'yellow',\n\t1,\n\t'yellow',\n];\n/**\n * MlSpatialElevationProfile returns a Button that will add a standard OSM tile layer to the maplibre-gl instance.\n *\n * @component\n */\n\ninterface geojson {\n\tfeatures: Feature | FeatureCollection | undefined;\n}\n\nexport interface MlSpatialElevationProfileProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * GeoJSON data that is supposed to be rendered by this component.\n\t */\n\t//geojson: {features: Feature | FeatureCollection | undefined };\n\tgeojson: geojson | FeatureCollection | undefined;\n\t/**\n\t * Prefix of the component id this component uses when adding elements to the MapLibreGl-instance\n\t */\n\tidPrefix?: string;\n\t/**\n\t * Number describes the factor of the height of the elevation\n\t */\n\televationFactor?: number;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n}\n\nconst MlSpatialElevationProfile = (props: MlSpatialElevationProfileProps) => {\n\tconst sourceName = useRef('elevationprofile-' + uuidv4());\n\tconst layerName = useRef('elevationprofile-layer-' + uuidv4());\n\tconst elevationFactor =\n\t\tprops.elevationFactor || MlSpatialElevationProfile.defaultProps.elevationFactor;\n\n\tconst _geojsonInfo = useMemo(() => {\n\t\tif (!props?.geojson?.features) return;\n\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t// @ts-ignore\n\t\tconst line = props.geojson.features?.find((element: Feature) => {\n\t\t\treturn element.geometry.type === 'LineString';\n\t\t});\n\n\t\tif (!line || !line.geometry) return;\n\n\t\tconst heights = line.geometry.coordinates.map((coordinate: Coordinates) => {\n\t\t\treturn coordinate[2];\n\t\t});\n\n\t\tconst min = Math.min(...heights);\n\n\t\tlet max = Math.max(...heights) - min;\n\n\t\tmax = max === 0 ? 1 : max;\n\n\t\treturn { max, min, line };\n\t}, [props.geojson]);\n\n\tconst _fillExtrusionColor: (string | number | string[])[] = useMemo(() => {\n\t\tif (!_geojsonInfo) return defaultFillExtrusionColor;\n\n\t\treturn [\n\t\t\t'interpolate',\n\t\t\t['linear'],\n\t\t\t['get', 'height'],\n\t\t\t0,\n\t\t\t'rgb(0,255,55)',\n\t\t\t_geojsonInfo.max * elevationFactor,\n\t\t\t'rgb(255,0,0)',\n\t\t];\n\t}, [_geojsonInfo, props.elevationFactor]);\n\n\tconst _geojson = useMemo(() => {\n\t\tif (!props.geojson?.features || !_geojsonInfo) return;\n\n\t\tconst newData = getElevationData(_geojsonInfo, elevationFactor);\n\t\treturn newData;\n\t}, [_geojsonInfo, elevationFactor]);\n\n\tuseSource({\n\t\tmapId: props.mapId,\n\t\tsourceId: sourceName.current,\n\t\tsource: {\n\t\t\ttype: 'geojson',\n\t\t\tdata: _geojson || featureCollection([]),\n\t\t},\n\t});\n\n\tuseLayer({\n\t\tlayerId: layerName.current,\n\t\tsource: sourceName.current,\n\n\t\toptions: {\n\t\t\ttype: 'fill-extrusion',\n\t\t\tpaint: {\n\t\t\t\t'fill-extrusion-height': ['get', 'height'],\n\t\t\t\t'fill-extrusion-opacity': 0.9,\n\t\t\t\t'fill-extrusion-color': (_fillExtrusionColor || defaultFillExtrusionColor) as (DataDrivenPropertyValueSpecification<string>),\n\t\t\t},\n\t\t},\n\t\tinsertBeforeLayer: props.insertBeforeLayer,\n\t});\n\n\treturn <></>;\n};\n\nMlSpatialElevationProfile.defaultProps = {\n\televationFactor: 1,\n};\n\nexport default MlSpatialElevationProfile;\n","import React, { useRef, useEffect, useCallback } from 'react';\nimport useMap from '../../hooks/useMap';\nimport { LayerSpecification } from 'maplibre-gl';\nimport { VectorSourceSpecification } from 'maplibre-gl';\n\nexport type MlVectorTileLayerProps = {\n\tmapId?: string;\n\tinsertBeforeLayer?: string;\n\tlayerId?: string;\n\tsourceOptions?: VectorSourceSpecification;\n\turl?: string;\n\tlayers: LayerSpecification[];\n}\n\n/**\n * Adds a vector-tile source and 0...n vector-tile-layers to the MapLibre instance referenced by\n * props.mapId\n *\n * @component\n */\nconst MlVectorTileLayer = (props: MlVectorTileLayerProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst layerId = useRef(props.layerId || 'MlVectorTileLayer-' + mapHook.componentId);\n\tconst layerPaintConfsRef = useRef({});\n\tconst layerLayoutConfsRef = useRef({});\n\tconst initializedRef = useRef(false);\n\n\tconst createLayers = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tinitializedRef.current = true;\n\n\t\tif (mapHook.map.map.getSource(layerId.current)) {\n\t\t\tmapHook.cleanup();\n\t\t}\n\n\t\t// Add the new layer to the maplibre instance once it is available\n\t\tmapHook.map.addSource(\n\t\t\tlayerId.current,\n\t\t\t{\n\t\t\t\ttype: 'vector',\n\t\t\t\ttiles: [props.url || ''],\n\t\t\t\tattribution: '',\n\t\t\t\tminzoom: 0,\n\t\t\t\tmaxzoom: 14,\n\t\t\t\t...props.sourceOptions,\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\n\t\tprops.layers.forEach((layer) => {\n\t\t\tif (!mapHook.map) return;\n\t\t\tmapHook.map.addLayer(\n\t\t\t\t{\n\t\t\t\t\tsource: layerId.current,\n\t\t\t\t\tminzoom: 0,\n\t\t\t\t\tmaxzoom: 22,\n\t\t\t\t\tlayout: {},\n\t\t\t\t\tpaint: {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t'line-opacity': 0.5,\n\t\t\t\t\t\t'line-color': 'rgb(80, 80, 80)',\n\t\t\t\t\t\t'line-width': 2,\n\t\t\t\t\t},\n\t\t\t\t\t...layer,\n\t\t\t\t},\n\t\t\t\tprops.insertBeforeLayer,\n\t\t\t\tmapHook.componentId\n\t\t\t);\n\t\t\tlayerPaintConfsRef.current[layer.id] = JSON.stringify(layer.paint);\n\t\t\tlayerLayoutConfsRef.current[layer.id] = JSON.stringify(layer.layout);\n\n\t\t\t// recreate layer if style has changed\n\t\t\tmapHook.map.on(\n\t\t\t\t'styledata',\n\t\t\t\t() => {\n\t\t\t\t\tif (initializedRef.current && !mapHook.map?.map.getSource(layerId.current)) {\n\t\t\t\t\t\tconsole.log('Recreate Layer ' + layerId.current);\n\t\t\t\t\t\tcreateLayers();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tmapHook.componentId\n\t\t\t);\n\t\t});\n\t}, [mapHook.map, props]);\n\n\tconst updateLayers = useCallback(() => {\n\t\tif (!initializedRef.current) return;\n\n\t\tprops.layers.forEach((layer) => {\n\t\t\tif (!mapHook.map) return;\n\t\t\tif (mapHook.map.map.getLayer(layer.id)) {\n\t\t\t\t// update changed paint property\n\t\t\t\tconst layerPaintConfString = JSON.stringify(layer.paint);\n\n\t\t\t\tif (layerPaintConfString !== layerPaintConfsRef.current[layer.id]) {\n\t\t\t\t\tfor (const paintKey in layer.paint) {\n\t\t\t\t\t\tmapHook.map.map.setPaintProperty(layer.id, paintKey, layer.paint[paintKey]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlayerPaintConfsRef.current[layer.id] = layerPaintConfString;\n\n\t\t\t\t// update changed layout property\n\t\t\t\tconst layerLayoutConfString = JSON.stringify(layer.layout);\n\n\t\t\t\tif (layerLayoutConfString !== layerLayoutConfsRef.current[layer.id]) {\n\t\t\t\t\tfor (const layoutKey in layer.layout) {\n\t\t\t\t\t\tmapHook.map.map.setLayoutProperty(layer.id, layoutKey, layer.layout[layoutKey]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlayerLayoutConfsRef.current[layer.id] = layerLayoutConfString;\n\t\t\t}\n\t\t});\n\t}, [mapHook.map, props.layers]);\n\n\t// initial layer creation\n\tuseEffect(() => {\n\t\tif (initializedRef.current) return;\n\t\tcreateLayers();\n\t}, [createLayers]);\n\n\t// if layers get removed or added\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !initializedRef.current) return;\n\t\tcreateLayers();\n\t}, [props.layers.length, mapHook.map]);\n\n\t// on layout/paint update\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !initializedRef.current) return;\n\t\tupdateLayers();\n\t}, [props.layers, mapHook.map]);\n\n\treturn <></>;\n};\n\nexport default MlVectorTileLayer;\n","import React, { useRef, useEffect, useContext } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport MapContext from \"../../contexts/MapContext\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n/**\n * TODO: Add short & useful description\n *\n * @param {object} props\n * @param {string} props.mapId Id of the target MapLibre instance in mapContext\n *\n * @component\n */\nconst MlWmsFeatureInfoPopup = (props) => {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tconst mapContext = useContext(MapContext);\n\n\tconst initializedRef = useRef(false);\n\tconst mapRef = useRef(undefined);\n\tconst componentId = useRef((props.idPrefix ? props.idPrefix : \"MlWmsFeatureInfoPopup-\") + uuidv4());\n\n\tuseEffect(() => {\n\t\tlet _componentId = componentId.current;\n\n\t\treturn () => {\n\t\t\t// This is the cleanup function, it is called when this react component is removed from react-dom\n\t\t\t// try to remove anything this component has added to the MapLibre-gl instance\n\t\t\t// e.g.: remove the layer\n\t\t\t// mapContext.getMap(props.mapId).removeLayer(layerRef.current);\n\t\t\t// check for the existence of map.style before calling getLayer or getSource\n\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.cleanup(_componentId);\n\t\t\t\tmapRef.current = undefined;\n\t\t\t}\n\t\t\tinitializedRef.current = false;\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!mapContext.mapExists(props.mapId) || initializedRef.current) return;\n\t\t// the MapLibre-gl instance (mapContext.getMap(props.mapId)) is accessible here\n\t\t// initialize the layer and add it to the MapLibre-gl instance or do something else with it\n\t\tinitializedRef.current = true;\n\t\tmapRef.current = mapContext.getMap(props.mapId);\n\n\t\tmapRef.current.setCenter([7.132122000552613, 50.716405378037706]);\n\t}, [mapContext.mapIds, mapContext, props.mapId]);\n\n\treturn <></>;\n};\n\nMlWmsFeatureInfoPopup.defaultProps = {\n\tmapId: undefined,\n};\n\nMlWmsFeatureInfoPopup.propTypes = {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId: PropTypes.string,\n};\nexport default MlWmsFeatureInfoPopup;\n","import React, { useMemo, useRef, useEffect, useCallback } from 'react';\nimport useMap from '../../hooks/useMap';\n\nimport PropTypes from 'prop-types';\nimport { RasterLayerSpecification, RasterSourceSpecification } from 'maplibre-gl';\n\nconst defaultProps = {\n\tvisible: true,\n\turlParameters: {\n\t\tbbox: '{bbox-epsg-3857}',\n\t\tformat: 'image/png',\n\t\tservice: 'WMS',\n\t\tversion: '1.1.1',\n\t\trequest: 'GetMap',\n\t\tsrs: 'EPSG:3857',\n\t\twidth: 256,\n\t\theight: 256,\n\t\tstyles: '',\n\t},\n\tattribution: '',\n\tsourceOptions: {\n\t\tminZoom: 0,\n\t\tmaxZoom: 20,\n\t},\n\tlayerOptions: {\n\t\tminZoom: 0,\n\t\tmaxZoom: 20,\n\t},\n};\n\ninterface MlWmsLayerProps {\n\turlParameters?: { [key: string]: string };\n\turl: string;\n\tvisible?: boolean;\n\tattribution?: string;\n\tmapId?: string;\n\tsourceOptions?: RasterSourceSpecification;\n\tlayerOptions?: RasterLayerSpecification;\n\tinsertBeforeLayer?: string;\n\tlayerId?: string;\n}\n/**\n * Adds a WMS raster source & layer to the maplibre-gl instance\n *\n * @param {object} props\n * @param {object} props.urlParameters URL query parameters that will be added to the WMS URL. A layers property (string) is mandatory. Any value defined on this attribute will extend the default object\n * @param {string} props.url WMS URL\n * @param {bool}\t props.visible Sets layer \"visibility\" property to \"visible\" if true or \"none\" if false\n * @param {string} props.attribution MapLibre attribution shown in the bottom right of the map, if this layer is visible\n * @param {string} props.mapId Id of the target MapLibre instance in mapContext\n * @param {object} props.sourceOptions Object that is passed to the MapLibre.addSource call as config option parameter\n * @param {object} props.layerOptions Object that is passed to the MapLibre.addLayer call as config option parameter\n * @param {string} props.insertBeforeLayer Id of an existing layer in the mapLibre instance to help specify the layer order\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t This layer will be visually beneath the layer with the \"insertBeforeLayer\" id\n *\n * @component\n */\nconst MlWmsLayer = (props: MlWmsLayerProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst initializedRef = useRef(false);\n\tconst layerId = useRef(props.layerId || 'MlWmsLayer-' + mapHook.componentId);\n\n\tconst tileUrl = useMemo(() => {\n\t\tlet _propsUrlParams;\n\t\tlet _wmsUrl = props.url;\n\t\tif (props.url.indexOf('?') !== -1) {\n\t\t\t_propsUrlParams = props.url.split('?');\n\t\t\t_wmsUrl = _propsUrlParams[0];\n\t\t}\n\t\tconst _urlParamsFromUrl = new URLSearchParams(_propsUrlParams?.[1]);\n\t\t// first spread in default props manually to enable overriding a single parameter without replacing the whole default urlParameters object\n\t\tconst urlParamsObj = {\n\t\t\t...defaultProps.urlParameters,\n\t\t\t...Object.fromEntries(_urlParamsFromUrl),\n\t\t\t...props.urlParameters,\n\t\t};\n\t\tconst urlParams = new URLSearchParams(urlParamsObj as unknown as Record<string, string>);\n\t\tconst urlParamsStr =\n\t\t\tdecodeURIComponent(urlParams.toString()) + ''.replace(/%2F/g, '/').replace(/%3A/g, ':');\n\n\t\treturn _wmsUrl + '?' + urlParamsStr;\n\t}, [props.urlParameters, props.url]);\n\n\tconst createLayer = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tinitializedRef.current = true;\n\n\t\tif (mapHook.map.map.getLayer(layerId.current)) {\n\t\t\tmapHook.cleanup();\n\t\t}\n\n\t\tmapHook.map.addSource(\n\t\t\tlayerId.current,\n\t\t\t{\n\t\t\t\ttype: 'raster',\n\t\t\t\ttiles: [tileUrl],\n\t\t\t\ttileSize: 256,\n\t\t\t\tattribution: props.attribution,\n\t\t\t\t...props.sourceOptions,\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\n\t\tmapHook.map.addLayer(\n\t\t\t{\n\t\t\t\tid: layerId.current,\n\t\t\t\ttype: 'raster',\n\t\t\t\tsource: layerId.current,\n\t\t\t\t...props.layerOptions,\n\t\t\t},\n\t\t\tprops.insertBeforeLayer,\n\t\t\tmapHook.componentId\n\t\t);\n\n\t\t// recreate layer if map style.json has changed\n\t\tmapHook.map.on(\n\t\t\t'styledata',\n\t\t\t() => {\n\t\t\t\tif (initializedRef.current && !mapHook.map?.map.getLayer(layerId.current)) {\n\t\t\t\t\tconsole.log('Recreate Layer ' + layerId.current);\n\t\t\t\t\tcreateLayer();\n\t\t\t\t}\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\t\tif (!props.visible) {\n\t\t\tmapHook.map.map.setLayoutProperty(layerId.current, 'visibility', 'none');\n\t\t}\n\t}, [mapHook.map, props, tileUrl]);\n\n\tuseEffect(() => {\n\t\tif (initializedRef.current) return;\n\n\t\tcreateLayer();\n\t}, [createLayer]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !mapHook.map?.map?.style?.sourceCaches?.[layerId.current] || !initializedRef.current) return;\n\n\t\tconst source = mapHook.map.map.getSource(layerId.current) as RasterSourceSpecification;\n\t\tsource.tiles = [tileUrl];\n\n\t\tmapHook.map.map.style.sourceCaches[layerId.current].clearTiles();\n\n\t\tmapHook.map.map.style.sourceCaches[layerId.current].update(mapHook.map.map.transform);\n\n\t\tmapHook.map.map.triggerRepaint();\n\t}, [mapHook.map, tileUrl]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !initializedRef.current) return;\n\n\t\t// toggle layer visibility by changing the layout object's visibility property\n\t\tif (props.visible) {\n\t\t\tmapHook.map.map.setLayoutProperty(layerId.current, 'visibility', 'visible');\n\t\t} else {\n\t\t\tmapHook.map.map.setLayoutProperty(layerId.current, 'visibility', 'none');\n\t\t}\n\t}, [props.visible, mapHook.map]);\n\n\treturn <></>;\n};\n\nMlWmsLayer.defaultProps = {\n\t...defaultProps,\n};\n\nMlWmsLayer.propTypes = {\n\t/**\n\t * WMS URL\n\t */\n\turl: PropTypes.string.isRequired,\n\t/**\n\t * URL query parameters that will be added to the WMS URL. A layers property (string) is mandatory. Any value defined on this attribute will extend the default object.\n\t */\n\turlParameters: PropTypes.shape({\n\t\tlayers: PropTypes.string.isRequired,\n\t\tbbox: PropTypes.string,\n\t\tformat: PropTypes.string,\n\t\tservice: PropTypes.string,\n\t\tversion: PropTypes.string,\n\t\trequest: PropTypes.string,\n\t\tsrs: PropTypes.string,\n\t\twidth: PropTypes.number,\n\t\theight: PropTypes.number,\n\t}),\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId: PropTypes.string,\n\t/**\n\t * MapLibre attribution shown in the bottom right of the map, if this layer is visible\n\t */\n\tattribution: PropTypes.string,\n\t/**\n\t * Object that is passed to the MapLibre.addLayer call as config option parameter\n\t */\n\tlayerOptions: PropTypes.object,\n\t/**\n\t * Object that is passed to the MapLibre.addSource call as config option parameter\n\t */\n\tsourceOptions: PropTypes.object,\n\t/**\n\t * Id of an existing layer in the mapLibre instance to help specify the layer order\n\t * This layer will be visually beneath the layer with the \"insertBeforeLayer\" id.\n\t */\n\tinsertBeforeLayer: PropTypes.string,\n\t/**\n\t * Sets layer \"visibility\" property to \"visible\" if true or \"none\" if false\n\t */\n\tvisible: PropTypes.bool,\n};\nexport default MlWmsLayer;\n","import { useState, useEffect } from \"react\";\nimport WMSCapabilities, { WMSCapabilitiesJSON } from \"wms-capabilities\";\n\nexport interface useWmsProps{\n\turl?:string;\n\turlParameters?:{[key: string]: string};\n}\n\nexport interface useWmsReturnType{\n\t\tcapabilities:WMSCapabilitiesJSON | null | undefined;\n\t\tgetFeatureInfoUrl:string | undefined;\n\t\twmsUrl:string | undefined;\n\t\terror:string | undefined;\n\t\tsetUrl:(value:string|undefined) => void;\n}\n\nfunction useWms(props:useWmsProps):useWmsReturnType {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tconst [getFeatureInfoUrl, setGetFeatureInfoUrl] = useState<string>();\n\tconst [url, setUrl] = useState(props.url);\n\tconst [wmsUrl, setWmsUrl] = useState(\"\");\n\tconst [capabilities, setCapabilities] = useState<WMSCapabilitiesJSON | null | undefined>();\n\tconst [error, setError] = useState();\n\n\tconst clearState = () => {\n\t\tsetGetFeatureInfoUrl(undefined);\n\t\tsetCapabilities(undefined);\n\t\t//setLayers([]);\n\t\tsetWmsUrl(\"\");\n\t};\n\n\tuseEffect(() => {\n\t\t// extract URL parameters from the given URL\n\t\tclearState();\n\t\tsetError(undefined);\n\n\t\tif (!url) return;\n\n\t\tlet _propsUrlParams;\n\t\tlet _wmsUrl = url;\n\t\tif (url.indexOf(\"?\") !== -1) {\n\t\t\t_propsUrlParams = url.split(\"?\");\n\t\t\t_wmsUrl = _propsUrlParams[0];\n\t\t}\n\t\tconst _urlParamsFromUrl = new URLSearchParams(_propsUrlParams?.[1]);\n\n\t\tconst urlParamsObj = {\n\t\t\t...Object.fromEntries(_urlParamsFromUrl),\n\t\t\t...props.urlParameters,\n\t\t};\n\t\t// create URLSearchParams object to assemble the URL Parameters\n\t\tconst urlParams = new URLSearchParams(urlParamsObj);\n\n\t\tconst urlParamsStr =\n\t\t\tdecodeURIComponent(urlParams.toString()) + \"\".replace(/%2F/g, \"/\").replace(/%3A/g, \":\");\n\n\t\tfetch(_wmsUrl + \"?\" + urlParamsStr)\n\t\t\t.then((res) => {\n\t\t\t\tif (!res.ok) {\n\t\t\t\t\tthrow Error(res.statusText + \" (\" + res.status + \" - \" + res.type + \")\");\n\t\t\t\t} else {\n\t\t\t\t\treturn res.text();\n\t\t\t\t}\n\t\t\t})\n\t\t\t.then((data:string) => {\n\t\t\t\tsetCapabilities(new WMSCapabilities(data, window.DOMParser).toJSON());\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\t//reset local state\n\t\t\t\tclearState();\n\t\t\t\tconsole.log(error);\n\t\t\t\tsetError(error.message);\n\t\t\t});\n\t}, [url, props.urlParameters]);\n\n\tuseEffect(() => {\n\t\tif (!capabilities?.Service) return;\n\n\t\tsetWmsUrl(capabilities.Capability?.Request?.GetMap?.DCPType?.[0]?.HTTP?.Get?.OnlineResource);\n\t\t// set getFeatureInfo url\n\t\tsetGetFeatureInfoUrl(\n\t\t\tcapabilities.Capability?.Request?.GetFeatureInfo?.DCPType?.[0]?.HTTP?.Get?.OnlineResource\n\t\t);\n\t}, [capabilities]);\n\n\treturn {\n\t\tcapabilities,\n\t\tgetFeatureInfoUrl,\n\t\twmsUrl,\n\t\terror,\n\t\tsetUrl,\n\t};\n}\n\nuseWms.defaultProps = {\n\turl: \"\",\n\turlParameters: {\n\t\tSERVICE: \"WMS\",\n\t\tVERSION: \"1.3.0\",\n\t\tREQUEST: \"GetCapabilities\",\n\t},\n};\n\nexport default useWms;\n","import React, { useRef, useEffect, useContext, useCallback, useState, useMemo } from 'react';\n\nimport MapContext, { MapContextType } from '../../contexts/MapContext';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport MlWmsLayer from '../MlWmsLayer/MlWmsLayer';\nimport MlMarker from '../MlMarker/MlMarker';\nimport useWms, { useWmsProps } from '../../hooks/useWms';\n\nimport VisibilityIcon from '@mui/icons-material/Visibility';\nimport VisibilityOffIcon from '@mui/icons-material/VisibilityOff';\nimport List from '@mui/material/List';\nimport ListItem from '@mui/material/ListItem';\nimport ListItemText from '@mui/material/ListItemText';\nimport IconButton from '@mui/material/IconButton';\nimport { LngLat, MapMouseEvent } from 'maplibre-gl';\nimport MapLibreGlWrapper from '../MapLibreMap/lib/MapLibreGlWrapper';\nimport { Layer2, Layer3 } from 'wms-capabilities';\nimport { useWmsReturnType } from '../../hooks/useWms';\n\nconst originShift = (2 * Math.PI * 6378137) / 2.0;\nconst lngLatToMeters = function (lnglat: LngLat, accuracy = { enable: true, decimal: 1 }) {\n\tconst lng = lnglat.lng;\n\tconst lat = lnglat.lat;\n\tlet x = (lng * originShift) / 180.0;\n\tlet y = Math.log(Math.tan(((90 + lat) * Math.PI) / 360.0)) / (Math.PI / 180.0);\n\ty = (y * originShift) / 180.0;\n\tif (accuracy.enable) {\n\t\tx = Number(x.toFixed(accuracy.decimal));\n\t\ty = Number(y.toFixed(accuracy.decimal));\n\t}\n\treturn [x, y];\n};\n\nexport interface MlWmsLoaderProps {\n\t/**\n\t * WMS URL\n\t */\n\turl: string;\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId: string;\n\t/**\n\t * URL parameters that will be used in the getCapabilities request\n\t */\n\turlParameters?: useWmsProps['urlParameters'];\n\t/**\n\t * URL parameters that will be added when requesting WMS capabilities\n\t */\n\twmsUrlParameters?: { [key: string]: string };\n\tlngLat?: LngLat;\n\tidPrefix?: string;\n}\n\nexport type LayerType = {\n\tvisible: boolean;\n\tName: string;\n\tAttribution?: { Title: string };\n} & Omit<Layer2, 'Layer'> &\n\tPartial<Pick<Layer2, 'Layer'>>;\n/**\n * Loads a WMS getCapabilities xml document and adds a MlWmsLayer component for each layer that is\n * offered by the WMS.\n *\n * TODO: EaseTo the extend offered by the WMS in a zoom level that is supported\n *\n * @component\n */\nconst MlWmsLoader = (props: MlWmsLoaderProps) => {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tconst mapContext: MapContextType = useContext(MapContext);\n\tconst { capabilities, error, setUrl, getFeatureInfoUrl, wmsUrl }: useWmsReturnType = useWms({\n\t\turlParameters: props.urlParameters,\n\t});\n\n\tconst initializedRef = useRef(false);\n\tconst mapRef = useRef<MapLibreGlWrapper>();\n\tconst componentId = useRef((props.idPrefix ? props.idPrefix : 'MlWmsLoader-') + uuidv4());\n\tconst [layers, setLayers] = useState<Array<LayerType>>([]);\n\n\tconst [featureInfoLngLat, setFeatureInfoLngLat] = useState<\n\t\t{ lng: number; lat: number } | undefined\n\t>();\n\tconst [featureInfoContent, setFeatureInfoContent] = useState<string | undefined>(undefined);\n\n\tuseEffect(() => {\n\t\tconst _componentId = componentId.current;\n\n\t\treturn () => {\n\t\t\t// This is the cleanup function, it is called when this react component is removed from react-dom\n\t\t\t// try to remove anything this component has added to the MapLibre-gl instance\n\t\t\t// e.g.: remove the layer\n\t\t\t// mapContext.getMap(props.mapId).removeLayer(layerRef.current);\n\t\t\t// check for the existence of map.style before calling getLayer or getSource\n\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.cleanup(_componentId);\n\t\t\t\tmapRef.current = undefined;\n\t\t\t}\n\t\t\tinitializedRef.current = false;\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!initializedRef.current) return;\n\n\t\tsetUrl(props.url);\n\t}, [props.url]);\n\n\tconst attribution = useMemo(() => {\n\t\treturn layers\n\t\t\t.filter((el) => el.visible && el?.Attribution?.Title)\n\t\t\t.map((el) => el?.Attribution?.Title)\n\t\t\t.filter((value, index, self) => self.indexOf(value) === index)\n\t\t\t.join(' ');\n\t}, [layers]);\n\n\tconst getFeatureInfo = useCallback(\n\t\t// eslint-disable-next-line @typescript-eslint/ban-types\n\t\t(ev:(MapMouseEvent & Object)) => {\n\t\t\tif (!mapRef.current) return;\n\t\t\tsetFeatureInfoLngLat(undefined);\n\t\t\tsetFeatureInfoContent(undefined);\n\t\t\tconst _bounds = mapRef.current.map.getBounds();\n\t\t\tconst _sw = lngLatToMeters(_bounds._sw);\n\t\t\tconst _ne = lngLatToMeters(_bounds._ne);\n\t\t\tconst bbox = [_sw[0], _sw[1], _ne[0], _ne[1]];\n\t\t\tconst _getFeatureInfoUrlParams = {\n\t\t\t\tREQUEST: 'GetFeatureInfo',\n\n\t\t\t\tBBOX: bbox.join(','),\n\t\t\t\tSERVICE: 'WMS',\n\t\t\t\tINFO_FORMAT:\n\t\t\t\t\tcapabilities?.Capability?.Request?.GetFeatureInfo.Format.indexOf('text/html') !== -1\n\t\t\t\t\t\t? 'text/html'\n\t\t\t\t\t\t: 'text/plain',\n\t\t\t\tFEATURE_COUNT: '10',\n\t\t\t\tLAYERS: layers\n\t\t\t\t\t.map((layer: LayerType) => (layer.visible && layer.queryable ? layer.Title : undefined))\n\t\t\t\t\t.filter((n) => n),\n\t\t\t\tQUERY_LAYERS: layers\n\t\t\t\t\t.map((layer: LayerType) => (layer.visible && layer.queryable ? layer.Title : undefined))\n\t\t\t\t\t.filter((n) => n),\n\t\t\t\tWIDTH: mapRef.current?.map._container.clientWidth,\n\t\t\t\tHEIGHT: mapRef.current?.map._container.clientHeight,\n\t\t\t\tsrs: 'EPSG:3857',\n\t\t\t\tCRS: 'EPSG:3857',\n\t\t\t\tversion: '1.3.0',\n\t\t\t\tX: ev.point.x,\n\t\t\t\tY: ev.point.y,\n\t\t\t\tI: ev.point.x,\n\t\t\t\tJ: ev.point.y,\n\t\t\t\tbuffer: '50',\n\t\t\t};\n\n\t\t\tlet _gfiUrl: string | undefined = getFeatureInfoUrl;\n\t\t\tlet _gfiUrlParts;\n\t\t\tif (_gfiUrl?.indexOf?.('?') !== -1) {\n\t\t\t\t_gfiUrlParts = props.url.split('?');\n\t\t\t\t_gfiUrl = _gfiUrlParts[0];\n\t\t\t}\n\t\t\tconst _urlParamsFromUrl = new URLSearchParams(_gfiUrlParts?.[1]);\n\n\t\t\tconst urlParamsObj = {\n\t\t\t\t...Object.fromEntries(_urlParamsFromUrl),\n\t\t\t\t..._getFeatureInfoUrlParams,\n\t\t\t};\n\t\t\t// create URLSearchParams object to assemble the URL Parameters\n\t\t\t// \"as any\" can be removed once the URLSearchParams ts spec is fixed\n\t\t\tconst urlParams = new URLSearchParams(urlParamsObj as unknown as Record<string, string>);\n\n\t\t\tfetch(props.url + '?' + urlParams.toString())\n\t\t\t\t.then((res) => {\n\t\t\t\t\tif (!res.ok) {\n\t\t\t\t\t\tthrow new Error('FeatureInfo could not be fetched');\n\t\t\t\t\t}\n\t\t\t\t\treturn res.text();\n\t\t\t\t})\n\t\t\t\t.then((text) => {\n\t\t\t\t\tsetFeatureInfoLngLat(ev.lngLat);\n\t\t\t\t\tsetFeatureInfoContent(text);\n\t\t\t\t})\n\t\t\t\t.catch((error) => console.log(error));\n\t\t},\n\t\t[capabilities, getFeatureInfoUrl]\n\t);\n\n\tuseEffect(() => {\n\t\tif (!mapRef.current) return;\n\n\t\tconst _getFeatureInfo = getFeatureInfo;\n\n\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t// @ts-ignore: ts appears not to consider overloads\n\t\tmapRef.current.map.on('click', _getFeatureInfo, componentId.current);\n\t\treturn () => {\n\t\t\tmapRef.current?.map.off?.('click', _getFeatureInfo);\n\t\t};\n\t}, [getFeatureInfo]);\n\n\tuseEffect(() => {\n\t\tif (!capabilities?.Service) return;\n\n\t\tif (capabilities?.Capability?.Layer?.CRS?.indexOf?.('EPSG:3857') === -1) {\n\t\t\tconsole.log(\n\t\t\t\t'MlWmsLoader (' + capabilities.Service.Title + '): No WGS 84/Pseudo-Mercator support'\n\t\t\t);\n\t\t} else {\n\t\t\tconsole.log(\n\t\t\t\t'MlWmsLoader (' + capabilities.Service.Title + '): WGS 84/Pseudo-Mercator supported'\n\t\t\t);\n\n\t\t\tlet _LatLonBoundingBox: Array<number> = [];\n\n\t\t\t// collect aueriable Layer2 layers\n\t\t\tlet _layers: LayerType[] = capabilities?.Capability?.Layer?.Layer.filter(\n\t\t\t\t(el) => !el.Layer?.length\n\t\t\t).map((layer: Layer2 & { Name: string }, idx: number) => {\n\t\t\t\tif (idx === 0) {\n\t\t\t\t\t_LatLonBoundingBox = layer.EX_GeographicBoundingBox;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tvisible: capabilities?.Capability?.Layer?.Layer?.length > 2 ? idx > 1 : true,\n\t\t\t\t\tAttribution: { Title: '' },\n\t\t\t\t\t...layer,\n\t\t\t\t};\n\t\t\t});\n\n\t\t\t// collect aueriable Layer3 layers\n\t\t\tcapabilities?.Capability?.Layer?.Layer.forEach((el) => {\n\t\t\t\tconst tmpLayers = el?.Layer?.filter((el) => el.CRS.length).map(\n\t\t\t\t\t(layer: Layer3, idx: number) => {\n\t\t\t\t\t\tif (idx === 0) {\n\t\t\t\t\t\t\t_LatLonBoundingBox = layer.EX_GeographicBoundingBox;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tvisible: false,\n\t\t\t\t\t\t\tAttribution: { Title: '' },\n\t\t\t\t\t\t\t...layer,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif (tmpLayers) {\n\t\t\t\t\t_layers = [..._layers, ...tmpLayers];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tsetLayers(_layers);\n\n\t\t\t// zoom to extent of first layer\n\t\t\tif (mapRef.current && _LatLonBoundingBox.length > 3) {\n\t\t\t\tmapRef.current.map.fitBounds([\n\t\t\t\t\t[_LatLonBoundingBox[0], _LatLonBoundingBox[1]],\n\t\t\t\t\t[_LatLonBoundingBox[2], _LatLonBoundingBox[3]],\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}, [capabilities]);\n\n\tuseEffect(() => {\n\t\tif (!mapContext?.mapExists?.(props.mapId) || initializedRef.current) return;\n\t\t// the MapLibre-gl instance (mapContext.map) is accessible here\n\t\t// initialize the layer and add it to the MapLibre-gl instance or do something else with it\n\t\tinitializedRef.current = true;\n\t\tmapRef.current = mapContext.getMap(props.mapId);\n\t\tsetUrl(props.url);\n\t}, [mapContext.mapIds, mapContext, props.mapId, props.url]);\n\n\treturn (\n\t\t<>\n\t\t\t{error && <p>{error}</p>}\n\t\t\t<h3 key=\"title\">{capabilities?.Service?.Title}</h3>\n\t\t\t<List dense key=\"layers\">\n\t\t\t\t{wmsUrl &&\n\t\t\t\t\tlayers?.map?.((layer, idx) => {\n\t\t\t\t\t\treturn layer?.Name ? (\n\t\t\t\t\t\t\t<ListItem\n\t\t\t\t\t\t\t\tkey={layer.Name + idx}\n\t\t\t\t\t\t\t\tsecondaryAction={\n\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\tedge=\"end\"\n\t\t\t\t\t\t\t\t\t\taria-label=\"toggle visibility\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\tconst _layers: Array<LayerType> = [...layers];\n\t\t\t\t\t\t\t\t\t\t\t_layers[idx].visible = !_layers[idx].visible;\n\t\t\t\t\t\t\t\t\t\t\tsetLayers([..._layers]);\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{layers[idx].visible ? <VisibilityIcon /> : <VisibilityOffIcon />}\n\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ListItemText primary={layer?.Title} />\n\t\t\t\t\t\t\t</ListItem>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<></>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t</List>\n\t\t\t{wmsUrl && layers?.length && (\n\t\t\t\t<MlWmsLayer\n\t\t\t\t\tkey={componentId.current}\n\t\t\t\t\turl={wmsUrl}\n\t\t\t\t\tattribution={attribution}\n\t\t\t\t\turlParameters={{\n\t\t\t\t\t\t...props.wmsUrlParameters,\n\t\t\t\t\t\tlayers: layers\n\t\t\t\t\t\t\t?.filter?.((layer) => layer.visible)\n\t\t\t\t\t\t\t.map((el) => el.Name)\n\t\t\t\t\t\t\t.reverse()\n\t\t\t\t\t\t\t.join(','),\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t<p key=\"description\" style={{ fontSize: '.7em' }}>\n\t\t\t\t{capabilities?.Capability?.Layer?.['Abstract']}\n\t\t\t</p>\n\n\t\t\t{featureInfoLngLat && <MlMarker {...featureInfoLngLat} content={featureInfoContent} />}\n\t\t</>\n\t);\n};\n\nMlWmsLoader.defaultProps = {\n\turl: '',\n\turlParameters: {\n\t\tSERVICE: 'WMS',\n\t\tVERSION: '1.3.0',\n\t\tREQUEST: 'GetCapabilities',\n\t},\n\twmsUrlParameters: {\n\t\tTRANSPARENT: 'TRUE',\n\t},\n};\n\nexport default MlWmsLoader;\n","import React, { useEffect, useContext } from \"react\";\n\nimport MapContext from \"../contexts/MapContext\";\n\n/**\n * This component is deprecated and will be removed in the next major release\n */\nconst MlBasicComponent = (props) => {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\t// without the requirement of adding it to the dependency list (ignore the false eslint exhaustive deps warning)\n\t// const layerRef = useRef(null);\n\tconst mapContext = useContext(MapContext);\n\n\tuseEffect(() => {\n\t\tif (!mapContext.mapExists()) return;\n\t\treturn () => {\n\t\t\t// This is the cleanup function, it is called when this react component is removed from react-dom\n\t\t\t// try to remove anything this component has added to the MapLibre-gl instance\n\t\t\t// e.g.: remove the layer\n\t\t\t// mapContext.map.removeLayer(layerRef.current);\n\t\t\tif (typeof props.cleanup === \"function\") {\n\t\t\t\tprops.cleanup(mapContext.getMap(props.mapId));\n\t\t\t}\n\t\t};\n\t});\n\n\tuseEffect(() => {\n\t\tif (!mapContext.mapExists(props.mapId)) return;\n\t\t// the MapLibre-gl instance (mapContext.map) is accessible here\n\t\t// initialize the layer and add it to the MapLibre-gl instance\n\t\tif (typeof props.mapIsReady === \"function\") {\n\t\t\tprops.mapIsReady(mapContext.getMap(props.mapId));\n\t\t}\n\t}, [mapContext.mapIds, mapContext, props]);\n\n\treturn <></>;\n};\n\nexport default MlBasicComponent;\n","import { useEffect, useCallback, useRef } from 'react';\n\nimport * as turf from '@turf/turf';\nimport useMap from '../useMap';\nimport { LngLatBoundsLike, LngLatLike } from 'maplibre-gl';\n\ninterface useCameraFollowPathProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Id of an existing layer in the mapLibre instance to help specify the layer order\n\t * This layer will be visually beneath the layer with the \"insertBeforeLayer\" id.\n\t */\n\tinsertBeforeLayer?: string;\n\t/* pause is an useRef const and is triggerd in the storie */\n\tpause?: boolean;\n\t/* zoom is an useRef const and is triggerd in the storie */\n\tzoom?: number;\n\t/* pitch is an useRef const and is triggerd in the storie */\n\tpitch?: number;\n\t/* speed is an useRef const and is triggerd in the storie */\n\tspeed?: number;\n\t/* kmPerStep is an useRef const */\n\tkmPerStep?: number;\n\t/* route is a json file, which is defined loaded in the storie */\n\troute?: any;\n\t/* stepDuration is a const */\n\tstepDuration?: number;\n\t/* timeoutId is an useRef const */\n\ttimeoutId?: number;\n}\nexport type { useCameraFollowPathProps };\n\n/**\n * Component template\n *\n */\nconst useCameraFollowPath = (props: useCameraFollowPathProps) => {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\t// without the requirement of adding it to the dependency list (ignore the false eslint exhaustive deps warning)\n\tconst initializedRef = useRef(false);\n\tconst pause = useRef<boolean | undefined>(props.pause);\n\tconst zoom = useRef<number | undefined>(props.zoom);\n\tconst pitch = useRef<number | undefined>(props.pitch);\n\tconst step = useRef(1);\n\tconst speed = useRef<number | undefined>(props.speed);\n\tconst timeoutId = useRef();\n\n\tconst kmPerStep = props.kmPerStep || 0.01;\n\tconst routeDistance = turf.lineDistance(props.route);\n\tconst stepDuration = props.stepDuration || 70;\n\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tuseEffect(() => {\n\t\tpause.current = props.pause;\n\t\tif (!pause.current) {\n\t\t\tplay();\n\t\t}\n\t}, [props.pause]);\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\t\tzoom.current = props.zoom;\n\t\tif (typeof zoom.current !== 'undefined' && mapHook.map.map.getZoom() !== zoom.current) {\n\t\t\tmapHook.map.map.setZoom(zoom.current);\n\t\t}\n\t}, [mapHook.map, props.zoom]);\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\t\tpitch.current = props.pitch;\n\t\tif (typeof pitch.current !== 'undefined' && pitch.current !== mapHook.map.map.getPitch()) {\n\t\t\tmapHook.map.map.setPitch(pitch.current);\n\t\t}\n\t}, [mapHook.map, props.pitch]);\n\tuseEffect(() => {\n\t\tspeed.current = props.speed;\n\t}, [props.speed]);\n\n\tconst disableInteractivity = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\t\tmapHook.map.map['scrollZoom'].disable();\n\t\tmapHook.map.map['boxZoom'].disable();\n\t\tmapHook.map.map['dragRotate'].disable();\n\t\tmapHook.map.map['dragPan'].disable();\n\t\tmapHook.map.map['keyboard'].disable();\n\t\tmapHook.map.map['doubleClickZoom'].disable();\n\t\tmapHook.map.map['touchZoomRotate'].disable();\n\t}, [mapHook.map]);\n\tconst enableInteractivity = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\t\tmapHook.map.map['scrollZoom'].enable();\n\t\tmapHook.map.map['boxZoom'].enable();\n\t\tmapHook.map.map['dragRotate'].enable();\n\t\tmapHook.map.map['dragPan'].enable();\n\t\tmapHook.map.map['keyboard'].enable();\n\t\tmapHook.map.map['doubleClickZoom'].enable();\n\t\tmapHook.map.map['touchZoomRotate'].enable();\n\t}, [mapHook.map]);\n\n\tfunction centerRoute() {\n\t\tif (!mapHook.map || !props.route) return;\n\t\tconst bbox = turf.bbox(props.route);\n\t\tlet bounds: LngLatBoundsLike;\n\t\tif (bbox && bbox.length > 3) {\n\t\t\tbounds = [\n\t\t\t\t[bbox[0], bbox[1]],\n\t\t\t\t[bbox[2], bbox[3]],\n\t\t\t];\n\t\t\tmapHook.map.map.fitBounds(bounds, { padding: 100 });\n\t\t}\n\t}\n\tfunction play() {\n\t\tif (!mapHook.map) return;\n\n\t\tif (!pause.current) {\n\t\t\tdisableInteractivity();\n\t\t\tif (typeof zoom.current !== 'undefined' && mapHook.map.map.getZoom() !== zoom.current) {\n\t\t\t\tmapHook.map.map.setZoom(zoom.current);\n\t\t\t}\n\n\t\t\tconst alongRoutelati: number[] = turf.along(props.route, step.current * kmPerStep).geometry\n\t\t\t\t.coordinates;\n\n\t\t\tif (step.current * kmPerStep < routeDistance) {\n\t\t\t\tmapHook.map.map.easeTo({\n\t\t\t\t\tcenter: alongRoutelati as LngLatLike,\n\t\t\t\t\tbearing: turf.bearing(\n\t\t\t\t\t\tturf.point([mapHook.map.map.getCenter().lng, mapHook.map.map.getCenter().lat]),\n\t\t\t\t\t\tturf.point(alongRoutelati)\n\t\t\t\t\t),\n\t\t\t\t\tduration: stepDuration,\n\t\t\t\t\tessential: true,\n\t\t\t\t});\n\t\t\t\tif (typeof speed.current !== 'undefined') {\n\t\t\t\t\tstep.current = step.current + speed.current;\n\t\t\t\t} else {\n\t\t\t\t\tstep.current++;\n\t\t\t\t}\n\t\t\t\tconsole.log('PAN MOVE');\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tplay();\n\t\t\t\t}, 100);\n\t\t\t} else {\n\t\t\t\tmapHook.map.map.setPitch(0);\n\t\t\t\tcenterRoute();\n\t\t\t\tenableInteractivity();\n\t\t\t\tconsole.log('ENABLE CONTROLS');\n\t\t\t\tstep.current = 1;\n\t\t\t}\n\t\t} else {\n\t\t\tenableInteractivity();\n\t\t}\n\t}\n\n\tfunction reset() {\n\t\tif (!mapHook.map) return;\n\t\tcenterRoute();\n\t\tenableInteractivity();\n\t\tstep.current = 1;\n\t}\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || initializedRef.current) return;\n\t\tinitializedRef.current = true;\n\t\tcenterRoute();\n\t}, [mapHook.map]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (timeoutId.current) {\n\t\t\t\tclearTimeout(timeoutId.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\treturn {\n\t\tplay: play,\n\t\treset: reset,\n\t};\n};\n\nuseCameraFollowPath.defaultProps = {\n\tmapId: undefined,\n\tzoom: 18,\n};\n\nexport default useCameraFollowPath;\n","import { useEffect } from 'react';\nimport useMap from '../useMap';\nimport { FilterSpecification } from 'maplibre-gl';\n\nexport interface UseLayerFilterProps {\n\tmapId?: string;\n\tlayerId?: string;\n\tfilter?: FilterSpecification;\n}\n\nfunction useLayerFilter(props: UseLayerFilterProps) {\n\tconst mapHook = useMap({ mapId: props.mapId });\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !props.layerId || !props.filter) return;\n\n\t\tif (mapHook.map.map.getLayer(props.layerId)) {\n\t\t\tconst _layerId = props.layerId;\n\n\t\t\tmapHook.map.map.setFilter(_layerId, props.filter);\n\t\t\treturn () => {\n\t\t\t\tif (mapHook.map) {\n\t\t\t\t\tmapHook.map.map.setFilter(_layerId, null);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\treturn;\n\t}, [props, mapHook.map]);\n\n\treturn {};\n}\n\nexport default useLayerFilter;\n","import React from 'react';\nimport { useEffect } from 'react';\nimport useMapState from './useMapState';\nimport useMap from './useMap';\n\nconst touchEquivalents = {\n\tmousedown: 'touchstart',\n\tmouseup: 'touchend',\n\tmousemove: 'touchmove',\n};\nconst touchEquivalentsKeys = Object.keys(touchEquivalents);\nfunction useLayerEvent(props) {\n\tconst mapState = useMapState({ mapId: props.mapId, watch: { layers: true } });\n\tconst mapHook = useMap({ mapId: props.mapId });\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return true;\n\t\tif (typeof props.condition !== 'undefined' && props.condition === false) return;\n\t\t//console.log('useLayerEvent');\n\t\t//console.log(mapState);\n\n\t\tif (mapHook.map.map.getLayer(props.layerId)) {\n\t\t\t//console.log(\"layer avail\");\n\t\t\tvar _event = props.event;\n\t\t\tvar _layerId = props.layerId;\n\t\t\tvar _eventHandler = props.eventHandler;\n\n\t\t\t//console.log(_event);\n\t\t\tmapHook.map.on(_event, _layerId, _eventHandler, mapHook.componentId);\n\t\t\tif (props?.addTouchEvents === true) {\n\t\t\t\tif (touchEquivalentsKeys.indexOf(_event) !== -1) {\n\t\t\t\t\tmapHook.map.on(touchEquivalents[_event], _layerId, _eventHandler, mapHook.componentId);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn () => {\n\t\t\t\tmapHook.map.off(_event, _layerId, _eventHandler);\n\t\t\t\tif (props?.addTouchEvents === true) {\n\t\t\t\t\tif (touchEquivalentsKeys.indexOf(_event) !== -1) {\n\t\t\t\t\t\tmapHook.map.off(touchEquivalents[_event], _layerId, _eventHandler, mapHook.componentId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}, [props, mapState, mapHook.map]);\n\n\treturn {};\n}\n\nexport default useLayerEvent;\n","import React from \"react\";\n\nconst SimpleDataContext = React.createContext({});\n\nexport const SimpleDataContextProvider = SimpleDataContext.Provider;\nexport default SimpleDataContext;\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { SimpleDataContextProvider } from \"./SimpleDataContext\";\nimport * as d3 from \"d3\";\n\nconst SimpleDataProvider = (props) => {\n\tconst [data, setData] = useState(null);\n\tuseEffect(() => {\n\t\tif (!props.url) return;\n\n\t\tlet data_promise = null;\n\t\tif (props.format === \"json\") {\n\t\t\tdata_promise = d3.json(props.url);\n\t\t} else if (props.format === \"csv\") {\n\t\t\tdata_promise = d3.csv(props.url);\n\t\t} else if (props.format === \"xml\") {\n\t\t\tdata_promise = d3.xml(props.url);\n\t\t}\n\n\t\tif (data_promise) {\n\t\t\tdata_promise.then((received_data) => {\n\t\t\t\tif (props.format === \"xml\") {\n\t\t\t\t\tif (props.nodeType) {\n\t\t\t\t\t\tlet dataTmp = [];\n\t\t\t\t\t\treceived_data.querySelectorAll(props.nodeType).forEach((el) => {\n\n\t\t\t\t\t\t\tdataTmp.push(props.formatData(el));\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetData(dataTmp);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (props.data_property) {\n\t\t\t\t\t\treceived_data = received_data[props.data_property];\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof props.formatData === \"function\") {\n\t\t\t\t\t\tsetData(received_data.map(props.formatData));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetData(received_data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (typeof props.onData === \"function\") {\n\t\t\t\t\tprops.onData();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}, [props.url, props]);\n\n\tconst value = {\n\t\tdata: data,\n\t\tsetData: setData,\n\t};\n\n\treturn (\n\t\t<SimpleDataContextProvider value={value}>\n\t\t\t{props.children}\n\t\t</SimpleDataContextProvider>\n\t);\n};\n\nSimpleDataProvider.propTypes = {\n\tchildren: PropTypes.node.isRequired,\n};\n\nexport default SimpleDataProvider;\n","import { List } from '@mui/material';\nimport React from 'react';\n\ntype Props = {\n\tchildren: JSX.Element | JSX.Element[];\n};\n\nfunction LayerList({ children }: Props) {\n\treturn <List sx={{marginTop:'15px'}}>{children}</List>;\n}\n\nexport default LayerList;\n","import { ColorObject, ColorPicker, ColorValue } from 'mui-color';\nimport React from 'react'\nimport { paintPropsType } from '../LayerPropertyForm';\n\ntype Props = {\nkey: string;\nvalue: string;\npropKey: string;\nsetPaintProps: (\n\t\tpaintProps: paintPropsType | ((current: paintPropsType) => paintPropsType)\n\t) => void;\n}\n\nexport default function PaintPropsColorPicker({propKey, value, setPaintProps}: Props) {\n \n return (\n\t\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tonChange={(value: (ColorObject & ColorValue)) => {\n\t\t\t\t\t\t\t\tsetPaintProps((current: paintPropsType): paintPropsType => {\n if(!value?.rgb?.[0]){\n return current;\n }\n\n const newProps = {\n\t\t\t\t\t\t\t\t\t\t...current,\n\t\t\t\t\t\t\t\t\t\t[propKey]:\n\t\t\t\t\t\t\t\t\t\t\t'rgba(' +\n\t\t\t\t\t\t\t\t\t\t\tvalue.rgb[0] +\n\t\t\t\t\t\t\t\t\t\t\t',' +\n\t\t\t\t\t\t\t\t\t\t\tvalue.rgb[1] +\n\t\t\t\t\t\t\t\t\t\t\t',' +\n\t\t\t\t\t\t\t\t\t\t\tvalue.rgb[2] +\n\t\t\t\t\t\t\t\t\t\t\t',' +\n\t\t\t\t\t\t\t\t\t\t\tvalue.alpha +\n\t\t\t\t\t\t\t\t\t\t\t')',\n\t\t\t\t\t\t\t\t\t};\n\n return newProps;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n )\n}","import {\n\tCircleLayerSpecification,\n\tFillLayerSpecification,\n\tLineLayerSpecification,\n} from 'maplibre-gl';\nimport React, { useRef } from 'react';\nimport ColorPicker from './input/ColorPicker';\nimport { Box, ListItem, Paper, Slider, TextField, Typography } from '@mui/material';\nimport {useCallback} from 'react';\n\nexport type paintPropsType =\n\t| CircleLayerSpecification['paint']\n\t| FillLayerSpecification['paint']\n\t| LineLayerSpecification['paint'];\n\ntype Props = {\n\tpaintProps: paintPropsType;\n\tsetPaintProps: (\n\t\tpaintProps: paintPropsType | ((current: paintPropsType) => paintPropsType)\n\t) => void;\n\tlayerType: string;\n};\n\nconst mapPropKeyToFormInputType = {\n\t'fill-color': 'colorpicker',\n\t'line-color': 'colorpicker',\n\t'line-width': 'slider',\n\t'line-blur': 'slider',\n};\nconst mapPropKeyToFormInputTypeKeys = Object.keys(mapPropKeyToFormInputType);\n\nconst inputPropsByPropKey = {\n\t'line-blur': {\n\t\tstep: 1,\n\t\tmin: 1,\n\t\tmax: 100,\n\t},\n\t'line-width': {\n\t\tstep: 1,\n\t\tmin: 1,\n\t\tmax: 100,\n\t},\n};\n\nexport default function LayerPropertyForm({ paintProps = {}, setPaintProps }: Props) {\n\tconst key = useRef(Math.round(Math.random() * 10000000000));\n\t//const onChange = (event) => {};\n\n\tconst getFormInputByType = useCallback((key: string) => {\n\t\tif (mapPropKeyToFormInputTypeKeys.indexOf(key) !== -1) {\n\t\t\tconst label = (\n\t\t\t\t<Typography id={key + '_label'} gutterBottom>\n\t\t\t\t\t{key}\n\t\t\t\t</Typography>\n\t\t\t);\n\t\t\tswitch (mapPropKeyToFormInputType[key]) {\n\t\t\t\tcase 'slider':\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t<Slider\n\t\t\t\t\t\t\t\t{...inputPropsByPropKey[key]}\n\t\t\t\t\t\t\t\tinputProps={{ inputMode: 'decimal', pattern: '[0-9]*' }}\n\t\t\t\t\t\t\t\tvalue={paintProps[key]}\n\t\t\t\t\t\t\t\tonChange={(_ev: Event, value: number) => {\n\t\t\t\t\t\t\t\t\tif (value) {\n\t\t\t\t\t\t\t\t\t\tsetPaintProps((current) => ({ ...current, [key]: value }));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'numberfield':\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t<TextField\n\t\t\t\t\t\t\t\tinputProps={{ inputMode: 'decimal', pattern: '[0-9]*' }}\n\t\t\t\t\t\t\t\tvalue={paintProps[key]}\n\t\t\t\t\t\t\t\tonChange={(ev: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\t\t\t\t\t\t\tif (ev?.target?.value) {\n\t\t\t\t\t\t\t\t\t\tsetPaintProps((current) => ({ ...current, [key]: parseInt(ev.target.value) }));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'colorpicker':\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t<Box sx={{ '& > div': { width: 'initial !important' } }}>\n\t\t\t\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\t\t\t\tvalue={paintProps[key]}\n\t\t\t\t\t\t\t\t\tpropKey={key}\n\t\t\t\t\t\t\t\t\tsetPaintProps={setPaintProps}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t</>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t},[paintProps]);\n\n\treturn (\n\t\t<>\n\t\t\t<ListItem key={key + '_paintPropForm'}>\n\t\t\t\t<Paper\n\t\t\t\t\tsx={{\n\t\t\t\t\t\tpadding: '15px',\n\t\t\t\t\t\tboxShadow: 'inset 0px 0px 10px rgb(50 50 50 / 10%)',\n\t\t\t\t\t\tborderRadius: '5px',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{Object.keys(paintProps).map((el: string) => getFormInputByType(el))}\n\t\t\t\t</Paper>\n\t\t\t</ListItem>\n\t\t</>\n\t);\n}\n","import { ExpandLess, ExpandMore } from '@mui/icons-material';\nimport { ListItemIcon, ListItemText, List, Checkbox, ListItem, IconButton } from '@mui/material';\nimport { Box } from '@mui/system';\nimport React, { useMemo, useState } from 'react';\n\ntype Props = {\n\tvisible: boolean;\n\tname?: string;\n\tchildren: JSX.Element | JSX.Element[];\n\tsetVisible?: (visible: boolean | ((val: unknown) => boolean)) => void;\n};\n\nexport default function LayerListFolder({ visible = true, name, children, setVisible }: Props) {\n\tconst [open, setOpen] = useState(false);\n\tconst [localVisible, setLocalVisible] = useState(true);\n\tconst _visible = useMemo(() => {\n\t\tif (!visible) {\n\t\t\treturn false;\n\t\t}\n\t\treturn localVisible;\n\t}, [visible, localVisible]);\n\n\tconst _children = useMemo(() => {\n\t\tif (children) {\n\t\t\tif (Array.isArray(children)) {\n\t\t\t\treturn children.map((element) => {\n\t\t\t\t\treturn React.cloneElement(element, {\n\t\t\t\t\t\tvisible: _visible,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn React.cloneElement(children, {\n\t\t\t\tvisible: _visible,\n\t\t\t});\n\t\t}\n\t\treturn <></>;\n\t}, [_visible]);\n\n\treturn (\n\t\t<>\n\t\t\t<ListItem\n\t\t\t\tsecondaryAction={\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\tsx={{ padding: '4px', marginTop: '-3px' }}\n\t\t\t\t\t\tedge=\"end\"\n\t\t\t\t\t\taria-label=\"open\"\n\t\t\t\t\t\tonClick={() => setOpen(!open)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{open ? <ExpandLess /> : <ExpandMore />}\n\t\t\t\t\t</IconButton>\n\t\t\t\t}\n\t\t\t\tsx={{\n\t\t\t\t\tpaddingRight: 0,\n\t\t\t\t\tpaddingLeft: 0,\n\t\t\t\t\tpaddingTop: 0,\n\t\t\t\t\tpaddingBottom: '4px',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<ListItemIcon sx={{ minWidth: '30px' }}>\n\t\t\t\t\t<Checkbox\n\t\t\t\t\t\tsx={{ padding: 0 }}\n\t\t\t\t\t\tdisabled={setVisible ? false : !visible}\n\t\t\t\t\t\tchecked={setVisible?visible:localVisible}\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tif (setVisible) {\n\t\t\t\t\t\t\t\tsetVisible((val) => !val);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetLocalVisible((val) => !val);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</ListItemIcon>\n\t\t\t\t<ListItemText primary={name} />\n\t\t\t</ListItem>\n\t\t\t<Box sx={{ display: open ? 'block' : 'none' }}>\n\t\t\t\t<List component=\"div\" disablePadding sx={{ paddingLeft: '18px' }}>\n\t\t\t\t\t{_children}\n\t\t\t\t</List>\n\t\t\t</Box>\n\t\t</>\n\t);\n}\n","import { ListItem, IconButton, ListItemIcon, Checkbox, ListItemText } from '@mui/material';\nimport React, { useEffect, useState } from 'react';\nimport LayerPropertyForm from './LayerPropertyForm';\nimport TuneIcon from '@mui/icons-material/Tune';\nimport { MlVectorTileLayerProps } from '../../../components/MlVectorTileLayer/MlVectorTileLayer';\n\ntype Props = {\n\tid: string;\n\tconfigurable?: boolean;\n\tvtProps: MlVectorTileLayerProps;\n\tsetVtProps: ((state: unknown) => void) | undefined;\n};\n\nexport default function LayerListItemVectorLayer({ configurable, vtProps, setVtProps, id }: Props) {\n\tconst [paintPropsFormVisible, setPaintPropsFormVisible] = useState(false);\n\tconst [visible, setVisible] = useState(true);\n\tconst [paintProps, setPaintProps] = useState(vtProps.layers[id].paint);\n\n\tuseEffect(() => {\n\t\tif (!setVtProps) return;\n\n\t\tconst _layers = [...vtProps.layers];\n\t\tif (!_layers[id].layout) {\n\t\t\t_layers[id].layout = { visibility: visible ? 'visible' : 'none' };\n\t\t} else {\n\t\t\t_layers[id].layout.visibility = visible ? 'visible' : 'none';\n\t\t}\n\n\t\tsetVtProps({ ...vtProps, layers: _layers });\n\t}, [visible, id, setVtProps, vtProps]);\n\n\tuseEffect(() => {\n\t\tif (!setVtProps) return;\n\n\t\tconst _paintProps = { ...paintProps };\n\t\tconst _layers = [...vtProps.layers];\n\t\t_layers[id].paint = _paintProps;\n\n\t\tsetVtProps({ ...vtProps, layers: _layers });\n\t}, [paintProps, id, setVtProps, vtProps]);\n\n\treturn (\n\t\t<>\n\t\t\t<ListItem\n\t\t\t\tkey={id}\n\t\t\t\tsx={{\n\t\t\t\t\tpaddingRight: configurable ? '56px' : 0,\n\t\t\t\t\tpaddingLeft: 0,\n\t\t\t\t\tpaddingTop: 0,\n\t\t\t\t\tpaddingBottom: '4px',\n\t\t\t\t}}\n\t\t\t\tsecondaryAction={\n\t\t\t\t\tconfigurable ? (\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\tedge=\"end\"\n\t\t\t\t\t\t\taria-label=\"comments\"\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tsetPaintPropsFormVisible((current) => {\n\t\t\t\t\t\t\t\t\treturn !current;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tsx={{ padding: '4px', marginTop: '-3px' }}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TuneIcon />\n\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t) : undefined\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<ListItemIcon sx={{ minWidth: '30px' }}>\n\t\t\t\t\t<Checkbox\n\t\t\t\t\t\tchecked={visible}\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tsetVisible((val) => !val);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</ListItemIcon>\n\t\t\t\t<ListItemText primary={vtProps.layers[id].id} />\n\t\t\t</ListItem>\n\t\t\t{configurable && paintPropsFormVisible && (\n\t\t\t\t<LayerPropertyForm\n\t\t\t\t\tpaintProps={paintProps}\n\t\t\t\t\tsetPaintProps={setPaintProps}\n\t\t\t\t\tlayerType={vtProps.layers[id].type}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nLayerListItemVectorLayer.defaultProps = {\n\tconfigurable: true,\n};\n","import { Checkbox, IconButton, ListItem, ListItemIcon, ListItemText } from '@mui/material';\nimport TuneIcon from '@mui/icons-material/Tune';\nimport React, { useMemo, useRef, useState } from 'react';\nimport getDefaulLayerTypeByGeometry from '../../components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry';\nimport LayerPropertyForm from './util/LayerPropertyForm';\nimport getDefaultPaintPropsByType from '../../components/MlGeoJsonLayer/util/getDefaultPaintPropsByType';\nimport LayerListFolder from './LayerListFolder';\nimport { LayerSpecification } from 'maplibre-gl';\nimport LayerListItemVectorLayer from './util/LayerListItemVectorLayer';\nimport { useEffect } from 'react';\n\ntype Props = {\n\tlayerComponent: JSX.Element;\n\tvisible: boolean;\n\tconfigurable: boolean;\n\ttype?: 'background' | 'background-labels' | 'layer' | 'wms-layer' | 'vector-tile-layer';\n\tname: string;\n\tdescription?: string;\n\tsetLayerState?: (state: unknown) => void;\n};\n\nfunction LayerListItem({\n\tlayerComponent,\n\tvisible,\n\ttype,\n\tname,\n\tdescription,\n\tconfigurable,\n\tsetLayerState,\n}: Props) {\n\tconst [localVisible, setLocalVisible] = useState(true);\n\tconst [paintPropsFormVisible, setPaintPropsFormVisible] = useState(false);\n\tconst visibleRef = useRef<boolean>(visible);\n\n\t// this state variable is used for layer components that provide a paint attribute\n\tconst [paintProps, setPaintProps] = useState(\n\t\tlayerComponent?.props?.paint ||\n\t\t\tgetDefaultPaintPropsByType(\n\t\t\t\tlayerComponent?.props?.type || getDefaulLayerTypeByGeometry(layerComponent.props.geojson)\n\t\t\t)\n\t);\n\n\tconst _visible = useMemo(() => {\n\t\tif (!visible) {\n\t\t\treturn false;\n\t\t}\n\t\treturn localVisible;\n\t}, [visible, localVisible]);\n\n\tuseEffect(() => {\n\t\tif (!setLayerState || !layerComponent?.props?.layers || _visible === visibleRef.current) return;\n\n\t\tvisibleRef.current = _visible;\n\n\t\tconst state = { ...layerComponent?.props };\n\t\tstate.layers = layerComponent?.props?.layers.map((el: LayerSpecification) => {\n\t\t\tif (el.layout) {\n\t\t\t\tel.layout['visibility'] = _visible ? 'visible' : 'none';\n\t\t\t} else {\n\t\t\t\tel.layout = { visibility: _visible ? 'visible' : 'none' };\n\t\t\t}\n\t\t\treturn el;\n\t\t});\n\t\tsetLayerState(state);\n\t}, [_visible, setLayerState, layerComponent?.props?.layers]);\n\n\tuseEffect(() => {\n\t\tif (!setLayerState || !paintProps) return;\n\n\t\tsetLayerState({ ...layerComponent.props, paint: paintProps });\n\t}, [paintProps, setLayerState]);\n\n\tconst _layerComponent = useMemo(() => {\n\t\tif (layerComponent && type === 'layer') {\n\t\t\tif (layerComponent?.props?.layers) {\n\t\t\t\treturn React.cloneElement(layerComponent, {\n\t\t\t\t\t...layerComponent?.props,\n\t\t\t\t\tlayers: layerComponent?.props?.layers,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn React.cloneElement(layerComponent, {\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\tvisibility: _visible ? 'visible' : 'none',\n\t\t\t\t\t},\n\t\t\t\t\t...(setLayerState ? {} : { paint: paintProps }),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn <></>;\n\t}, [type, layerComponent, paintProps, _visible, layerComponent?.props?.layers]);\n\n\tconst layerType = useMemo(() => {\n\t\tif (layerComponent && type === 'layer') {\n\t\t\tif (layerComponent.props.type) {\n\t\t\t\treturn layerComponent.props.type;\n\t\t\t}\n\t\t\tif (layerComponent.props.geojson) {\n\t\t\t\treturn getDefaulLayerTypeByGeometry(layerComponent.props.geojson);\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}, [layerComponent]);\n\n\treturn (\n\t\t<>\n\t\t\t{!layerComponent?.props?.layers && (\n\t\t\t\t<ListItem\n\t\t\t\t\tsx={{\n\t\t\t\t\t\tpaddingRight: configurable ? '56px' : 0,\n\t\t\t\t\t\tpaddingLeft: 0,\n\t\t\t\t\t\tpaddingTop: 0,\n\t\t\t\t\t\tpaddingBottom: '4px',\n\t\t\t\t\t}}\n\t\t\t\t\tsecondaryAction={\n\t\t\t\t\t\tconfigurable ? (\n\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\tedge=\"end\"\n\t\t\t\t\t\t\t\taria-label=\"comments\"\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tsetPaintPropsFormVisible((current) => {\n\t\t\t\t\t\t\t\t\t\treturn !current;\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tsx={{ padding: '4px', marginTop: '-3px' }}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TuneIcon />\n\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t) : undefined\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<ListItemIcon sx={{ minWidth: '30px' }}>\n\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\tdisabled={!visible}\n\t\t\t\t\t\t\tchecked={localVisible}\n\t\t\t\t\t\t\tsx={{ padding: 0 }}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tsetLocalVisible((val) => !val);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ListItemIcon>\n\t\t\t\t\t<ListItemText\n\t\t\t\t\t\tprimary={name}\n\t\t\t\t\t\tprimaryTypographyProps={{ sx: { fontSize: '0.9rem' } }}\n\t\t\t\t\t\tsecondary={description}\n\t\t\t\t\t\tsecondaryTypographyProps={{ sx: { fontSize: '0.7rem' } }}\n\t\t\t\t\t/>\n\t\t\t\t</ListItem>\n\t\t\t)}\n\t\t\t{_layerComponent}\n\t\t\t{!layerComponent?.props?.layers && configurable && paintPropsFormVisible && (\n\t\t\t\t<LayerPropertyForm\n\t\t\t\t\tpaintProps={paintProps}\n\t\t\t\t\tsetPaintProps={setPaintProps}\n\t\t\t\t\tlayerType={layerType}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{layerComponent?.props?.layers && (\n\t\t\t\t<LayerListFolder visible={localVisible} setVisible={setLocalVisible} name={name}>\n\t\t\t\t\t{layerComponent?.props?.layers?.map?.((_el: LayerSpecification, idx: number) => (\n\t\t\t\t\t\t<LayerListItemVectorLayer\n\t\t\t\t\t\t\tvtProps={layerComponent?.props}\n\t\t\t\t\t\t\tsetVtProps={setLayerState}\n\t\t\t\t\t\t\tid={'' + idx}\n\t\t\t\t\t\t\tkey={'' + idx}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</LayerListFolder>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nLayerListItem.defaultProps = {\n\ttype: 'layer',\n\tvisible: true,\n};\n\nexport default LayerListItem;\n","import * as React from 'react';\nimport { useState } from 'react';\nimport AppBar from '@mui/material/AppBar';\nimport Box from '@mui/material/Box';\nimport Toolbar from '@mui/material/Toolbar';\nimport IconButton from '@mui/material/IconButton';\nimport Menu from '@mui/material/Menu';\nimport MenuIcon from '@mui/icons-material/Menu';\nimport { useTheme } from '@mui/material/styles';\n\nexport interface TopToolbarProps {\n\tchildren?: React.ReactNode;\n\tunmovableButtons?: React.ReactNode;\n\tbuttons?: React.ReactNode;\n\tlogo?: React.ReactNode;\n}\n\nconst ghPagesUrl = 'https://mapcomponents.github.io/react-map-components-maplibre/';\nconst logoUrl = ghPagesUrl + 'assets/WG-MapComponents-Logo_rgb.svg';\nconst logoUrl_dark = ghPagesUrl + 'assets/WG-MapComponents-Logo_rgb-weisse-schrift.svg';\nconst logoUrl_mobile = ghPagesUrl + 'assets/mapcomponents_logo.png';\n\nfunction TopToolbar(props: TopToolbarProps) {\n\tconst theme = useTheme();\n\n\tconst [anchorElNav, setAnchorElNav] = useState<null | HTMLElement>(null);\n\n\tconst handleOpenNavMenu = (event: React.MouseEvent<HTMLElement>) => {\n\t\tsetAnchorElNav(event.currentTarget);\n\t};\n\n\tconst handleCloseNavMenu = () => {\n\t\tsetAnchorElNav(null);\n\t};\n\n\treturn (\n\t\t<AppBar\n\t\t\tsx={{\n\t\t\t\tminHeight: '62px',\n\t\t\t\tposition: 'absolute',\n\t\t\t\tzIndex: 1300,\n\t\t\t}}\n\t\t\tposition=\"static\"\n\t\t>\n\t\t\t<Toolbar disableGutters>\n\t\t\t\t{props.logo || (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Box\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\tmarginLeft: '25px',\n\t\t\t\t\t\t\t\tdisplay: { xs: 'none', md: 'flex' },\n\t\t\t\t\t\t\t\tflexGrow: { md: '30' },\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\tsrc={theme.palette.mode === 'dark' ? logoUrl_dark : logoUrl}\n\t\t\t\t\t\t\t\tstyle={{ width: '100%', maxWidth: '250px' }}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t<Box\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\tmarginLeft: '25px',\n\t\t\t\t\t\t\t\tdisplay: { xs: 'flex', sm: 'flex', md: 'none' },\n\t\t\t\t\t\t\t\tflexGrow: { xs: '500' },\n\t\t\t\t\t\t\t\tmr: { sm: '0px' },\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<img src={logoUrl_mobile} width=\"50px\" height=\"50px\" />\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t<Box sx={{ flexGrow: 1, display: { xs: 'flex' } }}>{props.unmovableButtons}</Box>\n\t\t\t\t{props.buttons ? (\n\t\t\t\t\t<Box sx={{ flexGrow: 22, display: { xs: 'flex', sm: 'none' } }}>\n\t\t\t\t\t\t<IconButton onClick={handleOpenNavMenu}>\n\t\t\t\t\t\t\t<MenuIcon />\n\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t<Menu\n\t\t\t\t\t\t\tid=\"menu-appbar\"\n\t\t\t\t\t\t\tanchorEl={anchorElNav}\n\t\t\t\t\t\t\tanchorOrigin={{\n\t\t\t\t\t\t\t\tvertical: 'bottom',\n\t\t\t\t\t\t\t\thorizontal: 'left',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tkeepMounted\n\t\t\t\t\t\t\ttransformOrigin={{\n\t\t\t\t\t\t\t\tvertical: 'top',\n\t\t\t\t\t\t\t\thorizontal: 'left',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\topen={Boolean(anchorElNav)}\n\t\t\t\t\t\t\tonClose={handleCloseNavMenu}\n\t\t\t\t\t\t\tPaperProps={{\n\t\t\t\t\t\t\t\televation: 24,\n\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\toverflow: 'visible',\n\t\t\t\t\t\t\t\t\tmt: '15px',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\tdisplay: { xs: 'block', sm: 'none' },\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Box sx={{ paddingLeft: '10px', paddingRight: '10px' }}>{props.buttons}</Box>\n\t\t\t\t\t\t</Menu>\n\t\t\t\t\t</Box>\n\t\t\t\t) : (\n\t\t\t\t\t''\n\t\t\t\t)}\n\t\t\t\t<Box sx={{ marginRight: '25px', display: { xs: 'none', sm: 'flex' } }}>{props.buttons}</Box>\n\t\t\t</Toolbar>\n\t\t</AppBar>\n\t);\n}\n\nexport default TopToolbar;\n","import React, { useState } from 'react';\nimport { styled } from '@mui/material/styles';\nimport CloseIcon from '@mui/icons-material/Close';\nimport { Paper, Drawer, IconButton, PaperProps, DrawerProps } from '@mui/material';\nimport useMediaQuery from '@mui/material/useMediaQuery';\nimport Box from '@mui/material/Box';\nimport { Global } from '@emotion/react';\nimport { Typography, SwipeableDrawer } from '@mui/material/';\n\nconst DrawerHeader = styled('div')(() => ({\n\tdisplay: 'flex',\n\talignItems: 'center',\n}));\n\ninterface SidebarProps {\n\tdrawerPaperProps?: PaperProps;\n\tdrawerHeaderProps?: Headers;\n\tchildren?: React.ReactNode;\n\topen?: boolean;\n\tsetOpen?: (val: boolean) => void;\n\tname?: string;\n}\n\nconst drawerBleeding = 56;\n\nconst Puller = styled(Box)(({ theme }) => ({\n\twidth: 30,\n\theight: 6,\n\tbackgroundColor: theme.palette.text.primary,\n\tborderRadius: 3,\n\tposition: 'absolute',\n\ttop: 8,\n\tleft: 'calc(50% - 15px)',\n}));\n\nexport default function Sidebar({\n\tdrawerPaperProps,\n\tdrawerHeaderProps,\n\t...props\n}: SidebarProps & DrawerProps) {\n\tconst mediaIsMobile = useMediaQuery('(max-width:600px)');\n\n\tconst [drawerOpen, setDrawerOpen] = useState(false);\n\n\treturn (\n\t\t<>\n\t\t\t{!mediaIsMobile ? (\n\t\t\t\t<Box sx={{ display: { xs: 'none', sm: 'flex' }, mr: 1 }}>\n\t\t\t\t\t<Drawer\n\t\t\t\t\t\ttransitionDuration={0}\n\t\t\t\t\t\tvariant=\"persistent\"\n\t\t\t\t\t\tanchor=\"left\"\n\t\t\t\t\t\topen={typeof props.open === 'undefined' ? drawerOpen : props.open}\n\t\t\t\t\t\tPaperProps={{\n\t\t\t\t\t\t\t...drawerPaperProps,\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tmaxWidth: { lg: '30%', md: '40%', sm: '50%', xs: '78%' },\n\t\t\t\t\t\t\t\tpadding: { lg: '20px', md: '20px', sm: '20px', xs: '10px' },\n\t\t\t\t\t\t\t\ttop: '64px',\n\t\t\t\t\t\t\t\twidth: {\n\t\t\t\t\t\t\t\t\txs: '80%',\n\t\t\t\t\t\t\t\t\tsm: '60%',\n\t\t\t\t\t\t\t\t\tmd: '350px',\n\t\t\t\t\t\t\t\t\tlg: '350px',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\t\t...drawerPaperProps?.sx,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\t\tzIndex: 105,\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\tbottom: 0,\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\t\tmaxWidth: { lg: '30%', md: '40%', sm: '50%', xs: '78%' },\n\t\t\t\t\t\t\t...(drawerOpen ? {} : { left: mediaIsMobile ? '-90vw' : '-20vw' }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DrawerHeader {...drawerHeaderProps}>\n\t\t\t\t\t\t\t<Typography variant=\"h6\">{props.name}</Typography>\n\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\tprops.setOpen\n\t\t\t\t\t\t\t\t\t\t? () => {\n\t\t\t\t\t\t\t\t\t\t\t\tprops.setOpen?.(false);\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: () => {\n\t\t\t\t\t\t\t\t\t\t\t\tsetDrawerOpen(false);\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\t\tright: '20px',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<CloseIcon />\n\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t</DrawerHeader>\n\t\t\t\t\t\t<Box>{props.children}</Box>\n\t\t\t\t\t</Drawer>\n\t\t\t\t</Box>\n\t\t\t) : (\n\t\t\t\t<Box sx={{ display: { xs: 'flex', sm: 'none' } }}>\n\t\t\t\t\t<Global\n\t\t\t\t\t\tstyles={{\n\t\t\t\t\t\t\t'.MuiDrawer-root > .MuiPaper-root': {\n\t\t\t\t\t\t\t\theight: `calc(50% - ${drawerBleeding}px)`,\n\t\t\t\t\t\t\t\toverflow: 'visible',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<SwipeableDrawer\n\t\t\t\t\t\tanchor=\"bottom\"\n\t\t\t\t\t\topen={typeof props.open === 'undefined' ? drawerOpen : props.open}\n\t\t\t\t\t\tonClose={\n\t\t\t\t\t\t\tprops.setOpen\n\t\t\t\t\t\t\t\t? () => {\n\t\t\t\t\t\t\t\t\t\tprops.setOpen?.(false);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: () => {\n\t\t\t\t\t\t\t\t\t\tsetDrawerOpen(false);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonOpen={\n\t\t\t\t\t\t\tprops.setOpen\n\t\t\t\t\t\t\t\t? () => {\n\t\t\t\t\t\t\t\t\t\tprops.setOpen?.(true);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: () => {\n\t\t\t\t\t\t\t\t\t\tsetDrawerOpen(true);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tswipeAreaWidth={drawerBleeding}\n\t\t\t\t\t\tdisableSwipeToOpen={false}\n\t\t\t\t\t\thideBackdrop={true}\n\t\t\t\t\t\tModalProps={{\n\t\t\t\t\t\t\tkeepMounted: true,\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\ttop: `calc(90%)`,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Paper\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\ttop: -drawerBleeding,\n\t\t\t\t\t\t\t\tborderTopLeftRadius: 8,\n\t\t\t\t\t\t\t\tborderTopRightRadius: 8,\n\t\t\t\t\t\t\t\tvisibility: 'visible',\n\t\t\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Puller />\n\t\t\t\t\t\t\t<Typography variant=\"h6\" sx={{ p: '13px' }}>\n\t\t\t\t\t\t\t\t{props.name}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</Paper>\n\n\t\t\t\t\t\t<Paper\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\tpx: '15px',\n\t\t\t\t\t\t\t\tpb: '15px',\n\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t\t\t\tpaddingTop: '20px',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{props.children}\n\t\t\t\t\t\t</Paper>\n\t\t\t\t\t</SwipeableDrawer>\n\t\t\t\t</Box>\n\t\t\t)}\n\t\t\t;\n\t\t</>\n\t);\n}\n"],"names":["Map","createTheme","React","useState","useRef","MUIThemeProvider","defaultProps","useContext","useEffect","uuidv4","useCallback","PropTypes","Button","GpsFixedIcon","jsPDF","useMemo","CircularProgress","PrinterIcon","templates","turf","ReactDOM","Moveable","FormControl","InputLabel","Select","MenuItem","FormLabel","RadioGroup","FormControlLabel","Radio","classes","CONTROL_BASE","CONTROL_PREFIX","CONTROL_BUTTON","CONTROL_BUTTON_LINE","CONTROL_BUTTON_POLYGON","CONTROL_BUTTON_POINT","CONTROL_BUTTON_TRASH","CONTROL_BUTTON_COMBINE_FEATURES","CONTROL_BUTTON_UNCOMBINE_FEATURES","CONTROL_GROUP","ATTRIBUTION","ACTIVE_BUTTON","BOX_SELECT","cursors","ADD","MOVE","DRAG","POINTER","NONE","types","POLYGON","LINE","POINT","geojsonTypes","FEATURE","LINE_STRING","FEATURE_COLLECTION","MULTI_PREFIX","MULTI_POINT","MULTI_LINE_STRING","MULTI_POLYGON","events","CREATE","DELETE","UPDATE","SELECTION_CHANGE","MODE_CHANGE","ACTIONABLE","RENDER","COMBINE_FEATURES","UNCOMBINE_FEATURES","updateActions","CHANGE_COORDINATES","meta","MIDPOINT","VERTEX","activeStates","ACTIVE","INACTIVE","LAT_MIN","LAT_RENDERED_MIN","LAT_MAX","LAT_RENDERED_MAX","LNG_MIN","LNG_MAX","isOfMetaType","type","e","featureTarget","properties","isShiftMousedown","originalEvent","shiftKey","button","isActiveFeature","active","Constants","isInactiveFeature","noTarget","undefined","isFeature","isVertex","isShiftDown","isEscapeKey","keyCode","isEnterKey","doubleClickZoom","enable","ctx","setTimeout","map","_ctx","store","getInitialConfigValue","disable","isEventAtCoordinates","event","coordinates","lngLat","lng","lat","create_vertex","parentId","path","selected","parent","coord_path","geometry","CustomPolygonMode","onSetup","console","log","polygon","newFeature","addFeature","clearSelectedFeatures","updateUIClasses","mouse","activateUIButton","setActionableState","trash","currentVertexPosition","clickAnywhere","state","changeMode","featureIds","id","updateCoordinate","fire","features","toGeoJSON","clickOnVertex","onMouseMove","CommonSelectors","onTap","onClick","onKeyUp","deleteFeature","silent","onStop","getFeature","removeCoordinate","isValid","toDisplayFeatures","geojson","display","isActivePolygon","length","coordinateCount","createVertex","endPos","lineCoordinates","onTrash","mouseEventPoint","mouseEvent","container","rect","getBoundingClientRect","Point","clientX","left","clientLeft","clientY","top","clientTop","create_midpoint","startVertex","endVertex","startCoord","endCoord","mid","createSupplementaryPoints","options","basePath","featureId","supplementaryPoints","push","isSelectedPath","forEach","line","lineIndex","processLine","String","indexOf","processMultiGeometry","lineBasePath","firstPointString","lastVertex","point","pointIndex","pointPath","vertex","midpoints","midpoint","createMidpoint","stringifiedPoint","JSON","stringify","selectedPaths","subType","replace","subCoordinates","index","subFeature","concat","StringSet","items","_items","_nums","_length","i","l","add","prototype","x","has","values","Object","keys","k","v","parse","sort","a","b","clear","geojsonCoords","require","traverse","extent","geojsonTypesByDataAttributes","geometries","dataAttributes","module","_","getExtent","bbox","geojsonExtent","value","some","attribute","update","ext","coords","include","constrain_feature_movement","geojsonFeatures","delta","northInnerEdge","southInnerEdge","northOuterEdge","southOuterEdge","westEdge","eastEdge","feature","bounds","featureSouthEdge","featureNorthEdge","featureWestEdge","featureEastEdge","constrainedDelta","Math","ceil","abs","move_features","constrainFeatureMovement","currentCoordinates","getCoordinates","moveCoordinate","coord","moveRing","ring","moveMultiPolygon","multi","nextCoordinates","incomingCoords","CustomSelectMode","opts","dragMoveLocation","boxSelectStartLocation","boxSelectElement","boxSelecting","canBoxSelect","dragMoving","canDragMove","initiallySelectedFeatureIds","setSelected","filter","fireActionable","combineFeatures","uncombineFeatures","fireUpdate","action","getSelected","f","selectedFeatures","multiFeatures","isInstanceOf","featureType","getUniqueIds","allFeatures","ids","s","reduce","memo","stopExtendedInteractions","parentNode","removeChild","dragPan","onMouseOut","clickOnFeature","wasSelected","getSelectedIds","doRender","coordPath","startPos","startOnActiveFeature","isShiftClick","selectedFeatureIds","isFeatureSelected","isSelected","deselect","select","onMouseDown","drawConfig","boxSelect","startBoxSelect","getContainer","onTouchStart","onDrag","dragMove","whileBoxSelect","document","createElement","classList","appendChild","current","minX","min","maxX","max","minY","y","maxY","translateValue","style","transform","WebkitTransform","width","height","stopPropagation","moveFeatures","onMouseUp","featuresInBox","featuresAt","idsToSelect","onCombineFeatures","featuresCombined","includes","subcoords","multiFeature","createdFeatures","deletedFeatures","onUncombineFeatures","featuresUncombined","getFeatures","drawUtils","getMatchingVertices","decimals","matchingVertices","v_lng","toFixed","v_lat","m","getDrawInstance","_controls","modes","SIMPLE_SELECT","isMidpoint","DirectSelect","selectedCoordPaths","startDragging","stopDragging","onVertex","about","selectedIndex","getAll","_geometry","groupMove_vertices","selectedCoordinates","pathsToCoordinates","setSelectedCoordinates","onMidpoint","addCoordinate","paths","feature_id","onFeature","dragFeature","dragVertex","selectedCoords","getCoordinate","selectedCoordPoints","coord_path_m","split","coord_m","clickNoTarget","clickInactive","clickActiveFeature","clearSelectedCoordinates","changed","Error","TypeError","localeCompare","numeric","noCoords","onTouchEnd","MapboxDraw","CustomDirectSelectMode","circle","lineArc","_extends","_g","styled","css","RotateRightIcon","NeedleIcon","RotateLeftIcon","useMediaQuery","Box","ButtonGroup","ControlPointIcon","RemoveCircleOutlineIcon","syncMove","_showNextTransitionSegment","props","transitionInProgressRef","transitionGeojsonDataRef","transitionGeojsonCommonDataRef","currentTransitionStepRef","msPerStep","transitionTimeoutRef","setDisplayGeojson","newData","lineString","onTransitionFrame","arguments","onTransitionEnd","_transitionToGeojson","oldGeojsonRef","transitionCoordinatesShort","transitionCoordinatesLong","targetCoordinates","srcCoordinates","sourceGeojson","targetGeojson","longerGeojson","shorterGeojson","reverseOrder","slice","len","transitionSteps","transitionTime","srcCoordinatesDistance","round","targetCoordinatesDistance","transitionDistance","srcCoordinatesShare","srcTransitionSteps","srcPerStepDistance","targetCoordinatesShare","targetTransitionSteps","targetPerStepDistance","transitionStepData","createTransitionSteps","reverse","linestringCoordinates","perStepDistance","stepCnt","tmpChunks","lineChunk","tmpLinestring","Paper","MlOsmLayer","mapHook","useMap","mapId","waitForLayer","insertBeforeLayer","layerId","componentId","addSource","_objectSpread","tileSize","sourceOptions","addLayer","source","minzoom","maxzoom","layerOptions","propTypes","string","idPrefix","object","removeSpace","trimSpace","splitSpace","okhash","h","charCodeAt","get","getElementsByTagName","attr","getAttribute","attrf","parseFloat","get1","n","norm","el","normalize","numarray","j","o","nodeVal","textContent","getMulti","ys","extend","coord1","coordPair","ll","ele","heartRate","time","isNaN","fc","serializer","XMLSerializer","isNodeEnv","process","browser","isTitaniumEnv","Titanium","exports","xml2str","str","xml","serializeToString","t","kml","doc","gj","styleIndex","styleByHash","styleMapIndex","geotypes","placemarks","styles","styleMaps","hash","toString","pairs","pairsMap","getPlacemark","kmlColor","color","opacity","substr","parseInt","gxCoord","gxCoords","root","elems","times","timeElems","getGeometry","geomNode","geomNodes","geoms","coordTimes","rings","track","geomsAndTimes","name","address","styleUrl","description","timeSpan","timeStamp","extendedData","lineStyle","polyStyle","visibility","styleHash","styleMapHash","normal","iconStyle","icon","href","begin","end","timespan","timestamp","linestyles","stroke","polystyles","pcolor","popacity","fill","outline","datas","simpleDatas","gpx","tracks","routes","waypoints","getTrack","getRoute","getPoint","initializeArray","arr","size","getPoints","node","pointname","pts","heartRates","c","segments","getProperties","getLineStyle","prop","routeObj","extensions","links","link","Popup","featureCollection","lineOffset","distance","MlWmsFeatureInfoPopup","mapContext","MapContext","initializedRef","mapRef","_componentId","cleanup","mapExists","getMap","setCenter","mapIds","WMSCapabilities","List","ListItem","IconButton","VisibilityIcon","VisibilityOffIcon","ListItemText","MlBasicComponent","mapIsReady","touchEquivalents","mousedown","mouseup","mousemove","touchEquivalentsKeys","useLayerEvent","mapState","useMapState","watch","layers","condition","getLayer","_event","_layerId","_eventHandler","eventHandler","on","addTouchEvents","off","SimpleDataContext","createContext","SimpleDataContextProvider","Provider","SimpleDataProvider","data","setData","url","data_promise","format","d3","json","csv","then","received_data","nodeType","dataTmp","querySelectorAll","formatData","data_property","onData","children","isRequired","ColorPicker","Typography","Slider","TextField","ExpandLess","ExpandMore","ListItemIcon","Checkbox","TuneIcon","useTheme","AppBar","Toolbar","MenuIcon","Menu","Drawer","CloseIcon","Global","SwipeableDrawer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,IAAA,iBAAA,kBAAA,YAAA;AAoEC,IAAA,SAAA,iBAAA,CAAY,KAGX,EAA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AA;gBAEDluB,yBAAC,CAAA,aAAA,CAAAof,cAAK,EACL,EAAA,EAAE,EAAE;AACH,wBAAA,QAAQ,EAAE,UAAU;wBACpB,GAAG,EAAE,CAAC,cAAc;AACpB,wBAAA,mBAAmB,EAAE,CAAC;AACtB,wBAAA,oBAAoB,EAAE,CAAC;AACvB,wBAAA,UAAU,EAAE,SAAS;AACrB,wBAAA,KAAK,EAAE,CAAC;AACR,wBAAA,IAAI,EAAE,CAAC;AACP,qBAAA,EAAA;AAED,oBAAApf,yBAAA,CAAA,aAAA,CAAC,MAAM,EAAG,IAAA,CAAA;AACV,oBAAAA,yBAAA,CAAA,aAAA,CAACktB,YAAU,EAAC,EAAA,OAAO,EAAC,IAAI,EAAC,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,EAAA,EACxC,KAAK,CAAC,IAAI,CACC,CACN;gBAERltB,yBAAC,CAAA,aAAA,CAAAof,cAAK,EACL,EAAA,EAAE,EAAE;AACH,wBAAA,EAAE,EAAE,MAAM;AACV,wBAAA,EAAE,EAAE,MAAM;AACV,wBAAA,MAAM,EAAE,MAAM;AACd,wBAAA,QAAQ,EAAE,MAAM;AAChB,wBAAA,UAAU,EAAE,MAAM;AAClB,qBAAA,EAAA,EAEA,KAAK,CAAC,QAAQ,CACR,CACS,CACb,CACN;AAEC,QAAA,GAAA,CAAA,EACF;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/components/MapLibreMap/lib/MapLibreGlWrapper.ts","../src/ui_components/MapcomponentsTheme.tsx","../src/contexts/MapContext.tsx","../src/components/MapLibreMap/MapLibreMap.tsx","../src/hooks/useMapState.ts","../src/hooks/useMap.ts","../src/components/MlCenterPosition/MlCenterPosition.tsx","../src/components/MlComponentTemplate/MlComponentTemplate.tsx","../src/hooks/useExportMap/lib.ts","../src/hooks/useExportMap/index.ts","../src/components/MlCreatePdfButton/MlCreatePdfButton.tsx","../src/components/MlCreatePdfForm/lib/pdf.templates.ts","../src/components/MlCreatePdfForm/lib/PdfContext.tsx","../src/components/MlCreatePdfForm/lib/PdfPreview.tsx","../src/components/MlCreatePdfForm/lib/PdfForm.tsx","../src/components/MlCreatePdfForm/MlCreatePdfForm.tsx","../src/components/MlFeatureEditor/lib/constants.js","../src/components/MlFeatureEditor/lib/common_selectors.js","../src/components/MlFeatureEditor/lib/double_click_zoom.js","../src/components/MlFeatureEditor/lib/is_event_at_coordinates.js","../src/components/MlFeatureEditor/lib/create_vertex.js","../src/components/MlFeatureEditor/custom-polygon-mode.js","../src/components/MlFeatureEditor/lib/mouse_event_point.js","../src/components/MlFeatureEditor/lib/create_midpoint.js","../src/components/MlFeatureEditor/lib/create_supplementary_points.js","../src/components/MlFeatureEditor/lib/string_set.js","../node_modules/@mapbox/geojson-extent/index.js","../src/components/MlFeatureEditor/lib/constrain_feature_movement.js","../src/components/MlFeatureEditor/lib/move_features.js","../src/components/MlFeatureEditor/custom-select-mode.js","../src/components/MlFeatureEditor/lib/utils.js","../src/components/MlFeatureEditor/custom-direct-select-mode.js","../src/components/MlFeatureEditor/MlFeatureEditor.tsx","../src/hooks/useLayer.ts","../src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx","../src/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.ts","../src/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.ts","../src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx","../src/components/MlFollowGps/MlFollowGps.tsx","../src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx","../src/components/MlMeasureTool/MlMeasureTool.tsx","../src/components/MlNavigationCompass/assets/rotate_right.svg","../src/components/MlNavigationCompass/assets/rotate_left.svg","../src/components/MlNavigationCompass/assets/needle.svg","../src/components/MlNavigationCompass/MlNavigationCompass.tsx","../src/components/MlNavigationTools/MlNavigationTools.tsx","../src/components/MlLayer/MlLayer.tsx","../src/components/MlScaleReference/MlScaleReference.tsx","../src/components/MlLayerMagnify/MlLayerMagnify.tsx","../src/components/MlLayerSwipe/MlLayerSwipe.tsx","../src/components/MlTransitionGeoJsonLayer/util/transitionFunctions.js","../src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx","../src/components/MlMarker/MlMarker.tsx","../src/components/MlOsmLayer/MlOsmLayer.js","../src/hooks/useGpx/lib/gpxConverter.js","../src/hooks/useGpx/useGpx.tsx","../src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx","../src/hooks/useSource.ts","../src/components/MlGpxViewer/MlGpxViewer.tsx","../src/components/MlGpxViewer/util/GeoJsonContext.ts","../src/components/MlGpxViewer/util/GeoJsonProvider.tsx","../src/components/MlShareMapState/MlShareMapState.tsx","../src/components/MlSpatialElevationProfile/util/getElevationData.tsx","../src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx","../src/components/MlVectorTileLayer/MlVectorTileLayer.tsx","../src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js","../src/components/MlWmsLayer/MlWmsLayer.tsx","../src/hooks/useWms.ts","../src/components/MlWmsLoader/MlWmsLoader.tsx","../src/components/MlBasicComponent.js","../src/hooks/useCameraFollowPath/useCameraFollowPath.tsx","../src/hooks/useLayerFilter/useLayerFilter.ts","../src/hooks/useLayerEvent.js","../src/contexts/SimpleDataContext.js","../src/contexts/SimpleDataProvider.js","../src/ui_components/LayerList/LayerList.tsx","../src/ui_components/ColorPicker/transformers.ts","../src/ui_components/ColorPicker/ColorPicker.tsx","../src/ui_components/LayerList/util/input/ColorPicker.tsx","../src/ui_components/LayerList/util/LayerPropertyForm.tsx","../src/ui_components/LayerList/LayerListFolder.tsx","../src/ui_components/LayerList/util/LayerListItemVectorLayer.tsx","../src/ui_components/LayerList/LayerListItem.tsx","../src/ui_components/TopToolbar.tsx","../src/ui_components/Sidebar.tsx"],"sourcesContent":["import {\n\tMap,\n\tIControl,\n\tMapOptions as MapOptionsType,\n\tMapEventType,\n\tMapLayerEventType,\n\tStyleImageInterface,\n\tLayerSpecification,\n\tCustomLayerInterface,\n\tSourceSpecification,\n\tControlPosition,\n\tStyleImageMetadata,\n} from 'maplibre-gl';\nimport { Map as MapType, Style } from 'maplibre-gl';\n\ntype WrapperEventArgArray = [string, (arg0: unknown) => void];\ntype EventArgArray = [\n\tkeyof MapLayerEventType | keyof MapEventType,\n\tstring | ((arg0: unknown) => void),\n\t((arg0: unknown) => void)?\n];\ntype LayerState = {\n\tid: string;\n\ttype: string;\n\tvisible: boolean;\n\tbaseLayer: boolean;\n};\ntype ViewportState = {\n\tcenter: { lng: number; lat: number };\n\tzoom: number;\n\tbearing: number;\n\tpitch: number;\n};\n\n/**\n * Creates a MapLibre-gl-js instance and offers all of the native MapLibre functions and properties as well as additional functionality such as element registration & cleanup and more events.\n *\n * @param {object} props\n *\n * @class\n */\n\ninterface MapLibreGlWrapper extends MapType {\n\taddImage: (\n\t\tid: string,\n\t\timage:\n\t\t\t| HTMLImageElement\n\t\t\t| ImageBitmap\n\t\t\t| ImageData\n\t\t\t| {\n\t\t\t\t\twidth: number;\n\t\t\t\t\theight: number;\n\t\t\t\t\tdata: Uint8Array | Uint8ClampedArray;\n\t\t\t }\n\t\t\t| StyleImageInterface,\n\t\tkey?: Partial<StyleImageMetadata> | string | undefined,\n\t\tcomponentId?: string | undefined\n\t) => this;\n\taddLayer: (\n\t\tlayer:\n\t\t\t| (LayerSpecification & {\n\t\t\t\t\tsource?: string | SourceSpecification | undefined;\n\t\t\t })\n\t\t\t| (CustomLayerInterface & {\n\t\t\t\t\tsource?: string | SourceSpecification | undefined;\n\t\t\t }),\n\t\tbeforeId?: string | undefined,\n\t\tcomponentId?: string | undefined\n\t) => this;\n\tcancelled: boolean;\n}\nclass MapLibreGlWrapper {\n\tregisteredElements: {\n\t\t[key: string]: {\n\t\t\tlayers: [string?];\n\t\t\tsources: [string?];\n\t\t\timages: [string?];\n\t\t\tcontrols: [(IControl | unknown)?];\n\t\t\tevents: [EventArgArray?];\n\t\t\twrapperEvents: [WrapperEventArgArray?];\n\t\t};\n\t};\n\tbaseLayers: [string?];\n\tfirstSymbolLayer: string | undefined;\n\teventHandlers: {\n\t\tlayerchange: {\n\t\t\thandler: (ev: unknown) => void;\n\t\t\toptions?: object | string;\n\t\t}[];\n\t\tviewportchange: {\n\t\t\thandler: (ev: unknown) => void;\n\t\t}[];\n\t};\n\twrapper: {\n\t\ton: (\n\t\t\teventName: string,\n\t\t\thandler: (ev: unknown) => void,\n\t\t\toptions?: object | string,\n\t\t\tcomponentId?: string\n\t\t) => void;\n\t\toff: (type: string, listener: (ev: unknown) => void) => void;\n\t\tfire: (eventName: string, context?: unknown) => void;\n\t\tlayerState: LayerState[];\n\t\tlayerStateString: string;\n\t\toldLayerStateStrings: object;\n\t\tbuildLayerObject: (layer: ReturnType<Style['getLayer']>) => LayerState;\n\t\tbuildLayerObjects: () => LayerState[];\n\t\trefreshLayerState: () => void;\n\t\tviewportState: ViewportState;\n\t\tviewportStateString: string;\n\t\toldViewportStateString: string;\n\t\tgetViewport: () => {\n\t\t\tcenter: { lng: number; lat: number };\n\t\t\tzoom: number;\n\t\t\tbearing: number;\n\t\t\tpitch: number;\n\t\t};\n\t\trefreshViewport: () => void;\n\t};\n\tinitRegisteredElements: (componentId: string, force?: boolean | undefined) => void;\n\taddNativeMaplibreFunctionsAndProps: () => void;\n\tmap: MapType;\n\tstyle: Style;\n\n\tstyleJson: object;\n\taddSource: (id: string, source: SourceSpecification, componentId?: string | undefined) => this;\n\taddControl: (\n\t\tcontrol: IControl | unknown,\n\t\tposition?: ControlPosition | undefined,\n\t\tcomponentId?: string | undefined\n\t) => this;\n\ton: (\n\t\ttype: keyof MapLayerEventType | keyof MapEventType | string,\n\t\tlayerId: string | ((ev: unknown) => void),\n\t\thandler?: ((ev: MapEventType & unknown) => Map | void) | string,\n\t\tcomponentId?: string | undefined\n\t) => this;\n\tcleanup: (componentId: string) => void;\n\n\tconstructor(props: {\n\t\tmapOptions: MapOptionsType;\n\t\tonReady: (map: MapType, context: unknown) => void;\n\t}) {\n\t\t// closure variable to safely point to the object context of the current MapLibreGlWrapper instance\n\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias\n\t\tconst self = this;\n\n\t\t// element registration and cleanup on a component level is experimental\n\t\tthis.registeredElements = {};\n\n\t\t// array of base layer ids, all layers that have been added by the style passed to the MapLibreGl coonstructor\n\t\tthis.baseLayers = [];\n\n\t\t// layer id of the first symbol layer\n\t\tthis.firstSymbolLayer = undefined;\n\n\t\t// event handlers registered in MapLibreGlWrapper\n\t\tthis.eventHandlers = {\n\t\t\tlayerchange: [],\n\t\t\tviewportchange: [],\n\t\t};\n\n\t\t// functions and properties provided by the wrapper\n\t\t// Add new functions and properties introduced by the wrapper to this object to prevent collisions due to future MapLibre API changes\n\t\tthis.wrapper = {\n\t\t\t/**\n\t\t\t * Subscribe the given event handler to an event\n\t\t\t *\n\t\t\t * @param {string} eventName\n\t\t\t * @param {function} handler\n\t\t\t * @param {object} options\n\t\t\t * @param {string} componentId\n\t\t\t * @returns {undefined}\n\t\t\t */\n\t\t\ton: (\n\t\t\t\teventName: string,\n\t\t\t\thandler: (ev: unknown) => void,\n\t\t\t\toptions?: object | string,\n\t\t\t\tcomponentId?: string\n\t\t\t) => {\n\t\t\t\tif (!self.eventHandlers[eventName]) return;\n\n\t\t\t\tif (typeof options === 'string') {\n\t\t\t\t\tcomponentId = options;\n\t\t\t\t\toptions = {};\n\t\t\t\t}\n\n\t\t\t\tself.eventHandlers[eventName].push({ handler, options });\n\n\t\t\t\tconst _arguments: WrapperEventArgArray = [eventName, handler];\n\t\t\t\tif (componentId && typeof componentId === 'string') {\n\t\t\t\t\tself.initRegisteredElements(componentId);\n\t\t\t\t\tself.registeredElements[componentId].wrapperEvents.push(_arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/**\n\t\t\t * Unsubscribes the given event handler from an event\n\t\t\t *\n\t\t\t * @param {string} eventName\n\t\t\t * @param {function} handler\n\t\t\t * @returns {undefined}\n\t\t\t */\n\t\t\toff: (eventName, handler) => {\n\t\t\t\tif (!self.eventHandlers[eventName]) return;\n\n\t\t\t\tself.eventHandlers[eventName] = self.eventHandlers[eventName].filter(\n\t\t\t\t\t(item: WrapperEventArgArray) => {\n\t\t\t\t\t\tif (!Object.is(item[1], handler)) {\n\t\t\t\t\t\t\treturn item;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Calls all event handlers that have been subscribed to the given eventName\n\t\t\t *\n\t\t\t * @param {string} eventName\n\t\t\t * @param {object} context\n\t\t\t * @returns {undefined}\n\t\t\t */\n\t\t\tfire: (eventName, context) => {\n\t\t\t\tif (!self.eventHandlers[eventName]) return;\n\n\t\t\t\tconst scope = context || window;\n\t\t\t\tconst event = new Event(eventName);\n\n\t\t\t\tself.eventHandlers[eventName].forEach(function (\n\t\t\t\t\titem:\n\t\t\t\t\t\t| MapLibreGlWrapper['eventHandlers']['layerchange'][0]\n\t\t\t\t\t\t| MapLibreGlWrapper['eventHandlers']['viewportchange'][0]\n\t\t\t\t) {\n\t\t\t\t\titem.handler.call(scope, event, self);\n\t\t\t\t});\n\t\t\t},\n\t\t\t/**\n\t\t\t * Array containing an object for each layer in the MapLibre instance providing information on visibility, loading state, order, paint & layout properties\n\t\t\t */\n\t\t\tlayerState: [],\n\t\t\t/**\n\t\t\t * Maps layerIds to layerState in JSON string form for quick deep comparisons\n\t\t\t */\n\t\t\tlayerStateString: '',\n\t\t\t/**\n\t\t\t * Previous Version of layerStateString\n\t\t\t */\n\t\t\toldLayerStateStrings: {},\n\t\t\t/**\n\t\t\t * Builds the layer info object for a given layer id\n\t\t\t *\n\t\t\t * @param {string} layer\n\t\t\t * @returns object\n\t\t\t */\n\t\t\tbuildLayerObject: (layer: ReturnType<Style['getLayer']>) => {\n\t\t\t\t//if (self.baseLayers.indexOf(layer.id) === -1) {\n\t\t\t\t//let paint = {};\n\t\t\t\t//let values = layer.paint?._values;\n\t\t\t\t//Object.keys(values || {}).map((propName) => {\n\t\t\t\t//\tpaint[propName] =\n\t\t\t\t//\t\ttypeof values[propName].value !== \"undefined\"\n\t\t\t\t//\t\t\t? values[propName].value.value\n\t\t\t\t//\t\t\t: values[propName];\n\t\t\t\t//});\n\t\t\t\t//let layout = {};\n\t\t\t\t//values = layer.layout?._values;\n\t\t\t\t//Object.keys(values || {}).map((propName) => {\n\t\t\t\t//\tlayout[propName] =\n\t\t\t\t//\t\ttypeof values[propName].value !== \"undefined\"\n\t\t\t\t//\t\t\t? values[propName].value.value\n\t\t\t\t//\t\t\t: values[propName];\n\t\t\t\t//});\n\t\t\t\treturn {\n\t\t\t\t\tid: layer.id,\n\t\t\t\t\ttype: layer.type,\n\t\t\t\t\tvisible: layer.visibility === 'none' ? false : true,\n\t\t\t\t\tbaseLayer: self.baseLayers.indexOf(layer.id) !== -1,\n\t\t\t\t\t//paint,\n\t\t\t\t\t//layout,\n\t\t\t\t\t//filter: layers[layerId].filter,\n\t\t\t\t\t//layout: layers[layerId].layout,\n\t\t\t\t\t//maxzoom: layers[layerId].maxzoom,\n\t\t\t\t\t//metadata: layers[layerId].metadata,\n\t\t\t\t\t//minzoom: layers[layerId].minzoom,\n\t\t\t\t\t//paint: layers[layerId].paint.get(),\n\t\t\t\t\t//source: layers[layerId].source,\n\t\t\t\t\t//sourceLayer: layers[layerId].sourceLayer,\n\t\t\t\t};\n\t\t\t\t//}\n\t\t\t},\n\t\t\t/**\n\t\t\t * Returns an array of layer state info objects for all layers in the MapLibre instance\n\t\t\t *\n\t\t\t * @returns array\n\t\t\t */\n\t\t\tbuildLayerObjects: () => {\n\t\t\t\treturn self.map.style._order\n\t\t\t\t\t.map((layerId: string) => {\n\t\t\t\t\t\treturn self.wrapper.buildLayerObject(self.map.style._layers[layerId]);\n\t\t\t\t\t})\n\t\t\t\t\t.filter((n) => typeof n !== 'undefined');\n\t\t\t},\n\t\t\t/**\n\t\t\t * Updates layer state info objects\n\t\t\t */\n\t\t\trefreshLayerState: () => {\n\t\t\t\tself.wrapper.layerState = self.wrapper.buildLayerObjects();\n\t\t\t\tif (JSON.stringify(self.wrapper.layerState) !== self.wrapper.layerStateString) {\n\t\t\t\t\tself.wrapper.fire('layerchange');\n\t\t\t\t\tself.wrapper.layerStateString = JSON.stringify(self.wrapper.layerState);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/**\n\t\t\t * Object containing information on the current viewport state\n\t\t\t */\n\t\t\tviewportState: {\n\t\t\t\tcenter: { lng: 0, lat: 0 },\n\t\t\t\tzoom: 0,\n\t\t\t\tbearing: 0,\n\t\t\t\tpitch: 0,\n\t\t\t},\n\t\t\t/**\n\t\t\t * The same data as viewportState in JSON string form for quick deep comparisons\n\t\t\t */\n\t\t\tviewportStateString: '{}',\n\t\t\t/**\n\t\t\t * Previous version of viewportStateString\n\t\t\t */\n\t\t\toldViewportStateString: '{}',\n\t\t\tgetViewport: () =>\n\t\t\t\ttypeof self.map.getCenter === 'function'\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcenter: (({ lng, lat }) => ({ lng, lat }))(self.map.getCenter()),\n\t\t\t\t\t\t\tzoom: self.map.getZoom(),\n\t\t\t\t\t\t\tbearing: self.map.getBearing(),\n\t\t\t\t\t\t\tpitch: self.map.getPitch(),\n\t\t\t\t\t }\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tcenter: { lng: 0, lat: 0 },\n\t\t\t\t\t\t\tzoom: 0,\n\t\t\t\t\t\t\tbearing: 0,\n\t\t\t\t\t\t\tpitch: 0,\n\t\t\t\t\t },\n\t\t\trefreshViewport: () => {\n\t\t\t\tself.wrapper.viewportState = self.wrapper.getViewport();\n\t\t\t},\n\t\t};\n\n\t\tthis.cancelled = false;\n\n\t\t/**\n\t\t * Initializes an empty registered elements object for the given componentId\n\t\t *\n\t\t * @param {string} componentId\n\t\t * @param {boolean} force\n\t\t */\n\t\tthis.initRegisteredElements = (componentId: string, force?: boolean | undefined) => {\n\t\t\tif (\n\t\t\t\ttypeof self.registeredElements[componentId] === 'undefined' ||\n\t\t\t\t(typeof force !== 'undefined' && force)\n\t\t\t) {\n\t\t\t\tself.registeredElements[componentId] = {\n\t\t\t\t\tlayers: [],\n\t\t\t\t\tsources: [],\n\t\t\t\t\timages: [],\n\t\t\t\t\tevents: [],\n\t\t\t\t\tcontrols: [],\n\t\t\t\t\twrapperEvents: [],\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Overrides MapLibre-gl-js addLayer function providing an additional componentId parameter for the wrapper element registration.\n\t\t *\n\t\t * @param {object} layer\n\t\t * @param {string} beforeId\n\t\t * @param {string} componentId\n\t\t */\n\t\tthis.addLayer = (layer, beforeId, componentId) => {\n\t\t\tif (!self.map.style) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tif (componentId && typeof componentId === 'string' && typeof layer.id !== 'undefined') {\n\t\t\t\tself.initRegisteredElements(componentId);\n\t\t\t\tself.registeredElements[componentId].layers.push(layer.id);\n\n\t\t\t\tif (layer?.source && typeof layer?.source !== 'string') {\n\t\t\t\t\tself.registeredElements[componentId].sources.push(layer.id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tself.map.addLayer(layer, beforeId);\n\t\t\treturn this;\n\t\t};\n\n\t\t/**\n\t\t * Overrides MapLibre-gl-js addSource function providing an additional componentId parameter for the wrapper element registration.\n\t\t *\n\t\t * @param {string} sourceId\n\t\t * @param {object} source\n\t\t * @param {object} options\n\t\t * @param {string} componentId\n\t\t * @returns {undefined}\n\t\t */\n\t\tthis.addSource = (sourceId, source, componentId) => {\n\t\t\tif (!self.map.style) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tif (componentId && typeof componentId === 'string' && typeof sourceId !== 'undefined') {\n\t\t\t\tself.initRegisteredElements(componentId);\n\t\t\t\tself.registeredElements[componentId].sources.push(sourceId);\n\t\t\t}\n\n\t\t\tself.map.addSource(sourceId, source);\n\t\t\treturn this;\n\t\t};\n\n\t\t/**\n\t\t * Overrides MapLibre-gl-js addImage function providing an additional componentId parameter for the wrapper element registration.\n\t\t *\n\t\t * @param {string} id\n\t\t * @param {*} image\n\t\t * @param {*} ref\n\t\t * @param {string} componentId\n\t\t */\n\t\tthis.addImage = (id, image, meta, componentId) => {\n\t\t\tif (!self.map.style) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tif (typeof meta === 'string' && typeof componentId === 'undefined') {\n\t\t\t\treturn self.addImage(id, image, undefined, meta);\n\t\t\t}\n\t\t\tif (componentId && typeof componentId === 'string' && typeof id !== 'undefined') {\n\t\t\t\tself.initRegisteredElements(componentId);\n\t\t\t\tself.registeredElements[componentId].images.push(id);\n\t\t\t}\n\n\t\t\tself.map.addImage(id, image, meta as Partial<StyleImageMetadata> | undefined);\n\t\t\treturn this;\n\t\t};\n\n\t\t/**\n\t\t * Overrides MapLibre-gl-js on function providing an additional componentId parameter for the wrapper element registration.\n\t\t *\n\t\t * @param {string} type\n\t\t * @param {string} layerId\n\t\t * @param {function} handler\n\t\t * @param {string} componentId\n\t\t */\n\t\tthis.on = (\n\t\t\ttype: keyof MapLayerEventType | keyof MapEventType,\n\t\t\tlayerId: string | ((ev: unknown) => void),\n\t\t\thandler: (ev: MapEventType & unknown) => Map | void,\n\t\t\tcomponentId?: string\n\t\t) => {\n\t\t\tif (typeof handler === 'string' && typeof layerId === 'function') {\n\t\t\t\treturn self.on.call(self, type, undefined, layerId, handler);\n\t\t\t}\n\n\t\t\tlet _arguments: EventArgArray = [type, layerId, handler];\n\t\t\tif (!layerId) {\n\t\t\t\t_arguments = [type, handler];\n\t\t\t}\n\n\t\t\tif (componentId && typeof componentId === 'string') {\n\t\t\t\tself.initRegisteredElements(componentId);\n\t\t\t\tself.registeredElements[componentId].events.push(_arguments);\n\t\t\t}\n\n\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t// @ts-ignore\n\t\t\tself.map.on(..._arguments);\n\t\t\treturn this;\n\t\t};\n\n\t\t/**\n\t\t * Overrides MapLibre-gl-js addControl function providing an additional componentId parameter for the wrapper element registration.\n\t\t *\n\t\t * @param {object} control\n\t\t * @param {string} position\n\t\t * @param {string} componentId\n\t\t */\n\t\tthis.addControl = (control, position, componentId) => {\n\t\t\tif (componentId && typeof componentId === 'string') {\n\t\t\t\tself.initRegisteredElements(componentId);\n\t\t\t\tself.registeredElements[componentId].controls.push(control);\n\t\t\t}\n\n\t\t\tself.map.addControl(control as IControl, position);\n\t\t\treturn this;\n\t\t};\n\n\t\t/**\n\t\t * Removes anything that has been added to the maplibre instance referenced with componentId\n\t\t *\n\t\t * @param {string} componentId\n\t\t */\n\t\tthis.cleanup = (componentId: string) => {\n\t\t\tif (self.map.style && typeof self.registeredElements[componentId] !== 'undefined') {\n\t\t\t\t// cleanup layers\n\t\t\t\tself.registeredElements[componentId].layers.forEach((item: string) => {\n\t\t\t\t\tif (self.map.style.getLayer(item)) {\n\t\t\t\t\t\tself.map.style.removeLayer(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// cleanup sources\n\t\t\t\tself.registeredElements[componentId].sources.forEach((item: string) => {\n\t\t\t\t\tif (self.map.style.getSource(item)) {\n\t\t\t\t\t\tself.map.style.removeSource(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// cleanup images\n\t\t\t\tself.registeredElements[componentId].images.forEach((item: string) => {\n\t\t\t\t\tif (self.map.hasImage(item)) {\n\t\t\t\t\t\tself.map.style.removeImage(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// cleanup events\n\t\t\t\tself.registeredElements[componentId].events.forEach((item: EventArgArray) => {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tself.map.off(...item);\n\t\t\t\t});\n\n\t\t\t\t// cleanup controls\n\t\t\t\tself.registeredElements[componentId].controls.forEach((item: IControl | unknown) => {\n\t\t\t\t\tself.map.removeControl(item as IControl);\n\t\t\t\t});\n\n\t\t\t\t// cleanup wrapper events\n\t\t\t\tself.registeredElements[componentId].wrapperEvents.forEach((item: WrapperEventArgArray) => {\n\t\t\t\t\tself.wrapper.off(...item);\n\t\t\t\t});\n\n\t\t\t\tself.initRegisteredElements(componentId, true);\n\t\t\t}\n\t\t};\n\n\t\t// add style prop functions that require map._update to be called afterwards\n\t\tconst updatingStyleFunctions = [\n\t\t\t'moveLayer',\n\t\t\t'removeLayer',\n\t\t\t'removeSource',\n\t\t\t'setPaintProperty',\n\t\t\t'setLayoutProperty',\n\t\t];\n\t\tupdatingStyleFunctions.forEach((item) => {\n\t\t\tthis[item] = (...props: any[]) => {\n\t\t\t\tif (self.map && self.map.style && typeof self.map.style[item] === 'function') {\n\t\t\t\t\tself.map.style[item](...props);\n\t\t\t\t}\n\t\t\t\treturn self.map._update ? self.map._update(true) : undefined;\n\t\t\t};\n\t\t});\n\n\t\t// add style prop functions\n\t\tconst styleFunctions = [\n\t\t\t'getLayer',\n\t\t\t'getSource',\n\t\t\t'listImages',\n\t\t\t'getPaintProperty',\n\t\t\t'getLayoutProperty',\n\t\t\t'removeImage',\n\t\t];\n\t\tstyleFunctions.forEach((item) => {\n\t\t\tthis[item] = (...props: any[]) => {\n\t\t\t\tif (self.map && self.map.style) {\n\t\t\t\t\treturn self.map.style[item](...props);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\t\t});\n\n\t\tthis.addNativeMaplibreFunctionsAndProps = () => {\n\t\t\t//\tadd MapLibre-gl functions\n\t\t\tObject.getOwnPropertyNames(Object.getPrototypeOf(this.map)).forEach((item) => {\n\t\t\t\tif (typeof this[item] === 'undefined') {\n\t\t\t\t\tthis[item] = (...props: any[]) => self.map[item](...props);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//\tadd MapLibre-gl properties\n\t\t\tObject.keys(this.map).forEach((item) => {\n\t\t\t\tif (typeof this[item] === 'undefined') {\n\t\t\t\t\tthis[item] = self.map[item];\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// add functions that are missing on the MapLibre instances prototype\n\t\tconst missingFunctions = [\n\t\t\t'getZoom',\n\t\t\t'setZoom',\n\t\t\t'getCenter',\n\t\t\t'setCenter',\n\t\t\t'getBearing',\n\t\t\t'setBearing',\n\t\t\t'getPitch',\n\t\t\t'setPitch',\n\t\t\t'jumpTo',\n\t\t\t'flyTo',\n\t\t\t'panTo',\n\t\t\t'panBy',\n\t\t\t'panBy',\n\t\t\t'zoomTo',\n\t\t\t'zoomIn',\n\t\t\t'zoomOut',\n\t\t\t'getPadding',\n\t\t\t'setPadding',\n\t\t\t'rotateTo',\n\t\t\t'resetNorth',\n\t\t\t'resetNorthPitch',\n\t\t\t'snapToNorth',\n\t\t\t'cameraForBounds',\n\t\t\t'fitBounds',\n\t\t\t'fitScreenCoordinates',\n\t\t\t'getFreeCameraOptions',\n\t\t\t'setFreeCameraOptions',\n\t\t\t'easeTo',\n\t\t\t'stop',\n\t\t];\n\t\tmissingFunctions.forEach((item) => {\n\t\t\tthis[item] = (...props: any[]) => {\n\t\t\t\tif (typeof self.map[item] === 'function') {\n\t\t\t\t\treturn self.map[item].call(self.map, ...props);\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t};\n\t\t});\n\n\t\t// initialize the MapLibre-gl instance\n\t\tconst initializeMapLibre = async () => {\n\t\t\t// if mapOptions style URL is given and if it is not a mapbox URL fetch the json and initialize the mapbox object\n\t\t\tif (\n\t\t\t\ttypeof props.mapOptions.style === 'string' &&\n\t\t\t\tprops.mapOptions.style.indexOf('mapbox://') === -1\n\t\t\t) {\n\t\t\t\tawait fetch(props.mapOptions.style)\n\t\t\t\t\t.then((response) => {\n\t\t\t\t\t\tif (response.ok) {\n\t\t\t\t\t\t\treturn response.json();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Error('error loading map style.json');\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.then((styleJson) => {\n\t\t\t\t\t\tstyleJson.layers.forEach((item: any) => {\n\t\t\t\t\t\t\tself.baseLayers.push(item.id);\n\t\t\t\t\t\t\tif (!self.firstSymbolLayer && item.type === 'symbol') {\n\t\t\t\t\t\t\t\tself.firstSymbolLayer = item.id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tself.styleJson = styleJson;\n\t\t\t\t\t\tprops.mapOptions.style = styleJson;\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\tself.map = new Map(props.mapOptions) as MapType;\n\t\t\twindow['_map'] = self.map;\n\n\t\t\tself.addNativeMaplibreFunctionsAndProps();\n\t\t\tself.wrapper.refreshViewport();\n\t\t\tself.wrapper.fire('viewportchange');\n\n\t\t\tself.map.on('load', () => {\n\t\t\t\tself.addNativeMaplibreFunctionsAndProps();\n\t\t\t});\n\n\t\t\tself.map.on('move', () => {\n\t\t\t\tself.wrapper.viewportState = self.wrapper.getViewport();\n\t\t\t\tself.wrapper.fire('viewportchange');\n\t\t\t});\n\t\t\tself.map.on('idle', () => {\n\t\t\t\tself.wrapper.refreshLayerState();\n\t\t\t});\n\t\t\tself.map.on('data', () => {\n\t\t\t\tself.wrapper.refreshLayerState();\n\t\t\t});\n\t\t\tif (typeof props.onReady === 'function') {\n\t\t\t\tprops.onReady(self.map, self);\n\t\t\t}\n\t\t};\n\t\tinitializeMapLibre();\n\t}\n}\nexport default MapLibreGlWrapper;\n\nexport type { LayerState, ViewportState };\n","import { createTheme } from '@mui/material/styles';\nimport { Theme } from '@mui/system';\n\ndeclare module '@mui/material/Button' {\n\tinterface ButtonPropsVariantOverrides {\n\t\tnavtools: true;\n\t}\n}\n\nconst lightDefault = createTheme({\n\tpalette: {\n\t\tmode: 'light',\n\t},\n});\nconst darkDefault = createTheme({\n\tpalette: {\n\t\tmode: 'dark',\n\t},\n});\n\nconst getDesignTokens = (mode: 'light' | 'dark') => ({\n\t...(mode === 'light' ? lightDefault : darkDefault),\n\tpalette: {\n\t\tmode,\n\t\t...(mode === 'dark'\n\t\t\t? {\n\t\t\t\t\tprimary: {\n\t\t\t\t\t\tmain: '#009FE3',\n\t\t\t\t\t},\n\t\t\t\t\tbackground: {\n\t\t\t\t\t\tdefault: '#222222',\n\t\t\t\t\t\tpaper: '#414141',\n\t\t\t\t\t\ticon: '#525252',\n\t\t\t\t\t},\n\t\t\t\t\ttext: {\n\t\t\t\t\t\tsecondary: '#fff',\n\t\t\t\t\t\tcontrast: '#121212',\n\t\t\t\t\t},\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tprimary: {\n\t\t\t\t\t\tmain: '#009FE3',\n\t\t\t\t\t},\n\n\t\t\t\t\tbackground: {\n\t\t\t\t\t\tdefault: '#fff',\n\t\t\t\t\t\tpaper: '#fdfdfd',\n\t\t\t\t\t\ticon: '#bdbdbd',\n\t\t\t\t\t},\n\t\t\t\t\ttext: {\n\t\t\t\t\t\tprimary: '#111',\n\t\t\t\t\t\tsecondary: '#121212',\n\t\t\t\t\t\tcontrast: '#fff',\n\t\t\t\t\t},\n\t\t\t }),\n\t},\n});\nconst getTheme = (mode: 'light' | 'dark') => {\n\tconst theme: Theme = getDesignTokens(mode);\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\treturn createTheme(theme, {\n\t\tcomponents: {\n\t\t\tMuiTypography: {\n\t\t\t\tstyleOverrides: {\n\t\t\t\t\troot: {},\n\t\t\t\t},\n\t\t\t},\n\t\t\tMuiAppBar: {\n\t\t\t\tstyleOverrides: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\tbackgroundColor: theme.palette.background.default,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tMuiIconButton: {\n\t\t\t\tstyleOverrides: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\tcolor: theme.palette.text.primary,\n\t\t\t\t\t\tbackgroundColor: theme.palette.background.icon,\n\t\t\t\t\t\t':hover': {\n\t\t\t\t\t\t\tbackgroundColor: theme.palette.background.icon,\n\t\t\t\t\t\t\tcolor: theme.palette.primary.main,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tMuiButton: {\n\t\t\t\tstyleOverrides: {\n\t\t\t\t\tcontained: {\n\t\t\t\t\t\tcolor: '#fff',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tvariants: [\n\t\t\t\t\t{\n\t\t\t\t\t\tprops: { variant: 'navtools' },\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tminWidth: '20px',\n\t\t\t\t\t\t\tminHeight: '20px',\n\t\t\t\t\t\t\tfontWeight: 600,\n\t\t\t\t\t\t\t[theme.breakpoints.down('md')]: {\n\t\t\t\t\t\t\t\twidth: '50px',\n\t\t\t\t\t\t\t\theight: '50px',\n\t\t\t\t\t\t\t\tfontSize: '1.4em',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t[theme.breakpoints.up('md')]: {\n\t\t\t\t\t\t\t\twidth: '30px',\n\t\t\t\t\t\t\t\theight: '30px',\n\t\t\t\t\t\t\t\tfontSize: '1.2em',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbackgroundColor: theme.palette.background.icon,\n\t\t\t\t\t\t\tborderRadius: '23%',\n\t\t\t\t\t\t\t//border: \"1px solid #bbb\",\n\t\t\t\t\t\t\t//boxShadow: \"0px 0px 4px rgba(0,0,0,.5)\",\n\t\t\t\t\t\t\tmargin: '0.15px',\n\t\t\t\t\t\t\tmarginTop: '4px',\n\t\t\t\t\t\t\t':hover': {\n\t\t\t\t\t\t\t\tcolor: theme.palette.primary.main,\n\t\t\t\t\t\t\t\tbackgroundColor: theme.palette.background.icon,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcolor: theme.palette.text.secondary,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t});\n};\n\nexport default getTheme;\n","import React, { useState, useRef, ReactNode } from 'react';\nimport MapLibreGlWrapper from '../components/MapLibreMap/lib/MapLibreGlWrapper';\n\nimport { ThemeProvider as MUIThemeProvider } from '@mui/material/styles';\nimport getTheme from '../ui_components/MapcomponentsTheme';\n\nexport interface MapContextType {\n\tmapIds: string[];\n\tmapExists: (map_id: string | undefined) => boolean;\n\tmaps: MapLibreGlWrapper[];\n\tmap: MapLibreGlWrapper | undefined;\n\tgetMap: (map_id: string | undefined) => MapLibreGlWrapper;\n\tsetMap: (map: MapLibreGlWrapper) => void;\n\tremoveMap: (map_id: string | undefined) => void;\n\tregisterMap: (map_id: string | undefined, map: MapLibreGlWrapper) => void;\n}\nconst MapContext = React.createContext({} as MapContextType);\n\n/**\n * MapComponentsProvider must be imported and wrapped around component where at least one of its child nodes requires access to a MapLibre-gl or openlayers instance that is registered in this mapContext.\nMapComponentsProvider must be used one level higher than the first use of MapContext.\n *\n * MapComponentsProvider requires at least one use of the MapLibreMap component somewhere down the component tree that will create the MapLibre-gl object and set the reference at MapContext.map. For MapLibre maps it is a good idea to provide a mapId attribute to the MapLibreMap Component even if you are only using a single map instance at start. It will make a later transition to using multiple instances within the same project much easier.\n */\n\nconst MapComponentsProvider = ({ children }: { children: ReactNode }) => {\n\tconst [map, setMap] = useState<MapLibreGlWrapper | undefined>(undefined);\n\tconst [mapIds, setMapIds] = useState<[...string[]]>([]);\n\tconst mapIds_raw = useRef<[...string[]]>([]);\n\tconst maps = useRef<{ [key: string]: MapLibreGlWrapper }>({});\n\n\tconst removeMap = (mapId: string) => {\n\t\tif (mapId) {\n\t\t\tif (typeof maps.current[mapId] !== 'undefined') {\n\t\t\t\tdelete maps.current[mapId];\n\t\t\t}\n\t\t\tconst mapIdIndex = mapIds_raw.current.indexOf(mapId);\n\t\t\tif (mapIdIndex > -1) {\n\t\t\t\tmapIds_raw.current.splice(mapIdIndex, 1);\n\t\t\t}\n\t\t\tsetMapIds([...mapIds_raw.current]);\n\n\t\t\tif (mapIds_raw.current.length === 0 && map) {\n\t\t\t\tsetMap(undefined);\n\t\t\t}\n\t\t} else {\n\t\t\tremoveMap('anonymous_map');\n\t\t}\n\t};\n\n\tconst setMapHandler = (mapInstance: MapLibreGlWrapper) => {\n\t\tsetMap(mapInstance);\n\n\t\tif (mapIds.length === 0) {\n\t\t\tconst mapId = 'anonymous_map';\n\t\t\tsetMapIds([...mapIds, mapId]);\n\t\t\tmaps.current[mapId] = mapInstance;\n\t\t}\n\t};\n\n\tconst value = {\n\t\tmap: map,\n\t\tsetMap: setMapHandler,\n\t\tmaps: maps.current,\n\t\tmapIds: mapIds,\n\t\tregisterMap: (mapId: string, mapInstance: MapLibreGlWrapper) => {\n\t\t\tif (mapId && mapInstance) {\n\t\t\t\tmaps.current[mapId] = mapInstance;\n\t\t\t\tmapIds_raw.current.push(mapId);\n\t\t\t\tsetMapIds([...mapIds_raw.current]);\n\n\t\t\t\tif (!map || map?.cancelled === true) {\n\t\t\t\t\tsetMap(mapInstance);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tremoveMap,\n\t\tmapExists: (mapId: string | undefined) => {\n\t\t\tif (mapId && Object.keys(maps.current).indexOf(mapId) === -1) {\n\t\t\t\treturn false;\n\t\t\t} else if (!mapId && !map) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\tgetMap: (mapId: string): MapLibreGlWrapper | null => {\n\t\t\tif (mapId && mapIds.indexOf(mapId) !== -1) {\n\t\t\t\treturn maps.current[mapId];\n\t\t\t} else if (!mapId && map) {\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t},\n\t} as unknown as MapContextType;\n\n\treturn (\n\t\t<MapContext.Provider value={value}>\n\t\t\t<MUIThemeProvider theme={getTheme('light')}>{children}</MUIThemeProvider>\n\t\t</MapContext.Provider>\n\t);\n};\n\nexport { MapComponentsProvider };\nexport default MapContext;\n","import React, { useRef, useEffect, useContext, FC, RefObject } from 'react';\n\nimport MapContext, { MapContextType } from '../../contexts/MapContext';\nimport MapLibreGlWrapper from './lib/MapLibreGlWrapper';\n\nimport { MapOptions as MapOptionsType, Map } from 'maplibre-gl';\nimport 'maplibre-gl/dist/maplibre-gl.css';\n\ntype MapLibreMapProps = {\n\t/**\n\t * Id of the MapLibreGl(Wrapper) instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Config object that is passed to the MapLibreGl constructor as first parameter.\n\t * See https://maplibre.org/maplibre-gl-js-docs/api/map/ for a formal documentation of al\n\t * available properties.\n\t */\n\toptions?: Partial<MapOptionsType>;\n\t/**\n\t * css style definition passed to the map container DOM element\n\t */\n\tstyle?: object;\n};\n\nconst defaultProps: MapLibreMapProps = {\n\tmapId: undefined,\n\toptions: {\n\t\tcenter: { lng: 8.607, lat: 53.1409349 },\n\t\tzoom: 11,\n\t\tcontainer: '',\n\t\tstyle: {\n\t\t\tversion: 8,\n\t\t\tname: 'blank',\n\t\t\tcenter: [0, 0],\n\t\t\tzoom: 0,\n\t\t\tsources: {},\n\t\t\tsprite: 'https://wms.wheregroup.com/tileserver/sprites/osm-bright',\n\t\t\tglyphs: 'https://wms.wheregroup.com/tileserver/fonts/{fontstack}/{range}.pbf',\n\t\t\tlayers: [\n\t\t\t\t{\n\t\t\t\t\tid: '_background',\n\t\t\t\t\ttype: 'background',\n\t\t\t\t\tpaint: {\n\t\t\t\t\t\t'background-color': 'rgba(0,0,0,0)',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n};\n\n/**\n * Creates a MapLibreGlWrapper instance and registers it in MapContext\n * after the MapLibre-gl load event has fired.\n *\n * MapLibreMap returns the html node that will be used by MapLibre-gl to render the map.\n * This Component must be kept unaware of any related components that interact with the MapLibre-gl\n * instance.\n *\n * @category Map components\n */\nconst MapLibreMap: FC<MapLibreMapProps> = (props: MapLibreMapProps) => {\n\tconst mapRef = useRef<MapLibreGlWrapper>();\n\tconst mapContainer = useRef<HTMLDivElement>();\n\n\tconst mapContext = useContext<MapContextType>(MapContext);\n\n\tconst mapIdRef = useRef(props.mapId);\n\tconst initializedRef = useRef(false);\n\tconst currentStyle = useRef(props.options?.style);\n\n\tuseEffect(() => {\n\t\tconst mapId = mapIdRef.current;\n\n\t\treturn () => {\n\t\t\tinitializedRef.current = false;\n\t\t\tmapContext.removeMap(mapId);\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.map?.remove?.();\n\t\t\t\tmapRef.current.cancelled = true;\n\t\t\t\tmapRef.current = undefined;\n\t\t\t}\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (initializedRef.current) return;\n\n\t\tif (mapContainer.current) {\n\t\t\tinitializedRef.current = true;\n\t\t\tmapRef.current = new MapLibreGlWrapper({\n\t\t\t\tmapOptions: {\n\t\t\t\t\tstyle: '',\n\t\t\t\t\t...props.options,\n\t\t\t\t\t...(props?.options?.style ? {} : { style: defaultProps?.options?.style }),\n\t\t\t\t\tcontainer: mapContainer.current,\n\t\t\t\t},\n\t\t\t\tonReady: (map: Map, wrapper: MapLibreGlWrapper) => {\n\t\t\t\t\tmap.once('load', () => {\n\t\t\t\t\t\tif (!wrapper?.cancelled) {\n\t\t\t\t\t\t\tif (props.mapId) {\n\t\t\t\t\t\t\t\tmapContext.registerMap(props.mapId, wrapper);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmapContext.setMap(wrapper);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tmap.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}, [props.options, props.mapId]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tmapRef.current?.map &&\n\t\t\tprops?.options?.style &&\n\t\t\tcurrentStyle.current !== props.options.style\n\t\t) {\n\t\t\tcurrentStyle.current = props.options.style;\n\t\t\tmapRef.current.map.setStyle(props.options.style);\n\t\t}\n\t}, [props?.options?.style]);\n\n\treturn (\n\t\t<div\n\t\t\tref={mapContainer as RefObject<HTMLDivElement>}\n\t\t\tclassName=\"mapContainer\"\n\t\t\tstyle={props.style}\n\t\t/>\n\t);\n};\n\nMapLibreMap.defaultProps = defaultProps;\n\nexport default MapLibreMap;\n","import { useContext, useCallback, useState, useEffect, useRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport MapContext, { MapContextType } from \"../contexts/MapContext\";\nimport MapLibreGlWrapper, {\n\tLayerState,\n\tViewportState,\n} from \"../components/MapLibreMap/lib/MapLibreGlWrapper\";\n\ntype useMapStateType = {\n\tlayers: (LayerState | undefined)[];\n\tviewport: ViewportState | undefined;\n};\n\n/**\n * React hook that allows subscribing to map state changes\n *\n * @component\n */\nfunction useMapState(props: {\n\tmapId?: string;\n\twatch?: {\n\t\tlayers?: boolean;\n\t\tsources?: boolean;\n\t\tviewport?: boolean;\n\t};\n\tfilter?: {\n\t\tincludeBaseLayers?: boolean;\n\t\tmatchLayerIds?: RegExp | string;\n\t\tmatchSourceIds?: RegExp | string;\n\t};\n}): useMapStateType {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tconst mapContext = useContext<MapContextType>(MapContext);\n\n\tconst initializedRef = useRef(false);\n\tconst mapRef = useRef<MapLibreGlWrapper>();\n\n\tconst [viewport, setViewport] = useState<ViewportState | undefined>();\n\tconst viewportRef = useRef(undefined);\n\n\tconst [layers, setLayers] = useState<(LayerState | undefined)[]>([]);\n\tconst layersRef = useRef<string>();\n\t//const mapRef = useRef(props.map);\n\tconst componentId = useRef(uuidv4());\n\n\t/**\n\t * returns the element if it matches the defined filter criteria\n\t * to be used as filter function on the layers array\n\t *\n\t * @param {object} layer\n\t */\n\tconst layerIdFilter = useCallback(\n\t\t(layer:LayerState) => {\n\t\t\tif (!props?.filter?.includeBaseLayers && layer?.baseLayer) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (typeof props.filter?.matchLayerIds !== \"undefined\") {\n\t\t\t\tif (props.filter.matchLayerIds instanceof RegExp) {\n\t\t\t\t\treturn props.filter.matchLayerIds.test(layer.id);\n\t\t\t\t} else {\n\t\t\t\t\treturn layer.id.includes(props.filter.matchLayerIds);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\t\t[props.filter]\n\t);\n\n\tconst refreshLayerState = useCallback(() => {\n\t\tif (!mapRef.current) return;\n\n\t\tconst _layerState = mapRef.current.wrapper.layerState.filter(layerIdFilter);\n\t\tconst _layerStateString = JSON.stringify(_layerState);\n\t\tif (layersRef.current !== _layerStateString) {\n\t\t\tlayersRef.current = _layerStateString;\n\t\t\tsetLayers(_layerState);\n\t\t}\n\t}, [layerIdFilter]);\n\n\tuseEffect(() => {\n\t\tconst _componentId = componentId.current;\n\n\t\treturn () => {\n\t\t\t// cleanup all event listeners\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.cleanup(_componentId);\n\t\t\t\tmapRef.current = undefined;\n\t\t\t}\n\t\t\tinitializedRef.current = false;\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!mapContext.mapExists(props.mapId) || initializedRef.current) return;\n\t\t// the MapLibre-gl instance (mapContext.getMap(props.mapId)) is accessible here\n\t\t// initialize the layer and add it to the MapLibre-gl instance or do something else with it\n\t\tinitializedRef.current = true;\n\t\tmapRef.current = mapContext.getMap(props.mapId);\n\n\t\tif (!mapRef.current) {\n\t\t\tinitializedRef.current = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (props?.watch?.viewport) {\n\t\t\tsetViewport(mapRef.current.wrapper.viewportState);\n\n\t\t\t// register viewportchange event handler\n\t\t\tmapRef.current.wrapper.on(\n\t\t\t\t\"viewportchange\",\n\t\t\t\t() => {\n\t\t\t\t\tif (viewportRef.current !== mapRef.current?.wrapper.viewportStateString) {\n\t\t\t\t\t\tsetViewport(mapRef.current?.wrapper.viewportState);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tcomponentId.current\n\t\t\t);\n\t\t}\n\n\t\t// register layerchange event handler\n\t\tif (props?.watch?.layers) {\n\t\t\trefreshLayerState();\n\n\t\t\tmapRef.current.wrapper.on(\n\t\t\t\t\"layerchange\",\n\t\t\t\trefreshLayerState,\n\t\t\t\t{\n\t\t\t\t\tincludeBaseLayers: props?.filter?.includeBaseLayers,\n\t\t\t\t\tmatchLayerIds: props?.filter?.matchLayerIds,\n\t\t\t\t},\n\t\t\t\tcomponentId.current\n\t\t\t);\n\t\t}\n\t}, [mapContext.mapIds, mapContext, props.mapId, refreshLayerState, props]);\n\n\treturn {\n\t\tlayers,\n\t\tviewport,\n\t};\n}\n\nuseMapState.defaultProps = {\n\tmapId: undefined,\n\twatch: {\n\t\tlayers: true,\n\t\tsources: false,\n\t\tviewport: false,\n\t},\n\tfilter: {\n\t\tincludeBaseLayers: false,\n\t},\n};\n\nuseMapState.propTypes = {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId: PropTypes.string,\n\t/**\n\t * Defines map Resources to watch\n\t */\n\twatch: PropTypes.shape({\n\t\tlayers: PropTypes.bool,\n\t\tsources: PropTypes.bool,\n\t\tviewport: PropTypes.bool,\n\t}),\n\t/**\n\t * Filter string or RegExp to more explicitly define the elements watched and increase performance\n\t * strings will be matched using layerId.includes(matchString)\n\t * RegExps will be matched using matchRegExp.test(layerId)\n\t */\n\tfilter: PropTypes.shape({\n\t\tincludeBaseLayers: PropTypes.bool,\n\t\tmatchLayerIds: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(RegExp)]),\n\t\tmatchSourceIds: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(RegExp)]),\n\t}),\n};\n\nexport default useMapState;\n","import { useContext, useState, useEffect, useRef } from \"react\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport MapContext, { MapContextType } from \"../contexts/MapContext\";\nimport useMapState from \"./useMapState\";\nimport MapLibreGlWrapper, { LayerState } from \"../components/MapLibreMap/lib/MapLibreGlWrapper\";\n\ntype useMapType = {\n\tmap: MapLibreGlWrapper | undefined;\n\tmapIsReady: boolean;\n\tcomponentId: string;\n\tlayers: (LayerState | undefined)[];\n\tcleanup: () => void;\n};\n\nfunction useMap(props?: { mapId?: string; waitForLayer?: string }): useMapType {\n\tconst mapContext: MapContextType = useContext(MapContext);\n\tconst [map, setMap] = useState<MapLibreGlWrapper>();\n\n\tconst mapState = useMapState({\n\t\tmapId: props?.mapId,\n\t\twatch: {\n\t\t\tviewport: false,\n\t\t\tlayers: props?.waitForLayer ? true : false,\n\t\t\tsources: false,\n\t\t},\n\t\tfilter: {\n\t\t\tincludeBaseLayers: true,\n\t\t},\n\t});\n\n\tconst mapRef = useRef<MapLibreGlWrapper>();\n\n\tconst componentId = useRef(uuidv4());\n\n\tconst [mapIsReady, setMapIsReady] = useState(false);\n\n\tconst cleanup = () => {\n\t\tif (mapRef.current) {\n\t\t\tmapRef.current.cleanup(componentId.current);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tcleanup();\n\t\t\tsetMapIsReady(false);\n\t\t\tmapRef.current = undefined;\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif(mapRef.current && mapRef.current.cancelled === true){\n\t\t\tmapRef.current = undefined\n\t\t\tsetMap(undefined)\n\t\t\tsetMapIsReady(false)\n\t\t}\n\t\tif (mapRef.current || !mapContext.mapExists(props?.mapId)) return;\n\n\t\t// check if waitForLayer (string, layer id of the layer this hook is supposed to wait for)\n\t\t// exists as layer in the MapLibre instance\n\t\tif (props?.waitForLayer) {\n\t\t\tlet layerFound = false;\n\n\t\t\tmapState?.layers?.forEach((layer: any) => {\n\t\t\t\tif (layer.id === props?.waitForLayer) {\n\t\t\t\t\tlayerFound = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (!layerFound) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tmapRef.current = mapContext.getMap(props?.mapId);\n\t\tsetMap(mapRef.current);\n\t\tsetMapIsReady(true);\n\t}, [mapContext.mapIds, mapState.layers, mapContext, props]);\n\n\treturn {\n\t\tmap: map,\n\t\tmapIsReady,\n\t\tcomponentId: componentId.current,\n\t\tlayers: mapState.layers,\n\t\tcleanup,\n\t};\n}\n\nexport default useMap;\n\nexport type { useMapType };\n","import React, { useState, useCallback } from \"react\";\nimport useMap from \"../../hooks/useMap\";\nimport { Button, SxProps, Theme } from '@mui/material';\nimport GpsFixedIcon from '@mui/icons-material/GpsFixed';\n\nexport interface MlCenterPositionProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Id of an existing layer in the mapLibre instance to help specify the layer order\n\t * This layer will be visually beneath the layer with the \"insertBeforeLayer\" id.\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Active button font color\n\t */\n\tonColor?: string;\n\t/**\n\t * Inactive button font color\n\t */\n\toffColor?: string;\n\t/**\n\t * CSS style object that is applied to the button component\n\t */\n\tstyle?: SxProps<Theme> | undefined;\n}\n\n/**\n * Component template\n *\n */\nconst MlCenterPosition = (props: MlCenterPositionProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst [locationAccessDenied, setLocationAccessDenied] = useState(false);\n\n\tconst centerCurrentLocation = () => {\n\t\tnavigator.geolocation.getCurrentPosition(getLocationSuccess, getLocationError);\n\t};\n\n\tconst getLocationSuccess = useCallback(\n\t\t(location: GeolocationPosition) => {\n\t\t\tmapHook.map?.map.setCenter?.([location.coords.longitude, location.coords.latitude]);\n\t\t},\n\t\t[mapHook.map]\n\t);\n\n\tconst getLocationError = () => {\n\t\tconsole.log('Access of user location denied');\n\t\tsetLocationAccessDenied(true);\n\t};\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"navtools\"\n\t\t\t\tsx={{\n\t\t\t\t\tzIndex: 1002,\n\t\t\t\t\tcolor: !locationAccessDenied ? props.onColor : props.offColor,\n\t\t\t\t}}\n\t\t\t\tonClick={centerCurrentLocation}\n\t\t\t\tdisabled={locationAccessDenied}\n\t\t\t>\n\t\t\t\t<GpsFixedIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />\n\t\t\t</Button>\n\t\t</>\n\t);\n};\n\nMlCenterPosition.defaultProps = {\n\tmapId: undefined,\n\tonColor: '#ececec',\n\toffColor: '#666',\n};\nexport default MlCenterPosition;\n","import React from \"react\";\nimport useMap from \"../../hooks/useMap\";\n\nexport interface MlComponentTemplateProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n}\n\n/**\n * Component description\n *\n */\nconst MlComponentTemplate = (props: MlComponentTemplateProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t});\n\tconsole.log(mapHook.componentId + \" remove this log\");\n\n\treturn <></>;\n};\n\nMlComponentTemplate.defaultProps = {\n\tmapId: undefined,\n};\nexport default MlComponentTemplate;\n","import { Map } from 'maplibre-gl';\nimport jsPDF from 'jspdf';\nimport MapLibreGlWrapper from '../../components/MapLibreMap/lib/MapLibreGlWrapper';\n\nimport { BBox } from '@turf/turf';\n\ninterface createExportOptions {\n\tmap: MapLibreGlWrapper;\n\twidth: number;\n\theight: number;\n\tbbox: BBox;\n\tbboxUnrotated: BBox;\n\tbearing: number;\n\tformat: string;\n\torientation: string;\n}\nexport type { createExportOptions };\n\nconst createExport = (options: createExportOptions) => {\n\tconst width = options.width;\n\tconst height = options.height;\n\n\t// Create map container\n\tconst hiddenContainer = document.createElement('div');\n\thiddenContainer.className = 'hidden-map';\n\thiddenContainer.style.width = '0px';\n\thiddenContainer.style.height = '0px';\n\thiddenContainer.style.overflow = 'hidden';\n\tdocument.body.appendChild(hiddenContainer);\n\tconst container = document.createElement('div');\n\tcontainer.style.width = width + 'px';\n\tcontainer.style.height = height + 'px';\n\thiddenContainer.appendChild(container);\n\n\tconst style = options.map.map.getStyle();\n\n\t// delete undefined source properties\n\tfor (const name in style.sources) {\n\t\tconst src = style.sources[name];\n\n\t\tObject.keys(src).forEach((key) => {\n\t\t\t// delete property if value is undefined.\n\t\t\t// for instance, raster-dem might have undefined value in \"url\" and \"bounds\"\n\t\t\tif (!src[key]) {\n\t\t\t\tdelete src[key];\n\t\t\t}\n\t\t});\n\t}\n\n\t// Create a new MapLibre-gl instance\n\tconst renderMap = new Map({\n\t\tcontainer: container,\n\t\tcenter: options.map.map.getCenter(),\n\t\tzoom: options.map.map.getZoom(),\n\t\tbearing: 0,\n\t\tpitch: 0,\n\t\tinteractive: false,\n\t\tpreserveDrawingBuffer: true,\n\t\tfadeDuration: 0,\n\t\tattributionControl: false,\n\t\tstyle: style,\n\t});\n\n\tconst bboxCamera = renderMap._cameraForBoxAndBearing(\n\t\t[options.bboxUnrotated[0], options.bboxUnrotated[1]],\n\t\t[options.bboxUnrotated[2], options.bboxUnrotated[3]],\n\t\toptions.bearing + options.map.map.getBearing()\n\t);\n\n\trenderMap._fitInternal(bboxCamera);\n\treturn new Promise<createExportResolverParams>((resolve) => {\n\t\tconsole.log('before idle');\n\n\t\trenderMap.once('idle', function () {\n\t\t\tconst params: createExportResolverParams = {\n\t\t\t\t...options,\n\t\t\t\trenderMap,\n\t\t\t\thiddenContainer,\n\t\t\t\tcreatePdf: (_options?: createJsPdfOptions) =>\n\t\t\t\t\tcreateJsPdf({ ...options, renderMap, hiddenContainer, ..._options }),\n\t\t\t\tcreatePng: (_options?: createPngOptions) =>\n\t\t\t\t\tcreatePng({ ...options, renderMap, hiddenContainer, ..._options }),\n\t\t\t};\n\n\t\t\tresolve(params);\n\t\t});\n\t});\n};\n\ninterface createExportResolverParams extends createExportOptions {\n\tcreatePdf: (_options?: createJsPdfOptions) => Promise<createPdfResolverParams>;\n\tcreatePng: (_options?: createPngOptions) => Promise<createPngResolverParams>;\n\trenderMap: Map;\n\thiddenContainer: HTMLDivElement;\n}\nexport type { createExportResolverParams };\n\ninterface createJsPdfOptions extends createExportOptions {\n\trenderMap: Map;\n\thiddenContainer: HTMLDivElement;\n}\n\nexport type { createJsPdfOptions };\n\nfunction createJsPdf(options: createJsPdfOptions) {\n\tconst pdf = new jsPDF({\n\t\torientation: options?.orientation === 'portrait' ? 'p' : 'l',\n\t\tunit: 'mm',\n\t\tcompress: true,\n\t\tformat: options.format,\n\t});\n\tObject.defineProperty(window, 'devicePixelRatio', {\n\t\tget: function () {\n\t\t\treturn 300 / 96;\n\t\t},\n\t});\n\n\treturn new Promise<createPdfResolverParams>((resolve) => {\n\t\t//Render map image\n\t\tpdf.addImage(\n\t\t\toptions.renderMap.getCanvas().toDataURL('image/png'),\n\t\t\t'png',\n\t\t\t0,\n\t\t\t0,\n\t\t\tpdf.internal.pageSize.getWidth(),\n\t\t\tpdf.internal.pageSize.getHeight(),\n\t\t\tundefined,\n\t\t\t'FAST'\n\t\t);\n\n\t\t// remove DOM Elements\n\t\toptions.renderMap.remove();\n\t\toptions.hiddenContainer.parentNode?.removeChild(options.hiddenContainer);\n\n\t\tconst params: createPdfResolverParams = {\n\t\t\t...options,\n\t\t\tpdf,\n\t\t\tdownloadPdf: (_options?: downloadPdfOptions) => downloadPdf({ ...params, ..._options }),\n\t\t};\n\n\t\tresolve(params);\n\t});\n}\ninterface createPdfResolverParams extends createJsPdfOptions {\n\tpdf: jsPDF;\n\tdownloadPdf: (_options?: downloadPdfOptions) => Promise<downloadPdfOptions>;\n}\n\ninterface downloadPdfOptions extends createJsPdfOptions {\n\tpdf: jsPDF;\n}\n\nfunction downloadPdf(options: downloadPdfOptions) {\n\toptions.pdf.save('Map.pdf');\n\n\treturn new Promise<downloadPdfOptions>(function (resolve) {\n\t\tresolve({ ...options });\n\t});\n}\n\nexport type { createPdfResolverParams };\n\nfunction createPng(options: createPngOptions) {\n\treturn new Promise<createPngResolverParams>((resolve) => {\n\t\tconst png = options.renderMap.getCanvas().toDataURL('image/png');\n\t\tconst params: createPngResolverParams = {\n\t\t\t...options,\n\t\t\tpng,\n\t\t\tdownloadPng: (_options?: downloadPngOptions) => downloadPng({ ...params, ..._options }),\n\t\t};\n\n\t\tresolve(params);\n\t});\n}\n\ninterface createPngOptions extends createExportOptions {\n\trenderMap: Map;\n\thiddenContainer: HTMLDivElement;\n}\n\nexport type { createPngOptions };\n\ninterface createPngResolverParams extends createPngOptions {\n\tpng: string;\n\tdownloadPng: (_options?: downloadPngOptions) => Promise<downloadPngOptions>;\n}\n\nexport type { createPngResolverParams };\n\ninterface downloadPngOptions extends createPngOptions {\n\t// png image as data url\n\tpng: string;\n\t// filename of the downloaded png\n\tname?: string;\n}\n\nfunction downloadPng(options: downloadPngOptions) {\n\tconst _a = document.createElement('a');\n\t_a.download = options?.name ? options.name + '.png' : 'map.png';\n\t_a.href = options.png;\n\tdocument.body.appendChild(_a);\n\t_a.click();\n\tdocument.body.removeChild(_a);\n\n\treturn new Promise<downloadPngOptions>(function (resolve) {\n\t\tresolve({ ...options });\n\t});\n}\n\nexport { createExport };\n","import { useMemo } from 'react';\nimport useMap from '../useMap';\nimport { createExport, createExportOptions } from './lib';\nimport MapLibreGlWrapper from '../../components/MapLibreMap/lib/MapLibreGlWrapper';\n\ninterface exportMapProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n}\n\nexport default function useExportMap(props: exportMapProps) {\n\tconst mapHook = useMap({ mapId: props.mapId });\n\n\tconst _createExport = useMemo(() => {\n\t\tif (mapHook.map) {\n\t\t\treturn (\n\t\t\t\toptions: Omit<createExportOptions, 'map'> & Partial<Pick<createExportOptions, 'map'>>\n\t\t\t) => {\n\t\t\t\treturn createExport({ map: mapHook.map as MapLibreGlWrapper, ...options });\n\t\t\t};\n\t\t}\n\t\treturn;\n\t}, [mapHook.map]);\n\n\treturn {\n\t\tcreateExport: _createExport,\n\t};\n}\n","import React from 'react';\nimport useMap from '../../hooks/useMap';\nimport PrinterIcon from '@mui/icons-material/Print';\nimport Button from '@mui/material/Button';\nimport { CircularProgress } from '@mui/material';\nimport useExportMap from '../../hooks/useExportMap';\nimport { BBox } from '@turf/turf';\nimport { createExportOptions } from 'src/hooks/useExportMap/lib';\n\nexport interface MlCreatePdfButtonProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Option overrides for the createExport function\n\t */\n\texportOptions?: createExportOptions\n}\n\n/**\n * Renders a button that will create a PDF version of the current map view (dimensions adjusted to fit Din A4 Paper).\n */\nconst MlCreatePdfButton = (props: MlCreatePdfButtonProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t});\n\tconst exportMap = useExportMap({ mapId: props.mapId });\n\tconst [loading, setLoading] = React.useState(false);\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tcolor=\"primary\"\n\t\t\t\tvariant=\"contained\"\n\t\t\t\tonClick={() => {\n\t\t\t\t\tif (mapHook.map && exportMap?.createExport) {\n\t\t\t\t\t\tsetLoading(true);\n\t\t\t\t\t\tconst bounds = mapHook.map.getBounds();\n\t\t\t\t\t\tconst bbox: BBox = [\n\t\t\t\t\t\t\tbounds.getWest(),\n\t\t\t\t\t\t\tbounds.getSouth(),\n\t\t\t\t\t\t\tbounds.getEast(),\n\t\t\t\t\t\t\tbounds.getNorth(),\n\t\t\t\t\t\t];\n\t\t\t\t\t\texportMap\n\t\t\t\t\t\t\t.createExport({\n\t\t\t\t\t\t\t\twidth: 595 * 1.4,\n\t\t\t\t\t\t\t\theight: 842 * 1.4,\n\t\t\t\t\t\t\t\tbbox: bbox,\n\t\t\t\t\t\t\t\tbboxUnrotated: bbox,\n\t\t\t\t\t\t\t\tbearing: mapHook.map.getBearing(),\n\t\t\t\t\t\t\t\tformat: 'a4',\n\t\t\t\t\t\t\t\torientation: 'portrait',\n\t\t\t\t\t\t\t\t...props.exportOptions\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.then((res) => res.createPdf())\n\t\t\t\t\t\t\t.then((res) => {\n\t\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t\t\treturn res.downloadPdf();\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{loading ? (\n\t\t\t\t\t<CircularProgress\n\t\t\t\t\t\tsize={24}\n\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\tcolor: 'text.contrast',\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<PrinterIcon />\n\t\t\t\t)}\n\t\t\t</Button>\n\t\t</>\n\t);\n};\n\nMlCreatePdfButton.defaultProps = {\n\tmapId: undefined,\n};\n\nexport default MlCreatePdfButton;\n","interface PdfTemplateType{\n\twidth: number;\n\theight: number;\n};\ninterface PdfTemplateObject{\n\t[key:string]:({[key:string]:PdfTemplateType});\n};\n\nconst PdfTemplates:PdfTemplateObject = {\n\tA4: {\n\t\t'300dpi': {\n\t\t\twidth: 2480,\n\t\t\theight: 3508,\n\t\t},\n\t\t'150dpi': {\n\t\t\twidth: 1240,\n\t\t\theight: 1754,\n\t\t},\n\t\t'72dpi': {\n\t\t\twidth: 595,\n\t\t\theight: 842,\n\t\t},\n\t},\n\tA3: {\n\t\t'300dpi': {\n\t\t\twidth: 3505,\n\t\t\theight: 4961,\n\t\t},\n\t\t'150dpi': {\n\t\t\twidth: 1754,\n\t\t\theight: 2480,\n\t\t},\n\t\t'72dpi': {\n\t\t\twidth: 842,\n\t\t\theight: 1191,\n\t\t},\n\t},\n\tA2: {\n\t\t'300dpi': {\n\t\t\twidth: 4961,\n\t\t\theight: 7016,\n\t\t},\n\t\t'150dpi': {\n\t\t\twidth: 2480,\n\t\t\theight: 3508,\n\t\t},\n\t\t'72dpi': {\n\t\t\twidth: 1191,\n\t\t\theight: 1684,\n\t\t},\n\t},\n\tA1: {\n\t\t'300dpi': {\n\t\t\twidth: 7016,\n\t\t\theight: 9933,\n\t\t},\n\t\t'150dpi': {\n\t\t\twidth: 3508,\n\t\t\theight: 4967,\n\t\t},\n\t\t'72dpi': {\n\t\t\twidth: 1684,\n\t\t\theight: 2384,\n\t\t},\n\t},\n\tA0: {\n\t\t'300dpi': {\n\t\t\twidth: 9933,\n\t\t\theight: 14043,\n\t\t},\n\t\t'150dpi': {\n\t\t\twidth: 4967,\n\t\t\theight: 7022,\n\t\t},\n\t\t'72dpi': {\n\t\t\twidth: 2384,\n\t\t\theight: 3370,\n\t\t},\n\t},\n};\n\nexport default PdfTemplates;","import React, { useState, useRef, useMemo } from 'react';\nimport templates from './pdf.templates';\nimport { PdfContextInterface, PdfPreviewOptions } from './pdfContext';\n\n\nconst PdfContext = React.createContext<PdfContextInterface>({} as PdfContextInterface);\n\nconst defaultTemplate = templates['A4']['72dpi'];\nconst PdfContextProvider = ({ children }: { children: React.ReactNode }) => {\n\tconst [format, setFormat] = useState('A4');\n\tconst [quality, setQuality] = useState('72dpi');\n\tconst [options, setOptions] = useState<PdfPreviewOptions>({\n\t\tcenter: undefined,\n\t\tscale: undefined,\n\t\trotate: 0,\n\t\twidth: 210,\n\t\theight: 297,\n\t\torientation: 'portrait',\n\t\tfixedScale: 0,\n\t});\n\n\tconst geojsonRef = useRef();\n\n\tconst template = useMemo(() => {\n\t\tif (typeof templates[format][quality] !== 'undefined') {\n\t\t\treturn options.orientation === 'portrait'\n\t\t\t\t? templates[format][quality]\n\t\t\t\t: {\n\t\t\t\t\t\twidth: templates[format][quality].height,\n\t\t\t\t\t\theight: templates[format][quality].width,\n\t\t\t\t };\n\t\t}\n\t\treturn defaultTemplate;\n\t}, [format, quality, options.orientation]);\n\n\tconst value = {\n\t\toptions,\n\t\tsetOptions,\n\t\tformat,\n\t\tsetFormat,\n\t\tquality,\n\t\tsetQuality,\n\t\tgeojsonRef,\n\t\ttemplate,\n\t};\n\n\treturn <PdfContext.Provider value={value}>{children}</PdfContext.Provider>;\n};\n\nexport { PdfContextProvider };\nexport default PdfContext;\n","import React, { useRef, useEffect, useMemo } from 'react';\nimport ReactDOM from 'react-dom';\nimport Moveable from 'react-moveable';\nimport useMap from '../../../hooks/useMap';\nimport useMapState from '../../../hooks/useMapState';\nimport * as turf from '@turf/turf';\nimport { PdfPreviewOptions } from './pdfContext';\nimport { LngLatLike, Map as MapType, PointLike } from 'maplibre-gl';\nimport { Feature, Units } from '@turf/turf';\n\ntype Props = {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Polygon GeoJson Feature representing the printing area\n\t */\n\tgeojsonRef: React.MutableRefObject<\n\t\t| Feature\n\t\t| undefined\n\t>;\n\t/**\n\t * a state variable containing the PDF previews current state\n\t */\n\toptions: PdfPreviewOptions;\n\t/**\n\t * setter function to update the current PDF preview state\n\t */\n\tsetOptions: (arg1: (val: PdfPreviewOptions) => PdfPreviewOptions) => void;\n};\n\nfunction getTargetRotationAngle(target: HTMLDivElement) {\n\tconst el_style = window.getComputedStyle(target, null);\n\tconst el_transform = el_style.getPropertyValue('transform');\n\n\tlet deg = 0;\n\n\tif (el_transform !== 'none') {\n\t\tconst values = el_transform.split('(')[1].split(')')[0].split(',');\n\t\tconst a = parseFloat(values[0]);\n\t\tconst b = parseFloat(values[1]);\n\t\tdeg = Math.round(Math.atan2(b, a) * (180 / Math.PI));\n\t}\n\n\treturn deg < 0 ? deg + 360 : deg;\n}\n\nfunction calcElemTransformedPoint(\n\tel: HTMLDivElement,\n\tpoint: [number, number],\n\ttransformOrigin: [number, number]\n): PointLike {\n\tconst style = getComputedStyle(el);\n\tconst p = [point[0] - transformOrigin[0], point[1] - transformOrigin[1]];\n\n\tconst matrix = new DOMMatrixReadOnly(style.transform);\n\n\t// transform pixel coordinates according to the css transform state of \"el\" (target)\n\treturn [\n\t\tp[0] * matrix.a + p[1] * matrix.c + matrix.e + transformOrigin[0],\n\t\tp[0] * matrix.b + p[1] * matrix.d + matrix.f + transformOrigin[1],\n\t];\n}\n\n// measure distance in pixels that is used to determine the current css transform.scale relative to the maps viewport.zoom\nconst scaleAnchorInPixels = 10;\n\n// used to determine the MapZoomScale modifier which is multiplied with props.options.scale to relate the scale to the current map viewport.zoom\nfunction getMapZoomScaleModifier(point: [number, number], _map: MapType) {\n\tconst left = _map.unproject(point);\n\tconst right = _map.unproject([point[0] + scaleAnchorInPixels, point[1]]);\n\tconst maxMeters = left.distanceTo(right);\n\treturn scaleAnchorInPixels / maxMeters;\n}\n\n/**\n * PdfPreview component renders a transformable (drag, scale, rotate) preview of the desired export or print content\n */\nexport default function PdfPreview(props: Props) {\n\tconst mapState = useMapState({ mapId: props.mapId, watch: { layers: false, viewport: true } });\n\tconst targetRef = useRef<HTMLDivElement>(null);\n\tconst fixedScaleRef = useRef<number | undefined>();\n\tconst moveableRef = useRef<Moveable>(null);\n\tconst mapContainerRef = useRef<HTMLDivElement>(document.querySelector('.mapContainer'));\n\t//const [transform, setTransform] = useState('translate(452.111px, 15.6148px)');\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t});\n\n\tuseEffect(() => {\n\t\tif (!mapState?.viewport?.zoom || !mapHook.map) return;\n\t\t// if the component was initialized with scale or center as undefined derive those values from the current map view state\n\n\t\t//initialize props if not defined\n\t\tconst _centerX = Math.round(mapHook.map.map._container.clientWidth / 2);\n\t\tconst _centerY = Math.round(mapHook.map.map._container.clientHeight / 2);\n\n\t\tif (!props.options.scale) {\n\t\t\t//const scale = parseFloat(/(14/mapState.viewport.zoom));\n\t\t\tconst scale = 1 / getMapZoomScaleModifier([_centerX, _centerY], mapHook.map.map);\n\n\t\t\tprops.setOptions((val: PdfPreviewOptions) => ({ ...val, scale: [scale, scale] }));\n\t\t}\n\t\tif (!props.options.center) {\n\t\t\tconst _center = mapHook.map.map.unproject([_centerX, _centerY]);\n\t\t\tprops.setOptions((val: PdfPreviewOptions) => ({\n\t\t\t\t...val,\n\t\t\t\tcenter: [_center.lng, _center.lat],\n\t\t\t}));\n\t\t}\n\t}, [mapHook.map, mapState.viewport?.zoom]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tmapHook.map.map.setPitch(0);\n\t\tconst _maxPitch = mapHook.map.map.getMaxPitch();\n\t\tmapHook.map.map.setMaxPitch(0);\n\t\treturn () => {\n\t\t\tmapHook.map?.map.setMaxPitch(_maxPitch);\n\t\t};\n\t}, [mapHook.map]);\n\n\tconst transformOrigin = useMemo<[number, number]>(() => {\n\t\tif (props.options.orientation === 'portrait') {\n\t\t\treturn [props.options.width / 2, props.options.height / 2];\n\t\t} else {\n\t\t\treturn [props.options.height / 2, props.options.width / 2];\n\t\t}\n\t}, [props.options.orientation, props.options.width, props.options.height]);\n\n\tconst transform = useMemo(() => {\n\t\tif (!mapHook.map || !props.options.scale) return 'none';\n\n\t\tconst centerInPixels = mapHook.map.map.project(props.options.center as LngLatLike);\n\n\t\tconst x = centerInPixels.x;\n\t\tconst y = centerInPixels.y;\n\t\tconst scale = props.options.scale[0] * getMapZoomScaleModifier([x, y], mapHook.map.map);\n\n\t\tconst viewportBearing = mapState?.viewport?.bearing ? mapState.viewport?.bearing : 0;\n\n\t\tconst _transform = `translate(${Math.floor(\n\t\t\tcenterInPixels.x - transformOrigin[0]\n\t\t)}px,${Math.floor(centerInPixels.y - transformOrigin[1])}px) rotate(${\n\t\t\tprops.options.rotate - viewportBearing\n\t\t}deg) scale(${scale},${scale})`;\n\n\t\tif (targetRef.current) targetRef.current.style.transform = _transform;\n\n\t\treturn _transform;\n\t}, [\n\t\tmapHook.map,\n\t\tmapState.viewport,\n\t\tprops.options.scale,\n\t\tprops.options.rotate,\n\t\tprops.options.center,\n\t\ttransformOrigin,\n\t]);\n\n\tuseEffect(() => {\n\t\tmoveableRef.current?.updateTarget();\n\t}, [transform]);\n\n\tuseEffect(() => {\n\t\t// update props.options.scale if fixedScale was changed\n\t\tif (\n\t\t\t!mapHook.map ||\n\t\t\t!props.options.center ||\n\t\t\t!props.options.fixedScale ||\n\t\t\t(typeof props.options.fixedScale !== 'undefined' &&\n\t\t\t\tfixedScaleRef.current === props.options.fixedScale)\n\t\t)\n\t\t\treturn;\n\n\t\tfixedScaleRef.current = props.options.fixedScale;\n\t\tconst point = turf.point(props.options.center);\n\t\tconst distance = props.options.fixedScale * (props.options.width / 1000);\n\n\t\tconst bearing = 90;\n\t\tconst options = { units: 'meters' as Units };\n\t\tconst destination = turf.destination(point, distance, bearing, options);\n\n\t\tconst centerInPixels = mapHook.map.map.project(point.geometry.coordinates as LngLatLike);\n\t\tconst destinationInPixels = mapHook.map.map.project(\n\t\t\tdestination.geometry.coordinates as LngLatLike\n\t\t);\n\n\t\tconst scaleFactor =\n\t\t\t(Math.round(destinationInPixels.x - centerInPixels.x) / props.options.width) *\n\t\t\t(1 / getMapZoomScaleModifier([centerInPixels.x, centerInPixels.y], mapHook.map.map));\n\t\tprops.setOptions((val: PdfPreviewOptions) => ({ ...val, scale: [scaleFactor, scaleFactor] }));\n\t}, [mapHook.map, props.options.width, props.options.center, props.options.fixedScale]);\n\n\t// update props.geoJsonRef\n\tuseEffect(() => {\n\t\tif (targetRef.current && mapHook.map) {\n\t\t\t// apply orientation\n\t\t\tlet _width = props.options.width;\n\t\t\tlet _height = props.options.height;\n\t\t\tif (props.options.orientation === 'portrait') {\n\t\t\t\ttargetRef.current.style.width = props.options.width + 'px';\n\t\t\t\ttargetRef.current.style.height = props.options.height + 'px';\n\t\t\t} else {\n\t\t\t\ttargetRef.current.style.width = props.options.height + 'px';\n\t\t\t\ttargetRef.current.style.height = props.options.width + 'px';\n\t\t\t\t_width = props.options.height;\n\t\t\t\t_height = props.options.width;\n\t\t\t}\n\t\t\tmoveableRef.current?.updateTarget();\n\n\t\t\tconst topLeft = mapHook.map.map.unproject(\n\t\t\t\tcalcElemTransformedPoint(targetRef.current, [0, 0], transformOrigin)\n\t\t\t);\n\t\t\tconst topRight = mapHook.map.map.unproject(\n\t\t\t\tcalcElemTransformedPoint(targetRef.current, [_width, 0], transformOrigin)\n\t\t\t);\n\t\t\tconst bottomLeft = mapHook.map.map.unproject(\n\t\t\t\tcalcElemTransformedPoint(targetRef.current, [0, _height], transformOrigin)\n\t\t\t);\n\t\t\tconst bottomRight = mapHook.map.map.unproject(\n\t\t\t\tcalcElemTransformedPoint(targetRef.current, [_width, _height], transformOrigin)\n\t\t\t);\n\n\t\t\tconst _geoJson = {\n\t\t\t\ttype: 'Feature',\n\t\t\t\tbbox: [topLeft.lng, topLeft.lat, bottomRight.lng, bottomRight.lat],\n\t\t\t\tgeometry: {\n\t\t\t\t\ttype: 'Polygon',\n\t\t\t\t\tcoordinates: [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t[topLeft.lng, topLeft.lat],\n\t\t\t\t\t\t\t[topRight.lng, topRight.lat],\n\t\t\t\t\t\t\t[bottomRight.lng, bottomRight.lat],\n\t\t\t\t\t\t\t[bottomLeft.lng, bottomLeft.lat],\n\t\t\t\t\t\t\t[topLeft.lng, topLeft.lat],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\tproperties: { bearing: getTargetRotationAngle(targetRef.current) },\n\t\t\t} as Feature;\n\t\t\tprops.geojsonRef.current = _geoJson;\n\t\t}\n\n\t\treturn undefined;\n\t}, [\n\t\tmapHook,\n\t\ttransform,\n\t\tprops.options.orientation,\n\t\tprops.geojsonRef,\n\t\tmapState,\n\t\ttargetRef.current,\n\t\ttransformOrigin,\n\t]);\n\n\treturn mapContainerRef.current ? ReactDOM.createPortal(\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName=\"target\"\n\t\t\t\tref={targetRef}\n\t\t\t\tstyle={{ transform: transform, transformOrigin: 'center center' }}\n\t\t\t></div>\n\t\t\t<Moveable\n\t\t\t\t// eslint-disable-next-line\n\t\t\t\t// @ts-ignore:\n\t\t\t\tref={moveableRef}\n\t\t\t\ttarget={targetRef}\n\t\t\t\tcontainer={null}\n\t\t\t\torigin={true}\n\t\t\t\tkeepRatio={true}\n\t\t\t\t/* draggable */\n\t\t\t\tdraggable={true}\n\t\t\t\tonDrag={(e) => {\n\t\t\t\t\tif (mapHook.map) {\n\n\t\t\t\t\t\tlet _transformParts = e.transform.split('translate(');\n\t\t\t\t\t\t_transformParts = _transformParts[1].split('px)')[0].split('px, ');\n\t\t\t\t\t\tconst _center = mapHook.map?.map.unproject([\n\t\t\t\t\t\t\tparseInt(_transformParts[0]) + transformOrigin[0],\n\t\t\t\t\t\t\tparseInt(_transformParts[1]) + transformOrigin[1],\n\t\t\t\t\t\t]);\n\t\t\t\t\t\tprops.setOptions((val: PdfPreviewOptions) => ({\n\t\t\t\t\t\t\t...val,\n\t\t\t\t\t\t\tcenter: [_center.lng, _center.lat],\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\t/* scalable */\n\t\t\t\tscalable={props.options.fixedScale ? false : true}\n\t\t\t\tonScale={(e) => {\n\t\t\t\t\tif (mapHook.map) {\n\t\t\t\t\t\tlet _transformParts = e.drag.transform.split('scale(');\n\t\t\t\t\t\t_transformParts = _transformParts[1].split(')')[0].split(', ');\n\n\t\t\t\t\t\tconst centerInPixels = mapHook.map.map.project(props.options.center as LngLatLike);\n\n\t\t\t\t\t\tconst x = centerInPixels.x;\n\t\t\t\t\t\tconst y = centerInPixels.y;\n\n\t\t\t\t\t\tconst scale =\n\t\t\t\t\t\t\tparseFloat(_transformParts[0]) *\n\t\t\t\t\t\t\t(1 / getMapZoomScaleModifier([x, y], mapHook.map.map));\n\n\n\t\t\t\t\t\tprops.setOptions((val: PdfPreviewOptions) => ({ ...val, scale: [scale, scale] }));\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\t/* rotatable */\n\t\t\t\trotatable={true}\n\t\t\t\tonRotate={(e) => {\n\t\t\t\t\tif (mapHook.map && mapState.viewport) {\n\t\t\t\t\t\tconst _transformParts = e.drag.transform.split('rotate(');\n\t\t\t\t\t\tconst _transformPartString = _transformParts[1].split('deg)')[0];\n\t\t\t\t\t\tconst viewportBearing = mapState?.viewport?.bearing ? mapState.viewport.bearing : 0;\n\n\t\t\t\t\t\tprops.setOptions((val: PdfPreviewOptions) => ({\n\t\t\t\t\t\t\t...val,\n\t\t\t\t\t\t\trotate: parseFloat(_transformPartString) + viewportBearing,\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>,\n\t\tmapContainerRef.current\n\t):<></>;\n}\n","import React, { useContext, useMemo, useCallback, useState } from 'react';\nimport PdfContext from './PdfContext';\nimport PdfPreview from './PdfPreview';\nimport {\n\tFormControl,\n\tMenuItem,\n\tSelect,\n\tInputLabel,\n\tButton,\n\tFormLabel,\n\tFormControlLabel,\n\tRadio,\n\tRadioGroup,\n\tCircularProgress,\n} from '@mui/material';\n\nimport useMap from '../../../hooks/useMap';\nimport useExportMap from '../../../hooks/useExportMap';\nimport { createPdfResolverParams } from '../../../hooks/useExportMap/lib';\n\nimport * as turf from '@turf/turf';\n\nimport templates from './pdf.templates';\nimport { PdfPreviewOptions } from './pdfContext';\n\nconst scaleOptions = [\n\t{\n\t\tvalue: 0,\n\t\tlabel: 'free scale',\n\t},\n\t{\n\t\tvalue: 250,\n\t\tlabel: '1/250',\n\t},\n\t{\n\t\tvalue: 500,\n\t\tlabel: '1/500',\n\t},\n\t{\n\t\tvalue: 750,\n\t\tlabel: '1/750',\n\t},\n\t{\n\t\tvalue: 1000,\n\t\tlabel: '1/1000',\n\t},\n\t{\n\t\tvalue: 1500,\n\t\tlabel: '1/1500',\n\t},\n\t{\n\t\tvalue: 2000,\n\t\tlabel: '1/2000',\n\t},\n\t{\n\t\tvalue: 10000,\n\t\tlabel: '1/10000',\n\t},\n\t{\n\t\tvalue: 100000,\n\t\tlabel: '1/100000',\n\t},\n];\nconst qualityOptions = [\n\t{\n\t\tvalue: '72dpi',\n\t\tlabel: 'Draft (72dpi)',\n\t},\n\t{\n\t\tvalue: '150dpi',\n\t\tlabel: 'Medium (150dpi)',\n\t},\n\t{\n\t\tvalue: '300dpi',\n\t\tlabel: 'High (300dpi)',\n\t},\n];\n\ninterface PdfFormProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\tonCreatePdf?: (options: createPdfResolverParams) => createPdfResolverParams;\n}\n\nexport default function PdfForm(props: PdfFormProps) {\n\tconst [loading, setLoading] = useState(false);\n\tconst pdfContext = useContext(PdfContext);\n\tconst mapHook = useMap({\n\t\t// eslint-disable-next-line react/prop-types\n\t\tmapId: props.mapId,\n\t});\n\tconst mapExporter = useExportMap({ mapId: props.mapId });\n\n\tconst createPdfHandler = useCallback(() => {\n\t\tif (\n\t\t\tmapHook.map &&\n\t\t\tmapExporter.createExport &&\n\t\t\tpdfContext.template &&\n\t\t\tpdfContext.format &&\n\t\t\tpdfContext.options?.orientation &&\n\t\t\tpdfContext.geojsonRef?.current?.bbox &&\n\t\t\tpdfContext.geojsonRef?.current\n\t\t) {\n\t\t\tsetLoading(true);\n\t\t\tconst bbox = turf.bbox(pdfContext.geojsonRef.current);\n\n\t\t\tmapExporter\n\t\t\t\t.createExport({\n\t\t\t\t\twidth: pdfContext.template.width,\n\t\t\t\t\theight: pdfContext.template.height,\n\t\t\t\t\tbbox: bbox,\n\t\t\t\t\tbboxUnrotated: pdfContext.geojsonRef.current.bbox,\n\t\t\t\t\tbearing: (pdfContext.geojsonRef.current?.properties?.bearing as number) || 0,\n\t\t\t\t\tformat: pdfContext.format.toLowerCase(),\n\t\t\t\t\torientation: pdfContext.options.orientation,\n\t\t\t\t})\n\t\t\t\t.then((res) => res.createPdf())\n\t\t\t\t.then((res) => {\n\t\t\t\t\tif (typeof props.onCreatePdf === 'function') {\n\t\t\t\t\t\tprops.onCreatePdf(res);\n\t\t\t\t\t}\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t\treturn res.downloadPdf();\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t});\n\t\t}\n\t}, [mapHook.map, pdfContext]);\n\n\tconst formControlStyles = useMemo(\n\t\t() => {\n\t\t\treturn {\n\t\t\t\tmargin: '5px 0 15px 0 ',\n\t\t\t\t//...props.formControlStyles,\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\t/*props.formControlStyles*/\n\t\t]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<FormControl fullWidth sx={formControlStyles}>\n\t\t\t\t<InputLabel id=\"format-select-label\">Format</InputLabel>\n\t\t\t\t<Select\n\t\t\t\t\tlabelId=\"format-select-label\"\n\t\t\t\t\tid=\"format-select\"\n\t\t\t\t\tlabel=\"Format\"\n\t\t\t\t\tvalue={pdfContext.format}\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tpdfContext.setFormat?.(event.target.value);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{Object.keys(templates).map((el) => (\n\t\t\t\t\t\t<MenuItem key={el} value={el}>\n\t\t\t\t\t\t\t{el}\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t))}\n\t\t\t\t</Select>\n\t\t\t</FormControl>\n\t\t\t<FormControl fullWidth sx={formControlStyles}>\n\t\t\t\t<FormLabel id=\"orientation-radio-buttons-group-label\">Orientation</FormLabel>\n\t\t\t\t<RadioGroup\n\t\t\t\t\trow\n\t\t\t\t\taria-labelledby=\"orientation-radio-buttons-group-label\"\n\t\t\t\t\tname=\"orientation-radio-buttons-group\"\n\t\t\t\t\tvalue={pdfContext.options?.orientation}\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tif (!pdfContext.setOptions) return;\n\n\t\t\t\t\t\tpdfContext.setOptions((val: PdfPreviewOptions) => ({\n\t\t\t\t\t\t\t...val,\n\t\t\t\t\t\t\torientation: event.target.value as 'landscape' | 'portrait',\n\t\t\t\t\t\t}));\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<FormControlLabel value=\"portrait\" control={<Radio />} label=\"Portrait\" />\n\t\t\t\t\t<FormControlLabel value=\"landscape\" control={<Radio />} label=\"Landscape\" />\n\t\t\t\t</RadioGroup>\n\t\t\t</FormControl>\n\t\t\t<FormControl fullWidth sx={formControlStyles}>\n\t\t\t\t<InputLabel id=\"quality-select-label\">Quality</InputLabel>\n\t\t\t\t<Select\n\t\t\t\t\tlabelId=\"quality-select-label\"\n\t\t\t\t\tid=\"quality-select\"\n\t\t\t\t\tlabel=\"Quality\"\n\t\t\t\t\tvalue={pdfContext.quality}\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tpdfContext.setQuality?.(event.target.value);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{qualityOptions.map((el) => (\n\t\t\t\t\t\t<MenuItem key={el.value} value={el.value}>\n\t\t\t\t\t\t\t{el.label}\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t))}\n\t\t\t\t</Select>\n\t\t\t</FormControl>\n\t\t\t<FormControl fullWidth sx={formControlStyles}>\n\t\t\t\t<InputLabel id=\"scale-select-label\">Scale</InputLabel>\n\t\t\t\t<Select\n\t\t\t\t\tlabelId=\"scale-select-label\"\n\t\t\t\t\tid=\"scale-select\"\n\t\t\t\t\tlabel=\"Scale\"\n\t\t\t\t\tvalue={pdfContext?.options?.fixedScale}\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tpdfContext.setOptions?.((val) => ({\n\t\t\t\t\t\t\t...val,\n\t\t\t\t\t\t\tfixedScale: event.target.value as number,\n\t\t\t\t\t\t}));\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{scaleOptions.map((el, idx) => (\n\t\t\t\t\t\t<MenuItem key={idx} value={el.value}>\n\t\t\t\t\t\t\t{el.label}\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t))}\n\t\t\t\t</Select>\n\t\t\t</FormControl>\n\t\t\t<FormControl fullWidth sx={formControlStyles}>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"contained\"\n\t\t\t\t\tclassName=\"createPdfButton\"\n\t\t\t\t\tonClick={createPdfHandler}\n\t\t\t\t\tdisabled={loading}\n\t\t\t\t>\n\t\t\t\t\tcreate PDF\n\t\t\t\t</Button>\n\t\t\t\t{loading && (\n <CircularProgress\n size={24}\n sx={{\n color: 'primary.main',\n position: 'absolute',\n top: '50%',\n left: '50%',\n marginTop: '-12px',\n marginLeft: '-12px',\n }}\n />\n )}\n\t\t\t</FormControl>\n\t\t\t{pdfContext.options && pdfContext.setOptions && (\n\t\t\t\t<PdfPreview\n\t\t\t\t\toptions={pdfContext.options}\n\t\t\t\t\tsetOptions={pdfContext.setOptions}\n\t\t\t\t\tgeojsonRef={pdfContext.geojsonRef}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</>\n\t);\n}\n","import React from 'react';\nimport PdfForm from './lib/PdfForm';\nimport { PdfContextProvider } from './lib/PdfContext';\nimport { createPdfResolverParams } from '../../hooks/useExportMap/lib';\nimport { SxProps } from '@mui/material';\n\ninterface MlCreatePdfFormProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * sx props that will be applied to the form control components\n\t */\n\tformControlStyles?: SxProps;\n\t/**\n\t * Function that will be called before the PDF is created. \n\t * Allowing to access and manipulate the jspdf instance before the PDF is created.\n\t */\n\tonCreatePdf?: (options:createPdfResolverParams) => createPdfResolverParams;\n}\n\nexport type { MlCreatePdfFormProps };\n\n/**\n * Create PDF Form Component\n *\n */\nconst MlCreatePdfForm = (props: MlCreatePdfFormProps) => {\n\treturn (\n\t\t<>\n\t\t\t<PdfContextProvider>\n\t\t\t\t<PdfForm {...props} />\n\t\t\t</PdfContextProvider>\n\t\t</>\n\t);\n};\n\nMlCreatePdfForm.defaultProps = {\n\tmapId: undefined,\n};\nexport default MlCreatePdfForm;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nexport const classes = {\n\tCONTROL_BASE: 'mapboxgl-ctrl',\n\tCONTROL_PREFIX: 'mapboxgl-ctrl-',\n\tCONTROL_BUTTON: 'mapbox-gl-draw_ctrl-draw-btn',\n\tCONTROL_BUTTON_LINE: 'mapbox-gl-draw_line',\n\tCONTROL_BUTTON_POLYGON: 'mapbox-gl-draw_polygon',\n\tCONTROL_BUTTON_POINT: 'mapbox-gl-draw_point',\n\tCONTROL_BUTTON_TRASH: 'mapbox-gl-draw_trash',\n\tCONTROL_BUTTON_COMBINE_FEATURES: 'mapbox-gl-draw_combine',\n\tCONTROL_BUTTON_UNCOMBINE_FEATURES: 'mapbox-gl-draw_uncombine',\n\tCONTROL_GROUP: 'mapboxgl-ctrl-group',\n\tATTRIBUTION: 'mapboxgl-ctrl-attrib',\n\tACTIVE_BUTTON: 'active',\n\tBOX_SELECT: 'mapbox-gl-draw_boxselect'\n};\n\nexport const sources = {\n\tHOT: 'mapbox-gl-draw-hot',\n\tCOLD: 'mapbox-gl-draw-cold'\n};\n\nexport const cursors = {\n\tADD: 'add',\n\tMOVE: 'move',\n\tDRAG: 'drag',\n\tPOINTER: 'pointer',\n\tNONE: 'none'\n};\n\nexport const types = {\n\tPOLYGON: 'polygon',\n\tLINE: 'line_string',\n\tPOINT: 'point'\n};\n\nexport const geojsonTypes = {\n\tFEATURE: 'Feature',\n\tPOLYGON: 'Polygon',\n\tLINE_STRING: 'LineString',\n\tPOINT: 'Point',\n\tFEATURE_COLLECTION: 'FeatureCollection',\n\tMULTI_PREFIX: 'Multi',\n\tMULTI_POINT: 'MultiPoint',\n\tMULTI_LINE_STRING: 'MultiLineString',\n\tMULTI_POLYGON: 'MultiPolygon'\n};\n\nexport const modes = {\n\tDRAW_LINE_STRING: 'draw_line_string',\n\tDRAW_POLYGON: 'draw_polygon',\n\tDRAW_POINT: 'draw_point',\n\tSIMPLE_SELECT: 'simple_select',\n\tDIRECT_SELECT: 'direct_select',\n\tSTATIC: 'static'\n};\n\nexport const events = {\n\tCREATE: 'draw.create',\n\tDELETE: 'draw.delete',\n\tUPDATE: 'draw.update',\n\tSELECTION_CHANGE: 'draw.selectionchange',\n\tMODE_CHANGE: 'draw.modechange',\n\tACTIONABLE: 'draw.actionable',\n\tRENDER: 'draw.render',\n\tCOMBINE_FEATURES: 'draw.combine',\n\tUNCOMBINE_FEATURES: 'draw.uncombine'\n};\n\nexport const updateActions = {\n\tMOVE: 'move',\n\tCHANGE_COORDINATES: 'change_coordinates'\n};\n\nexport const meta = {\n\tFEATURE: 'feature',\n\tMIDPOINT: 'midpoint',\n\tVERTEX: 'vertex'\n};\n\nexport const activeStates = {\n\tACTIVE: 'true',\n\tINACTIVE: 'false'\n};\n\nexport const interactions = [\n\t'scrollZoom',\n\t'boxZoom',\n\t'dragRotate',\n\t'dragPan',\n\t'keyboard',\n\t'doubleClickZoom',\n\t'touchZoomRotate'\n];\n\nexport const LAT_MIN = -90;\nexport const LAT_RENDERED_MIN = -85;\nexport const LAT_MAX = 90;\nexport const LAT_RENDERED_MAX = 85;\nexport const LNG_MIN = -270;\nexport const LNG_MAX = 270;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport * as Constants from \"./constants\";\n\nexport function isOfMetaType(type) {\n\treturn function (e) {\n\t\tconst featureTarget = e.featureTarget;\n\t\tif (!featureTarget) return false;\n\t\tif (!featureTarget.properties) return false;\n\t\treturn featureTarget.properties.meta === type;\n\t};\n}\n\nexport function isShiftMousedown(e) {\n\tif (!e.originalEvent) return false;\n\tif (!e.originalEvent.shiftKey) return false;\n\treturn e.originalEvent.button === 0;\n}\n\nexport function isActiveFeature(e) {\n\tif (!e.featureTarget) return false;\n\tif (!e.featureTarget.properties) return false;\n\treturn (\n\t\te.featureTarget.properties.active === Constants.activeStates.ACTIVE &&\n\t\te.featureTarget.properties.meta === Constants.meta.FEATURE\n\t);\n}\n\nexport function isInactiveFeature(e) {\n\tif (!e.featureTarget) return false;\n\tif (!e.featureTarget.properties) return false;\n\treturn (\n\t\te.featureTarget.properties.active === Constants.activeStates.INACTIVE &&\n\t\te.featureTarget.properties.meta === Constants.meta.FEATURE\n\t);\n}\n\nexport function noTarget(e) {\n\treturn e.featureTarget === undefined;\n}\n\nexport function isFeature(e) {\n\tif (!e.featureTarget) return false;\n\tif (!e.featureTarget.properties) return false;\n\treturn e.featureTarget.properties.meta === Constants.meta.FEATURE;\n}\n\nexport function isVertex(e) {\n\tconst featureTarget = e.featureTarget;\n\tif (!featureTarget) return false;\n\tif (!featureTarget.properties) return false;\n\treturn featureTarget.properties.meta === Constants.meta.VERTEX;\n}\n\nexport function isShiftDown(e) {\n\tif (!e.originalEvent) return false;\n\treturn e.originalEvent.shiftKey === true;\n}\n\nexport function isEscapeKey(e) {\n\treturn e.keyCode === 27;\n}\n\nexport function isEnterKey(e) {\n\treturn e.keyCode === 13;\n}\n\nexport function isTrue() {\n\treturn true;\n}\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nconst doubleClickZoom = {\n\tenable(ctx) {\n\t\tsetTimeout(() => {\n\t\t\t// First check we've got a map and some context.\n\t\t\tif (\n\t\t\t\t!ctx.map ||\n\t\t\t\t!ctx.map.doubleClickZoom ||\n\t\t\t\t!ctx._ctx ||\n\t\t\t\t!ctx._ctx.store ||\n\t\t\t\t!ctx._ctx.store.getInitialConfigValue\n\t\t\t)\n\t\t\t\treturn;\n\t\t\t// Now check initial state wasn't false (we leave it disabled if so)\n\t\t\tif (!ctx._ctx.store.getInitialConfigValue(\"doubleClickZoom\")) return;\n\t\t\tctx.map.doubleClickZoom.enable();\n\t\t}, 0);\n\t},\n\tdisable(ctx) {\n\t\tsetTimeout(() => {\n\t\t\tif (!ctx.map || !ctx.map.doubleClickZoom) return;\n\t\t\t// Always disable here, as it's necessary in some cases.\n\t\t\tctx.map.doubleClickZoom.disable();\n\t\t}, 0);\n\t},\n};\nexport default doubleClickZoom;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nfunction isEventAtCoordinates(event, coordinates) {\n\tif (!event.lngLat) return false;\n\treturn event.lngLat.lng === coordinates[0] && event.lngLat.lat === coordinates[1];\n}\n\nexport default isEventAtCoordinates;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport * as Constants from \"./constants\";\n\n/**\n * Returns GeoJSON for a Point representing the\n * vertex of another feature.\n *\n * @param {string} parentId\n * @param {Array<number>} coordinates\n * @param {string} path - Dot-separated numbers indicating exactly\n *\t where the point exists within its parent feature's coordinates.\n * @param {boolean} selected\n * @return {GeoJSON} Point\n */\nconst create_vertex = function (parentId, coordinates, path, selected) {\n\treturn {\n\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\tproperties: {\n\t\t\tmeta: Constants.meta.VERTEX,\n\t\t\tparent: parentId,\n\t\t\tcoord_path: path,\n\t\t\tactive: selected\n\t\t\t\t? Constants.activeStates.ACTIVE\n\t\t\t\t: Constants.activeStates.INACTIVE,\n\t\t},\n\t\tgeometry: {\n\t\t\ttype: Constants.geojsonTypes.POINT,\n\t\t\tcoordinates,\n\t\t},\n\t};\n};\nexport default create_vertex;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport * as CommonSelectors from \"./lib/common_selectors.js\";\nimport doubleClickZoom from \"./lib/double_click_zoom.js\";\nimport * as Constants from \"./lib/constants.js\";\nimport isEventAtCoordinates from \"./lib/is_event_at_coordinates.js\";\nimport createVertex from \"./lib/create_vertex.js\";\n\nconst CustomPolygonMode = {};\n\nCustomPolygonMode.onSetup = function () {\n\tconsole.log(\"Change mode: custom polygon\");\n\n\tconst polygon = this.newFeature({\n\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\tproperties: {},\n\t\tgeometry: {\n\t\t\ttype: Constants.geojsonTypes.POLYGON,\n\t\t\tcoordinates: [[]],\n\t\t},\n\t});\n\n\tthis.addFeature(polygon);\n\n\tthis.clearSelectedFeatures();\n\tdoubleClickZoom.disable(this);\n\tthis.updateUIClasses({ mouse: Constants.cursors.ADD });\n\tthis.activateUIButton(Constants.types.POLYGON);\n\tthis.setActionableState({\n\t\ttrash: true,\n\t});\n\n\treturn {\n\t\tpolygon,\n\t\tcurrentVertexPosition: 0,\n\t};\n};\n\nCustomPolygonMode.clickAnywhere = function (state, e) {\n\tif (\n\t\tstate.currentVertexPosition > 0 &&\n\t\tisEventAtCoordinates(\n\t\t\te,\n\t\t\tstate.polygon.coordinates[0][state.currentVertexPosition - 1]\n\t\t)\n\t) {\n\t\treturn this.changeMode(\"custom_select\", {\n\t\t\tfeatureIds: [state.polygon.id],\n\t\t});\n\t}\n\tthis.updateUIClasses({ mouse: Constants.cursors.ADD });\n\tstate.polygon.updateCoordinate(\n\t\t`0.${state.currentVertexPosition}`,\n\t\te.lngLat.lng,\n\t\te.lngLat.lat\n\t);\n\tstate.currentVertexPosition++;\n\tstate.polygon.updateCoordinate(\n\t\t`0.${state.currentVertexPosition}`,\n\t\te.lngLat.lng,\n\t\te.lngLat.lat\n\t);\n\n\tthis.map.fire(Constants.events.CREATE, {\n\t\tfeatures: [state.polygon.toGeoJSON()],\n\t});\n};\n\nCustomPolygonMode.clickOnVertex = function (state) {\n\treturn this.changeMode(\"custom_select\", {\n\t\tfeatureIds: [state.polygon.id],\n\t});\n};\n\nCustomPolygonMode.onMouseMove = function (state, e) {\n\tstate.polygon.updateCoordinate(\n\t\t`0.${state.currentVertexPosition}`,\n\t\te.lngLat.lng,\n\t\te.lngLat.lat\n\t);\n\n\tif (CommonSelectors.isVertex(e)) {\n\t\tthis.updateUIClasses({ mouse: Constants.cursors.POINTER });\n\t}\n};\n\nCustomPolygonMode.onTap = CustomPolygonMode.onClick = function (state, e) {\n\tif (CommonSelectors.isVertex(e)) return this.clickOnVertex(state, e);\n\treturn this.clickAnywhere(state, e);\n};\n\nCustomPolygonMode.onKeyUp = function (state, e) {\n\tif (CommonSelectors.isEscapeKey(e)) {\n\t\tthis.deleteFeature([state.polygon.id], { silent: true });\n\t\tthis.changeMode(\"custom_select\");\n\t} else if (CommonSelectors.isEnterKey(e)) {\n\t\tthis.changeMode(\"custom_select\", {\n\t\t\tfeatureIds: [state.polygon.id],\n\t\t});\n\t}\n};\n\nCustomPolygonMode.onStop = function (state) {\n\tthis.updateUIClasses({ mouse: Constants.cursors.NONE });\n\tdoubleClickZoom.enable(this);\n\tthis.activateUIButton();\n\n\t// check to see if we've deleted this feature\n\tif (this.getFeature(state.polygon.id) === undefined) return;\n\n\t//remove last added coordinate\n\tstate.polygon.removeCoordinate(`0.${state.currentVertexPosition}`);\n\tif (state.polygon.isValid()) {\n\t\tthis.map.fire(Constants.events.CREATE, {\n\t\t\tfeatures: [state.polygon.toGeoJSON()],\n\t\t});\n\t} else {\n\t\tthis.deleteFeature([state.polygon.id], { silent: true });\n\t\tthis.changeMode(\"custom_select\", {}, { silent: true });\n\t}\n};\n\nCustomPolygonMode.toDisplayFeatures = function (state, geojson, display) {\n\tconst isActivePolygon = geojson.properties.id === state.polygon.id;\n\tgeojson.properties.active = isActivePolygon\n\t\t? Constants.activeStates.ACTIVE\n\t\t: Constants.activeStates.INACTIVE;\n\tif (!isActivePolygon) return display(geojson);\n\n\t// Don't render a polygon until it has two positions\n\t// (and a 3rd which is just the first repeated)\n\tif (geojson.geometry.coordinates.length === 0) return;\n\n\tconst coordinateCount = geojson.geometry.coordinates[0].length;\n\t// 2 coordinates after selecting a draw type\n\t// 3 after creating the first point\n\tif (coordinateCount < 3) {\n\t\treturn;\n\t}\n\tgeojson.properties.meta = Constants.meta.FEATURE;\n\tdisplay(\n\t\tcreateVertex(state.polygon.id, geojson.geometry.coordinates[0][0], \"0.0\", false)\n\t);\n\tif (coordinateCount > 3) {\n\t\t// Add a start position marker to the map, clicking on this will finish the feature\n\t\t// This should only be shown when we're in a valid spot\n\t\tconst endPos = geojson.geometry.coordinates[0].length - 3;\n\t\tdisplay(\n\t\t\tcreateVertex(\n\t\t\t\tstate.polygon.id,\n\t\t\t\tgeojson.geometry.coordinates[0][endPos],\n\t\t\t\t`0.${endPos}`,\n\t\t\t\tfalse\n\t\t\t)\n\t\t);\n\t}\n\tif (coordinateCount <= 4) {\n\t\t// If we've only drawn two positions (plus the closer),\n\t\t// make a LineString instead of a Polygon\n\t\tconst lineCoordinates = [\n\t\t\t[geojson.geometry.coordinates[0][0][0], geojson.geometry.coordinates[0][0][1]],\n\t\t\t[geojson.geometry.coordinates[0][1][0], geojson.geometry.coordinates[0][1][1]],\n\t\t];\n\t\t// create an initial vertex so that we can track the first point on mobile devices\n\t\tdisplay({\n\t\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\t\tproperties: geojson.properties,\n\t\t\tgeometry: {\n\t\t\t\tcoordinates: lineCoordinates,\n\t\t\t\ttype: Constants.geojsonTypes.LINE_STRING,\n\t\t\t},\n\t\t});\n\t\tif (coordinateCount === 3) {\n\t\t\treturn;\n\t\t}\n\t}\n\t// render the Polygon\n\treturn display(geojson);\n};\n\nCustomPolygonMode.onTrash = function (state) {\n\tthis.deleteFeature([state.polygon.id], { silent: true });\n\tthis.changeMode(\"custom_select\");\n};\n\nexport default CustomPolygonMode;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport Point from '@mapbox/point-geometry';\n\n/**\n * Returns a Point representing a mouse event's position\n * relative to a containing element.\n *\n * @param {MouseEvent} mouseEvent\n * @param {Node} container\n * @returns {Point}\n */\nfunction mouseEventPoint(mouseEvent, container) {\n\tconst rect = container.getBoundingClientRect();\n\treturn new Point(\n\t\tmouseEvent.clientX - rect.left - (container.clientLeft || 0),\n\t\tmouseEvent.clientY - rect.top - (container.clientTop || 0)\n\t);\n}\n\nexport default mouseEventPoint;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport * as Constants from \"./constants\";\n\nconst create_midpoint = function (parent, startVertex, endVertex) {\n\tconst startCoord = startVertex.geometry.coordinates;\n\tconst endCoord = endVertex.geometry.coordinates;\n\n\t// If a coordinate exceeds the projection, we can't calculate a midpoint,\n\t// so run away\n\tif (\n\t\tstartCoord[1] > Constants.LAT_RENDERED_MAX ||\n\t\tstartCoord[1] < Constants.LAT_RENDERED_MIN ||\n\t\tendCoord[1] > Constants.LAT_RENDERED_MAX ||\n\t\tendCoord[1] < Constants.LAT_RENDERED_MIN\n\t) {\n\t\treturn null;\n\t}\n\n\tconst mid = {\n\t\tlng: (startCoord[0] + endCoord[0]) / 2,\n\t\tlat: (startCoord[1] + endCoord[1]) / 2,\n\t};\n\n\treturn {\n\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\tproperties: {\n\t\t\tmeta: Constants.meta.MIDPOINT,\n\t\t\tparent,\n\t\t\tlng: mid.lng,\n\t\t\tlat: mid.lat,\n\t\t\tcoord_path: endVertex.properties.coord_path,\n\t\t},\n\t\tgeometry: {\n\t\t\ttype: Constants.geojsonTypes.POINT,\n\t\t\tcoordinates: [mid.lng, mid.lat],\n\t\t},\n\t};\n};\nexport default create_midpoint;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport createVertex from \"./create_vertex\";\nimport createMidpoint from \"./create_midpoint\";\nimport * as Constants from \"./constants\";\n\nfunction createSupplementaryPoints(geojson, options = {}, basePath = null) {\n\tconst { type, coordinates } = geojson.geometry;\n\tconst featureId = geojson.properties && geojson.properties.id;\n\n\tlet supplementaryPoints = [];\n\n\tif (type === Constants.geojsonTypes.POINT) {\n\t\t// For points, just create a vertex\n\t\tsupplementaryPoints.push(\n\t\t\tcreateVertex(featureId, coordinates, basePath, isSelectedPath(basePath))\n\t\t);\n\t} else if (type === Constants.geojsonTypes.POLYGON) {\n\t\t// Cycle through a Polygon's rings and\n\t\t// process each line\n\t\tcoordinates.forEach((line, lineIndex) => {\n\t\t\tprocessLine(\n\t\t\t\tline,\n\t\t\t\tbasePath !== null ? `${basePath}.${lineIndex}` : String(lineIndex)\n\t\t\t);\n\t\t});\n\t} else if (type === Constants.geojsonTypes.LINE_STRING) {\n\t\tprocessLine(coordinates, basePath);\n\t} else if (type.indexOf(Constants.geojsonTypes.MULTI_PREFIX) === 0) {\n\t\tprocessMultiGeometry();\n\t}\n\n\tfunction processLine(line, lineBasePath) {\n\t\tlet firstPointString = \"\";\n\t\tlet lastVertex = null;\n\t\tline.forEach((point, pointIndex) => {\n\t\t\tconst pointPath =\n\t\t\t\tlineBasePath !== undefined && lineBasePath !== null\n\t\t\t\t\t? `${lineBasePath}.${pointIndex}`\n\t\t\t\t\t: String(pointIndex);\n\t\t\tconst vertex = createVertex(\n\t\t\t\tfeatureId,\n\t\t\t\tpoint,\n\t\t\t\tpointPath,\n\t\t\t\tisSelectedPath(pointPath)\n\t\t\t);\n\n\t\t\t// If we're creating midpoints, check if there was a\n\t\t\t// vertex before this one. If so, add a midpoint\n\t\t\t// between that vertex and this one.\n\t\t\tif (options.midpoints && lastVertex) {\n\t\t\t\tconst midpoint = createMidpoint(featureId, lastVertex, vertex);\n\t\t\t\tif (midpoint) {\n\t\t\t\t\tsupplementaryPoints.push(midpoint);\n\t\t\t\t}\n\t\t\t}\n\t\t\tlastVertex = vertex;\n\n\t\t\t// A Polygon line's last point is the same as the first point. If we're on the last\n\t\t\t// point, we want to draw a midpoint before it but not another vertex on it\n\t\t\t// (since we already a vertex there, from the first point).\n\t\t\tconst stringifiedPoint = JSON.stringify(point);\n\t\t\tif (firstPointString !== stringifiedPoint) {\n\t\t\t\tsupplementaryPoints.push(vertex);\n\t\t\t}\n\t\t\tif (pointIndex === 0) {\n\t\t\t\tfirstPointString = stringifiedPoint;\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction isSelectedPath(path) {\n\t\tif (!options.selectedPaths) return false;\n\t\treturn options.selectedPaths.indexOf(path) !== -1;\n\t}\n\n\t// Split a multi-geometry into constituent\n\t// geometries, and accumulate the supplementary points\n\t// for each of those constituents\n\tfunction processMultiGeometry() {\n\t\tconst subType = type.replace(Constants.geojsonTypes.MULTI_PREFIX, \"\");\n\t\tcoordinates.forEach((subCoordinates, index) => {\n\t\t\tconst subFeature = {\n\t\t\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\t\t\tproperties: geojson.properties,\n\t\t\t\tgeometry: {\n\t\t\t\t\ttype: subType,\n\t\t\t\t\tcoordinates: subCoordinates,\n\t\t\t\t},\n\t\t\t};\n\t\t\tsupplementaryPoints = supplementaryPoints.concat(\n\t\t\t\tcreateSupplementaryPoints(subFeature, options, index)\n\t\t\t);\n\t\t});\n\t}\n\n\treturn supplementaryPoints;\n}\n\nexport default createSupplementaryPoints;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nfunction StringSet(items) {\n\tthis._items = {};\n\tthis._nums = {};\n\tthis._length = items ? items.length : 0;\n\tif (!items) return;\n\tfor (let i = 0, l = items.length; i < l; i++) {\n\t\tthis.add(items[i]);\n\t\tif (items[i] === undefined) continue;\n\t\tif (typeof items[i] === 'string') this._items[items[i]] = i;\n\t\telse this._nums[items[i]] = i;\n\n\t}\n}\n\nStringSet.prototype.add = function(x) {\n\tif (this.has(x)) return this;\n\tthis._length++;\n\tif (typeof x === 'string') this._items[x] = this._length;\n\telse this._nums[x] = this._length;\n\treturn this;\n};\n\nStringSet.prototype.delete = function(x) {\n\tif (this.has(x) === false) return this;\n\tthis._length--;\n\tdelete this._items[x];\n\tdelete this._nums[x];\n\treturn this;\n};\n\nStringSet.prototype.has = function(x) {\n\tif (typeof x !== 'string' && typeof x !== 'number') return false;\n\treturn this._items[x] !== undefined || this._nums[x] !== undefined;\n};\n\nStringSet.prototype.values = function() {\n\tconst values = [];\n\tObject.keys(this._items).forEach((k) => {\n\t\tvalues.push({ k, v: this._items[k] });\n\t});\n\tObject.keys(this._nums).forEach((k) => {\n\t\tvalues.push({ k: JSON.parse(k), v: this._nums[k] });\n\t});\n\n\treturn values.sort((a, b) => a.v - b.v).map(a => a.k);\n};\n\nStringSet.prototype.clear = function() {\n\tthis._length = 0;\n\tthis._items = {};\n\tthis._nums = {};\n\treturn this;\n};\n\nexport default StringSet;\n","var geojsonCoords = require('@mapbox/geojson-coords'),\n traverse = require('traverse'),\n extent = require('@mapbox/extent');\n\nvar geojsonTypesByDataAttributes = {\n features: ['FeatureCollection'],\n coordinates: ['Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon'],\n geometry: ['Feature'],\n geometries: ['GeometryCollection']\n}\n\nvar dataAttributes = Object.keys(geojsonTypesByDataAttributes);\n\nmodule.exports = function(_) {\n return getExtent(_).bbox();\n};\n\nmodule.exports.polygon = function(_) {\n return getExtent(_).polygon();\n};\n\nmodule.exports.bboxify = function(_) {\n return traverse(_).map(function(value) {\n if (!value) return ;\n\n var isValid = dataAttributes.some(function(attribute){\n if(value[attribute]) {\n return geojsonTypesByDataAttributes[attribute].indexOf(value.type) !== -1;\n }\n return false;\n });\n\n if(isValid){\n value.bbox = getExtent(value).bbox();\n this.update(value);\n }\n\n });\n};\n\nfunction getExtent(_) {\n var ext = extent(),\n coords = geojsonCoords(_);\n for (var i = 0; i < coords.length; i++) ext.include(coords[i]);\n return ext;\n}\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport extent from \"@mapbox/geojson-extent\";\nimport * as Constants from \"./constants\";\n\nconst {\n\tLAT_MIN,\n\tLAT_MAX,\n\tLAT_RENDERED_MIN,\n\tLAT_RENDERED_MAX,\n\tLNG_MIN,\n\tLNG_MAX,\n} = Constants;\n\n// Ensure that we do not drag north-south far enough for\n// - any part of any feature to exceed the poles\n// - any feature to be completely lost in the space between the projection's\n//\t edge and the poles, such that it couldn't be re-selected and moved back\nconst constrain_feature_movement = function (geojsonFeatures, delta) {\n\t// \"inner edge\" = a feature's latitude closest to the equator\n\tlet northInnerEdge = LAT_MIN;\n\tlet southInnerEdge = LAT_MAX;\n\t// \"outer edge\" = a feature's latitude furthest from the equator\n\tlet northOuterEdge = LAT_MIN;\n\tlet southOuterEdge = LAT_MAX;\n\n\tlet westEdge = LNG_MAX;\n\tlet eastEdge = LNG_MIN;\n\n\tgeojsonFeatures.forEach((feature) => {\n\t\tconst bounds = extent(feature);\n\t\tconst featureSouthEdge = bounds[1];\n\t\tconst featureNorthEdge = bounds[3];\n\t\tconst featureWestEdge = bounds[0];\n\t\tconst featureEastEdge = bounds[2];\n\t\tif (featureSouthEdge > northInnerEdge) northInnerEdge = featureSouthEdge;\n\t\tif (featureNorthEdge < southInnerEdge) southInnerEdge = featureNorthEdge;\n\t\tif (featureNorthEdge > northOuterEdge) northOuterEdge = featureNorthEdge;\n\t\tif (featureSouthEdge < southOuterEdge) southOuterEdge = featureSouthEdge;\n\t\tif (featureWestEdge < westEdge) westEdge = featureWestEdge;\n\t\tif (featureEastEdge > eastEdge) eastEdge = featureEastEdge;\n\t});\n\n\t// These changes are not mutually exclusive: we might hit the inner\n\t// edge but also have hit the outer edge and therefore need\n\t// another readjustment\n\tconst constrainedDelta = delta;\n\tif (northInnerEdge + constrainedDelta.lat > LAT_RENDERED_MAX) {\n\t\tconstrainedDelta.lat = LAT_RENDERED_MAX - northInnerEdge;\n\t}\n\tif (northOuterEdge + constrainedDelta.lat > LAT_MAX) {\n\t\tconstrainedDelta.lat = LAT_MAX - northOuterEdge;\n\t}\n\tif (southInnerEdge + constrainedDelta.lat < LAT_RENDERED_MIN) {\n\t\tconstrainedDelta.lat = LAT_RENDERED_MIN - southInnerEdge;\n\t}\n\tif (southOuterEdge + constrainedDelta.lat < LAT_MIN) {\n\t\tconstrainedDelta.lat = LAT_MIN - southOuterEdge;\n\t}\n\tif (westEdge + constrainedDelta.lng <= LNG_MIN) {\n\t\tconstrainedDelta.lng += Math.ceil(Math.abs(constrainedDelta.lng) / 360) * 360;\n\t}\n\tif (eastEdge + constrainedDelta.lng >= LNG_MAX) {\n\t\tconstrainedDelta.lng -= Math.ceil(Math.abs(constrainedDelta.lng) / 360) * 360;\n\t}\n\n\treturn constrainedDelta;\n};\n\nexport default constrain_feature_movement;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport constrainFeatureMovement from \"./constrain_feature_movement\";\nimport * as Constants from \"./constants\";\n\nvar move_features = function (features, delta) {\n\tconst constrainedDelta = constrainFeatureMovement(\n\t\tfeatures.map((feature) => feature.toGeoJSON()),\n\t\tdelta\n\t);\n\n\tfeatures.forEach((feature) => {\n\t\tconst currentCoordinates = feature.getCoordinates();\n\n\t\tconst moveCoordinate = (coord) => {\n\t\t\tconst point = {\n\t\t\t\tlng: coord[0] + constrainedDelta.lng,\n\t\t\t\tlat: coord[1] + constrainedDelta.lat,\n\t\t\t};\n\t\t\treturn [point.lng, point.lat];\n\t\t};\n\t\tconst moveRing = (ring) => ring.map((coord) => moveCoordinate(coord));\n\t\tconst moveMultiPolygon = (multi) => multi.map((ring) => moveRing(ring));\n\n\t\tlet nextCoordinates;\n\t\tif (feature.type === Constants.geojsonTypes.POINT) {\n\t\t\tnextCoordinates = moveCoordinate(currentCoordinates);\n\t\t} else if (\n\t\t\tfeature.type === Constants.geojsonTypes.LINE_STRING ||\n\t\t\tfeature.type === Constants.geojsonTypes.MULTI_POINT\n\t\t) {\n\t\t\tnextCoordinates = currentCoordinates.map(moveCoordinate);\n\t\t} else if (\n\t\t\tfeature.type === Constants.geojsonTypes.POLYGON ||\n\t\t\tfeature.type === Constants.geojsonTypes.MULTI_LINE_STRING\n\t\t) {\n\t\t\tnextCoordinates = currentCoordinates.map(moveRing);\n\t\t} else if (feature.type === Constants.geojsonTypes.MULTI_POLYGON) {\n\t\t\tnextCoordinates = currentCoordinates.map(moveMultiPolygon);\n\t\t}\n\n\t\tfeature.incomingCoords(nextCoordinates);\n\t});\n};\nexport default move_features;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport * as CommonSelectors from \"./lib/common_selectors.js\";\nimport doubleClickZoom from \"./lib/double_click_zoom.js\";\nimport * as Constants from \"./lib/constants.js\";\nimport mouseEventPoint from \"./lib/mouse_event_point.js\";\nimport createSupplementaryPoints from \"./lib/create_supplementary_points.js\";\nimport StringSet from \"./lib/string_set.js\";\nimport moveFeatures from \"./lib/move_features.js\";\n\nconst CustomSelectMode = {};\nCustomSelectMode.onSetup = function (opts) {\n\tconsole.log(\"Change mode: custom select\");\n\n\t// turn the opts into state.\n\tconst state = {\n\t\tdragMoveLocation: null,\n\t\tboxSelectStartLocation: null,\n\t\tboxSelectElement: undefined,\n\t\tboxSelecting: false,\n\t\tcanBoxSelect: false,\n\t\tdragMoving: false,\n\t\tcanDragMove: false,\n\t\tinitiallySelectedFeatureIds: opts.featureIds || [],\n\t};\n\n\tthis.setSelected(\n\t\tstate.initiallySelectedFeatureIds.filter(\n\t\t\t(id) => this.getFeature(id) !== undefined\n\t\t)\n\t);\n\tthis.fireActionable();\n\n\tthis.setActionableState({\n\t\tcombineFeatures: true,\n\t\tuncombineFeatures: true,\n\t\ttrash: true,\n\t});\n\n\treturn state;\n};\n\nCustomSelectMode.fireUpdate = function () {\n\tthis.map.fire(Constants.events.UPDATE, {\n\t\taction: Constants.updateActions.MOVE,\n\t\tfeatures: this.getSelected().map((f) => f.toGeoJSON()),\n\t});\n};\n\nCustomSelectMode.fireActionable = function () {\n\tconst selectedFeatures = this.getSelected();\n\n\tconst multiFeatures = selectedFeatures.filter((feature) =>\n\t\tthis.isInstanceOf(\"MultiFeature\", feature)\n\t);\n\n\tlet combineFeatures = false;\n\n\tif (selectedFeatures.length > 1) {\n\t\tcombineFeatures = true;\n\t\tconst featureType = selectedFeatures[0].type.replace(\"Multi\", \"\");\n\t\tselectedFeatures.forEach((feature) => {\n\t\t\tif (feature.type.replace(\"Multi\", \"\") !== featureType) {\n\t\t\t\tcombineFeatures = false;\n\t\t\t}\n\t\t});\n\t}\n\n\tconst uncombineFeatures = multiFeatures.length > 0;\n\tconst trash = selectedFeatures.length > 0;\n\n\tthis.setActionableState({\n\t\tcombineFeatures,\n\t\tuncombineFeatures,\n\t\ttrash,\n\t});\n};\n\nCustomSelectMode.getUniqueIds = function (allFeatures) {\n\tif (!allFeatures.length) return [];\n\tconst ids = allFeatures\n\t\t.map((s) => s.properties.id)\n\t\t.filter((id) => id !== undefined)\n\t\t.reduce((memo, id) => {\n\t\t\tmemo.add(id);\n\t\t\treturn memo;\n\t\t}, new StringSet());\n\n\treturn ids.values();\n};\n\nCustomSelectMode.stopExtendedInteractions = function (state) {\n\tif (state.boxSelectElement) {\n\t\tif (state.boxSelectElement.parentNode)\n\t\t\tstate.boxSelectElement.parentNode.removeChild(state.boxSelectElement);\n\t\tstate.boxSelectElement = null;\n\t}\n\n\tthis.map.dragPan.enable();\n\n\tstate.boxSelecting = false;\n\tstate.canBoxSelect = false;\n\tstate.dragMoving = false;\n\tstate.canDragMove = false;\n};\n\nCustomSelectMode.onStop = function () {\n\tdoubleClickZoom.enable(this);\n};\n\nCustomSelectMode.onMouseMove = function (state) {\n\t// On mousemove that is not a drag, stop extended interactions.\n\t// This is useful if you drag off the canvas, release the button,\n\t// then move the mouse back over the canvas --- we don't allow the\n\t// interaction to continue then, but we do let it continue if you held\n\t// the mouse button that whole time\n\treturn this.stopExtendedInteractions(state);\n};\n\nCustomSelectMode.onMouseOut = function (state) {\n\t// As soon as you mouse leaves the canvas, update the feature\n\tif (state.dragMoving) return this.fireUpdate();\n};\n\nCustomSelectMode.onTap = CustomSelectMode.onClick = function (state, e) {\n\t// Click (with or without shift) on no feature\n\tif (CommonSelectors.noTarget(e)) return this.clickAnywhere(state, e); // also tap\n\tif (CommonSelectors.isOfMetaType(Constants.meta.VERTEX)(e))\n\t\treturn this.clickOnVertex(state, e); //tap\n\tif (CommonSelectors.isFeature(e)) return this.clickOnFeature(state, e);\n};\n\nCustomSelectMode.clickAnywhere = function (state) {\n\t// Clear the re-render selection\n\tconst wasSelected = this.getSelectedIds();\n\tif (wasSelected.length) {\n\t\tthis.clearSelectedFeatures();\n\t\twasSelected.forEach((id) => this.doRender(id));\n\t}\n\tdoubleClickZoom.enable(this);\n\tthis.stopExtendedInteractions(state);\n};\n\nCustomSelectMode.clickOnVertex = function (state, e) {\n\t// Enter direct select mode\n\tthis.changeMode(\"custom_direct_select\", {\n\t\tfeatureId: e.featureTarget.properties.parent,\n\t\tcoordPath: e.featureTarget.properties.coord_path,\n\t\tstartPos: e.lngLat,\n\t\t//\t\tgroupMove_vertices: matchingVertices,\n\t});\n\tthis.updateUIClasses({ mouse: Constants.cursors.MOVE });\n};\n\nCustomSelectMode.startOnActiveFeature = function (state, e) {\n\t// Stop any already-underway extended interactions\n\tthis.stopExtendedInteractions(state);\n\n\t// Disable map.dragPan immediately so it can't start\n\tthis.map.dragPan.disable();\n\n\t// Re-render it and enable drag move\n\tthis.doRender(e.featureTarget.properties.id);\n\n\t// Set up the state for drag moving\n\tstate.canDragMove = true;\n\tstate.dragMoveLocation = e.lngLat;\n};\n\nCustomSelectMode.clickOnFeature = function (state, e) {\n\t// Stop everything\n\tdoubleClickZoom.disable(this);\n\tthis.stopExtendedInteractions(state);\n\n\tconst isShiftClick = CommonSelectors.isShiftDown(e);\n\tconst selectedFeatureIds = this.getSelectedIds();\n\tconst featureId = e.featureTarget.properties.id;\n\tconst isFeatureSelected = this.isSelected(featureId);\n\n\t// Click (without shift) on any selected feature but a point\n\tif (\n\t\t!isShiftClick &&\n\t\tisFeatureSelected &&\n\t\tthis.getFeature(featureId).type !== Constants.geojsonTypes.POINT\n\t) {\n\t\t// Enter direct select mode\n\t\treturn this.changeMode(\"custom_direct_select\", {\n\t\t\tfeatureId,\n\t\t});\n\t}\n\n\t// Shift-click on a selected feature\n\tif (isFeatureSelected && isShiftClick) {\n\t\t// Deselect it\n\t\tthis.deselect(featureId);\n\t\tthis.updateUIClasses({ mouse: Constants.cursors.POINTER });\n\t\tif (selectedFeatureIds.length === 1) {\n\t\t\tdoubleClickZoom.enable(this);\n\t\t}\n\t\t// Shift-click on an unselected feature\n\t} else if (!isFeatureSelected && isShiftClick) {\n\t\t// Add it to the selection\n\t\tthis.select(featureId);\n\t\tthis.updateUIClasses({ mouse: Constants.cursors.MOVE });\n\t\t// Click (without shift) on an unselected feature\n\t} else if (!isFeatureSelected && !isShiftClick) {\n\t\t// Make it the only selected feature\n\t\tselectedFeatureIds.forEach((id) => this.doRender(id));\n\t\tthis.setSelected(featureId);\n\t\tthis.updateUIClasses({ mouse: Constants.cursors.MOVE });\n\t}\n\n\t// No matter what, re-render the clicked feature\n\tthis.doRender(featureId);\n};\n\nCustomSelectMode.onMouseDown = function (state, e) {\n\tif (CommonSelectors.isActiveFeature(e)) return this.startOnActiveFeature(state, e);\n\tif (this.drawConfig.boxSelect && CommonSelectors.isShiftMousedown(e))\n\t\treturn this.startBoxSelect(state, e);\n};\n\nCustomSelectMode.startBoxSelect = function (state, e) {\n\tthis.stopExtendedInteractions(state);\n\tthis.map.dragPan.disable();\n\t// Enable box select\n\tstate.boxSelectStartLocation = mouseEventPoint(\n\t\te.originalEvent,\n\t\tthis.map.getContainer()\n\t);\n\tstate.canBoxSelect = true;\n};\n\nCustomSelectMode.onTouchStart = function (state, e) {\n\tif (CommonSelectors.isActiveFeature(e)) return this.startOnActiveFeature(state, e);\n};\n\nCustomSelectMode.onDrag = function (state, e) {\n\tif (state.canDragMove) return this.dragMove(state, e);\n\tif (this.drawConfig.boxSelect && state.canBoxSelect)\n\t\treturn this.whileBoxSelect(state, e);\n};\n\nCustomSelectMode.whileBoxSelect = function (state, e) {\n\tstate.boxSelecting = true;\n\tthis.updateUIClasses({ mouse: Constants.cursors.ADD });\n\n\t// Create the box node if it doesn't exist\n\tif (!state.boxSelectElement) {\n\t\tstate.boxSelectElement = document.createElement(\"div\");\n\t\tstate.boxSelectElement.classList.add(Constants.classes.BOX_SELECT);\n\t\tthis.map.getContainer().appendChild(state.boxSelectElement);\n\t}\n\n\t// Adjust the box node's width and xy position\n\tconst current = mouseEventPoint(e.originalEvent, this.map.getContainer());\n\tconst minX = Math.min(state.boxSelectStartLocation.x, current.x);\n\tconst maxX = Math.max(state.boxSelectStartLocation.x, current.x);\n\tconst minY = Math.min(state.boxSelectStartLocation.y, current.y);\n\tconst maxY = Math.max(state.boxSelectStartLocation.y, current.y);\n\tconst translateValue = `translate(${minX}px, ${minY}px)`;\n\tstate.boxSelectElement.style.transform = translateValue;\n\tstate.boxSelectElement.style.WebkitTransform = translateValue;\n\tstate.boxSelectElement.style.width = `${maxX - minX}px`;\n\tstate.boxSelectElement.style.height = `${maxY - minY}px`;\n};\n\nCustomSelectMode.dragMove = function (state, e) {\n\t// Dragging when drag move is enabled\n\tstate.dragMoving = true;\n\te.originalEvent.stopPropagation();\n\n\tconst delta = {\n\t\tlng: e.lngLat.lng - state.dragMoveLocation.lng,\n\t\tlat: e.lngLat.lat - state.dragMoveLocation.lat,\n\t};\n\n\tmoveFeatures(this.getSelected(), delta);\n\n\tstate.dragMoveLocation = e.lngLat;\n};\n\nCustomSelectMode.onMouseUp = function (state, e) {\n\t// End any extended interactions\n\tif (state.dragMoving) {\n\t\tthis.fireUpdate();\n\t} else if (state.boxSelecting) {\n\t\tconst bbox = [\n\t\t\tstate.boxSelectStartLocation,\n\t\t\tmouseEventPoint(e.originalEvent, this.map.getContainer()),\n\t\t];\n\t\tconst featuresInBox = this.featuresAt(null, bbox, \"click\");\n\t\tconst idsToSelect = this.getUniqueIds(featuresInBox).filter(\n\t\t\t(id) => !this.isSelected(id)\n\t\t);\n\n\t\tif (idsToSelect.length) {\n\t\t\tthis.select(idsToSelect);\n\t\t\tidsToSelect.forEach((id) => this.doRender(id));\n\t\t\tthis.updateUIClasses({ mouse: Constants.cursors.MOVE });\n\t\t}\n\t}\n\tthis.stopExtendedInteractions(state);\n};\n\nCustomSelectMode.toDisplayFeatures = function (state, geojson, display) {\n\tgeojson.properties.active = this.isSelected(geojson.properties.id)\n\t\t? Constants.activeStates.ACTIVE\n\t\t: Constants.activeStates.INACTIVE;\n\tdisplay(geojson);\n\tthis.fireActionable();\n\tif (\n\t\tgeojson.properties.active !== Constants.activeStates.ACTIVE ||\n\t\tgeojson.geometry.type === Constants.geojsonTypes.POINT\n\t)\n\t\treturn;\n\tcreateSupplementaryPoints(geojson).forEach(display);\n};\n\nCustomSelectMode.onTrash = function () {\n\tthis.deleteFeature(this.getSelectedIds());\n\tthis.fireActionable();\n};\n\nCustomSelectMode.onCombineFeatures = function () {\n\tconst selectedFeatures = this.getSelected();\n\n\tif (selectedFeatures.length === 0 || selectedFeatures.length < 2) return;\n\n\tconst coordinates = [],\n\t\tfeaturesCombined = [];\n\tconst featureType = selectedFeatures[0].type.replace(\"Multi\", \"\");\n\n\tfor (let i = 0; i < selectedFeatures.length; i++) {\n\t\tconst feature = selectedFeatures[i];\n\n\t\tif (feature.type.replace(\"Multi\", \"\") !== featureType) {\n\t\t\treturn;\n\t\t}\n\t\tif (feature.type.includes(\"Multi\")) {\n\t\t\tfeature.getCoordinates().forEach((subcoords) => {\n\t\t\t\tcoordinates.push(subcoords);\n\t\t\t});\n\t\t} else {\n\t\t\tcoordinates.push(feature.getCoordinates());\n\t\t}\n\n\t\tfeaturesCombined.push(feature.toGeoJSON());\n\t}\n\n\tif (featuresCombined.length > 1) {\n\t\tconst multiFeature = this.newFeature({\n\t\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\t\tproperties: featuresCombined[0].properties,\n\t\t\tgeometry: {\n\t\t\t\ttype: `Multi${featureType}`,\n\t\t\t\tcoordinates,\n\t\t\t},\n\t\t});\n\n\t\tthis.addFeature(multiFeature);\n\t\tthis.deleteFeature(this.getSelectedIds(), { silent: true });\n\t\tthis.setSelected([multiFeature.id]);\n\n\t\tthis.map.fire(Constants.events.COMBINE_FEATURES, {\n\t\t\tcreatedFeatures: [multiFeature.toGeoJSON()],\n\t\t\tdeletedFeatures: featuresCombined,\n\t\t});\n\t}\n\tthis.fireActionable();\n};\n\nCustomSelectMode.onUncombineFeatures = function () {\n\tconst selectedFeatures = this.getSelected();\n\tif (selectedFeatures.length === 0) return;\n\n\tconst createdFeatures = [];\n\tconst featuresUncombined = [];\n\n\tfor (let i = 0; i < selectedFeatures.length; i++) {\n\t\tconst feature = selectedFeatures[i];\n\n\t\tif (this.isInstanceOf(\"MultiFeature\", feature)) {\n\t\t\tfeature.getFeatures().forEach((subFeature) => {\n\t\t\t\tthis.addFeature(subFeature);\n\t\t\t\tsubFeature.properties = feature.properties;\n\t\t\t\tcreatedFeatures.push(subFeature.toGeoJSON());\n\t\t\t\tthis.select([subFeature.id]);\n\t\t\t});\n\t\t\tthis.deleteFeature(feature.id, { silent: true });\n\t\t\tfeaturesUncombined.push(feature.toGeoJSON());\n\t\t}\n\t}\n\n\tif (createdFeatures.length > 1) {\n\t\tthis.map.fire(Constants.events.UNCOMBINE_FEATURES, {\n\t\t\tcreatedFeatures,\n\t\t\tdeletedFeatures: featuresUncombined,\n\t\t});\n\t}\n\tthis.fireActionable();\n};\n\nexport default CustomSelectMode;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nconst drawUtils = {\n\tgetMatchingVertices: (vertex, featureId, allFeatures, map) => {\n\t\t// number of decimals should probably be dynamic depending on zoom level\n\t\tlet decimals = 5;\n\t\tlet matchingVertices = [];\n\n\t\tlet v_lng = vertex[0].toFixed(decimals);\n\t\tlet v_lat = vertex[1].toFixed(decimals);\n\n\t\tfor (var i = 0; i < allFeatures.length; i++) {\n\t\t\tif (allFeatures[i].id !== featureId) {\n\t\t\t\tfor (var k = 0; k < allFeatures[i].geometry.coordinates.length; k++) {\n\t\t\t\t\tfor (var m = 0; m < allFeatures[i].geometry.coordinates[k].length; m++) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tv_lng ===\n\t\t\t\t\t\t\t\tallFeatures[i].geometry.coordinates[k][m][0].toFixed(decimals) &&\n\t\t\t\t\t\t\tv_lat ===\n\t\t\t\t\t\t\t\tallFeatures[i].geometry.coordinates[k][m][1].toFixed(decimals)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tmatchingVertices.push({\n\t\t\t\t\t\t\t\tfeatureId: allFeatures[i].id,\n\t\t\t\t\t\t\t\tcoord_path: k + \".\" + m,\n\t\t\t\t\t\t\t\t//feature: map.getFeature(allFeatures[i].id),\n\t\t\t\t\t\t\t\tlng: allFeatures[i].geometry.coordinates[k][m][0],\n\t\t\t\t\t\t\t\tlat: allFeatures[i].geometry.coordinates[k][m][1],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn matchingVertices;\n\t},\n\tgetDrawInstance: (map) => {\n\t\tfor (var i = map._controls.length - 1; i >= 0; i--) {\n\t\t\tif (\n\t\t\t\tmap._controls[i]?.modes?.SIMPLE_SELECT === \"simple_select\"\n\t\t\t) {\n\t\t\t\treturn map._controls[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t},\n};\n\nexport default drawUtils;\n","/**\n * Code from https://github.com/mapbox/mapbox-gl-draw\n * and licensed under ISC\n */\nimport {\n\tnoTarget,\n\tisOfMetaType,\n\tisActiveFeature,\n\tisInactiveFeature,\n\tisShiftDown,\n} from \"./lib/common_selectors.js\";\nimport createSupplementaryPoints from \"./lib/create_supplementary_points.js\";\nimport constrainFeatureMovement from \"./lib/constrain_feature_movement.js\";\nimport doubleClickZoom from \"./lib/double_click_zoom.js\";\nimport * as Constants from \"./lib/constants.js\";\nimport moveFeatures from \"./lib/move_features.js\";\nimport drawUtils from \"./lib/utils.js\";\n\nconst isVertex = isOfMetaType(Constants.meta.VERTEX);\nconst isMidpoint = isOfMetaType(Constants.meta.MIDPOINT);\n\nconst DirectSelect = {};\n\n// INTERNAL FUNCTIONS\n\nDirectSelect.fireUpdate = function () {\n\tthis.map.fire(Constants.events.UPDATE, {\n\t\taction: Constants.updateActions.CHANGE_COORDINATES,\n\t\tfeatures: this.getSelected().map((f) => f.toGeoJSON()),\n\t});\n};\n\nDirectSelect.fireActionable = function (state) {\n\tthis.setActionableState({\n\t\tcombineFeatures: false,\n\t\tuncombineFeatures: false,\n\t\ttrash: state.selectedCoordPaths.length > 0,\n\t});\n};\n\nDirectSelect.startDragging = function (state, e) {\n\tthis.map.dragPan.disable();\n\tstate.canDragMove = true;\n\tstate.dragMoveLocation = e.lngLat;\n};\n\nDirectSelect.stopDragging = function (state) {\n\tthis.map.dragPan.enable();\n\tstate.dragMoving = false;\n\tstate.canDragMove = false;\n\tstate.dragMoveLocation = null;\n};\n\nDirectSelect.onVertex = function (state, e) {\n\tthis.startDragging(state, e);\n\tconst about = e.featureTarget.properties;\n\tconst selectedIndex = state.selectedCoordPaths.indexOf(about.coord_path);\n\tif (!isShiftDown(e) && selectedIndex === -1) {\n\t\tstate.selectedCoordPaths = [about.coord_path];\n\t} else if (isShiftDown(e) && selectedIndex === -1) {\n\t\tstate.selectedCoordPaths.push(about.coord_path);\n\t}\n\n\t// currently this work with single selected vertices only\n\tlet allFeatures = drawUtils.getDrawInstance(this.map).getAll();\n\n\tlet matchingVertices = drawUtils.getMatchingVertices(\n\t\te.featureTarget._geometry.coordinates,\n\t\te.featureTarget.properties.parent,\n\t\tallFeatures.features,\n\t\tthis.map\n\t);\n\tstate.groupMove_vertices = matchingVertices;\n\n\tfor (let i = 0; i < state.groupMove_vertices.length; i++) {\n\t\tstate.groupMove_vertices[i].feature = this.getFeature(\n\t\t\tstate.groupMove_vertices[i].featureId\n\t\t);\n\t}\n\n\tconst selectedCoordinates = this.pathsToCoordinates(\n\t\tstate.featureId,\n\t\tstate.selectedCoordPaths\n\t);\n\tthis.setSelectedCoordinates(selectedCoordinates);\n};\n\nDirectSelect.onMidpoint = function (state, e) {\n\tthis.startDragging(state, e);\n\tconst about = e.featureTarget.properties;\n\tstate.feature.addCoordinate(about.coord_path, about.lng, about.lat);\n\tthis.fireUpdate();\n\tstate.selectedCoordPaths = [about.coord_path];\n};\n\nDirectSelect.pathsToCoordinates = function (featureId, paths) {\n\treturn paths.map((coord_path) => ({ feature_id: featureId, coord_path }));\n};\n\nDirectSelect.onFeature = function (state, e) {\n\tif (state.selectedCoordPaths.length === 0) this.startDragging(state, e);\n\telse this.stopDragging(state);\n};\n\nDirectSelect.dragFeature = function (state, e, delta) {\n\tmoveFeatures(this.getSelected(), delta);\n\tstate.dragMoveLocation = e.lngLat;\n};\n\nDirectSelect.dragVertex = function (state, e, delta) {\n\tconst selectedCoords = state.selectedCoordPaths.map((coord_path) =>\n\t\tstate.feature.getCoordinate(coord_path)\n\t);\n\tconst selectedCoordPoints = selectedCoords.map((coords) => ({\n\t\ttype: Constants.geojsonTypes.FEATURE,\n\t\tproperties: {},\n\t\tgeometry: {\n\t\t\ttype: Constants.geojsonTypes.POINT,\n\t\t\tcoordinates: coords,\n\t\t},\n\t}));\n\n\tconst constrainedDelta = constrainFeatureMovement(selectedCoordPoints, delta);\n\tfor (let i = 0; i < selectedCoords.length; i++) {\n\t\tconst coord = selectedCoords[i];\n\t\tstate.feature.updateCoordinate(\n\t\t\tstate.selectedCoordPaths[i],\n\t\t\tcoord[0] + constrainedDelta.lng,\n\t\t\tcoord[1] + constrainedDelta.lat\n\t\t);\n\n\t\tfor (let k = 0; k < state.groupMove_vertices.length; k++) {\n\t\t\tlet coord_path_m = state.groupMove_vertices[k].coord_path.split(\".\");\n\t\t\tif (\n\t\t\t\ttypeof coord_path_m[0] !== \"undefined\" &&\n\t\t\t\ttypeof coord_path_m[1] !== \"undefined\" &&\n\t\t\t\ttypeof state.groupMove_vertices[k].feature.coordinates[coord_path_m[0]] !==\n\t\t\t\t\t\"undefined\" &&\n\t\t\t\ttypeof state.groupMove_vertices[k].feature.coordinates[coord_path_m[0]][\n\t\t\t\t\tcoord_path_m[1]\n\t\t\t\t] !== \"undefined\"\n\t\t\t) {\n\t\t\t\tlet coord_m =\n\t\t\t\t\tstate.groupMove_vertices[k].feature.coordinates[coord_path_m[0]][\n\t\t\t\t\t\tcoord_path_m[1]\n\t\t\t\t\t];\n\t\t\t\tstate.groupMove_vertices[k].feature.updateCoordinate(\n\t\t\t\t\tstate.groupMove_vertices[k].coord_path,\n\t\t\t\t\tcoord_m[0] + constrainedDelta.lng,\n\t\t\t\t\tcoord_m[1] + constrainedDelta.lat\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n};\n\nDirectSelect.clickNoTarget = function () {\n\tthis.changeMode(\"custom_select\");\n};\n\nDirectSelect.clickInactive = function () {\n\tthis.changeMode(\"custom_select\");\n};\n\nDirectSelect.clickActiveFeature = function (state) {\n\tstate.selectedCoordPaths = [];\n\tthis.clearSelectedCoordinates();\n\tstate.feature.changed();\n};\n\n// EXTERNAL FUNCTIONS\n\nDirectSelect.onSetup = function (opts) {\n\tconst featureId = opts.featureId;\n\tconst feature = this.getFeature(featureId);\n\n\tif (!feature) {\n\t\tthrow new Error(\"You must provide a featureId to enter direct_select mode\");\n\t}\n\n\tif (feature.type === Constants.geojsonTypes.POINT) {\n\t\tthrow new TypeError(\"direct_select mode doesn't handle point features\");\n\t}\n\n\tconst state = {\n\t\tfeatureId,\n\t\tfeature,\n\t\tdragMoveLocation: opts.startPos || null,\n\t\tdragMoving: false,\n\t\tcanDragMove: false,\n\t\tselectedCoordPaths: opts.coordPath ? [opts.coordPath] : [],\n\t\tgroupMove_vertices: opts.groupMove_vertices ? opts.groupMove_vertices : [],\n\t};\n\n\tthis.setSelectedCoordinates(\n\t\tthis.pathsToCoordinates(featureId, state.selectedCoordPaths)\n\t);\n\tthis.setSelected(featureId);\n\tdoubleClickZoom.disable(this);\n\n\tthis.setActionableState({\n\t\ttrash: true,\n\t});\n\n\treturn state;\n};\n\nDirectSelect.onStop = function () {\n\tdoubleClickZoom.enable(this);\n\tthis.clearSelectedCoordinates();\n};\n\nDirectSelect.toDisplayFeatures = function (state, geojson, push) {\n\tif (state.featureId === geojson.properties.id) {\n\t\tgeojson.properties.active = Constants.activeStates.ACTIVE;\n\t\tpush(geojson);\n\t\tcreateSupplementaryPoints(geojson, {\n\t\t\tmap: this.map,\n\t\t\tmidpoints: true,\n\t\t\tselectedPaths: state.selectedCoordPaths,\n\t\t}).forEach(push);\n\t} else {\n\t\tgeojson.properties.active = Constants.activeStates.INACTIVE;\n\t\tpush(geojson);\n\t}\n\tthis.fireActionable(state);\n};\n\nDirectSelect.onTrash = function (state) {\n\t// Uses number-aware sorting to make sure '9' < '10'. Comparison is reversed because we want them\n\t// in reverse order so that we can remove by index safely.\n\tstate.selectedCoordPaths\n\t\t.sort((a, b) => b.localeCompare(a, \"en\", { numeric: true }))\n\t\t.forEach((id) => state.feature.removeCoordinate(id));\n\tthis.fireUpdate();\n\tstate.selectedCoordPaths = [];\n\tthis.clearSelectedCoordinates();\n\tthis.fireActionable(state);\n\tif (state.feature.isValid() === false) {\n\t\tthis.deleteFeature([state.featureId]);\n\t\tthis.changeMode(\"custom_select\", {});\n\t}\n};\n\nDirectSelect.onMouseMove = function (state, e) {\n\t// On mousemove that is not a drag, stop vertex movement.\n\tconst isFeature = isActiveFeature(e);\n\tconst onVertex = isVertex(e);\n\tconst noCoords = state.selectedCoordPaths.length === 0;\n\tif (isFeature && noCoords) this.updateUIClasses({ mouse: Constants.cursors.MOVE });\n\telse if (onVertex && !noCoords)\n\t\tthis.updateUIClasses({ mouse: Constants.cursors.MOVE });\n\telse this.updateUIClasses({ mouse: Constants.cursors.NONE });\n\tthis.stopDragging(state);\n};\n\nDirectSelect.onMouseOut = function (state) {\n\t// As soon as you mouse leaves the canvas, update the feature\n\tif (state.dragMoving) this.fireUpdate();\n};\n\nDirectSelect.onTouchStart = DirectSelect.onMouseDown = function (state, e) {\n\tif (isVertex(e)) return this.onVertex(state, e);\n\tif (isActiveFeature(e)) return this.onFeature(state, e);\n\tif (isMidpoint(e)) return this.onMidpoint(state, e);\n};\n\nDirectSelect.onDrag = function (state, e) {\n\tif (state.canDragMove !== true) return;\n\tstate.dragMoving = true;\n\te.originalEvent.stopPropagation();\n\n\tconst delta = {\n\t\tlng: e.lngLat.lng - state.dragMoveLocation.lng,\n\t\tlat: e.lngLat.lat - state.dragMoveLocation.lat,\n\t};\n\tif (state.selectedCoordPaths.length > 0) this.dragVertex(state, e, delta);\n\telse this.dragFeature(state, e, delta);\n\n\tstate.dragMoveLocation = e.lngLat;\n};\n\nDirectSelect.onClick = function (state, e) {\n\tif (noTarget(e)) return this.clickNoTarget(state, e);\n\tif (isActiveFeature(e)) return this.clickActiveFeature(state, e);\n\tif (isInactiveFeature(e)) return this.clickInactive(state, e);\n\tthis.stopDragging(state);\n};\n\nDirectSelect.onTap = function (state, e) {\n\tif (noTarget(e)) return this.clickNoTarget(state, e);\n\tif (isActiveFeature(e)) return this.clickActiveFeature(state, e);\n\tif (isInactiveFeature(e)) return this.clickInactive(state, e);\n};\n\nDirectSelect.onTouchEnd = DirectSelect.onMouseUp = function (state) {\n\tif (state.dragMoving) {\n\t\tthis.fireUpdate();\n\t}\n\tthis.stopDragging(state);\n};\n\nexport default DirectSelect;\n","import React, { useState, useEffect, useRef } from 'react';\nimport './MlFeatureEditor.css';\n\nimport '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport CustomPolygonMode from './custom-polygon-mode.js';\nimport CustomSelectMode from './custom-select-mode.js';\nimport CustomDirectSelectMode from './custom-direct-select-mode.js';\n\nimport useMap from '../../hooks/useMap';\nimport { GeoJSONObject, Feature } from '@turf/turf';\n\ninterface MlFeatureEditorProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Id of an existing layer in the mapLibre instance to help specify the layer order\n\t * This layer will be visually beneath the layer with the \"insertBeforeLayer\" id.\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Input GeoJson data at initialization\n\t */\n\tgeojson?: Feature;\n\t/**\n\t * Callback function that is called each time the GeoJson data within has changed within MlFeatureEditor.\n\t * First parameter is the new GeoJson feature.\n\t */\n\tonChange?: (para: GeoJSONObject[]) => void;\n\t/**\n\t * Callback function that is called each time the GeoJson data within has been finished within MlFeatureEditor.\n\t * First parameter is the new GeoJson feature.\n\t */\n\tonFinish?: () => void;\n\t/**\n\t * Feature editor mode:\n\t * - \"custom_select\" edit features\n\t * - \"custom_polygon\" draw Polygon\n\t * - \"draw_point\" draw Point\n\t * - \"draw_line_string\" draw LineString\n\t */\n\tmode?: string;\n}\n\n/**\n * GeoJson Feature editor that allows to create or manipulate GeoJson data\n */\nconst MlFeatureEditor = (props: MlFeatureEditorProps) => {\n\tconst draw = useRef<MapboxDraw>();\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst drawToolsInitialized = useRef(false);\n\tconst [drawToolsReady, setDrawToolsReady] = useState(false);\n\n\tconst modeChangeHandler = (e: any) => {\n\t\tconsole.log('MlFeatureEditor mode change to ' + e.mode);\n\t\t//setDrawMode(e.mode);\n\t\tif (\n\t\t\ttypeof props.onFinish === 'function' &&\n\t\t\t(e.mode === 'custom_select' || e.mode === 'simple_select')\n\t\t) {\n\t\t\tprops.onFinish();\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (mapHook.map && !drawToolsInitialized.current) {\n\t\t\tdrawToolsInitialized.current = true;\n\n\t\t\tif (\n\t\t\t\tmapHook.map.map.style &&\n\t\t\t\tmapHook.map.map.getSource('mapbox-gl-draw-cold') &&\n\t\t\t\tdraw.current\n\t\t\t) {\n\t\t\t\t// remove old Mapbox-gl-Draw from Mapbox instance when hot-reloading this component during development\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t// @ts-ignore\n\t\t\t\tdraw.current?.remove();\n\t\t\t}\n\n\t\t\tdraw.current = new MapboxDraw({\n\t\t\t\tdisplayControlsDefault: false,\n\t\t\t\tdefaultMode: props.mode || 'custom_select',\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t// @ts-ignore\n\t\t\t\tmodes: Object.assign(\n\t\t\t\t\t{\n\t\t\t\t\t\tcustom_polygon: CustomPolygonMode,\n\t\t\t\t\t\tcustom_select: CustomSelectMode,\n\t\t\t\t\t\tcustom_direct_select: CustomDirectSelectMode,\n\t\t\t\t\t},\n\t\t\t\t\tMapboxDraw.modes\n\t\t\t\t),\n\t\t\t});\n\n\t\t\tmapHook.map.addControl(draw.current, 'top-left', mapHook.componentId);\n\t\t\tmapHook.map.on('draw.modechange', modeChangeHandler, mapHook.componentId);\n\n\t\t\tsetDrawToolsReady(true);\n\t\t}\n\t}, [mapHook.map, props, drawToolsInitialized]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !drawToolsReady) return;\n\n\t\tconst changeHandler = () => {\n\t\t\tif (draw.current) {\n\t\t\t\t// update drawnFeatures state object\n\t\t\t\tif (typeof props.onChange === 'function') {\n\t\t\t\t\tconst currentFeatureCollection = draw.current.getAll?.();\n\t\t\t\t\tprops.onChange(currentFeatureCollection?.features);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tmapHook.map.on('mouseup', changeHandler);\n\n\t\tmapHook.map.on('touchend', changeHandler);\n\n\t\treturn () => {\n\t\t\tif (!mapHook.map) return;\n\n\t\t\tmapHook.map.map.off('mouseup', changeHandler);\n\t\t\tmapHook.map.map.off('touchend', changeHandler);\n\t\t};\n\t}, [drawToolsReady, mapHook.map]);\n\n\tuseEffect(() => {\n\t\tif (draw.current && props.geojson?.geometry) {\n\t\t\tdraw.current.set({ type: 'FeatureCollection', features: [props.geojson as any] });\n\t\t}\n\t}, [props.geojson, drawToolsReady]);\n\n\tuseEffect(() => {\n\t\tif (props.mode && draw.current) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t// @ts-ignore\n\t\t\tdraw.current.changeMode(props.mode);\n\t\t}\n\t}, [props.mode]);\n\n\treturn <></>;\n};\n\nexport default MlFeatureEditor;\n","import { useState, useEffect, useCallback, useRef } from 'react';\n\nimport useMap, { useMapType } from './useMap';\n\nimport {\n\tSourceSpecification,\n\tLayerSpecification,\n\tMapMouseEvent,\n\tGeoJSONFeature,\n\tStyle,\n\tMapEventType,\n\tMap,\n} from 'maplibre-gl';\n\nimport MapLibreGlWrapper from '../components/MapLibreMap/lib/MapLibreGlWrapper';\n\nimport { GeoJSONObject } from '@turf/turf';\n\ntype getLayerType = Style['getLayer'];\n\ntype useLayerType = {\n\tmap: MapLibreGlWrapper | undefined;\n\tlayer: ReturnType<getLayerType> | undefined;\n\tlayerId: string;\n\tcomponentId: string;\n\tmapHook: useMapType;\n};\n\nexport type MapEventHandler = (\n\tev: MapMouseEvent & {\n\t\tfeatures?: GeoJSONFeature[] | undefined;\n\t} & Record<string, unknown>\n) => void;\n\nexport interface useLayerProps {\n\tmapId?: string;\n\tlayerId?: string;\n\tidPrefix?: string;\n\tinsertBeforeLayer?: string;\n\tinsertBeforeFirstSymbolLayer?: boolean;\n\tgeojson?: GeoJSONObject;\n\tsource?: SourceSpecification | string;\n\toptions: Partial<LayerSpecification>;\n\tonHover?: (ev: MapEventType & unknown) => Map | void;\n\tonClick?: (ev: MapEventType & unknown) => Map | void;\n\tonLeave?: (ev: MapEventType & unknown) => Map | void;\n}\n\nconst legalLayerTypes = [\n\t'fill',\n\t'line',\n\t'symbol',\n\t'circle',\n\t'heatmap',\n\t'fill-extrusion',\n\t'raster',\n\t'hillshade',\n\t'background',\n];\n\nfunction useLayer(props: useLayerProps): useLayerType {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst layerTypeRef = useRef<string>('');\n\tconst layerPaintConfRef = useRef<string>('');\n\tconst layerLayoutConfRef = useRef<string>('');\n\n\tconst [layer, setLayer] = useState<ReturnType<getLayerType>>();\n\n\tconst initializedRef = useRef<boolean>(false);\n\tconst layerId = useRef(\n\t\tprops.layerId || (props.idPrefix ? props.idPrefix : 'Layer-') + mapHook.componentId\n\t);\n\n\tconst createLayer = useCallback(() => {\n\t\tif (!mapHook.map || mapHook?.map.cancelled) return;\n\n\t\tif (mapHook.map.map.getLayer(layerId.current)) {\n\t\t\tmapHook.cleanup();\n\t\t}\n\t\tif (mapHook.map.map.getSource(layerId.current)) {\n\t\t\tmapHook.map.map.removeSource(layerId.current);\n\t\t}\n\n\t\tif (typeof props.source === 'string') {\n\t\t\tif (props.source === '' || !mapHook.map.map.getSource(props.source)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (typeof props.options.type === 'undefined') {\n\t\t\treturn;\n\t\t}\n\n\t\tinitializedRef.current = true;\n\n\t\tmapHook.map.addLayer(\n\t\t\t{\n\t\t\t\t...props.options,\n\t\t\t\t...(props.geojson && !props.source\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tsource: {\n\t\t\t\t\t\t\t\ttype: 'geojson',\n\t\t\t\t\t\t\t\tdata: props.geojson,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }\n\t\t\t\t\t: {}),\n\t\t\t\t...(props.source\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tsource: props.source,\n\t\t\t\t\t }\n\t\t\t\t\t: {}),\n\t\t\t\tid: layerId.current,\n\t\t\t} as LayerSpecification,\n\t\t\tprops.insertBeforeLayer\n\t\t\t\t? props.insertBeforeLayer\n\t\t\t\t: props.insertBeforeFirstSymbolLayer\n\t\t\t\t? mapHook.map.firstSymbolLayer\n\t\t\t\t: undefined,\n\t\t\tmapHook.componentId\n\t\t);\n\n\t\tsetLayer(() => mapHook.map?.map.getLayer(layerId.current));\n\n\t\tif (typeof props.onHover !== 'undefined') {\n\t\t\tmapHook.map.on('mousemove', layerId.current, props.onHover, mapHook.componentId);\n\t\t}\n\n\t\tif (typeof props.onClick !== 'undefined') {\n\t\t\tmapHook.map.on('click', layerId.current, props.onClick, mapHook.componentId);\n\t\t}\n\n\t\tif (typeof props.onLeave !== 'undefined') {\n\t\t\tmapHook.map.on('mouseleave', layerId.current, props.onLeave, mapHook.componentId);\n\t\t}\n\n\t\t// recreate layer if style has changed\n\t\tmapHook.map.on(\n\t\t\t'styledata',\n\t\t\t() => {\n\t\t\t\tif (initializedRef.current && !mapHook.map?.map.getLayer(layerId.current)) {\n\t\t\t\t\tconsole.log('Recreate Layer');\n\t\t\t\t\tcreateLayer();\n\t\t\t\t}\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\n\t\tlayerPaintConfRef.current = JSON.stringify(props.options?.paint);\n\t\tlayerLayoutConfRef.current = JSON.stringify(props.options?.layout);\n\t\tlayerTypeRef.current = props.options.type as LayerSpecification['type'];\n\t}, [props, mapHook.map]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tif (\n\t\t\tmapHook.map?.cancelled === false &&\n\t\t\tinitializedRef.current &&\n\t\t\tmapHook?.map?.map?.getLayer?.(layerId.current) &&\n\t\t\t(legalLayerTypes.indexOf(props.options.type as LayerSpecification['type']) === -1 ||\n\t\t\t\t(legalLayerTypes.indexOf(props.options.type as LayerSpecification['type']) !== -1 &&\n\t\t\t\t\tprops.options.type === layerTypeRef.current))\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tcreateLayer();\n\t}, [mapHook.map, props.options, createLayer]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tmapHook.map?.cancelled === true ||\n\t\t\t!initializedRef.current ||\n\t\t\t!mapHook.map?.map?.getSource?.(layerId.current)\n\t\t)\n\t\t\treturn;\n\n\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t//@ts-ignore setData only exists on GeoJsonSource\n\t\tmapHook.map.map.getSource(layerId.current)?.setData?.(props.geojson);\n\t}, [props.geojson, mapHook.map, props.options.type]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tmapHook.map?.cancelled === true ||\n\t\t\t!mapHook.map ||\n\t\t\t!mapHook.map?.map?.getLayer?.(layerId.current) ||\n\t\t\t!initializedRef.current ||\n\t\t\tprops.options.type !== layerTypeRef.current\n\t\t)\n\t\t\treturn;\n\n\t\tlet key;\n\n\t\tconst layoutString = JSON.stringify(props.options.layout);\n\t\tif (props.options.layout && layoutString !== layerLayoutConfRef.current) {\n\t\t\tconst oldLayout = JSON.parse(layerLayoutConfRef.current);\n\n\t\t\tfor (key in props.options.layout) {\n\t\t\t\tif (props.options.layout?.[key] && props.options.layout[key] !== oldLayout[key]) {\n\t\t\t\t\tmapHook.map.map.setLayoutProperty(layerId.current, key, props.options.layout[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tlayerLayoutConfRef.current = layoutString;\n\t\t}\n\n\t\tconst paintString = JSON.stringify(props.options.paint);\n\t\tif (paintString !== layerPaintConfRef.current) {\n\t\t\tconst oldPaint = JSON.parse(layerPaintConfRef.current);\n\t\t\tfor (key in props.options.paint) {\n\t\t\t\tif (props.options.paint?.[key] && props.options.paint[key] !== oldPaint[key]) {\n\t\t\t\t\tmapHook.map.map.setPaintProperty(layerId.current, key, props.options.paint[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tlayerPaintConfRef.current = paintString;\n\t\t}\n\t}, [props.options, mapHook.map]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tinitializedRef.current = false;\n\t\t\tmapHook.cleanup();\n\t\t};\n\t}, []);\n\n\treturn {\n\t\tmap: mapHook.map,\n\t\tlayer: layer,\n\t\tlayerId: layerId.current,\n\t\tcomponentId: mapHook.componentId,\n\t\tmapHook: mapHook,\n\t};\n}\n\nuseLayer.defaultProps = {};\n\nexport default useLayer;\n","import React from \"react\";\n\nimport { v4 as uuidv4 } from \"uuid\";\nimport useLayer from \"../../hooks/useLayer\";\n\ninterface MlFillExtrusionLayerProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Id of the layer that will be added by this component\n\t */\n\tlayerId?: string;\n\t/**\n\t * Paint properties of the config object that is passed to the MapLibreGl.addLayer call. All\n\t * available properties are documented in the MapLibreGl documentation\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill-extrusion\n\t */\n\tpaint?: object;\n\t/**\n\t * Source id of a vector tile source containing the geometries to use for this fill-extrusion\n\t * layer.\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#source-layer\n\t */\n\tsourceId?: string;\n\t/**\n\t * Layer id from a vector tile source containing the geometries to use for this fill-extrusion\n\t * layer.\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#source-layer\n\t */\n\tsourceLayer?: string;\n\t/**\n\t * This layer will be hidden for zoom levels lower than defined on this property\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#minzoom\n\t */\n\tminZoom?: number;\n}\n\n/**\n * Adds a fill extrusion layer to the MapLibre instance reference by props.mapId\n *\n */\nconst MlFillExtrusionLayer = (props: MlFillExtrusionLayerProps) => {\n\tuseLayer({\n\t\tmapId: props.mapId,\n\t\tlayerId: props.layerId || \"MlFillExtrusionLayer-\" + uuidv4(),\n\t\toptions: {\n\t\t\tid: \"\",\n\t\t\ttype: \"fill-extrusion\",\n\t\t\tsource: props.sourceId || \"openmaptiles\",\n\t\t\t\"source-layer\": props.sourceLayer || \"building\",\n\t\t\tminzoom: props.minZoom || 14,\n\t\t\tpaint: {\n\t\t\t\t...props.paint,\n\t\t\t},\n\t\t},\n\t\tinsertBeforeFirstSymbolLayer: true,\n\t});\n\n\treturn <></>;\n};\n\nMlFillExtrusionLayer.defaultProps = {\n\tmapId: undefined,\n\tpaint: {\n\t\t\"fill-extrusion-color\": \"hsl(196, 61%, 83%)\",\n\t\t\"fill-extrusion-height\": {\n\t\t\tproperty: \"render_height\",\n\t\t\ttype: \"identity\",\n\t\t},\n\t\t\"fill-extrusion-base\": {\n\t\t\tproperty: \"render_min_height\",\n\t\t\ttype: \"identity\",\n\t\t},\n\t\t\"fill-extrusion-opacity\": 1,\n\t},\n};\n\nexport default MlFillExtrusionLayer;\n","import { LayerSpecification, RasterLayerSpecification } from 'maplibre-gl';\n\nconst getDefaultPaintPropsByType = (\n\ttype: string,\n\tdefaultPaintOverrides?: { [key: string]: unknown }\n): Exclude<LayerSpecification['paint'], RasterLayerSpecification['paint']> => {\n\tswitch (type) {\n\t\tcase 'fill':\n\t\t\tif (defaultPaintOverrides?.fill) {\n\t\t\t\treturn defaultPaintOverrides.fill;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t'fill-color': 'rgba(10,240,256,0.6)',\n\t\t\t\t'fill-outline-color': 'rgba(20,230,256,0.8)',\n\t\t\t};\n\t\tcase 'line':\n\t\t\tif (defaultPaintOverrides?.line) {\n\t\t\t\treturn defaultPaintOverrides.line;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t'line-color': 'rgb(203,211,2)',\n\t\t\t\t'line-width': 5,\n\t\t\t\t'line-blur': 0,\n\t\t\t};\n\t\tcase 'circle':\n\t\tdefault:\n\t\t\tif (defaultPaintOverrides?.circle) {\n\t\t\t\treturn defaultPaintOverrides.circle;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t'circle-color': 'rgba(10,240,256,0.8)',\n\t\t\t\t'circle-stroke-color': '#fff',\n\t\t\t\t'circle-stroke-width': 2,\n\t\t\t\t'circle-radius': 4,\n\t\t\t};\n\t}\n};\n\nexport default getDefaultPaintPropsByType;\n","import { Feature, FeatureCollection } from \"@turf/turf\";\nimport { LayerSpecification } from \"maplibre-gl\";\n\nconst mapGeometryTypesToLayerTypes = {\n\tPosition: \"circle\",\n\tPoint: \"circle\",\n\tMultiPoint: \"circle\",\n\tLineString: \"line\",\n\tMultiLineString: \"line\",\n\tPolygon: \"fill\",\n\tMultiPolygon: \"fill\",\n\tGeometryCollection: \"circle\",\n};\n\nconst getDefaulLayerTypeByGeometry: Function = (\n\tgeojson: Feature | FeatureCollection\n): LayerSpecification['type'] => {\n\tif (geojson?.type === \"Feature\") {\n\t\treturn mapGeometryTypesToLayerTypes?.[geojson?.geometry?.type]\n\t\t\t? mapGeometryTypesToLayerTypes[geojson.geometry.type]\n\t\t\t: \"circle\";\n\t}\n\tif (geojson?.type === \"FeatureCollection\") {\n\t\tif (geojson.features.length) {\n\t\t\treturn getDefaulLayerTypeByGeometry(geojson.features[0]);\n\t\t}\n\t\treturn \"circle\";\n\t}\n\treturn \"fill\";\n};\nexport default getDefaulLayerTypeByGeometry;\n","import React from 'react';\n\nimport useLayer from '../../hooks/useLayer';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport getDefaultPaintPropsByType from './util/getDefaultPaintPropsByType';\nimport getDefaulLayerTypeByGeometry from './util/getDefaultLayerTypeByGeometry';\nimport { Feature, FeatureCollection } from '@turf/turf';\nimport { useLayerProps } from '../../hooks/useLayer';\n\nimport {\n\tLineLayerSpecification,\n\tCircleLayerSpecification,\n\tFillLayerSpecification,\n\tLayerSpecification,\n\tRasterLayerSpecification,\n} from 'maplibre-gl';\n\nexport type MlGeoJsonLayerProps = {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Id of an existing layer in the mapLibre instance to help specify the layer order\n\t * This layer will be visually beneath the layer with the \"insertBeforeLayer\" id.\n\t * This layer will not be added to the maplibre-gl instance until a layer with an\n\t * id that matches the value of insertBeforeLayer is created.\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Id of the new layer and source that are added to the MapLibre instance\n\t */\n\tlayerId?: string;\n\t/**\n\t * GeoJSON data that is supposed to be rendered by this component.\n\t */\n\tgeojson: Feature | FeatureCollection | undefined;\n\t/**\n\t * Type of the layer that will be added to the MapLibre instance.\n\t * All types from LayerSpecification union type are supported except the type from\n\t * RasterLayerSpecification\n\t */\n\ttype?: Exclude<LayerSpecification['type'], RasterLayerSpecification['type']>;\n\t/**\n\t * Paint property object, that is passed to the addLayer call.\n\t * Possible props depend on the layer type.\n\t * See https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/\n\t * Some examples are:\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill\n\t * All paint types from LayerSpecification union type are supported except the paint type from\n\t * RasterLayerSpecification\n\t */\n\n\tpaint?: Exclude<LayerSpecification['paint'], RasterLayerSpecification['paint']>;\n\t/**\n\t * Layout property object, that is passed to the addLayer call.\n\t * Possible props depend on the layer type.\n\t * See https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/\n\t * Some examples are:\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#line\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill\n\t * All layout types from LayerSpecification union type are supported except the layout type from\n\t * RasterLayerSpecification\n\n\t */\n\tlayout?: Exclude<LayerSpecification['layout'], RasterLayerSpecification['layout']>;\n\n\t/**\n\t * Javascript object that is spread into the addLayer commands first parameter.\n\t */\n\toptions?: Exclude<LayerSpecification, RasterLayerSpecification>;\n\t/**\n\t * Javascript object with optional properties \"fill\", \"line\", \"circle\" to override implicit layer type default paint properties.\n\t */\n\tdefaultPaintOverrides?: {\n\t\tcircle?: CircleLayerSpecification['paint'];\n\t\tfill?: FillLayerSpecification['paint'];\n\t\tline?: LineLayerSpecification['paint'];\n\t};\n\t/**\n\t * Hover event handler that is executed whenever a geometry rendered by this component is hovered.\n\t */\n\tonHover?: useLayerProps['onHover'];\n\t/**\n\t * Click event handler that is executed whenever a geometry rendered by this component is clicked.\n\t */\n\tonClick?: useLayerProps['onClick'];\n\t/**\n\t * Leave event handler that is executed whenever a geometry rendered by this component is\n\t * left/unhovered.\n\t */\n\tonLeave?: useLayerProps['onLeave'];\n};\n\n/**\n * Adds source and layer to display GeoJSON data on the map.\n *\n * @component\n */\n\nconst MlGeoJsonLayer = (props: MlGeoJsonLayerProps) => {\n\tconst layerType = props.type || getDefaulLayerTypeByGeometry(props.geojson);\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tuseLayer({\n\t\tmapId: props.mapId,\n\t\tlayerId: props.layerId || 'MlGeoJsonLayer-' + uuidv4(),\n\t\tgeojson: props.geojson,\n\t\toptions: {\n\t\t\tpaint: props.paint || getDefaultPaintPropsByType(layerType, props.defaultPaintOverrides),\n\t\t\tlayout: props.layout || {},\n\t\t\t...props.options,\n\t\t\ttype: layerType as LayerSpecification['type'],\n\t\t} as Partial<LayerSpecification>,\n\t\tinsertBeforeLayer: props.insertBeforeLayer,\n\t\tonHover: props.onHover,\n\t\tonClick: props.onClick,\n\t\tonLeave: props.onLeave,\n\t});\n\n\treturn <></>;\n};\n\nexport default MlGeoJsonLayer;\n","import React, { useRef, useEffect, useState, useCallback, useMemo } from \"react\";\nimport useMap from \"../../hooks/useMap\";\nimport MlGeoJsonLayer from \"../MlGeoJsonLayer/MlGeoJsonLayer\";\n\nimport { Button } from '@mui/material';\nimport GpsFixedIcon from '@mui/icons-material/GpsFixed';\n\nimport { point, circle, lineArc, Feature, Point } from '@turf/turf';\nimport { CircleLayerSpecification, FillLayerSpecification } from 'maplibre-gl';\n\ninterface MlFollowGpsProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * By default a dot will be shown on the map at the user's location. Set to false to disable.\n\t */\n\tshowUserLocation?: boolean;\n\t/**\n\t * By default a cone will be shown on the map at the user's location to indicate the device's orientation.\n\t * Set to false to disable.\n\t */\n\tshowOrientation?: boolean;\n\t/**\n\t * By default, if showUserLocation is true, a transparent circle will be drawn around the user location\n\t * indicating the accuracy (95% confidence level) of the user's location. Set to false to disable.\n\t */\n\tshowAccuracyCircle?: boolean;\n\t/**\n\t * Use the MapLibre.flyTo function to center the map to the current users position if true.\n\t * Otherwise the MapLibre.setCenter function is used.\n\t */\n\tuseFlyTo?: boolean;\n\t/**\n\t * Center map to current position once updated location data is recieved.\n\t * \"false\" will center the map once on component activation and then display the updated user location on the map.\n\t */\n\tcenterUserPosition?: boolean;\n\t/**\n\t * Orientation cone paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the orientation cone polygon.\n\t * Use any available paint prop from layer type \"fill\".\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill\n\t */\n\torientationConePaint?: FillLayerSpecification['paint'];\n\t/**\n\t * Position circle paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the position circle.\n\t * Use any available paint prop from layer type \"circle\".\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#circle\n\t */\n\tcirclePaint?: CircleLayerSpecification['paint'];\n\t/**\n\t * Active button font color\n\t */\n\tonColor?: string;\n\t/**\n\t * Inactive button font color\n\t */\n\toffColor?: string;\n\t/**\n\t * Accuracy paint property object, that is passed to the MlGeoJsonLayer responsible for drawing the accuracy polygon.\n\t * Use any available paint prop from layer type \"fill\".\n\t * https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#fill\n\t */\n\taccuracyPaint?: FillLayerSpecification['paint'];\n}\n\n/**\n * Adds a button that makes the map follow the users GPS position using\n * navigator.geolocation.watchPosition if activated\n *\n */\nconst MlFollowGps = (props: MlFollowGpsProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst [isFollowed, setIsFollowed] = useState(false);\n\tconst [userLocationGeoJson, setUserLocationGeoJson] = useState<Feature<Point>>();\n\tconst [locationAccessDenied, setLocationAccessDenied] = useState(false);\n\tconst [accuracyGeoJson, setAccuracyGeoJson] = useState<Feature>();\n\tconst [deviceOrientation, setDeviceOrientation] = useState(0);\n\tconst initiallyCentered = useRef(false);\n\n\tconst getLocationSuccess = useCallback(\n\t\t(pos: GeolocationPosition) => {\n\t\t\tif (!mapHook.map) return;\n\n\t\t\tif ((!props.centerUserPosition && !initiallyCentered.current) || props.centerUserPosition) {\n\t\t\t\tif (props.useFlyTo) {\n\t\t\t\t\tmapHook.map.map.flyTo({\n\t\t\t\t\t\tcenter: [pos.coords.longitude, pos.coords.latitude],\n\t\t\t\t\t\tzoom: 18,\n\t\t\t\t\t\tspeed: 1,\n\t\t\t\t\t\tcurve: 1,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tmapHook.map.map.setCenter([pos.coords.longitude, pos.coords.latitude]);\n\t\t\t\t}\n\n\t\t\t\tinitiallyCentered.current = true;\n\t\t\t}\n\t\t\tif (!props.showUserLocation) return;\n\t\t\tconst geoJsonPoint = point([pos.coords.longitude, pos.coords.latitude]);\n\t\t\tsetUserLocationGeoJson(geoJsonPoint);\n\t\t\tsetAccuracyGeoJson(circle(geoJsonPoint, pos.coords.accuracy / 1000));\n\t\t},\n\t\t[mapHook.map, props]\n\t);\n\n\tconst getLocationError = () => {\n\t\tconsole.log('Access of user location denied');\n\t\tsetLocationAccessDenied(true);\n\t};\n\n\tconst orientationCone = useMemo(() => {\n\t\tif (!userLocationGeoJson) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst radius = 0.02;\n\t\tconst bearing1 = deviceOrientation - 15;\n\t\tconst bearing2 = deviceOrientation + 15;\n\t\tconst options = { steps: 65 };\n\t\tconst arc = lineArc(userLocationGeoJson, radius, bearing1, bearing2, options);\n\t\tconst copy = arc;\n\t\tcopy.geometry.coordinates.push(userLocationGeoJson.geometry.coordinates);\n\t\tcopy.geometry.coordinates.slice(0, 0);\n\t\treturn copy;\n\t}, [deviceOrientation, userLocationGeoJson]);\n\n\tconst handleOrientation = (event: DeviceOrientationEvent) => {\n\t\tif (event?.alpha) {\n\t\t\tsetDeviceOrientation(-event.alpha);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (isFollowed) {\n\t\t\tconst _handleOrientation = handleOrientation;\n\t\t\twindow.addEventListener('deviceorientation', _handleOrientation);\n\t\t\treturn () => {\n\t\t\t\twindow.removeEventListener('deviceorientation', _handleOrientation);\n\t\t\t};\n\t\t} else {\n\t\t\tinitiallyCentered.current = false;\n\t\t}\n\t\treturn;\n\t}, [isFollowed]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tif (isFollowed) {\n\t\t\tconst _watchId = navigator.geolocation.watchPosition(getLocationSuccess, getLocationError);\n\n\t\t\treturn () => {\n\t\t\t\tnavigator.geolocation.clearWatch(_watchId);\n\t\t\t};\n\t\t}\n\t\treturn;\n\t}, [mapHook.map, isFollowed, getLocationSuccess]);\n\n\treturn (\n\t\t<>\n\t\t\t{isFollowed && userLocationGeoJson && (\n\t\t\t\t<MlGeoJsonLayer\n\t\t\t\t\tgeojson={accuracyGeoJson}\n\t\t\t\t\ttype={'fill'}\n\t\t\t\t\tpaint={{\n\t\t\t\t\t\t'fill-color': '#cbd300',\n\t\t\t\t\t\t'fill-opacity': 0.3,\n\t\t\t\t\t\t...props.accuracyPaint,\n\t\t\t\t\t}}\n\t\t\t\t\tinsertBeforeLayer={props.insertBeforeLayer}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{isFollowed && orientationCone && (\n\t\t\t\t<MlGeoJsonLayer\n\t\t\t\t\tgeojson={orientationCone}\n\t\t\t\t\ttype={'fill'}\n\t\t\t\t\tpaint={{\n\t\t\t\t\t\t'fill-color': '#0000ff',\n\t\t\t\t\t\t'fill-antialias': false,\n\t\t\t\t\t\t'fill-opacity': 0.3,\n\t\t\t\t\t\t...props.orientationConePaint,\n\t\t\t\t\t}}\n\t\t\t\t\tinsertBeforeLayer={props.insertBeforeLayer}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{isFollowed && userLocationGeoJson && (\n\t\t\t\t<MlGeoJsonLayer\n\t\t\t\t\tgeojson={userLocationGeoJson}\n\t\t\t\t\ttype={'circle'}\n\t\t\t\t\tpaint={{\n\t\t\t\t\t\t'circle-color': '#009ee0',\n\t\t\t\t\t\t'circle-radius': 5,\n\t\t\t\t\t\t'circle-stroke-color': '#fafaff',\n\t\t\t\t\t\t'circle-stroke-width': 1,\n\t\t\t\t\t\t...props.circlePaint,\n\t\t\t\t\t}}\n\t\t\t\t\tinsertBeforeLayer={props.insertBeforeLayer}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t<Button\n\t\t\t\tvariant=\"navtools\"\n\t\t\t\tsx={{\n\t\t\t\t\tzIndex: 1002,\n\t\t\t\t\tcolor: isFollowed ? props.onColor : props.offColor,\n\t\t\t\t}}\n\t\t\t\tdisabled={locationAccessDenied}\n\t\t\t\tonClick={() => {\n\t\t\t\t\tsetIsFollowed(!isFollowed);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<GpsFixedIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />\n\t\t\t</Button>\n\t\t</>\n\t);\n};\n\nMlFollowGps.defaultProps = {\n\tmapId: undefined,\n\tonColor: '#ececec',\n\toffColor: '#666',\n\tshowAccuracyCircle: true,\n\tshowUserLocation: true,\n\tshowOrientation: true,\n\tcenterUserPosition: true,\n\tuseFlyTo: false,\n};\n\nexport default MlFollowGps;\n","import React, { useRef, useEffect, useState } from 'react';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLayer from '../../hooks/useLayer';\nimport useMap from '../../hooks/useMap';\nimport { SymbolLayerSpecification } from 'maplibre-gl';\nimport { Feature, FeatureCollection } from '@turf/turf';\n\nexport interface MlImageMarkerLayerProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Id of the layer that will be added by this component to the maplibre-gl instance\n\t */\n\tlayerId?: string;\n\t/**\n\t * Id of the image that will be added by this component to the maplibre-gl instance\n\t */\n\timageId?: string;\n\t/**\n\t * Path or URL to a supported raster image\n\t */\n\timgSrc?: string;\n\t/**\n\t * Javascript object that is passed the addLayer command as first parameter.\n\t */\n\toptions?: {\n\t\tsource?: { type?: string | undefined; data: Feature | FeatureCollection | undefined };\n\t\tlayout?: SymbolLayerSpecification['layout'];\n\t\tpaint?: SymbolLayerSpecification['paint'];\n\t};\n}\n\nconst MlImageMarkerLayer = (props: MlImageMarkerLayerProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst [imageId, setImageId] = useState<string>();\n\tconst imageIdRef = useRef(props.imageId || 'img_' + uuidv4());\n\tconst layerId = useRef(props.layerId || 'MlImageMarkerLayer-' + mapHook.componentId);\n\n\tuseLayer({\n\t\tgeojson: props.options?.source?.data,\n\t\tlayerId: layerId.current,\n\t\toptions: {\n\t\t\ttype: 'symbol',\n\t\t\tlayout: {\n\t\t\t\t...props.options?.layout,\n\t\t\t\t'icon-image': imageId || imageIdRef.current,\n\t\t\t},\n\t\t\tpaint: {\n\t\t\t\t...props.options?.paint,\n\t\t\t},\n\t\t},\n\t});\n\n\tconst createImage = (mapHook: ReturnType<typeof useMap>, props: MlImageMarkerLayerProps) => {\n\t\tif (!mapHook.map) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (props.imgSrc && !mapHook.map.map.hasImage(imageIdRef.current)) {\n\t\t\tmapHook.map.map.loadImage(props.imgSrc, function (error, image) {\n\t\t\t\tif (error) throw error;\n\n\t\t\t\tif (!mapHook.map || mapHook.map.map.hasImage(imageIdRef.current)) return;\n\n\t\t\t\tmapHook.map.addImage(\n\t\t\t\t\timageIdRef.current,\n\t\t\t\t\timage as unknown as ImageData,\n\t\t\t\t\tmapHook.componentId\n\t\t\t\t);\n\n\t\t\t\tsetImageId(imageIdRef.current);\n\t\t\t});\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tif (props.imgSrc) {\n\t\t\tcreateImage(mapHook, props);\n\t\t}\n\t}, [props, mapHook]);\n\n\treturn <></>;\n};\n\nexport default MlImageMarkerLayer;\n","import React, { useEffect, useState } from \"react\";\nimport MlFeatureEditor from \"../MlFeatureEditor/MlFeatureEditor\";\nimport * as turf from \"@turf/turf\";\n\ninterface MlMeasureToolProps {\n\t/**\n\t * String that specify if the Tool measures an area (\"polygon\") or length (\"line\")\n\t */\n\tmeasureType?: string;\n\t/**\n\t * String that dictates which unit of measurement is used\n\t */\n\tunit?: turf.Units;\n}\n\n//const unitSquareConvert = {\n//\tkilometers: 1,\n//\tmiles: 1 / 2.58998811,\n//};\nfunction getUnitSquareMultiplier(measureType:string | undefined) {\n\treturn measureType === \"miles\" ? 1 / 2.58998811 : 1;\n}\nfunction getUnitLabel(measureType:string | undefined) {\n\treturn measureType === \"miles\" ? 'mi' : 'km';\n}\n\nconst MlMeasureTool = (props: MlMeasureToolProps) => {\n\tconst [length, setLength] = useState(0);\n\tconst [currentFeatures, setCurrentFeatures] = useState([undefined]);\n\n\tuseEffect(() => {\n\t\tif (currentFeatures[0]) {\n\t\t\tsetLength(\n\t\t\t\tprops.measureType === \"polygon\"\n\t\t\t\t\t? (turf.area(currentFeatures[0]) / 1000000) * getUnitSquareMultiplier(props.unit)\n\t\t\t\t\t: turf.length(currentFeatures[0], { units: props.unit })\n\t\t\t);\n\t\t}\n\t}, [props.unit, currentFeatures]);\n\n\treturn (\n\t\t<>\n\t\t\t<MlFeatureEditor\n\t\t\t\tonChange={(features:any) => {\n\t\t\t\t\tsetCurrentFeatures(features);\n\t\t\t\t}}\n\t\t\t\tmode={props.measureType === \"polygon\" ? \"custom_polygon\" : \"draw_line_string\"}\n\t\t\t/>\n\t\t\t{length.toFixed(2)} {getUnitLabel(props.unit)}\n\t\t\t{props.measureType === \"polygon\" ? \"²\" : \"\"}\n\t\t</>\n\t);\n};\n\nMlMeasureTool.defaultProps = {\n\tmapId: undefined,\n\tmeasureType: \"line\",\n\tunit: \"kilometers\",\n};\nexport default MlMeasureTool;\n","export default \"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20%20%20width%3D%2239.675098mm%22%20%20%20height%3D%22104.27064mm%22%20%20%20viewBox%3D%220%200%2039.675098%20104.27064%22%20%20%20version%3D%221.1%22%20%20%20%3E%20%20%3Cg%20%20%20%20%20transform%3D%22translate%28-86.019554%2C-58.032633%29%22%3E%20%20%20%20%3Cpath%20%20%20%20%20%20%20style%3D%22stroke-width%3A0.744756%22%20%20%20%20%20%20%20d%3D%22m%20442.74023%2C219.33594%20-117.62695%2C32.32422%2054.71094%2C31.12304%20c%20-21.99397%2C41.5931%20-32.8507%2C84.88283%20-38.33008%2C127.89649%20-6.86182%2C50.94051%20-5.95715%2C103.99765%2020.23828%2C155.46484%205.97246%2C11.72776%2013.65817%2C23.59773%2024.38867%2C35.06641%202.6597%2C2.84073%205.65602%2C5.75455%209.12891%2C8.68164%200.87557%2C0.7378%201.85363%2C1.52609%202.95117%2C2.35547%200.29669%2C0.22563%200.63616%2C0.47742%201.02149%2C0.75586%20l%200.58203%2C0.42578%2034.57812%2C-15.12305%20-0.33789%2C-0.2207%20c%20-0.0265%2C-0.0151%20-0.0842%2C-0.0587%20-0.18359%2C-0.13086%20-0.46723%2C-0.34885%20-0.9819%2C-0.76796%20-1.56055%2C-1.25%20-2.29757%2C-1.91343%20-4.46539%2C-4.04643%20-6.64062%2C-6.33985%20-8.80052%2C-9.27114%20-15.30333%2C-19.4993%20-20.83985%2C-30.13867%20-24.42289%2C-46.90715%20-24.77465%2C-97.03535%20-18.58008%2C-146.68164%204.94388%2C-37.37493%2013.65299%2C-74.4847%2030.20508%2C-109.92969%20l%2058.6211%2C33.34766%20z%22%20%20%20%20%20%20%20transform%3D%22scale%280.26458333%29%22%20%2F%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E\"","export default \"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20%20%20width%3D%2239.675098mm%22%20%20%20height%3D%22104.27064mm%22%20%20%20viewBox%3D%220%200%2039.675098%20104.27064%22%20%20%20version%3D%221.1%22%20%20%20%3E%20%20%3Cg%20%20%20%20%20transform%3D%22translate%28-86.019554%2C-58.032633%29%22%3E%20%20%20%20%3Cpath%20%20%20%20%20%20%20d%3D%22m%2094.572523%2C58.032633%2031.122127%2C8.55245%20-14.4756%2C8.234638%20c%205.81924%2C11.004841%208.69175%2C22.458582%2010.1415%2C33.839279%201.81552%2C13.47801%201.57616%2C27.51604%20-5.35471%2C41.13341%20-1.58021%2C3.10296%20-3.61373%2C6.24356%20-6.45284%2C9.27798%20-0.70371%2C0.75161%20-1.49649%2C1.52256%20-2.41535%2C2.29702%20-0.23167%2C0.19521%20-0.49044%2C0.40378%20-0.78083%2C0.62322%20-0.0785%2C0.0597%20-0.16832%2C0.12632%20-0.27027%2C0.19999%20l%20-0.154%2C0.11265%20-9.148793%2C-4.00131%200.0894%2C-0.0584%20c%200.007%2C-0.004%200.02228%2C-0.0155%200.04857%2C-0.0346%200.123621%2C-0.0923%200.259794%2C-0.20319%200.412895%2C-0.33073%200.607899%2C-0.50626%201.181468%2C-1.07062%201.756997%2C-1.67742%202.328481%2C-2.45299%204.049011%2C-5.15919%205.513881%2C-7.97419%206.46189%2C-12.41085%206.55496%2C-25.67394%204.91598%2C-38.80952%20-1.30807%2C-9.888781%20-3.61235%2C-19.707408%20-7.99176%2C-29.085561%20l%20-15.510171%2C8.823235%20z%22%20%2F%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E\"","export default \"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20%20%20width%3D%2275.967445mm%22%20%20%20height%3D%22234.71339mm%22%20%20%20viewBox%3D%220%200%2075.967445%20234.71339%22%20%20%20version%3D%221.1%22%20%20%20%3E%20%20%3Cg%20%20%20%20%20transform%3D%22translate%28-76.705281%2C-29.77268%29%22%3E%20%20%20%20%3Cpath%20%20%20%20%20%20%20d%3D%22m%20114.68901%2C29.77268%2037.98372%2C117.3567%20H%2076.705281%20Z%22%20%20%20%20%20%20%20%20%2F%3E%20%20%20%20%3Cpath%20%20%20%20%20%20%20d%3D%22m%20114.68901%2C264.48608%2037.98372%2C-117.3567%20H%2076.705281%20Z%22%20%20%20%20%20%20%20%20%2F%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E\"","import React, { useState, useEffect } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { ReactComponent as RotateRightIcon } from \"./assets/rotate_right.svg\";\nimport { ReactComponent as RotateLeftIcon } from \"./assets/rotate_left.svg\";\nimport { ReactComponent as NeedleIcon } from \"./assets/needle.svg\";\n\nimport styled from \"@emotion/styled\";\nimport { css } from \"@emotion/css\";\nimport useMap from \"../../hooks/useMap\";\n\nconst NeedleButton = styled.div`\n\twidth: 40%;\n\tdisplay: flex;\n\talign-items: center;\n\n\t&:hover {\n\t\tcursor: pointer;\n\t}\n\tpath {\n\t\tfilter: drop-shadow(0px 0px 15px rgba(0, 0, 0, 0.2));\n\t}\n\t&:hover path {\n\t\tfilter: drop-shadow(0px 0px 13px rgba(255, 255, 255, 0.1));\n\t}\n\tpath:nth-of-type(2) {\n\t\tfill: #343434;\n\t}\n\t&:hover path:nth-of-type(2) {\n\t\tfill: #434343;\n\t}\n\tpath:nth-of-type(1) {\n\t\tfill: #e90318;\n\t}\n\t&:hover path:nth-of-type(1) {\n\t\tfill: #fb4052;\n\t}\n`;\nconst NeedleContainer = styled.div`\n\tpointer-events: none;\n\tdisplay: flex;\n\tz-index: 1002;\n\tposition: absolute;\n\talign-items: center;\n\n\tmargin-left: -30%;\n\tpath:nth-of-type(2) {\n\t}\n\tsvg g {\n\t\ttransform: translate(-76.7053, -29.7727) scale(2, 1);\n\t}\n\tsvg {\n\t\tz-index: 9990;\n\t\theight: 150px;\n\t\twidth: 200px;\n\t}\n`;\nconst RotateButton = styled.div`\n\twidth: 30%;\n\tmargin-top: 14px;\n\tz-index: 999;\n\tdisplay: flex;\n\n\tsvg:hover {\n\t\tcursor: pointer;\n\t}\n\tsvg:hover path {\n\t\tfill: #ececec;\n\t\tfilter: drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.1));\n\t}\n\tpath {\n\t\tfill: #bbb;\n\t}\n\tsvg {\n\t\ttransform: scale(0.6);\n\t\tz-index: 9990;\n\t\theight: 172px;\n\t}\n`;\n\ninterface MlNavigationCompassProps {\n\tmapId?: string;\n\tinsertBeforeLayer?: string;\n\tstyle?: any;\n\tbackgroundStyle?: any;\n\tneedleStyle?: any;\n\trotateRightStyle?: any;\n\trotateLeftStyle?: any;\n}\n/**\n * Navigation component that displays a compass component which indicates the current oriantation of the map it is registered for and offers controls to turn the bearing 90° left/right or reset north to point up.\n *\n * All style props are applied using @emotion/css to allow more complex css selectors.\n *\n * @component\n */\nconst MlNavigationCompass = (props: MlNavigationCompassProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\tconst [bearing, setBearing] = useState(0);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tlet _updateBearing = () => {\n\t\t\tif (!mapHook.map?.map?.getBearing) return;\n\t\t\tsetBearing(Math.round(mapHook.map.map.getBearing()));\n\t\t};\n\n\t\tmapHook.map.on(\"rotate\", _updateBearing, mapHook.componentId);\n\t\t_updateBearing();\n\n\t\treturn () => {\n\t\t\tmapHook.map?.map.off(\"rotate\", _updateBearing);\n\t\t};\n\t}, [mapHook.map, props.mapId]);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={css({\n\t\t\t\t\tzIndex: 1000,\n\t\t\t\t\ttop: 0,\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t...props.style,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName={css({\n\t\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t\tborder: \"10px solid #bcbcbc\",\n\t\t\t\t\t\tbackgroundColor: \"#717171\",\n\t\t\t\t\t\tbackground: \"radial-gradient(#717171, #414141)\",\n\t\t\t\t\t\theight: \"200px\",\n\t\t\t\t\t\twidth: \"200px\",\n\t\t\t\t\t\tborderRadius: \"50%\",\n\t\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\t\tjustifyContent: \"center\",\n\t\t\t\t\t\ttransform: \"scale(0.2) translateX(-448px) translateY(-448px)\",\n\t\t\t\t\t\t...props.backgroundStyle,\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t<RotateButton className={css({ ...props.rotateRightStyle })}>\n\t\t\t\t\t\t<RotateRightIcon\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tif(!mapHook.map)return;\n\n\t\t\t\t\t\t\t\tlet bearing = Math.round(mapHook.map.map.getBearing());\n\t\t\t\t\t\t\t\tlet rest = Math.round(bearing % 90);\n\t\t\t\t\t\t\t\tif (bearing > 0) {\n\t\t\t\t\t\t\t\t\trest = 90 - rest;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (rest === 0) {\n\t\t\t\t\t\t\t\t\trest = 90;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmapHook.map.map.setBearing(Math.round(bearing + Math.abs(rest)));\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t></RotateRightIcon>\n\t\t\t\t\t</RotateButton>\n\t\t\t\t\t<NeedleButton\n\t\t\t\t\t\tclassName={css({ ...props.needleStyle })}\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tmapHook.map?.map.setBearing(0);\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<NeedleContainer\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\ttransform: \"rotate(\" + (bearing>0?\"-\"+bearing:-1*bearing) + \"deg)\",\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<NeedleIcon />\n\t\t\t\t\t\t</NeedleContainer>\n\t\t\t\t\t</NeedleButton>\n\t\t\t\t\t<RotateButton className={css({ ...props.rotateLeftStyle })}>\n\t\t\t\t\t\t<RotateLeftIcon\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tif(!mapHook.map)return;\n\n\t\t\t\t\t\t\t\tlet bearing = Math.round(mapHook.map.map.getBearing());\n\t\t\t\t\t\t\t\tlet rest = Math.round(bearing % 90);\n\t\t\t\t\t\t\t\tif (bearing < 0) {\n\t\t\t\t\t\t\t\t\trest = 90 + rest;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (rest === 0) {\n\t\t\t\t\t\t\t\t\trest = 90;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmapHook.map.map.setBearing(Math.round(bearing - Math.abs(rest)));\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t></RotateLeftIcon>\n\t\t\t\t\t</RotateButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nMlNavigationCompass.propTypes = {\n\t/**\n\t * Component id prefix\n\t */\n\tidPrefix: PropTypes.string,\n\t/**\n\t * Style object to adjust css definitions of the component.\n\t */\n\tstyle: PropTypes.object,\n\t/**\n\t * Style object to adjust css definitions of the background.\n\t */\n\tbackgroundStyle: PropTypes.object,\n\t/**\n\t * Style object to adjust css definitions of the compass needle.\n\t */\n\tneedleStyle: PropTypes.object,\n\t/**\n\t * Style object to adjust css definitions of the rotate right button.\n\t */\n\trotateRightStyle: PropTypes.object,\n\t/**\n\t * Style object to adjust css definitions of the rotate left button.\n\t */\n\trotateLeftStyle: PropTypes.object,\n};\n\nexport default MlNavigationCompass;\n","import React, {useCallback, useEffect, useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport ControlPointIcon from \"@mui/icons-material/ControlPoint\";\nimport RemoveCircleOutlineIcon from \"@mui/icons-material/RemoveCircleOutline\";\nimport Box from \"@mui/material/Box\";\nimport { SxProps } from \"@mui/material\";\n\nimport MlNavigationCompass from \"../MlNavigationCompass/MlNavigationCompass\";\nimport MlFollowGps from \"../MlFollowGps/MlFollowGps\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport useMap from \"../../hooks/useMap\";\nimport MlCenterPosition from \"../MlCenterPosition/MlCenterPosition\";\n\ninterface MlNavigationToolsProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Show 3D button\n\t */\n\tshow3DButton?: boolean;\n\t/**\n\t * Show zoom button\n\t */\n\tshowZoomButtons?: boolean;\n\t/**\n\t * Show follow GPS button\n\t */\n\tshowFollowGpsButton?: boolean;\n\t/**\n\t * Show center on current position button\n\t */\n\tshowCenterLocationButton?: boolean;\n\t/**\n\t * Additional JSX Elements to be rendered below MlNavigationTools buttons\n\t */\n\tchildren?: JSX.Element;\n\t/**\n\t * Style attribute for NavigationTools container\n\t */\n\tsx?: SxProps;\n\t/**\n\t * Style attribute for NavigationTools container\n\t */\n\tmediaIsMobile?: boolean;\n}\n\n/**\n * @component\n */\n\nconst MlNavigationTools = (props: MlNavigationToolsProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst [pitch, setPitch] = useState(0);\n\tconst mediaIsMobile = useMediaQuery('(max-width:900px)');\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tmapHook.map.on(\n\t\t\t'pitchend',\n\t\t\t() => {\n\t\t\t\tif (!mapHook.map) return;\n\n\t\t\t\tsetPitch(mapHook.map.map.getPitch());\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\t\tsetPitch(mapHook.map.map.getPitch());\n\t}, [mapHook.map, props.mapId]);\n\n\tconst zoomIn = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tif (mapHook.map.map.transform._zoom + 0.5 <= mapHook.map.map.transform._maxZoom) {\n\t\t\tmapHook.map.map.easeTo({ zoom: mapHook.map.map.transform._zoom + 0.5 });\n\t\t}\n\t}, [mapHook.map]);\n\n\tconst zoomOut = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tif (mapHook.map.map.transform._zoom - 0.5 >= mapHook.map.map.transform._minZoom) {\n\t\t\tmapHook.map.map.easeTo({ zoom: mapHook.map.map.transform._zoom - 0.5 });\n\t\t}\n\t}, [mapHook.map]);\n\n\tconst adjustPitch = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tlet targetPitch = 60;\n\t\tif (mapHook.map.map.getPitch() !== 0) {\n\t\t\ttargetPitch = 0;\n\t\t}\n\t\tmapHook.map.map.easeTo({ pitch: targetPitch });\n\t}, [mapHook.map]);\n\n\treturn (\n\t\t<Box\n\t\t\tsx={{\n\t\t\t\tzIndex: 501,\n\t\t\t\tposition: 'absolute',\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tflexDirection: 'column',\n\t\t\t\t...(mediaIsMobile ? { margin: '20px 10px 20px 10px' } : {}),\n\t\t\t\t...props.sx,\n\t\t\t}}\n\t\t>\n\t\t\t<MlNavigationCompass\n\t\t\t\tstyle={{\n\t\t\t\t\twidth: '31px',\n\t\t\t\t\tposition: 'relative',\n\t\t\t\t\theight: mediaIsMobile ? '55px' : '45px',\n\t\t\t\t\tmarginLeft: mediaIsMobile ? '3px' : '-5px',\n\t\t\t\t\ttransform: mediaIsMobile ? 'scale(1.6)' : 'scale(1)',\n\t\t\t\t}}\n\t\t\t\tbackgroundStyle={{\n\t\t\t\t\tboxShadow: '0px 0px 18px rgba(0,0,0,.5)',\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t{props.show3DButton && (\n\t\t\t\t<Button variant=\"navtools\" onClick={adjustPitch}>\n\t\t\t\t\t{pitch ? '2D' : '3D'}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t\t{props.showFollowGpsButton && <MlFollowGps />}\n\t\t\t{props.showCenterLocationButton && <MlCenterPosition />}\n\t\t\t<ButtonGroup\n\t\t\t\torientation=\"vertical\"\n\t\t\t\tsx={{\n\t\t\t\t\twidth: '50px',\n\t\t\t\t\tborder: 'none',\n\t\t\t\t\tButton: { minWidth: '20px !important'},\n\t\t\t\t\t'Button:hover': { border: 'none' },\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{props.showZoomButtons && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Button variant=\"navtools\" onClick={zoomIn}>\n\t\t\t\t\t\t\t<ControlPointIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button variant=\"navtools\" onClick={zoomOut}>\n\t\t\t\t\t\t\t<RemoveCircleOutlineIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</ButtonGroup>\n\t\t\t{props.children && React.cloneElement(props.children, {})}\n\t\t</Box>\n\t);\n};\n\nMlNavigationTools.defaultProps = {\n\tmapId: undefined,\n\tshow3DButton: true,\n\tshowFollowGpsButton: true,\n\tshowCenterLocationButton: false,\n\tshowZoomButtons: true,\n\tsx: {\n\t\tright: \"5px\",\n\t\tbottom: \"20px\",\n\t},\n};\n\nexport default MlNavigationTools;\n","import React from \"react\";\n\nimport useLayer from \"../../hooks/useLayer\";\nimport { Feature, FeatureCollection } from \"@turf/turf\";\n\ninterface MlLayerProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Id of the layer that will be added by this component to the maplibre-gl instance\n\t */\n\tlayerId?: string;\n\t/**\n\t * Javascript object that is passed the addLayer command as first parameter.\n\t */\n\toptions?: any;\n\t/**\n\t * GeoJSON data that is supposed to be rendered by this component.\n\t */\n\tgeojson?: Feature | FeatureCollection | undefined;\n}\n\n/**\n * Basic layer component that create a layer in a MapLibre-gl instance and keeps it updated according to it attribute configuration.\n * \n * @category Map components \n */\nconst MlLayer = (props: MlLayerProps) => {\n\tuseLayer({\n\t\tidPrefix: 'MlLayer-',\n\t\tlayerId: props.layerId,\n\t\tmapId: props.mapId,\n\t\tgeojson: props.geojson,\n\t\toptions: {\n\t\t\ttype: \"background\",\n\t\t\tpaint: {\n\t\t\t\t\"background-color\": \"rgba(0,0,0,0)\",\n\t\t\t},\n\t\t\t...props.options,\n\t\t},\n\t\tinsertBeforeLayer: props.insertBeforeLayer,\n\t});\n\n\treturn <></>;\n};\n\nexport default MlLayer;\n","import React, { useRef, useEffect, useState, useCallback } from 'react';\nimport useMap from '../../hooks/useMap';\n\nexport interface MlScaleReferenceProps {\n\tmapId?: string;\n\tinsertBeforeLayer?: string | undefined;\n\tmaxWidth?: number;\n\tunit?: string;\n}\n\nconst MlScaleReference = (props: MlScaleReferenceProps) => {\n\tconst zoomRef = useRef(0);\n\tconst mapHook = useMap({ mapId: props.mapId, waitForLayer: props.insertBeforeLayer });\n\n\tconst [pxWidth, setPxWidth] = useState(0);\n\tconst [text, setText] = useState('');\n\n\tconst updateScale = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\t\tif (mapHook.map?.map.getZoom() === zoomRef.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tzoomRef.current = mapHook.map?.map.getZoom();\n\t\t// Calculation from MapLibre\n\t\t// A horizontal scale is imagined to be present at center of the map\n\t\t// Using spherical law of cosines approximation, the real distance is\n\t\t// found between the two coordinates.\n\t\tconst maxWidth = props.maxWidth || 100;\n\n\t\tconst y = mapHook.map.map._container.clientHeight / 2;\n\t\tconst left = mapHook.map.map.unproject([0, y]);\n\t\tconst right = mapHook.map.map.unproject([maxWidth, y]);\n\t\tconst maxMeters = left.distanceTo(right);\n\t\t// The real distance corresponding to 100px scale length is rounded off to\n\t\t// near pretty number and the scale length for the same is found out.\n\t\t// Default unit of the scale is based on User's locale.\n\t\tif (props.unit === 'imperial') {\n\t\t\tconst maxFeet = 3.2808 * maxMeters;\n\t\t\tif (maxFeet > 5280) {\n\t\t\t\tconst maxMiles = maxFeet / 5280;\n\t\t\t\tsetScale(maxWidth, maxMiles, mapHook.map.map._getUIString('ScaleControl.Miles'));\n\t\t\t} else {\n\t\t\t\tsetScale(maxWidth, maxFeet, mapHook.map.map._getUIString('ScaleControl.Feet'));\n\t\t\t}\n\t\t} else if (props.unit === 'nautical') {\n\t\t\tconst maxNauticals = maxMeters / 1852;\n\t\t\tsetScale(maxWidth, maxNauticals, mapHook.map.map._getUIString('ScaleControl.NauticalMiles'));\n\t\t} else if (maxMeters >= 1000) {\n\t\t\tsetScale(maxWidth, maxMeters / 1000, mapHook.map.map._getUIString('ScaleControl.Kilometers'));\n\t\t} else {\n\t\t\tsetScale(maxWidth, maxMeters, mapHook.map.map._getUIString('ScaleControl.Meters'));\n\t\t}\n\t}, [mapHook.map, props.unit, props.maxWidth]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tconst _updateScale = updateScale;\n\t\tmapHook.map.on('move', _updateScale, mapHook.componentId);\n\t\tupdateScale();\n\n\t\treturn () => {\n\t\t\tmapHook.map?.map.off('move', _updateScale);\n\t\t};\n\t}, [mapHook.map, updateScale]);\n\n\tconst setScale = (maxWidth: number, maxDistance: number, unit: string) => {\n\t\tconst distance = getRoundNum(maxDistance);\n\t\tconst ratio = distance / maxDistance;\n\t\tsetPxWidth(maxWidth * ratio);\n\t\tsetText(distance + ' ' + unit);\n\t};\n\n\tconst getDecimalRoundNum = (d: number) => {\n\t\tconst multiplier = Math.pow(10, Math.ceil(-Math.log(d) / Math.LN10));\n\t\treturn Math.round(d * multiplier) / multiplier;\n\t};\n\n\tconst getRoundNum = (num: number) => {\n\t\tconst pow10 = Math.pow(10, `${Math.floor(num)}`.length - 1);\n\t\tlet d = num / pow10;\n\n\t\td = d >= 10 ? 10 : d >= 5 ? 5 : d >= 3 ? 3 : d >= 2 ? 2 : d >= 1 ? 1 : getDecimalRoundNum(d);\n\n\t\treturn pow10 * d;\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tbackgroundColor: 'hsla(0,0%,100%,.75)',\n\t\t\t\t\tfontSize: '10px',\n\t\t\t\t\tborder: '2px solid #333',\n\t\t\t\t\tborderTop: '#333',\n\t\t\t\t\tpadding: '0 5px',\n\t\t\t\t\tcolor: '#333',\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\twidth: pxWidth + 'px',\n\t\t\t\t\tfontFamily: 'sans-serif',\n\t\t\t\t}}\n\t\t\t\tdangerouslySetInnerHTML={{ __html: text }}\n\t\t\t></div>\n\t\t</>\n\t);\n};\n\nexport default MlScaleReference;\n","import React, { useContext, useCallback, useRef, useEffect, useState, useMemo } from 'react';\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport syncMove from '@mapbox/mapbox-gl-sync-move';\nimport './style.css';\nimport MapContext, { MapContextType } from '../../contexts/MapContext';\n\nexport interface MlLayerMagnifyProps {\n\t/**\n\t * Id of the first MapLibre instance\n\t */\n\tmap1Id: string;\n\t/**\n\t * Id of the second MapLibre instance\n\t */\n\tmap2Id: string;\n\t/**\n\t * Size of the \"magnifier\"-circle\n\t */\n\tmagnifierRadius?: number;\n\t/**\n\t * object (React.CSSProperties) that is added to the magnifier default style\n\t */\n\tmagnifierStyle: React.CSSProperties | undefined;\n}\n\n/**\n *\n * Hides the MapLibreMap referenced by props.map2Id except for the \"magnifier\"-circle that reveals\n * the map and can be dragged around on top of the MapLibreMap referenced by props.map1Id\n */\nconst MlLayerMagnify = (props: MlLayerMagnifyProps) => {\n\tconst mapContext: MapContextType = useContext(MapContext);\n\tconst syncMoveInitializedRef = useRef(false);\n\tconst syncCleanupFunctionRef = useRef(() => {});\n\n\tconst [swipeX, setSwipeX] = useState(50);\n\tconst swipeXRef = useRef(50);\n\tconst [swipeY, setSwipeY] = useState(50);\n\tconst swipeYRef = useRef(50);\n\n\tconst magnifierRadius = useMemo(() => {\n\t\treturn props.magnifierRadius || 200;\n\t}, [props.magnifierRadius]);\n\n\tconst mapExists = useCallback(() => {\n\t\tif (!props.map1Id || !props.map2Id) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!mapContext.getMap(props.map1Id) || !mapContext.getMap(props.map2Id)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}, [props, mapContext]);\n\n\tconst onResize = useRef(() => {\n\t\tif (!mapExists()) return;\n\n\t\tonMove({\n\t\t\tclientX: swipeXRef.current,\n\t\t\tclientY: swipeYRef.current,\n\t\t} as (TouchEvent & MouseEvent));\n\t});\n\n\tuseEffect(() => {\n\t\twindow.addEventListener('resize', onResize.current);\n\t\tconst _onResize = onResize.current;\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('resize', _onResize);\n\t\t\tsyncCleanupFunctionRef.current();\n\t\t};\n\t}, []);\n\n\tconst onMove = useCallback(\n\t\t(e:(TouchEvent & MouseEvent)) => {\n\t\t\tif (!mapExists()) return;\n\n\t\t\tconst bounds = mapContext.maps[props.map1Id].getCanvas().getBoundingClientRect();\n\t\t\tlet clientX =\n\t\t\t\te?.clientX ||\n\t\t\t\t(typeof e?.touches !== 'undefined' && typeof e?.touches[0] !== 'undefined'\n\t\t\t\t\t? e?.touches[0].clientX\n\t\t\t\t\t: 0);\n\t\t\tlet clientY =\n\t\t\t\te?.clientY ||\n\t\t\t\t(typeof e.touches !== 'undefined' && typeof e.touches[0] !== 'undefined'\n\t\t\t\t\t? e.touches[0].clientY\n\t\t\t\t\t: 0);\n\n\t\t\tclientX -= bounds.x;\n\t\t\tclientY -= bounds.y;\n\t\t\tconst swipeX_tmp = parseFloat(((clientX / bounds.width) * 100).toFixed(2));\n\t\t\tconst swipeY_tmp = parseFloat(((clientY / bounds.height) * 100).toFixed(2));\n\n\t\t\tif (swipeXRef.current !== swipeX_tmp || swipeYRef.current !== swipeY_tmp) {\n\t\t\t\tsetSwipeX(swipeX_tmp);\n\t\t\t\tswipeXRef.current = swipeX_tmp;\n\t\t\t\tsetSwipeY(swipeY_tmp);\n\t\t\t\tswipeYRef.current = swipeY_tmp;\n\n\t\t\t\tmapContext.maps[props.map2Id].getContainer().style.clipPath =\n\t\t\t\t\t`circle(${magnifierRadius}px at ` +\n\t\t\t\t\t(swipeXRef.current * bounds.width) / 100 +\n\t\t\t\t\t'px ' +\n\t\t\t\t\t(swipeYRef.current * bounds.height) / 100 +\n\t\t\t\t\t'px)';\n\t\t\t}\n\t\t},\n\t\t[mapContext, mapExists, props, magnifierRadius]\n\t);\n\n\tuseEffect(() => {\n\t\tif (!mapExists() || syncMoveInitializedRef.current) return;\n\n\t\tsyncMoveInitializedRef.current = true;\n\t\tsyncCleanupFunctionRef.current = syncMove(\n\t\t\tmapContext.getMap(props.map1Id).map,\n\t\t\tmapContext.getMap(props.map2Id).map\n\t\t);\n\n\t\tonMove({\n\t\t\tclientX: swipeXRef.current,\n\t\t\tclientY: swipeYRef.current,\n\t\t} as (TouchEvent & MouseEvent));\n\t\t/*\n\t\tautomatically adjust radius for small screens\n\t\tif (\n\t\t\tmapContext.maps[props.map1Id].getCanvas().clientWidth >\n\t\t\t\tmapContext.maps[props.map1Id].getCanvas().clientHeight &&\n\t\t\tmagnifierRadius * 2 >\n\t\t\t\tmapContext.maps[props.map1Id].getCanvas().clientHeight\n\t\t) {\n\t\t\tmagnifierRadius = Math.floor(\n\t\t\t\tmapContext.maps[props.map1Id].getCanvas().clientHeight / 2\n\t\t\t);\n\t\t\tsetMagnifierRadius(magnifierRadius);\n\t\t}\n\n\t\tif (\n\t\t\tmapContext.maps[props.map1Id].getCanvas().clientHeight >\n\t\t\t\tmapContext.maps[props.map1Id].getCanvas().clientWidth &&\n\t\t\tmagnifierRadius * 2 >\n\t\t\t\tmapContext.maps[props.map1Id].getCanvas().clientWidth\n\t\t) {\n\t\t\tmagnifierRadius = Math.floor(\n\t\t\t\tmapContext.maps[props.map1Id].getCanvas().clientWidth / 2\n\t\t\t);\n\t\t\tsetMagnifierRadius(magnifierRadius);\n\t\t}\n\t\t*/\n\n\t\tonMove({\n\t\t\tclientX: mapContext.maps[props.map1Id].getCanvas().clientWidth / 2,\n\t\t\tclientY: mapContext.maps[props.map1Id].getCanvas().clientHeight / 2,\n\t\t} as (TouchEvent & MouseEvent));\n\t}, [mapContext.mapIds, mapContext, mapExists, props, onMove]);\n\n\tconst onDown = (e: React.MouseEvent | React.TouchEvent) => {\n\t\tif (e.nativeEvent instanceof TouchEvent) {\n\t\t\tdocument.addEventListener('touchmove', onMove);\n\t\t\tdocument.addEventListener('touchend', onTouchEnd);\n\t\t} else {\n\t\t\tdocument.addEventListener('mousemove', onMove);\n\t\t\tdocument.addEventListener('mouseup', onMouseUp);\n\t\t}\n\t};\n\n\tconst onTouchEnd = () => {\n\t\tdocument.removeEventListener('touchmove', onMove);\n\t\tdocument.removeEventListener('touchend', onTouchEnd);\n\t};\n\n\tconst onMouseUp = () => {\n\t\tdocument.removeEventListener('mousemove', onMove);\n\t\tdocument.removeEventListener('mouseup', onMouseUp);\n\t};\n\n\tconst onWheel = (e: React.WheelEvent) => {\n\t\tconst evCopy = new WheelEvent(e.type, e as unknown as WheelEventInit);\n\t\tmapContext.map?.map.getCanvas().dispatchEvent(evCopy);\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tposition: 'absolute',\n\t\t\t\tleft: swipeX + '%',\n\t\t\t\ttop: swipeY + '%',\n\t\t\t\tborderRadius: '50%',\n\t\t\t\twidth: magnifierRadius * 2 - 2 + 'px',\n\t\t\t\theight: magnifierRadius * 2 - 2 + 'px',\n\t\t\t\tbackground: 'rgba(0,0,0,0)',\n\t\t\t\tborder: '2px solid #fafafa',\n\t\t\t\tboxShadow: '1px 2px 2px rgba(19, 19, 19, .5), inset 1px 1px 1px rgba(19, 19, 19, .2)',\n\t\t\t\tcursor: 'pointer',\n\t\t\t\tzIndex: '110',\n\t\t\t\tmarginLeft: magnifierRadius * -1 - 1 + 'px',\n\t\t\t\tmarginTop: magnifierRadius * -1 - 1 + 'px',\n\t\t\t\ttextAlign: 'center',\n\t\t\t\tlineHeight: '91px',\n\t\t\t\tfontSize: '2em',\n\t\t\t\tcolor: '#fafafa',\n\t\t\t\tuserSelect: 'none',\n\t\t\t\t...props.magnifierStyle,\n\t\t\t}}\n\t\t\tonTouchStart={onDown}\n\t\t\tonMouseDown={onDown}\n\t\t\tonWheel={onWheel}\n\t\t></div>\n\t);\n};\n\nMlLayerMagnify.defaultProps = {\n\tmagnifierRadius: 200,\n\tmagnifierStyle: {},\n};\n\nexport default MlLayerMagnify;\n","import React, { useContext, useCallback, useRef, useEffect, useState } from 'react';\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport syncMove from '@mapbox/mapbox-gl-sync-move';\nimport './style.css';\nimport MapContext, { MapContextType } from '../../contexts/MapContext';\n\nexport interface MlLayerSwipeProps {\n\t/**\n\t * Id of the first MapLibre instance.\n\t */\n\tmap1Id: string;\n\t/**\n\t * Id of the second MapLibre instance.\n\t */\n\tmap2Id: string;\n\t/**\n\t * object (React.CSSProperties) that is added to the button default style\n\t */\n\tbuttonStyle: React.CSSProperties | undefined;\n}\n\n/**\n *\tcreates a split view of 2 synchronised maplibre instances\n */\nconst MlLayerSwipe = (props: MlLayerSwipeProps) => {\n\tconst mapContext: MapContextType = useContext(MapContext);\n\tconst initializedRef = useRef(false);\n\n\tconst [swipeX, setSwipeX] = useState(50);\n\tconst swipeXRef = useRef(0);\n\n\tconst syncCleanupFunctionRef = useRef(() => {});\n\n\tconst mapExists = useCallback(() => {\n\t\tif (!props.map1Id || !props.map2Id) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!mapContext.getMap(props.map1Id) || !mapContext.getMap(props.map2Id)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}, [mapContext, props.map1Id, props.map2Id]);\n\n\tconst cleanup = () => {\n\t\tsyncCleanupFunctionRef.current();\n\t};\n\n\tconst onMove = useCallback(\n\t\t(e:(TouchEvent & MouseEvent)) => {\n\t\t\tif (!mapExists()) return;\n\n\t\t\tconst bounds = mapContext.maps[props.map1Id].getCanvas().getBoundingClientRect();\n\t\t\tlet clientX =\n\t\t\t\te.clientX ||\n\t\t\t\t(typeof e.touches !== 'undefined' && typeof e.touches[0] !== 'undefined'\n\t\t\t\t\t? e.touches[0].clientX\n\t\t\t\t\t: 0);\n\n\t\t\tclientX -= bounds.x;\n\t\t\tconst swipeX_tmp = parseFloat(((clientX / bounds.width) * 100).toFixed(2));\n\n\t\t\tif (swipeXRef.current !== swipeX_tmp) {\n\t\t\t\tsetSwipeX(swipeX_tmp);\n\t\t\t\tswipeXRef.current = swipeX_tmp;\n\n\t\t\t\tconst clipA = 'rect(0, ' + (swipeXRef.current * bounds.width) / 100 + 'px, 999em, 0)';\n\n\t\t\t\tmapContext.maps[props.map2Id].getContainer().style.clip = clipA;\n\t\t\t}\n\t\t},\n\t\t[mapContext, mapExists, props.map1Id, props.map2Id]\n\t);\n\n\tuseEffect(() => {\n\t\treturn cleanup;\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!mapExists() || initializedRef.current) return;\n\n\t\tinitializedRef.current = true;\n\t\tsyncCleanupFunctionRef.current = syncMove(\n\t\t\tmapContext.getMap(props.map1Id).map,\n\t\t\tmapContext.getMap(props.map2Id).map\n\t\t);\n\t\tonMove({\n\t\t\tclientX: mapContext.maps[props.map1Id].getCanvas().clientWidth / 2,\n\t\t} as (TouchEvent & MouseEvent));\n\t}, [mapContext.mapIds, mapContext, props, onMove, mapExists]);\n\n\tconst onDown = (e: React.MouseEvent | React.TouchEvent) => {\n\t\tif (e.nativeEvent instanceof TouchEvent) {\n\t\t\tdocument.addEventListener('touchmove', onMove);\n\t\t\tdocument.addEventListener('touchend', onTouchEnd);\n\t\t} else {\n\t\t\tdocument.addEventListener('mousemove', onMove);\n\t\t\tdocument.addEventListener('mouseup', onMouseUp);\n\t\t}\n\t};\n\n\tconst onTouchEnd = () => {\n\t\tdocument.removeEventListener('touchmove', onMove);\n\t\tdocument.removeEventListener('touchend', onTouchEnd);\n\t};\n\n\tconst onMouseUp = () => {\n\t\tdocument.removeEventListener('mousemove', onMove);\n\t\tdocument.removeEventListener('mouseup', onMouseUp);\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tposition: 'absolute',\n\t\t\t\tleft: swipeX + '%',\n\t\t\t\ttop: '50%',\n\t\t\t\tborderRadius: '50%',\n\t\t\t\twidth: '100px',\n\t\t\t\theight: '100px',\n\t\t\t\tbackground: '#0066ff',\n\t\t\t\tborder: '3px solid #eaebf1',\n\t\t\t\tcursor: 'pointer',\n\t\t\t\tzIndex: '110',\n\t\t\t\tmarginLeft: '-50px',\n\t\t\t\tmarginTop: '-50px',\n\t\t\t\ttextAlign: 'center',\n\t\t\t\tlineHeight: '91px',\n\t\t\t\tfontSize: '2em',\n\t\t\t\tcolor: '#fafafa',\n\t\t\t\tuserSelect: 'none',\n\t\t\t\t...props.buttonStyle,\n\t\t\t}}\n\t\t\tonTouchStart={onDown}\n\t\t\tonMouseDown={onDown}\n\t\t></div>\n\t);\n};\n\nMlLayerSwipe.defaultProps = {\n\tbuttonStyle: {},\n};\n\nexport default MlLayerSwipe;\n","import * as turf from \"@turf/turf\";\n\nconst _showNextTransitionSegment = function (\n\tprops,\n\tmap,\n\ttransitionInProgressRef,\n\ttransitionGeojsonDataRef,\n\ttransitionGeojsonCommonDataRef,\n\tcurrentTransitionStepRef,\n\tmsPerStep,\n\ttransitionTimeoutRef,\n\tsetDisplayGeojson\n) {\n\tif (typeof transitionGeojsonDataRef.current[currentTransitionStepRef.current] !== \"undefined\") {\n\t\t// if at last transition step set to target geojson\n\t\t// else to an assembled LineString from common geometry and the current transition step geometry\n\t\tlet newData =\n\t\t\tcurrentTransitionStepRef.current + 1 === transitionGeojsonDataRef.current.length\n\t\t\t\t? props.geojson\n\t\t\t\t: turf.lineString([\n\t\t\t\t\t\t...transitionGeojsonCommonDataRef.current,\n\t\t\t\t\t\t...transitionGeojsonDataRef.current[currentTransitionStepRef.current].geometry\n\t\t\t\t\t\t\t.coordinates,\n\t\t\t\t\t]);\n\n\t\tsetDisplayGeojson(newData);\n\n\t\tif (typeof props.onTransitionFrame === \"function\") {\n\t\t\tprops.onTransitionFrame(newData);\n\t\t}\n\n\t\tcurrentTransitionStepRef.current++;\n\t\tif (\n\t\t\ttransitionInProgressRef.current &&\n\t\t\tcurrentTransitionStepRef.current < transitionGeojsonDataRef.current.length\n\t\t) {\n\t\t\ttransitionTimeoutRef.current = setTimeout(\n\t\t\t\t() => _showNextTransitionSegment(...arguments),\n\t\t\t\tmsPerStep\n\t\t\t);\n\t\t} else {\n\t\t\tif (typeof props.onTransitionEnd === \"function\") {\n\t\t\t\tprops.onTransitionEnd(props.geojson);\n\t\t\t}\n\t\t\ttransitionInProgressRef.current = false;\n\t\t}\n\t}\n};\n\nconst _transitionToGeojson = (\n\tprops,\n\ttransitionGeojsonCommonDataRef,\n\ttransitionGeojsonDataRef,\n\ttransitionInProgressRef,\n\toldGeojsonRef,\n\tmsPerStep,\n\tcurrentTransitionStepRef,\n\tmap,\n\ttransitionTimeoutRef,\n\tsetDisplayGeojson\n) => {\n\t// create the transition geojson between oldGeojsonRef.current and props.geojson\n\n\t// create a geojson that contains no common point between the two line features\n\tlet transitionCoordinatesShort = [];\n\tlet transitionCoordinatesLong = [];\n\tlet targetCoordinates = [];\n\tlet srcCoordinates = [];\n\ttransitionGeojsonCommonDataRef.current = [];\n\tlet sourceGeojson = oldGeojsonRef.current || {\n\t\tgeometry: {\n\t\t\ttype: \"LineString\",\n\t\t\tcoordinates: [],\n\t\t},\n\t\tproperties: {},\n\t\ttype: \"Feature\",\n\t};\n\n\tlet targetGeojson = props.geojson;\n\n\tlet longerGeojson = targetGeojson;\n\tlet shorterGeojson = sourceGeojson;\n\tlet reverseOrder = false;\n\t// In case one geojson is missing completely use the first two coordinates of the other geojson\n\tif (\n\t\ttypeof longerGeojson.geometry === \"undefined\" &&\n\t\ttypeof shorterGeojson.geometry !== \"undefined\" &&\n\t\tshorterGeojson.geometry.coordinates.length > 1\n\t) {\n\t\tlongerGeojson = turf.lineString(shorterGeojson.geometry.coordinates.slice(0, 2));\n\t} else if (\n\t\ttypeof shorterGeojson.geometry === \"undefined\" &&\n\t\ttypeof longerGeojson.geometry !== \"undefined\" &&\n\t\tlongerGeojson.geometry.coordinates.length > 1\n\t) {\n\t\tshorterGeojson = turf.lineString(longerGeojson.geometry.coordinates.slice(0, 2));\n\t} else if (\n\t\ttypeof shorterGeojson.geometry === \"undefined\" &&\n\t\ttypeof longerGeojson.geometry === \"undefined\"\n\t) {\n\t\treturn;\n\t}\n\n\tif (longerGeojson.geometry.coordinates.length < shorterGeojson.geometry.coordinates.length) {\n\t\tlongerGeojson = sourceGeojson;\n\t\tshorterGeojson = targetGeojson;\n\t\treverseOrder = true;\n\t}\n\n\tif (longerGeojson && shorterGeojson) {\n\t\tfor (var i = 0, len = longerGeojson.geometry.coordinates.length; i < len; i++) {\n\t\t\tif (\n\t\t\t\ttypeof shorterGeojson.geometry.coordinates[i] !== \"undefined\" &&\n\t\t\t\tlongerGeojson.geometry.coordinates[i][0] === shorterGeojson.geometry.coordinates[i][0] &&\n\t\t\t\tlongerGeojson.geometry.coordinates[i][1] === shorterGeojson.geometry.coordinates[i][1]\n\t\t\t) {\n\t\t\t\t// if coordinates are equal\n\t\t\t\ttransitionGeojsonCommonDataRef.current.push(longerGeojson.geometry.coordinates[i]);\n\t\t\t} else {\n\t\t\t\tif (typeof longerGeojson.geometry.coordinates[i] !== \"undefined\") {\n\t\t\t\t\ttransitionCoordinatesLong.push(longerGeojson.geometry.coordinates[i]);\n\t\t\t\t}\n\t\t\t\tif (typeof shorterGeojson.geometry.coordinates[i] !== \"undefined\") {\n\t\t\t\t\ttransitionCoordinatesShort.push(shorterGeojson.geometry.coordinates[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (reverseOrder) {\n\t\ttargetCoordinates = transitionCoordinatesShort;\n\t\tsrcCoordinates = transitionCoordinatesLong;\n\t} else {\n\t\ttargetCoordinates = transitionCoordinatesLong;\n\t\tsrcCoordinates = transitionCoordinatesShort;\n\t}\n\n\tif (targetCoordinates.length < 2 && srcCoordinates < 2) return;\n\t// create props.transitionTime / msPerStep (=: transitionSteps) Versions of transitionGeojsonCommonDataRef.current + transitionCoordinates making the transitionCoordinates transitionCoordinatesDistance / transitionSteps longer on each step\n\n\tlet transitionSteps = props.transitionTime / msPerStep;\n\tlet srcCoordinatesDistance =\n\t\tsrcCoordinates.length > 1 ? Math.round(turf.length(turf.lineString(srcCoordinates))) : 0;\n\tlet targetCoordinatesDistance =\n\t\ttargetCoordinates.length > 1 ? Math.round(turf.length(turf.lineString(targetCoordinates))) : 0;\n\tlet transitionDistance = targetCoordinatesDistance + srcCoordinatesDistance;\n\n\tlet srcCoordinatesShare = srcCoordinatesDistance / transitionDistance;\n\tlet srcTransitionSteps = Math.round(transitionSteps * srcCoordinatesShare);\n\tlet srcPerStepDistance = Math.round((srcCoordinatesDistance / srcTransitionSteps) * 100) / 100;\n\n\tlet targetCoordinatesShare = targetCoordinatesDistance / transitionDistance;\n\tlet targetTransitionSteps = Math.round(transitionSteps * targetCoordinatesShare);\n\tlet targetPerStepDistance =\n\t\tMath.round((targetCoordinatesDistance / targetTransitionSteps) * 100) / 100;\n\n\t// use srcPerStepDistance as src coordinates are always animated backwards\n\tlet loopStepDistance = srcCoordinatesDistance;\n\tif (loopStepDistance <= 0) {\n\t\tloopStepDistance = 0.1;\n\t}\n\n\t// create transition step data as an array of all required FeatureCollection states until the transition is complete\n\tlet transitionStepData;\n\n\ttransitionStepData = [\n\t\t...createTransitionSteps(srcCoordinates, srcPerStepDistance, srcTransitionSteps),\n\t];\n\ttransitionStepData.reverse();\n\n\ttransitionStepData = [\n\t\t...transitionStepData,\n\t\t...createTransitionSteps(targetCoordinates, targetPerStepDistance, targetTransitionSteps),\n\t];\n\n\ttransitionStepData.push(targetGeojson);\n\n\ttransitionGeojsonDataRef.current = transitionStepData;\n\n\tcurrentTransitionStepRef.current = 1;\n\ttransitionInProgressRef.current = true;\n\ttransitionTimeoutRef.current = setTimeout(\n\t\t() =>\n\t\t\t_showNextTransitionSegment(\n\t\t\t\tprops,\n\t\t\t\tmap,\n\t\t\t\ttransitionInProgressRef,\n\t\t\t\ttransitionGeojsonDataRef,\n\t\t\t\ttransitionGeojsonCommonDataRef,\n\t\t\t\tcurrentTransitionStepRef,\n\t\t\t\tmsPerStep,\n\t\t\t\ttransitionTimeoutRef,\n\t\t\t\tsetDisplayGeojson\n\t\t\t),\n\t\tmsPerStep\n\t);\n};\n\nlet createTransitionSteps = (linestringCoordinates, perStepDistance, stepCnt) => {\n\tlet transitionSteps = [];\n\n\tif (linestringCoordinates.length > 1) {\n\t\tlet tmpChunks = turf.lineChunk(turf.lineString(linestringCoordinates), perStepDistance);\n\t\t// tmpLineString contains all coordinates of all previous plus current loop iteration\n\t\tlet tmpLinestring = tmpChunks.features[0];\n\t\tfor (let i = 0; i < stepCnt; i++) {\n\t\t\ttransitionSteps.push(tmpLinestring);\n\t\t\tif (typeof tmpChunks.features[i] !== \"undefined\") {\n\t\t\t\ttmpLinestring = turf.lineString([\n\t\t\t\t\t...tmpLinestring.geometry.coordinates,\n\t\t\t\t\t...tmpChunks.features[i].geometry.coordinates,\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn transitionSteps;\n};\n\nexport { _showNextTransitionSegment, _transitionToGeojson };\n","import React, { useState, useRef, useEffect, useCallback } from 'react';\nimport * as turf from '@turf/turf';\nimport useMap from '../../hooks/useMap';\nimport { _transitionToGeojson } from './util/transitionFunctions';\nimport MlGeoJsonLayer from '../MlGeoJsonLayer/MlGeoJsonLayer';\nimport { Feature, FeatureCollection } from '@turf/turf';\nimport { MlGeoJsonLayerProps } from '../MlGeoJsonLayer/MlGeoJsonLayer';\n\nconst msPerStep = 50;\n\ntype MlTransitionGeoJsonLayerProps = MlGeoJsonLayerProps & {\n\ttransitionTime: number;\n};\n\n/**\n * Adds source and layer of types \"line\", \"fill\" or \"circle\" to display GeoJSON data on the map.\n */\nconst MlTransitionGeoJsonLayer = (props: MlTransitionGeoJsonLayerProps) => {\n\t// ignore eslint. Only using `geojson` for destructuring\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tconst { geojson, ...restProps } = props;\n\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\tconst initializedRef = useRef(false);\n\n\t// transition effect variables\n\tconst oldGeojsonRef = useRef<Feature | FeatureCollection>();\n\tconst transitionInProgressRef = useRef(false);\n\tconst transitionTimeoutRef = useRef(undefined);\n\tconst currentTransitionStepRef = useRef(false);\n\tconst transitionGeojsonDataRef = useRef([]);\n\tconst transitionGeojsonCommonDataRef = useRef([]);\n\tconst [displayGeojson, setDisplayGeojson] = useState(turf.featureCollection([]));\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\t// This is the cleanup function, it is called when this react component is removed from react-dom\n\t\t\tif (transitionTimeoutRef.current) {\n\t\t\t\tclearTimeout(transitionTimeoutRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\tconst transitionToGeojson = useCallback(() => {\n\t\t_transitionToGeojson(\n\t\t\tprops,\n\t\t\ttransitionGeojsonCommonDataRef,\n\t\t\ttransitionGeojsonDataRef,\n\t\t\ttransitionInProgressRef,\n\t\t\toldGeojsonRef,\n\t\t\tmsPerStep,\n\t\t\tcurrentTransitionStepRef,\n\t\t\tmapHook.map,\n\t\t\ttransitionTimeoutRef,\n\t\t\tsetDisplayGeojson\n\t\t);\n\t}, [props, mapHook.map]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !initializedRef.current) return;\n\n\t\tif (\n\t\t\ttypeof props.transitionTime !== 'undefined' &&\n\t\t\tprops.type === 'line' &&\n\t\t\toldGeojsonRef.current\n\t\t) {\n\t\t\ttransitionInProgressRef.current = false;\n\t\t\tcurrentTransitionStepRef.current = false;\n\t\t\ttransitionGeojsonDataRef.current = [];\n\t\t\ttransitionGeojsonCommonDataRef.current = [];\n\t\t\ttransitionToGeojson();\n\t\t}\n\t\toldGeojsonRef.current = props.geojson;\n\t}, [mapHook.map, transitionToGeojson, props]);\n\n\tconst startTransition = useCallback(() => {\n\t\tif (\n\t\t\tprops.type === 'line' &&\n\t\t\ttypeof props.transitionTime !== 'undefined' &&\n\t\t\tprops.transitionTime &&\n\t\t\ttypeof props.geojson !== 'undefined' &&\n\t\t\tJSON.stringify(oldGeojsonRef.current) !== JSON.stringify(props.geojson)\n\t\t) {\n\t\t\ttransitionToGeojson();\n\t\t\toldGeojsonRef.current = props.geojson;\n\t\t}\n\t}, [props, transitionToGeojson]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.mapIsReady || !props.geojson) return;\n\n\t\tinitializedRef.current = true;\n\n\t\tstartTransition();\n\t}, [mapHook.mapIsReady, startTransition, props]);\n\n\treturn (\n\t\t<>\n\t\t\t<MlGeoJsonLayer {...restProps} geojson={displayGeojson} />\n\t\t</>\n\t);\n};\n\nexport default MlTransitionGeoJsonLayer;\n","import React, { useRef, useState, useEffect } from \"react\";\nimport MlGeoJsonLayer from \"../MlGeoJsonLayer/MlGeoJsonLayer\";\nimport Paper from \"@mui/material/Paper\";\nimport useMapState from \"../../hooks/useMapState\";\nimport useMap from \"../../hooks/useMap\";\n\nimport Point from \"@mapbox/point-geometry\";\n\ninterface MlMarkerProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Longitude of the marker position\n\t */\n\tlng: number;\n\t/**\n\t * Latitude of the marker position\n\t */\n\tlat: number;\n\t/**\n\t * Content of the description popup\n\t */\n\tcontent?: string;\n}\n\n/**\n * Adds a marker to the map and displays the contents of the \"content\" property in an iframe next to it\n */\nconst MlMarker = (props: MlMarkerProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst mapState = useMapState({\n\t\tmapId: props.mapId,\n\t\twatch: { viewport: true },\n\t});\n\n\tconst iframe = useRef<HTMLIFrameElement>(null);\n\n\tconst [iframeDimensions, setIframeDimensions] = useState({\n\t\twidth: \"400px\",\n\t\theight: \"500px\",\n\t});\n\n\tconst [markerPixelPos, setMarkerPixelPos] = useState<Point>();\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map?.map?.project) return;\n\n\t\tconst _pixelPos = mapHook.map.map.project([props.lng, props.lat]);\n\n\t\tsetMarkerPixelPos(_pixelPos);\n\t}, [mapHook.map, props.lng, props.lat, mapState.viewport]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\t!mapHook.map ||\n\t\t\t!iframe.current?.contentWindow?.document?.body?.scrollHeight\n\t\t)\n\t\t\treturn;\n\n\t\tlet mapHeight = mapHook.map.map._container.clientHeight;\n\n\t\tconst _pixelPos = mapHook.map.map.project([props.lng, props.lat]);\n\t\tlet pixelToBottom = mapHeight - _pixelPos.y;\n\t\tlet iframeHeight =\n\t\t\tiframe.current?.contentWindow?.document?.body?.scrollHeight;\n\t\tlet iframeWidth =\n\t\t\tiframe.current?.contentWindow?.document?.body?.scrollWidth;\n\n\t\tsetIframeDimensions({\n\t\t\twidth: iframeWidth + \"px\",\n\t\t\theight:\n\t\t\t\t(pixelToBottom < iframeHeight ? pixelToBottom : iframeHeight) + \"px\",\n\t\t});\n\t}, [props.lng, props.lat, props.content]);\n\n\treturn (\n\t\t<>\n\t\t\t<MlGeoJsonLayer\n\t\t\t\tgeojson={{\n\t\t\t\t\ttype: \"Feature\",\n\t\t\t\t\tgeometry: {\n\t\t\t\t\t\ttype: \"Point\",\n\t\t\t\t\t\tcoordinates: [props.lng, props.lat],\n\t\t\t\t\t},\n\t\t\t\t\tproperties: {},\n\t\t\t\t}}\n\t\t\t\tpaint={{\n\t\t\t\t\t\"circle-radius\": 14,\n\t\t\t\t\t\"circle-color\": \"rgba(40,200,20,0.5)\",\n\t\t\t\t}}\n\t\t\t\ttype=\"circle\"\n\t\t\t\tmapId={props.mapId}\n\t\t\t></MlGeoJsonLayer>\n\t\t\t{markerPixelPos && (\n\t\t\t\t<Paper\n\t\t\t\t\tsx={{\n\t\t\t\t\t\topacity: 0.7,\n\t\t\t\t\t\tposition: \"fixed\",\n\t\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\t\t/** TODO: fix positioning delay when moving the map */\n\t\t\t\t\t\tleft: markerPixelPos.x,\n\t\t\t\t\t\ttop: markerPixelPos.y,\n\t\t\t\t\t\twidth: iframeDimensions.width,\n\t\t\t\t\t\theight: iframeDimensions.height,\n\t\t\t\t\t\t\"&:hover\": {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tzIndex: -1,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<iframe\n\t\t\t\t\t\tstyle={{ width: \"100%\" }}\n\t\t\t\t\t\tsrcDoc={props.content}\n\t\t\t\t\t\tref={iframe}\n\t\t\t\t\t\tsandbox=\"allow-same-origin allow-popups-to-escape-sandbox\"\n\t\t\t\t\t\tframeBorder=\"0\"\n\t\t\t\t\t\ttitle={mapHook.componentId}\n\t\t\t\t\t></iframe>\n\t\t\t\t</Paper>\n\t\t\t)}\n\t\t</>\n\t);\n};\n\nMlMarker.defaultProps = {\n\tmapId: undefined,\n};\n\nexport default MlMarker;\n","import React, { useRef, useEffect, useState } from \"react\";\n\nimport PropTypes from \"prop-types\";\nimport useMap from \"../../hooks/useMap\";\n\n/**\n * Adds a standard OSM tile layer to the maplibre-gl instancereference by\n * props.mapId\n *\n * @component\n */\nconst MlOsmLayer = (props) => {\n\tconst mapHook = useMap({ mapId: props.mapId, waitForLayer: props.insertBeforeLayer });\n\n\tconst layerId = useRef(props.layerId || \"MlOsmLayer-\" + mapHook.componentId);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tmapHook.map.addSource(\n\t\t\tlayerId.current,\n\t\t\t{\n\t\t\t\ttype: \"raster\",\n\t\t\t\ttileSize: 256,\n\t\t\t\t...props.sourceOptions,\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\t\tmapHook.map.addLayer(\n\t\t\t{\n\t\t\t\tid: layerId.current,\n\t\t\t\ttype: \"raster\",\n\t\t\t\tsource: layerId.current,\n\t\t\t\tminzoom: 0,\n\t\t\t\tmaxzoom: 22,\n\t\t\t\t...props.layerOptions,\n\t\t\t},\n\t\t\tprops.insertBeforeLayer,\n\t\t\tmapHook.componentId\n\t\t);\n\t}, [props, mapHook.map]);\n\n\treturn <></>;\n};\n\nMlOsmLayer.propTypes = {\n\t/**\n\t * Id of the target MapLibre instance in mapHook\n\t */\n\tmapId: PropTypes.string,\n\t/**\n\t * Prefix of the component id this component uses when adding elements to the MapLibreGl-instance\n\t */\n\tidPrefix: PropTypes.string,\n\t/**\n\t * Options object that will be used as first parameter on the MapLibreGl.addSource call see MapLibre source options documentation.\n\t */\n\tsourceOptions: PropTypes.object,\n\t/**\n\t * Options object that will be used as first parameter on the MapLibreGl.addLayer call see MapLibre layer options documentation.\n\t *\n\t */\n\tlayerOptions: PropTypes.object,\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer: PropTypes.string,\n};\n\nexport default MlOsmLayer;\n","/**\n * https://github.com/mapbox/togeojson\n *\n * Copyright (c) 2016 Mapbox All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar toGeoJSON = (function () {\n\tvar removeSpace = /\\s*/g,\n\t\ttrimSpace = /^\\s*|\\s*$/g,\n\t\tsplitSpace = /\\s+/;\n\t// generate a short, numeric hash of a string\n\tfunction okhash(x) {\n\t\tif (!x || !x.length) return 0;\n\t\tfor (var i = 0, h = 0; i < x.length; i++) {\n\t\t\th = ((h << 5) - h + x.charCodeAt(i)) | 0;\n\t\t}\n\t\treturn h;\n\t}\n\t// all Y children of X\n\tfunction get(x, y) {\n\t\treturn x.getElementsByTagName(y);\n\t}\n\tfunction attr(x, y) {\n\t\treturn x.getAttribute(y);\n\t}\n\tfunction attrf(x, y) {\n\t\treturn parseFloat(attr(x, y));\n\t}\n\t// one Y child of X, if any, otherwise null\n\tfunction get1(x, y) {\n\t\tvar n = get(x, y);\n\t\treturn n.length ? n[0] : null;\n\t}\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Node.normalize\n\tfunction norm(el) {\n\t\tif (el.normalize) {\n\t\t\tel.normalize();\n\t\t}\n\t\treturn el;\n\t}\n\t// cast array x into numbers\n\tfunction numarray(x) {\n\t\tfor (var j = 0, o = []; j < x.length; j++) {\n\t\t\to[j] = parseFloat(x[j]);\n\t\t}\n\t\treturn o;\n\t}\n\t// get the content of a text node, if any\n\tfunction nodeVal(x) {\n\t\tif (x) {\n\t\t\tnorm(x);\n\t\t}\n\t\treturn (x && x.textContent) || \"\";\n\t}\n\t// get the contents of multiple text nodes, if present\n\tfunction getMulti(x, ys) {\n\t\tvar o = {},\n\t\t\tn,\n\t\t\tk;\n\t\tfor (k = 0; k < ys.length; k++) {\n\t\t\tn = get1(x, ys[k]);\n\t\t\tif (n) o[ys[k]] = nodeVal(n);\n\t\t}\n\t\treturn o;\n\t}\n\t// add properties of Y to X, overwriting if present in both\n\tfunction extend(x, y) {\n\t\tfor (var k in y) x[k] = y[k];\n\t}\n\t// get one coordinate from a coordinate array, if any\n\tfunction coord1(v) {\n\t\treturn numarray(v.replace(removeSpace, \"\").split(\",\"));\n\t}\n\t// get all coordinates from a coordinate array as [[],[]]\n\tfunction coord(v) {\n\t\tvar coords = v.replace(trimSpace, \"\").split(splitSpace),\n\t\t\to = [];\n\t\tfor (var i = 0; i < coords.length; i++) {\n\t\t\to.push(coord1(coords[i]));\n\t\t}\n\t\treturn o;\n\t}\n\tfunction coordPair(x) {\n\t\tvar ll = [attrf(x, \"lon\"), attrf(x, \"lat\")],\n\t\t\tele = get1(x, \"ele\"),\n\t\t\t// handle namespaced attribute in browser\n\t\t\theartRate = get1(x, \"gpxtpx:hr\") || get1(x, \"hr\"),\n\t\t\ttime = get1(x, \"time\"),\n\t\t\te;\n\t\tif (ele) {\n\t\t\te = parseFloat(nodeVal(ele));\n\t\t\tif (!isNaN(e)) {\n\t\t\t\tll.push(e);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tcoordinates: ll,\n\t\t\ttime: time ? nodeVal(time) : null,\n\t\t\theartRate: heartRate ? parseFloat(nodeVal(heartRate)) : null,\n\t\t};\n\t}\n\n\t// create a new feature collection parent object\n\tfunction fc() {\n\t\treturn {\n\t\t\ttype: \"FeatureCollection\",\n\t\t\tfeatures: [],\n\t\t};\n\t}\n\n\tvar serializer;\n\tif (typeof XMLSerializer !== \"undefined\") {\n\t\t/* istanbul ignore next */\n\t\tserializer = new XMLSerializer();\n\t} else {\n\t\tvar isNodeEnv = typeof process === \"object\" && !process.browser;\n\t\tvar isTitaniumEnv = typeof Titanium === \"object\";\n\t\tif (typeof exports === \"object\" && (isNodeEnv || isTitaniumEnv)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-var-requires, no-undef\n\t\t\tserializer = new (require(\"xmldom\").XMLSerializer)();\n\t\t} else {\n\t\t\tthrow new Error(\"Unable to initialize serializer\");\n\t\t}\n\t}\n\tfunction xml2str(str) {\n\t\t// IE9 will create a new XMLSerializer but it'll crash immediately.\n\t\t// This line is ignored because we don't run coverage tests in IE9\n\t\t/* istanbul ignore next */\n\t\tif (str.xml !== undefined) return str.xml;\n\t\treturn serializer.serializeToString(str);\n\t}\n\n\tvar t = {\n\t\tkml: function (doc) {\n\t\t\tvar gj = fc(),\n\t\t\t\t// styleindex keeps track of hashed styles in order to match features\n\t\t\t\tstyleIndex = {},\n\t\t\t\tstyleByHash = {},\n\t\t\t\t// stylemapindex keeps track of style maps to expose in properties\n\t\t\t\tstyleMapIndex = {},\n\t\t\t\t// atomic geospatial types supported by KML - MultiGeometry is\n\t\t\t\t// handled separately\n\t\t\t\tgeotypes = [\"Polygon\", \"LineString\", \"Point\", \"Track\", \"gx:Track\"],\n\t\t\t\t// all root placemarks in the file\n\t\t\t\tplacemarks = get(doc, \"Placemark\"),\n\t\t\t\tstyles = get(doc, \"Style\"),\n\t\t\t\tstyleMaps = get(doc, \"StyleMap\");\n\n\t\t\tfor (var k = 0; k < styles.length; k++) {\n\t\t\t\tvar hash = okhash(xml2str(styles[k])).toString(16);\n\t\t\t\tstyleIndex[\"#\" + attr(styles[k], \"id\")] = hash;\n\t\t\t\tstyleByHash[hash] = styles[k];\n\t\t\t}\n\t\t\tfor (var l = 0; l < styleMaps.length; l++) {\n\t\t\t\tstyleIndex[\"#\" + attr(styleMaps[l], \"id\")] = okhash(xml2str(styleMaps[l])).toString(16);\n\t\t\t\tvar pairs = get(styleMaps[l], \"Pair\");\n\t\t\t\tvar pairsMap = {};\n\t\t\t\tfor (var m = 0; m < pairs.length; m++) {\n\t\t\t\t\tpairsMap[nodeVal(get1(pairs[m], \"key\"))] = nodeVal(get1(pairs[m], \"styleUrl\"));\n\t\t\t\t}\n\t\t\t\tstyleMapIndex[\"#\" + attr(styleMaps[l], \"id\")] = pairsMap;\n\t\t\t}\n\t\t\tfor (var j = 0; j < placemarks.length; j++) {\n\t\t\t\tgj.features = gj.features.concat(getPlacemark(placemarks[j]));\n\t\t\t}\n\t\t\tfunction kmlColor(v) {\n\t\t\t\tvar color, opacity;\n\t\t\t\tv = v || \"\";\n\t\t\t\tif (v.substr(0, 1) === \"#\") {\n\t\t\t\t\tv = v.substr(1);\n\t\t\t\t}\n\t\t\t\tif (v.length === 6 || v.length === 3) {\n\t\t\t\t\tcolor = v;\n\t\t\t\t}\n\t\t\t\tif (v.length === 8) {\n\t\t\t\t\topacity = parseInt(v.substr(0, 2), 16) / 255;\n\t\t\t\t\tcolor = \"#\" + v.substr(6, 2) + v.substr(4, 2) + v.substr(2, 2);\n\t\t\t\t}\n\t\t\t\treturn [color, isNaN(opacity) ? undefined : opacity];\n\t\t\t}\n\t\t\tfunction gxCoord(v) {\n\t\t\t\treturn numarray(v.split(\" \"));\n\t\t\t}\n\t\t\tfunction gxCoords(root) {\n\t\t\t\tvar elems = get(root, \"coord\", \"gx\"),\n\t\t\t\t\tcoords = [],\n\t\t\t\t\ttimes = [];\n\t\t\t\tif (elems.length === 0) elems = get(root, \"gx:coord\");\n\t\t\t\tfor (var i = 0; i < elems.length; i++) coords.push(gxCoord(nodeVal(elems[i])));\n\t\t\t\tvar timeElems = get(root, \"when\");\n\t\t\t\tfor (var j = 0; j < timeElems.length; j++) times.push(nodeVal(timeElems[j]));\n\t\t\t\treturn {\n\t\t\t\t\tcoords: coords,\n\t\t\t\t\ttimes: times,\n\t\t\t\t};\n\t\t\t}\n\t\t\tfunction getGeometry(root) {\n\t\t\t\tvar geomNode,\n\t\t\t\t\tgeomNodes,\n\t\t\t\t\ti,\n\t\t\t\t\tj,\n\t\t\t\t\tk,\n\t\t\t\t\tgeoms = [],\n\t\t\t\t\tcoordTimes = [];\n\t\t\t\tif (get1(root, \"MultiGeometry\")) {\n\t\t\t\t\treturn getGeometry(get1(root, \"MultiGeometry\"));\n\t\t\t\t}\n\t\t\t\tif (get1(root, \"MultiTrack\")) {\n\t\t\t\t\treturn getGeometry(get1(root, \"MultiTrack\"));\n\t\t\t\t}\n\t\t\t\tif (get1(root, \"gx:MultiTrack\")) {\n\t\t\t\t\treturn getGeometry(get1(root, \"gx:MultiTrack\"));\n\t\t\t\t}\n\t\t\t\tfor (i = 0; i < geotypes.length; i++) {\n\t\t\t\t\tgeomNodes = get(root, geotypes[i]);\n\t\t\t\t\tif (geomNodes) {\n\t\t\t\t\t\tfor (j = 0; j < geomNodes.length; j++) {\n\t\t\t\t\t\t\tgeomNode = geomNodes[j];\n\t\t\t\t\t\t\tif (geotypes[i] === \"Point\") {\n\t\t\t\t\t\t\t\tgeoms.push({\n\t\t\t\t\t\t\t\t\ttype: \"Point\",\n\t\t\t\t\t\t\t\t\tcoordinates: coord1(nodeVal(get1(geomNode, \"coordinates\"))),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else if (geotypes[i] === \"LineString\") {\n\t\t\t\t\t\t\t\tgeoms.push({\n\t\t\t\t\t\t\t\t\ttype: \"LineString\",\n\t\t\t\t\t\t\t\t\tcoordinates: coord(nodeVal(get1(geomNode, \"coordinates\"))),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else if (geotypes[i] === \"Polygon\") {\n\t\t\t\t\t\t\t\tvar rings = get(geomNode, \"LinearRing\"),\n\t\t\t\t\t\t\t\t\tcoords = [];\n\t\t\t\t\t\t\t\tfor (k = 0; k < rings.length; k++) {\n\t\t\t\t\t\t\t\t\tcoords.push(coord(nodeVal(get1(rings[k], \"coordinates\"))));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tgeoms.push({\n\t\t\t\t\t\t\t\t\ttype: \"Polygon\",\n\t\t\t\t\t\t\t\t\tcoordinates: coords,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else if (geotypes[i] === \"Track\" || geotypes[i] === \"gx:Track\") {\n\t\t\t\t\t\t\t\tvar track = gxCoords(geomNode);\n\t\t\t\t\t\t\t\tgeoms.push({\n\t\t\t\t\t\t\t\t\ttype: \"LineString\",\n\t\t\t\t\t\t\t\t\tcoordinates: track.coords,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tif (track.times.length) coordTimes.push(track.times);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tgeoms: geoms,\n\t\t\t\t\tcoordTimes: coordTimes,\n\t\t\t\t};\n\t\t\t}\n\t\t\tfunction getPlacemark(root) {\n\t\t\t\tvar geomsAndTimes = getGeometry(root),\n\t\t\t\t\ti,\n\t\t\t\t\tproperties = {},\n\t\t\t\t\tname = nodeVal(get1(root, \"name\")),\n\t\t\t\t\taddress = nodeVal(get1(root, \"address\")),\n\t\t\t\t\tstyleUrl = nodeVal(get1(root, \"styleUrl\")),\n\t\t\t\t\tdescription = nodeVal(get1(root, \"description\")),\n\t\t\t\t\ttimeSpan = get1(root, \"TimeSpan\"),\n\t\t\t\t\ttimeStamp = get1(root, \"TimeStamp\"),\n\t\t\t\t\textendedData = get1(root, \"ExtendedData\"),\n\t\t\t\t\tlineStyle = get1(root, \"LineStyle\"),\n\t\t\t\t\tpolyStyle = get1(root, \"PolyStyle\"),\n\t\t\t\t\tvisibility = get1(root, \"visibility\");\n\n\t\t\t\tif (!geomsAndTimes.geoms.length) return [];\n\t\t\t\tif (name) properties.name = name;\n\t\t\t\tif (address) properties.address = address;\n\t\t\t\tif (styleUrl) {\n\t\t\t\t\tif (styleUrl[0] !== \"#\") {\n\t\t\t\t\t\tstyleUrl = \"#\" + styleUrl;\n\t\t\t\t\t}\n\n\t\t\t\t\tproperties.styleUrl = styleUrl;\n\t\t\t\t\tif (styleIndex[styleUrl]) {\n\t\t\t\t\t\tproperties.styleHash = styleIndex[styleUrl];\n\t\t\t\t\t}\n\t\t\t\t\tif (styleMapIndex[styleUrl]) {\n\t\t\t\t\t\tproperties.styleMapHash = styleMapIndex[styleUrl];\n\t\t\t\t\t\tproperties.styleHash = styleIndex[styleMapIndex[styleUrl].normal];\n\t\t\t\t\t}\n\t\t\t\t\t// Try to populate the lineStyle or polyStyle since we got the style hash\n\t\t\t\t\tvar style = styleByHash[properties.styleHash];\n\t\t\t\t\tif (style) {\n\t\t\t\t\t\tif (!lineStyle) lineStyle = get1(style, \"LineStyle\");\n\t\t\t\t\t\tif (!polyStyle) polyStyle = get1(style, \"PolyStyle\");\n\t\t\t\t\t\tvar iconStyle = get1(style, \"IconStyle\");\n\t\t\t\t\t\tif (iconStyle) {\n\t\t\t\t\t\t\tvar icon = get1(iconStyle, \"Icon\");\n\t\t\t\t\t\t\tif (icon) {\n\t\t\t\t\t\t\t\tvar href = nodeVal(get1(icon, \"href\"));\n\t\t\t\t\t\t\t\tif (href) properties.icon = href;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (description) properties.description = description;\n\t\t\t\tif (timeSpan) {\n\t\t\t\t\tvar begin = nodeVal(get1(timeSpan, \"begin\"));\n\t\t\t\t\tvar end = nodeVal(get1(timeSpan, \"end\"));\n\t\t\t\t\tproperties.timespan = { begin: begin, end: end };\n\t\t\t\t}\n\t\t\t\tif (timeStamp) {\n\t\t\t\t\tproperties.timestamp = nodeVal(get1(timeStamp, \"when\"));\n\t\t\t\t}\n\t\t\t\tif (lineStyle) {\n\t\t\t\t\tvar linestyles = kmlColor(nodeVal(get1(lineStyle, \"color\"))),\n\t\t\t\t\t\tcolor = linestyles[0],\n\t\t\t\t\t\topacity = linestyles[1],\n\t\t\t\t\t\twidth = parseFloat(nodeVal(get1(lineStyle, \"width\")));\n\t\t\t\t\tif (color) properties.stroke = color;\n\t\t\t\t\tif (!isNaN(opacity)) properties[\"stroke-opacity\"] = opacity;\n\t\t\t\t\tif (!isNaN(width)) properties[\"stroke-width\"] = width;\n\t\t\t\t}\n\t\t\t\tif (polyStyle) {\n\t\t\t\t\tvar polystyles = kmlColor(nodeVal(get1(polyStyle, \"color\"))),\n\t\t\t\t\t\tpcolor = polystyles[0],\n\t\t\t\t\t\tpopacity = polystyles[1],\n\t\t\t\t\t\tfill = nodeVal(get1(polyStyle, \"fill\")),\n\t\t\t\t\t\toutline = nodeVal(get1(polyStyle, \"outline\"));\n\t\t\t\t\tif (pcolor) properties.fill = pcolor;\n\t\t\t\t\tif (!isNaN(popacity)) properties[\"fill-opacity\"] = popacity;\n\t\t\t\t\tif (fill) properties[\"fill-opacity\"] = fill === \"1\" ? properties[\"fill-opacity\"] || 1 : 0;\n\t\t\t\t\tif (outline)\n\t\t\t\t\t\tproperties[\"stroke-opacity\"] = outline === \"1\" ? properties[\"stroke-opacity\"] || 1 : 0;\n\t\t\t\t}\n\t\t\t\tif (extendedData) {\n\t\t\t\t\tvar datas = get(extendedData, \"Data\"),\n\t\t\t\t\t\tsimpleDatas = get(extendedData, \"SimpleData\");\n\n\t\t\t\t\tfor (i = 0; i < datas.length; i++) {\n\t\t\t\t\t\tproperties[datas[i].getAttribute(\"name\")] = nodeVal(get1(datas[i], \"value\"));\n\t\t\t\t\t}\n\t\t\t\t\tfor (i = 0; i < simpleDatas.length; i++) {\n\t\t\t\t\t\tproperties[simpleDatas[i].getAttribute(\"name\")] = nodeVal(simpleDatas[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (visibility) {\n\t\t\t\t\tproperties.visibility = nodeVal(visibility);\n\t\t\t\t}\n\t\t\t\tif (geomsAndTimes.coordTimes.length) {\n\t\t\t\t\tproperties.coordTimes =\n\t\t\t\t\t\tgeomsAndTimes.coordTimes.length === 1\n\t\t\t\t\t\t\t? geomsAndTimes.coordTimes[0]\n\t\t\t\t\t\t\t: geomsAndTimes.coordTimes;\n\t\t\t\t}\n\t\t\t\tvar feature = {\n\t\t\t\t\ttype: \"Feature\",\n\t\t\t\t\tgeometry:\n\t\t\t\t\t\tgeomsAndTimes.geoms.length === 1\n\t\t\t\t\t\t\t? geomsAndTimes.geoms[0]\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\ttype: \"GeometryCollection\",\n\t\t\t\t\t\t\t\t\tgeometries: geomsAndTimes.geoms,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\tproperties: properties,\n\t\t\t\t};\n\t\t\t\tif (attr(root, \"id\")) feature.id = attr(root, \"id\");\n\t\t\t\treturn [feature];\n\t\t\t}\n\t\t\treturn gj;\n\t\t},\n\t\tgpx: function (doc) {\n\t\t\tvar i,\n\t\t\t\ttracks = get(doc, \"trk\"),\n\t\t\t\troutes = get(doc, \"rte\"),\n\t\t\t\twaypoints = get(doc, \"wpt\"),\n\t\t\t\t// a feature collection\n\t\t\t\tgj = fc(),\n\t\t\t\tfeature;\n\t\t\tfor (i = 0; i < tracks.length; i++) {\n\t\t\t\tfeature = getTrack(tracks[i]);\n\t\t\t\tif (feature) gj.features.push(feature);\n\t\t\t}\n\t\t\tfor (i = 0; i < routes.length; i++) {\n\t\t\t\tfeature = getRoute(routes[i]);\n\t\t\t\tif (feature) gj.features.push(feature);\n\t\t\t}\n\t\t\tfor (i = 0; i < waypoints.length; i++) {\n\t\t\t\tgj.features.push(getPoint(waypoints[i]));\n\t\t\t}\n\t\t\tfunction initializeArray(arr, size) {\n\t\t\t\tfor (var h = 0; h < size; h++) {\n\t\t\t\t\tarr.push(null);\n\t\t\t\t}\n\t\t\t\treturn arr;\n\t\t\t}\n\t\t\tfunction getPoints(node, pointname) {\n\t\t\t\tvar pts = get(node, pointname),\n\t\t\t\t\tline = [],\n\t\t\t\t\ttimes = [],\n\t\t\t\t\theartRates = [],\n\t\t\t\t\tl = pts.length;\n\t\t\t\tif (l < 2) return {}; // Invalid line in GeoJSON\n\t\t\t\tfor (var i = 0; i < l; i++) {\n\t\t\t\t\tvar c = coordPair(pts[i]);\n\t\t\t\t\tline.push(c.coordinates);\n\t\t\t\t\tif (c.time) times.push(c.time);\n\t\t\t\t\tif (c.heartRate || heartRates.length) {\n\t\t\t\t\t\tif (!heartRates.length) initializeArray(heartRates, i);\n\t\t\t\t\t\theartRates.push(c.heartRate || null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tline: line,\n\t\t\t\t\ttimes: times,\n\t\t\t\t\theartRates: heartRates,\n\t\t\t\t};\n\t\t\t}\n\t\t\tfunction getTrack(node) {\n\t\t\t\tvar segments = get(node, \"trkseg\"),\n\t\t\t\t\ttrack = [],\n\t\t\t\t\ttimes = [],\n\t\t\t\t\theartRates = [],\n\t\t\t\t\tline;\n\t\t\t\tfor (var i = 0; i < segments.length; i++) {\n\t\t\t\t\tline = getPoints(segments[i], \"trkpt\");\n\t\t\t\t\tif (line) {\n\t\t\t\t\t\tif (line.line) track.push(line.line);\n\t\t\t\t\t\tif (line.times && line.times.length) times.push(line.times);\n\t\t\t\t\t\tif (heartRates.length || (line.heartRates && line.heartRates.length)) {\n\t\t\t\t\t\t\tif (!heartRates.length) {\n\t\t\t\t\t\t\t\tfor (var s = 0; s < i; s++) {\n\t\t\t\t\t\t\t\t\theartRates.push(initializeArray([], track[s].length));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (line.heartRates && line.heartRates.length) {\n\t\t\t\t\t\t\t\theartRates.push(line.heartRates);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\theartRates.push(initializeArray([], line.line.length || 0));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (track.length === 0) return;\n\t\t\t\tvar properties = getProperties(node);\n\t\t\t\textend(properties, getLineStyle(get1(node, \"extensions\")));\n\t\t\t\tif (times.length) properties.coordTimes = track.length === 1 ? times[0] : times;\n\t\t\t\tif (heartRates.length)\n\t\t\t\t\tproperties.heartRates = track.length === 1 ? heartRates[0] : heartRates;\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Feature\",\n\t\t\t\t\tproperties: properties,\n\t\t\t\t\tgeometry: {\n\t\t\t\t\t\ttype: track.length === 1 ? \"LineString\" : \"MultiLineString\",\n\t\t\t\t\t\tcoordinates: track.length === 1 ? track[0] : track,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t\tfunction getRoute(node) {\n\t\t\t\tvar line = getPoints(node, \"rtept\");\n\t\t\t\tif (!line.line) return;\n\t\t\t\tvar prop = getProperties(node);\n\t\t\t\textend(prop, getLineStyle(get1(node, \"extensions\")));\n\t\t\t\tvar routeObj = {\n\t\t\t\t\ttype: \"Feature\",\n\t\t\t\t\tproperties: prop,\n\t\t\t\t\tgeometry: {\n\t\t\t\t\t\ttype: \"LineString\",\n\t\t\t\t\t\tcoordinates: line.line,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn routeObj;\n\t\t\t}\n\t\t\tfunction getPoint(node) {\n\t\t\t\tvar prop = getProperties(node);\n\t\t\t\textend(prop, getMulti(node, [\"sym\"]));\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"Feature\",\n\t\t\t\t\tproperties: prop,\n\t\t\t\t\tgeometry: {\n\t\t\t\t\t\ttype: \"Point\",\n\t\t\t\t\t\tcoordinates: coordPair(node).coordinates,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t\tfunction getLineStyle(extensions) {\n\t\t\t\tvar style = {};\n\t\t\t\tif (extensions) {\n\t\t\t\t\tvar lineStyle = get1(extensions, \"line\");\n\t\t\t\t\tif (lineStyle) {\n\t\t\t\t\t\tvar color = nodeVal(get1(lineStyle, \"color\")),\n\t\t\t\t\t\t\topacity = parseFloat(nodeVal(get1(lineStyle, \"opacity\"))),\n\t\t\t\t\t\t\twidth = parseFloat(nodeVal(get1(lineStyle, \"width\")));\n\t\t\t\t\t\tif (color) style.stroke = color;\n\t\t\t\t\t\tif (!isNaN(opacity)) style[\"stroke-opacity\"] = opacity;\n\t\t\t\t\t\t// GPX width is in mm, convert to px with 96 px per inch\n\t\t\t\t\t\tif (!isNaN(width)) style[\"stroke-width\"] = (width * 96) / 25.4;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn style;\n\t\t\t}\n\t\t\tfunction getProperties(node) {\n\t\t\t\tvar prop = getMulti(node, [\"name\", \"cmt\", \"desc\", \"type\", \"time\", \"keywords\"]),\n\t\t\t\t\tlinks = get(node, \"link\");\n\t\t\t\tif (links.length) prop.links = [];\n\t\t\t\tfor (var i = 0, link; i < links.length; i++) {\n\t\t\t\t\tlink = { href: attr(links[i], \"href\") };\n\t\t\t\t\textend(link, getMulti(links[i], [\"text\", \"type\"]));\n\t\t\t\t\tprop.links.push(link);\n\t\t\t\t}\n\t\t\t\treturn prop;\n\t\t\t}\n\t\t\treturn gj;\n\t\t},\n\t};\n\treturn t;\n})();\n\nexport default toGeoJSON;\n","import { useState, useEffect } from 'react';\nimport toGeoJSON from './lib/gpxConverter';\nimport { FeatureCollection } from '@turf/turf';\n\ninterface useGpxProps {\n\t/**\n\t * a string containing GPX data that is supposed to be parsed and converted to GeoJSON by this hook\n\t */\n\tdata?: string;\n}\n\nexport interface MetadataType {\n\ttitle: string;\n\tvalue: string;\n\tid: number;\n}\n\n/**\n * useGpx hook converts GPX data to GeoJSON\n *\n */\nconst useGpx = (props: useGpxProps) => {\n\tconst [geojson, setGeojson] = useState<FeatureCollection | undefined>();\n\tconst [metadata, setMetadata] = useState<MetadataType[]>([]);\n\n\tconst parseGpx = (gpxAsString: string) => {\n\t\ttry {\n\t\t\tsetMetadata([]);\n\t\t\tconst domParser = new DOMParser();\n\t\t\tconst gpxDoc = domParser.parseFromString(gpxAsString, 'application/xml');\n\t\t\tconst metadata = gpxDoc.querySelector('metadata');\n\t\t\tmetadata?.childNodes.forEach((node: Element) => {\n\t\t\t\tlet value = node.textContent;\n\t\t\t\tconst title = node.nodeName;\n\n\t\t\t\tif (node.nodeName === 'link') {\n\t\t\t\t\tvalue = node.getAttribute('href');\n\t\t\t\t}\n\t\t\t\tif (value?.trim().length) {\n\t\t\t\t\tconst metaDataEntry = {\n\t\t\t\t\t\ttitle: title,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tid: new Date().getTime(),\n\t\t\t\t\t};\n\t\t\t\t\tsetMetadata((prevState) => [...prevState, metaDataEntry]);\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst data = toGeoJSON.gpx(gpxDoc);\n\t\t\tsetGeojson(data as FeatureCollection);\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (!props.data) return;\n\n\t\tparseGpx(props.data);\n\t}, [props.data]);\n\n\treturn {\n\t\tgeojson,\n\t\tmetadata,\n\t};\n};\n\nuseGpx.defaultProps = {\n\tdata: undefined,\n};\nexport default useGpx;\n","import React, { useRef, useEffect } from 'react';\nimport useMap from '../../hooks/useMap';\nimport { GeoJSONFeature } from 'maplibre-gl';\nimport {\n\tLngLatLike,\n\tPopup,\n\tMapEventType,\n} from 'maplibre-gl';\n\ninterface useLayerHoverPopupProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Id of an existing layer in the mapLibre instance this event will be registered to\n\t */\n\tlayerId?: string;\n\tgetPopupContent: (feature: GeoJSONFeature) => string;\n}\n\n/**\n * useLayerHoverPopup hook registers a mouseenter event to display feature properties in a MapLibre popup if a feature on the configured layer is hovered\n *\n */\nconst useLayerHoverPopup = (props: useLayerHoverPopupProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.layerId,\n\t});\n\tconst popup = useRef(\n\t\tnew Popup({\n\t\t\tcloseButton: false,\n\t\t\tcloseOnClick: true,\n\t\t})\n\t);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !props.layerId) return;\n\t\tmapHook.map.on(\n\t\t\t'mouseenter',\n\t\t\tprops.layerId,\n\t\t\t(\n\t\t\t\te: MapEventType & {\n\t\t\t\t\tfeatures?: ({[key:string]:string} & { geometry:{coordinates:[number,number]}})[] | undefined;\n\t\t\t\t\tlngLat: { lng: number; lat: number };\n\t\t\t\t}\n\t\t\t) => {\n\t\t\t\tif (!mapHook.map) return;\n\t\t\t\t// Change the cursor style as a UI indicator.\n\n\t\t\t\tconst coordinates = e?.features?.[0].geometry.coordinates.slice();\n\t\t\t\t//const description = e.features[0].properties.desc;\n\t\t\t\tlet content = '';\n\t\t\t\tif (e?.features?.[0] && typeof props.getPopupContent === 'function') {\n\t\t\t\t\tcontent = props.getPopupContent(e.features[0] as unknown as GeoJSONFeature);\n\t\t\t\t}\n\n\t\t\t\tif (coordinates?.[0]) {\n\t\t\t\t\t// Ensure that if the map is zoomed out such that multiple\n\t\t\t\t\t// copies of the feature are visible, the popup appears\n\t\t\t\t\t// over the copy being pointed to.\n\t\t\t\t\twhile (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {\n\t\t\t\t\t\tcoordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Populate the popup and set its coordinates\n\n\t\t\t\t\t// based on the feature found.\n\t\t\t\t\tpopup.current.setLngLat(coordinates as LngLatLike).setHTML(content).addTo(mapHook.map.map);\n\t\t\t\t}\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\t}, [mapHook.map]);\n\n\treturn <></>;\n};\n\nuseLayerHoverPopup.defaultProps = {\n\tmapId: undefined,\n};\nexport default useLayerHoverPopup;\n","import { useEffect, useRef, useCallback, useState } from \"react\";\nimport useMap, { useMapType } from \"./useMap\";\nimport MapLibreGlWrapper from \"../components/MapLibreMap/lib/MapLibreGlWrapper\";\nimport { Source, SourceSpecification } from \"maplibre-gl\";\n\ntype useSourceType = {\n\tmap: MapLibreGlWrapper | undefined;\n\tsource: Source | undefined;\n\tcomponentId: string;\n\tmapHook: useMapType;\n};\ninterface useSourceProps {\n\tmapId?: string;\n\tidPrefix?: string;\n\tsource: SourceSpecification;\n\tsourceId: string;\n}\n\nfunction useSource(props: useSourceProps): useSourceType {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t});\n\n\tconst initializedRef = useRef<boolean>(false);\n\tconst [source, setSource] = useState<Source>();\n\tconst sourceId = useRef(\n\t\tprops.sourceId || (props.idPrefix ? props.idPrefix : \"Source-\") + mapHook.componentId\n\t);\n\n\tconst createSource = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\t\tinitializedRef.current = true;\n\n\t\tif (mapHook.map.map.getSource(sourceId.current)) {\n\t\t\tmapHook.cleanup();\n\t\t}\n\n\t\tmapHook.map?.addSource(sourceId.current, {\n\t\t\t...props.source,\n\t\t}, mapHook.componentId);\n\n\t\tsetSource(mapHook.map.map.getSource(sourceId.current));\n\t}, [props, mapHook.map]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || initializedRef.current) return;\n\t\tcreateSource();\n\t}, [mapHook.map, props, createSource]);\n\n\tuseEffect(() => {\n\t\tif (!initializedRef.current || !mapHook.map?.map?.getSource(props.sourceId)) return;\n\n\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t//@ts-ignore setData only exists on GeoJsonSource\n\t\tmapHook.map.map.getSource(props.sourceId)?.setData?.(props.source.data);\n\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t//@ts-ignore data only exists on GeoJsonSource\n\t}, [props.source?.data]);\n\n\t//cleanup\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tinitializedRef.current = false;\n\t\t\tif (mapHook.map && mapHook.map?.map?.style?._layers) {\n\t\t\t\tfor (const [layerId, layer] of Object.entries(mapHook.map.map.style._layers)) {\n\t\t\t\t\tif (layer.source === sourceId.current) {\n\t\t\t\t\t\tmapHook.map.map.removeLayer(layerId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmapHook.map.map.removeSource(sourceId.current);\n\t\t\t}\n\t\t};\n\t}, [mapHook.map]);\n\n\treturn {\n\t\tmap: mapHook.map,\n\t\tsource: source,\n\t\tcomponentId: mapHook.componentId,\n\t\tmapHook: mapHook,\n\t};\n}\n\nexport default useSource;\n","import React, { useEffect, useRef } from 'react';\nimport { bbox, featureCollection, FeatureCollection } from '@turf/turf';\nimport { LngLatBoundsLike } from 'maplibre-gl';\nimport useMap from '../../hooks/useMap';\nimport useGpx, { MetadataType } from '../../hooks/useGpx/useGpx';\nimport useLayerHoverPopup from '../../hooks/useLayerHoverPopup/useLayerHoverPopup';\nimport useSource from '../../hooks/useSource';\nimport useLayer from '../../hooks/useLayer';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport interface MlGpxViewerProps {\n\t/**\n\t * Id of the target MapLibre instance in mapHook\n\t */\n\tmapId?: string;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n\t/**\n\t * Prefix of the component id this component uses when adding elements to the MapLibreGl-instance\n\t */\n\tidPrefix?: string;\n\tgpxData: string | undefined;\n\tonParseGpxData: (arg0: {\n\t\tgeojson: FeatureCollection | undefined;\n\t\tmetadata: MetadataType[];\n\t}) => void;\n}\n\n/**\n * MlGpxViewer visualizes a given GPX Track on the map\n */\nconst MlGpxViewer = (props: MlGpxViewerProps) => {\n\tconst parsedGpx = useGpx({ data: props.gpxData });\n\tconst mapHook = useMap({ mapId: props.mapId, waitForLayer: props.insertBeforeLayer });\n\tconst sourceName = useRef('gpx-viewer-source-' + uuidv4());\n\tconst layerNameLines = useRef('importer-layer-lines-' + uuidv4());\n\tconst layerNamePoints = useRef('importer-layer-points-' + uuidv4());\n\n\tuseLayerHoverPopup({\n\t\tlayerId: layerNamePoints.current,\n\t\tgetPopupContent: (feature) => feature?.properties?.name,\n\t});\n\n\tuseSource({\n\t\tmapId: props.mapId,\n\t\tsourceId: sourceName.current,\n\t\tsource: {\n\t\t\ttype: 'geojson',\n\t\t\tdata: parsedGpx.geojson || featureCollection([]),\n\t\t},\n\t});\n\n\tuseLayer({\n\t\tlayerId: layerNameLines.current,\n\t\tsource: sourceName.current,\n\t\toptions: {\n\t\t\ttype: 'line',\n\t\t\tpaint: {\n\t\t\t\t'line-width': 4,\n\t\t\t\t'line-color': 'rgba(212, 55, 23,0.5)',\n\t\t\t},\n\t\t},\n\t\tinsertBeforeLayer: props.insertBeforeLayer,\n\t});\n\n\tuseLayer({\n\t\tlayerId: layerNamePoints.current,\n\t\tsource: sourceName.current,\n\t\toptions: {\n\t\t\ttype: 'circle',\n\t\t\tpaint: {\n\t\t\t\t'circle-color': 'rgba(72, 77, 99,0.5)',\n\t\t\t\t'circle-radius': 7,\n\t\t\t},\n\t\t\tfilter: ['==', '$type', 'Point'],\n\t\t},\n\t\tinsertBeforeLayer: props.insertBeforeLayer,\n\t});\n\n\tuseEffect(() => {\n\n\t if (!mapHook.map || !parsedGpx.geojson) return;\n\n\t\tif (typeof props.onParseGpxData === 'function') {\n\t\t\tprops.onParseGpxData(parsedGpx);\n\t\t}\n\t\t\n\t\t// fit map view to GeoJSON bbox\n\t\t\n\t\tconst bounds = bbox(parsedGpx.geojson);\n\t\tmapHook.map.map.fitBounds(bounds as LngLatBoundsLike);\n\t\t\t\t\n\t}, [parsedGpx]);\n\n\treturn <></>;\n};\n\nMlGpxViewer.defaultProps = {};\n\nexport default MlGpxViewer;\n","import React from \"react\";\nimport { FeatureCollection } from '@turf/turf';\n\ntype ContextProps = { \n\t\tdata: FeatureCollection,\n\t\tsetData: Function,\n\t\tgetEmptyFeatureCollection: Function\n\t};\n\nconst GeoJsonContext = React.createContext<Partial<ContextProps>>({});\n\nexport const GeoJsonContextProvider = GeoJsonContext.Provider;\nexport default GeoJsonContext;\n","import React, { useState } from \"react\";\nimport { GeoJsonContextProvider } from \"./GeoJsonContext\";\nimport { FeatureCollection } from '@turf/turf';\n\nconst GeoJsonProvider = ({ children }:{children:JSX.Element}) => {\n\tconst [data, setData] = useState<FeatureCollection>({\n\t\ttype: \"FeatureCollection\",\n\t\tfeatures: [],\n\t});\n\tconst getEmptyFeatureCollection = () => {\n\t\treturn {\n\t\t\ttype: \"FeatureCollection\",\n\t\t\tfeatures: [],\n\t\t};\n\t};\n\tconst value = {\n\t\tdata,\n\t\tsetData,\n\t\tgetEmptyFeatureCollection,\n\t};\n\n\treturn <GeoJsonContextProvider value={value}>{children}</GeoJsonContextProvider>;\n};\n\nexport default GeoJsonProvider;\n","import React, { useRef, useEffect, useContext, useState, useCallback } from 'react';\nimport PropTypes from 'prop-types';\n\nimport MapContext from '../../contexts/MapContext';\nimport { v4 as uuidv4 } from 'uuid';\nimport useMapState from '../../hooks/useMapState';\nimport MapLibreGlWrapper from '../MapLibreMap/lib/MapLibreGlWrapper';\n\nexport interface MapState {\n\tlat?: number;\n\tlng?: number;\n\tzoom?: number;\n\tbearing?: number;\n\tpitch?: number;\n\tlayers?: {\n\t\tvisible: boolean;\n\t\tid: string;\n\t}[];\n}\n\nconst getCurrentUrlParameters = (): MapState => {\n\tconst currentParams = Object.fromEntries(new URLSearchParams(window.location.search));\n\tcurrentParams.layers = JSON.parse(currentParams?.layers ? currentParams.layers : '[]');\n\n\treturn currentParams;\n};\n\nconst initialUrlParams = getCurrentUrlParameters();\n\n/**\n * TODO: Add short & useful description\n *\n * @param {object} props\n * @param {string} props.mapId Id of the target MapLibre instance in mapContext\n *\n * @component\n */\n\nexport interface MlShareMapStateProps {\n\t//\n\tmapId?: string;\n\tidPrefix?: string;\n\tactive?: boolean;\n}\n\nexport interface LayerStatesInterface {\n\t//\n\t[key: string]: boolean;\n}\n\nconst MlShareMapState = (props: MlShareMapStateProps) => {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tconst mapContext = useContext(MapContext);\n\tconst initializedRef = useRef(false);\n\tconst mapRef = useRef<MapLibreGlWrapper | undefined>();\n\tconst [map, setMap] = useState<MapLibreGlWrapper | undefined>(undefined);\n\tconst layersFromUrlParamsRef = useRef({});\n\tconst componentId = useRef((props.idPrefix ? props.idPrefix : 'MlShareMapState-') + uuidv4());\n\tconst mapState = useMapState({\n\t\twatch: {\n\t\t\tviewport: false,\n\t\t\tlayers: true,\n\t\t\tsources: false,\n\t\t},\n\t\tfilter: {\n\t\t\tincludeBaseLayers: false,\n\t\t},\n\t});\n\n\tconst allStatesRestoredRef = useRef(false);\n\tconst layerStatesRestored = useRef<LayerStatesInterface>();\n\tconst restoredStatesRef = useRef({\n\t\tviewport: {\n\t\t\tcenter: false,\n\t\t\tbearing: false,\n\t\t\tpitch: false,\n\t\t\tzoom: false,\n\t\t},\n\t\tlayers: {\n\t\t\t...layersFromUrlParamsRef,\n\t\t},\n\t});\n\n\t// initial URL-Params\n\tconst mapStateRef = useRef<MapState>({});\n\n\tconst refreshUrlParameters = useCallback(() => {\n\t\tif (!props.active) return;\n\n\t\tconst mapLayers = [];\n\t\tfor (const x in mapState.layers) {\n\t\t\tmapLayers.push({\n\t\t\t\tid: mapState.layers[x]?.id,\n\t\t\t\ttype: mapState.layers[x]?.type,\n\t\t\t\tvisible: mapState.layers[x]?.visible,\n\t\t\t});\n\t\t}\n\t\trefreshMapState();\n\t\tconst urlParams = new URLSearchParams({\n\t\t\t...(getCurrentUrlParameters() as Record<string, string>),\n\t\t\t...(mapStateRef.current as Record<string, string>),\n\t\t\tlayers: JSON.stringify(mapLayers),\n\t\t});\n\t\tJSON.parse(Object.fromEntries(urlParams).layers).forEach((el: { id: number }) => {\n\t\t\t// is iD a number?\n\t\t\tlayersFromUrlParamsRef.current[el.id] = false;\n\t\t});\n\n\t\tconst currentParams = new URLSearchParams(window.location.search);\n\t\tif (urlParams.toString() !== currentParams.toString()) {\n\t\t\twindow.history.pushState(\n\t\t\t\t{ ...mapStateRef.current },\n\t\t\t\tdocument.title,\n\t\t\t\t'?' + urlParams.toString()\n\t\t\t);\n\t\t}\n\t}, [mapState.layers, props.active]);\n\n\tuseEffect(() => {\n\t\tconst _componentId = componentId.current;\n\n\t\tmapStateRef.current = getCurrentUrlParameters();\n\n\t\treturn () => {\n\t\t\t// This is the cleanup function, it is called when this react component is removed from react-dom\n\t\t\t// try to remove anything this component has added to the MapLibre-gl instance\n\t\t\t// e.g.: remove the layer\n\t\t\t// mapContext.getMap(props.mapId).removeLayer(layerRef.current);\n\t\t\t// check for the existence of map.style before calling getLayer or getSource\n\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.cleanup(_componentId);\n\t\t\t\tmapRef.current = undefined;\n\t\t\t}\n\t\t\tinitializedRef.current = false;\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!mapRef.current) return;\n\n\t\trefreshUrlParameters();\n\t}, [refreshUrlParameters]);\n\n\tuseEffect(() => {\n\t\tif (!mapRef.current) return;\n\n\t\tconst _refreshUrlParameters = refreshUrlParameters;\n\n\t\tmapRef.current.on('moveend', _refreshUrlParameters, componentId.current);\n\n\t\treturn () => {\n\t\t\tmapRef.current?.map.off('moveend', _refreshUrlParameters);\n\t\t};\n\t}, [refreshUrlParameters, map]);\n\n\tuseEffect(() => {\n\t\tif (!mapContext?.mapExists?.(props.mapId) || initializedRef.current) return;\n\t\t// the MapLibre-gl instance (mapContext.getMap(props.mapId)) is accessible here\n\t\t// initialize the layer and add it to the MapLibre-gl instance or do something else with it\n\t\tinitializedRef.current = true;\n\t\tmapRef.current = mapContext.getMap(props.mapId);\n\t\tsetMap(mapRef.current);\n\t\tif (mapStateRef.current.lat && mapStateRef.current.lng) {\n\t\t\trestoreViewportState();\n\t\t}\n\t}, [mapContext.mapIds, mapContext, props.mapId, props.active]);\n\n\tuseEffect(() => {\n\t\tif (!mapState?.layers?.length) return;\n\n\t\tif (typeof layerStatesRestored.current === 'undefined') {\n\t\t\tlayerStatesRestored.current = undefined;\n\t\t\tinitialUrlParams?.layers?.forEach((layer: { id: string }) => {\n\t\t\t\tif (layerStatesRestored.current?.[layer.id]) {\n\t\t\t\t\tlayerStatesRestored.current[layer.id] = false;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfor (const key in layerStatesRestored.current) {\n\t\t\tlet _allDone = true;\n\t\t\tif (layerStatesRestored.current[key] === false) {\n\t\t\t\t_allDone = false;\n\t\t\t}\n\t\t\tif (_allDone) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (initialUrlParams.layers) {\n\t\t\tinitialUrlParams.layers.forEach((layer) => {\n\t\t\t\tif (\n\t\t\t\t\tmapRef.current?.map.getLayer(layer.id) && //number oder str?\n\t\t\t\t\tlayerStatesRestored.current?.[layer.id] === false\n\t\t\t\t) {\n\t\t\t\t\tlayerStatesRestored.current[layer.id] = true;\n\t\t\t\t\tmapRef.current.map\n\t\t\t\t\t\t?.getLayer(layer.id)\n\t\t\t\t\t\t?.setLayoutProperty('visibility', layer.visible ? 'visible' : 'none');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}, [mapState.layers, props.mapId, props.active]);\n\n\tuseEffect(() => {\n\t\tif (!map) return;\n\t\tif (!mapState.layers) return;\n\n\t\tif (!props.active) {\n\t\t\tmap.cleanup(componentId.current);\n\t\t}\n\t}, [props.active, map, mapState.layers]);\n\n\t//ist .current?.map. richtig?\n\n\tconst refreshMapState = () => {\n\t\tmapStateRef.current.lat = mapRef.current?.map.getCenter().lat;\n\t\tmapStateRef.current.lng = mapRef.current?.map.getCenter().lng;\n\t\tmapStateRef.current.zoom = mapRef.current?.map.getZoom();\n\t\tmapStateRef.current.bearing = mapRef.current?.map.getBearing();\n\t\tmapStateRef.current.pitch = mapRef.current?.map.getPitch();\n\t};\n\n\tconst restoreViewportState = () => {\n\t\tif (!restoredStatesRef.current.viewport.center) {\n\t\t\trestoredStatesRef.current.viewport.center = true;\n\n\t\t\tif (mapStateRef.current.lng && mapStateRef.current.lat) {\n\t\t\t\tmapRef.current?.map.setCenter([mapStateRef.current.lng, mapStateRef.current.lat]);\n\t\t\t}\n\t\t\tif (mapStateRef.current.zoom) {\n\t\t\t\tmapRef.current?.map.setZoom(mapStateRef.current.zoom);\n\t\t\t}\n\t\t\tif (mapStateRef.current.bearing) {\n\t\t\t\tmapRef.current?.map.setBearing(mapStateRef.current.bearing);\n\t\t\t}\n\t\t\tif (mapStateRef.current.pitch) {\n\t\t\t\tmapRef.current?.map.setPitch(mapStateRef.current.pitch);\n\t\t\t}\n\t\t}\n\n\t\tallStatesRestoredRef.current = true;\n\t};\n\n\twindow.onpopstate = (event) => {\n\t\tif (event.state && event.state.lng && event.state.lat && event.state.zoom) {\n\t\t\tmapRef.current?.map.easeTo({\n\t\t\t\t// so möglich?\n\t\t\t\tzoom: event.state.zoom,\n\t\t\t\tcenter: [event.state.lng, event.state.lat],\n\t\t\t});\n\t\t}\n\t};\n\n\treturn <></>;\n};;\n\nMlShareMapState.defaultProps = {\n\tmapId: undefined,\n};\n\nMlShareMapState.propTypes = {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId: PropTypes.string,\n};\nexport default MlShareMapState;\n","import { distance, lineOffset } from '@turf/turf';\nimport { polygon, lineString, featureCollection} from '@turf/helpers';\nimport { GeoJSONFeature } from 'maplibre-gl';\n\ninterface geometry{\ncoordinates: Array<number>\n}\ninterface line {\ngeometry: geometry\n}\ninterface _geojsonInfo {\nline: line, \nmin: number\n}\n\n\n\nexport default function getElevationData(_geojsonInfo: _geojsonInfo, elevationFactor: number) {\n\n const createStep = (x: number, y: number, z: number, x2: number, y2: number) => {\n //const summand = 0.0002;\n const line = lineString([\n [x, y],\n [x2, y2],\n ]);\n const offsetLine = lineOffset(line, 5, { units: 'meters' });\n const x3 = offsetLine.geometry.coordinates[0][0];\n const y3 = offsetLine.geometry.coordinates[0][1];\n const x4 = offsetLine.geometry.coordinates[1][0];\n const y4 = offsetLine.geometry.coordinates[1][1];\n \n return polygon(\n [\n [\n [x, y],\n [x2, y2],\n \n [x4, y4],\n [x3, y3],\n [x, y],\n ],\n ],\n { height: z * elevationFactor }\n );\n };\n \n const lerp = (x: number, y: number, a: number) => x * (1 - a) + y * a;\n\t\tconst points: GeoJSONFeature[] = [];\n\n\t\t_geojsonInfo.line.geometry.coordinates.forEach((coordinate: number, index: number) => {\n\t\t\t//const point = createPoint(coordinate[0],coordinate[1],coordinate[2]-min);\n\t\t\t//points.push(point);\n\t\t\tif (_geojsonInfo.line.geometry.coordinates[index + 1]) {\n\t\t\t\tconst wayLength = distance(\n\t\t\t\t\t[coordinate[0], coordinate[1]],\n\t\t\t\t\t[\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][0],\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][1],\n\t\t\t\t\t],\n\t\t\t\t\t{ units: 'kilometers' }\n\t\t\t\t);\n\t\t\t\tlet listLength = ~~((wayLength * 1000) / 10);\n\t\t\t\tlistLength = listLength < 1 ? 1 : listLength;\n\t\t\t\tfor (let i = 0; i < listLength; i++) {\n\t\t\t\t\tconst x = lerp(\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index][0],\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][0],\n\t\t\t\t\t\ti / listLength\n\t\t\t\t\t);\n\t\t\t\t\tconst y = lerp(\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index][1],\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][1],\n\t\t\t\t\t\ti / listLength\n\t\t\t\t\t);\n\t\t\t\t\tconst z = lerp(\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index][2] - _geojsonInfo.min,\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][2] - _geojsonInfo.min,\n\t\t\t\t\t\ti / listLength\n\t\t\t\t\t);\n\n\t\t\t\t\tconst x2 = lerp(\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index][0],\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][0],\n\t\t\t\t\t\t(i + 1) / listLength\n\t\t\t\t\t);\n\t\t\t\t\tconst y2 = lerp(\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index][1],\n\t\t\t\t\t\t_geojsonInfo.line.geometry.coordinates[index + 1][1],\n\t\t\t\t\t\t(i + 1) / listLength\n\t\t\t\t\t);\n\n\t\t\t\t\tconst point = createStep(x, y, z, x2, y2);\n\t\t\t\t\tpoints.push(point as unknown as GeoJSONFeature);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tconst output = featureCollection(points);\n\n\t\treturn output;\n \n}\n\n","import React, { useRef, useMemo } from 'react';\nimport { featureCollection } from '@turf/helpers';\nimport { Feature, FeatureCollection } from '@turf/turf';\nimport { v4 as uuidv4 } from 'uuid';\nimport useSource from '../../hooks/useSource';\nimport useLayer from '../../hooks/useLayer';\nimport getElevationData from './util/getElevationData';\nimport { Coordinates, DataDrivenPropertyValueSpecification } from 'maplibre-gl';\n\nconst defaultFillExtrusionColor: (string | number | string[])[] = [\n\t'interpolate',\n\t['linear'],\n\t['get', 'height'],\n\t0,\n\t'rgba(0, 0, 255, 0)',\n\t0.1,\n\t'royalblue',\n\t0.3,\n\t'cyan',\n\t0.5,\n\t'lime',\n\t0.7,\n\t'yellow',\n\t1,\n\t'yellow',\n];\n/**\n * MlSpatialElevationProfile returns a Button that will add a standard OSM tile layer to the maplibre-gl instance.\n *\n * @component\n */\n\ninterface geojson {\n\tfeatures: Feature | FeatureCollection | undefined;\n}\n\nexport interface MlSpatialElevationProfileProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * GeoJSON data that is supposed to be rendered by this component.\n\t */\n\t//geojson: {features: Feature | FeatureCollection | undefined };\n\tgeojson: geojson | FeatureCollection | undefined;\n\t/**\n\t * Prefix of the component id this component uses when adding elements to the MapLibreGl-instance\n\t */\n\tidPrefix?: string;\n\t/**\n\t * Number describes the factor of the height of the elevation\n\t */\n\televationFactor?: number;\n\t/**\n\t * The layerId of an existing layer this layer should be rendered visually beneath\n\t * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see \"beforeId\" property\n\t */\n\tinsertBeforeLayer?: string;\n}\n\nconst MlSpatialElevationProfile = (props: MlSpatialElevationProfileProps) => {\n\tconst sourceName = useRef('elevationprofile-' + uuidv4());\n\tconst layerName = useRef('elevationprofile-layer-' + uuidv4());\n\tconst elevationFactor =\n\t\tprops.elevationFactor || MlSpatialElevationProfile.defaultProps.elevationFactor;\n\n\tconst _geojsonInfo = useMemo(() => {\n\t\tif (!props?.geojson?.features) return;\n\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t// @ts-ignore\n\t\tconst line = props.geojson.features?.find((element: Feature) => {\n\t\t\treturn element.geometry.type === 'LineString';\n\t\t});\n\n\t\tif (!line || !line.geometry) return;\n\n\t\tconst heights = line.geometry.coordinates.map((coordinate: Coordinates) => {\n\t\t\treturn coordinate[2];\n\t\t});\n\n\t\tconst min = Math.min(...heights);\n\n\t\tlet max = Math.max(...heights) - min;\n\n\t\tmax = max === 0 ? 1 : max;\n\n\t\treturn { max, min, line };\n\t}, [props.geojson]);\n\n\tconst _fillExtrusionColor: (string | number | string[])[] = useMemo(() => {\n\t\tif (!_geojsonInfo) return defaultFillExtrusionColor;\n\n\t\treturn [\n\t\t\t'interpolate',\n\t\t\t['linear'],\n\t\t\t['get', 'height'],\n\t\t\t0,\n\t\t\t'rgb(0,255,55)',\n\t\t\t_geojsonInfo.max * elevationFactor,\n\t\t\t'rgb(255,0,0)',\n\t\t];\n\t}, [_geojsonInfo, props.elevationFactor]);\n\n\tconst _geojson = useMemo(() => {\n\t\tif (!props.geojson?.features || !_geojsonInfo) return;\n\n\t\tconst newData = getElevationData(_geojsonInfo, elevationFactor);\n\t\treturn newData;\n\t}, [_geojsonInfo, elevationFactor]);\n\n\tuseSource({\n\t\tmapId: props.mapId,\n\t\tsourceId: sourceName.current,\n\t\tsource: {\n\t\t\ttype: 'geojson',\n\t\t\tdata: _geojson || featureCollection([]),\n\t\t},\n\t});\n\n\tuseLayer({\n\t\tlayerId: layerName.current,\n\t\tsource: sourceName.current,\n\n\t\toptions: {\n\t\t\ttype: 'fill-extrusion',\n\t\t\tpaint: {\n\t\t\t\t'fill-extrusion-height': ['get', 'height'],\n\t\t\t\t'fill-extrusion-opacity': 0.9,\n\t\t\t\t'fill-extrusion-color': (_fillExtrusionColor || defaultFillExtrusionColor) as (DataDrivenPropertyValueSpecification<string>),\n\t\t\t},\n\t\t},\n\t\tinsertBeforeLayer: props.insertBeforeLayer,\n\t});\n\n\treturn <></>;\n};\n\nMlSpatialElevationProfile.defaultProps = {\n\televationFactor: 1,\n};\n\nexport default MlSpatialElevationProfile;\n","import React, { useRef, useEffect, useCallback } from 'react';\nimport useMap from '../../hooks/useMap';\nimport { LayerSpecification } from 'maplibre-gl';\nimport { VectorSourceSpecification } from 'maplibre-gl';\n\nexport type MlVectorTileLayerProps = {\n\tmapId?: string;\n\tinsertBeforeLayer?: string;\n\tlayerId?: string;\n\tsourceOptions?: VectorSourceSpecification;\n\turl?: string;\n\tlayers: LayerSpecification[];\n}\n\n/**\n * Adds a vector-tile source and 0...n vector-tile-layers to the MapLibre instance referenced by\n * props.mapId\n *\n * @component\n */\nconst MlVectorTileLayer = (props: MlVectorTileLayerProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst layerId = useRef(props.layerId || 'MlVectorTileLayer-' + mapHook.componentId);\n\tconst layerPaintConfsRef = useRef({});\n\tconst layerLayoutConfsRef = useRef({});\n\tconst initializedRef = useRef(false);\n\n\tconst createLayers = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tinitializedRef.current = true;\n\n\t\tif (mapHook.map.map.getSource(layerId.current)) {\n\t\t\tmapHook.cleanup();\n\t\t}\n\n\t\t// Add the new layer to the maplibre instance once it is available\n\t\tmapHook.map.addSource(\n\t\t\tlayerId.current,\n\t\t\t{\n\t\t\t\ttype: 'vector',\n\t\t\t\ttiles: [props.url || ''],\n\t\t\t\tattribution: '',\n\t\t\t\tminzoom: 0,\n\t\t\t\tmaxzoom: 14,\n\t\t\t\t...props.sourceOptions,\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\n\t\tprops.layers.forEach((layer) => {\n\t\t\tif (!mapHook.map) return;\n\t\t\tmapHook.map.addLayer(\n\t\t\t\t{\n\t\t\t\t\tsource: layerId.current,\n\t\t\t\t\tminzoom: 0,\n\t\t\t\t\tmaxzoom: 22,\n\t\t\t\t\tlayout: {},\n\t\t\t\t\tpaint: {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t'line-opacity': 0.5,\n\t\t\t\t\t\t'line-color': 'rgb(80, 80, 80)',\n\t\t\t\t\t\t'line-width': 2,\n\t\t\t\t\t},\n\t\t\t\t\t...layer,\n\t\t\t\t},\n\t\t\t\tprops.insertBeforeLayer,\n\t\t\t\tmapHook.componentId\n\t\t\t);\n\t\t\tlayerPaintConfsRef.current[layer.id] = JSON.stringify(layer.paint);\n\t\t\tlayerLayoutConfsRef.current[layer.id] = JSON.stringify(layer.layout);\n\n\t\t\t// recreate layer if style has changed\n\t\t\tmapHook.map.on(\n\t\t\t\t'styledata',\n\t\t\t\t() => {\n\t\t\t\t\tif (initializedRef.current && !mapHook.map?.map.getSource(layerId.current)) {\n\t\t\t\t\t\tconsole.log('Recreate Layer ' + layerId.current);\n\t\t\t\t\t\tcreateLayers();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tmapHook.componentId\n\t\t\t);\n\t\t});\n\t}, [mapHook.map, props]);\n\n\tconst updateLayers = useCallback(() => {\n\t\tif (!initializedRef.current) return;\n\n\t\tprops.layers.forEach((layer) => {\n\t\t\tif (!mapHook.map) return;\n\t\t\tif (mapHook.map.map.getLayer(layer.id)) {\n\t\t\t\t// update changed paint property\n\t\t\t\tconst layerPaintConfString = JSON.stringify(layer.paint);\n\n\t\t\t\tif (layerPaintConfString !== layerPaintConfsRef.current[layer.id]) {\n\t\t\t\t\tfor (const paintKey in layer.paint) {\n\t\t\t\t\t\tmapHook.map.map.setPaintProperty(layer.id, paintKey, layer.paint[paintKey]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlayerPaintConfsRef.current[layer.id] = layerPaintConfString;\n\n\t\t\t\t// update changed layout property\n\t\t\t\tconst layerLayoutConfString = JSON.stringify(layer.layout);\n\n\t\t\t\tif (layerLayoutConfString !== layerLayoutConfsRef.current[layer.id]) {\n\t\t\t\t\tfor (const layoutKey in layer.layout) {\n\t\t\t\t\t\tmapHook.map.map.setLayoutProperty(layer.id, layoutKey, layer.layout[layoutKey]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlayerLayoutConfsRef.current[layer.id] = layerLayoutConfString;\n\t\t\t}\n\t\t});\n\t}, [mapHook.map, props.layers]);\n\n\t// initial layer creation\n\tuseEffect(() => {\n\t\tif (initializedRef.current) return;\n\t\tcreateLayers();\n\t}, [createLayers]);\n\n\t// if layers get removed or added\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !initializedRef.current) return;\n\t\tcreateLayers();\n\t}, [props.layers.length, mapHook.map]);\n\n\t// on layout/paint update\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !initializedRef.current) return;\n\t\tupdateLayers();\n\t}, [props.layers, mapHook.map]);\n\n\treturn <></>;\n};\n\nexport default MlVectorTileLayer;\n","import React, { useRef, useEffect, useContext } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport MapContext from \"../../contexts/MapContext\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n/**\n * TODO: Add short & useful description\n *\n * @param {object} props\n * @param {string} props.mapId Id of the target MapLibre instance in mapContext\n *\n * @component\n */\nconst MlWmsFeatureInfoPopup = (props) => {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tconst mapContext = useContext(MapContext);\n\n\tconst initializedRef = useRef(false);\n\tconst mapRef = useRef(undefined);\n\tconst componentId = useRef((props.idPrefix ? props.idPrefix : \"MlWmsFeatureInfoPopup-\") + uuidv4());\n\n\tuseEffect(() => {\n\t\tlet _componentId = componentId.current;\n\n\t\treturn () => {\n\t\t\t// This is the cleanup function, it is called when this react component is removed from react-dom\n\t\t\t// try to remove anything this component has added to the MapLibre-gl instance\n\t\t\t// e.g.: remove the layer\n\t\t\t// mapContext.getMap(props.mapId).removeLayer(layerRef.current);\n\t\t\t// check for the existence of map.style before calling getLayer or getSource\n\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.cleanup(_componentId);\n\t\t\t\tmapRef.current = undefined;\n\t\t\t}\n\t\t\tinitializedRef.current = false;\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!mapContext.mapExists(props.mapId) || initializedRef.current) return;\n\t\t// the MapLibre-gl instance (mapContext.getMap(props.mapId)) is accessible here\n\t\t// initialize the layer and add it to the MapLibre-gl instance or do something else with it\n\t\tinitializedRef.current = true;\n\t\tmapRef.current = mapContext.getMap(props.mapId);\n\n\t\tmapRef.current.setCenter([7.132122000552613, 50.716405378037706]);\n\t}, [mapContext.mapIds, mapContext, props.mapId]);\n\n\treturn <></>;\n};\n\nMlWmsFeatureInfoPopup.defaultProps = {\n\tmapId: undefined,\n};\n\nMlWmsFeatureInfoPopup.propTypes = {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId: PropTypes.string,\n};\nexport default MlWmsFeatureInfoPopup;\n","import React, { useMemo, useRef, useEffect, useCallback } from 'react';\nimport useMap from '../../hooks/useMap';\n\nimport PropTypes from 'prop-types';\nimport { RasterLayerSpecification, RasterSourceSpecification } from 'maplibre-gl';\n\nconst defaultProps = {\n\tvisible: true,\n\turlParameters: {\n\t\tbbox: '{bbox-epsg-3857}',\n\t\tformat: 'image/png',\n\t\tservice: 'WMS',\n\t\tversion: '1.1.1',\n\t\trequest: 'GetMap',\n\t\tsrs: 'EPSG:3857',\n\t\twidth: 256,\n\t\theight: 256,\n\t\tstyles: '',\n\t},\n\tattribution: '',\n\tsourceOptions: {\n\t\tminZoom: 0,\n\t\tmaxZoom: 20,\n\t},\n\tlayerOptions: {\n\t\tminZoom: 0,\n\t\tmaxZoom: 20,\n\t},\n};\n\ninterface MlWmsLayerProps {\n\turlParameters?: { [key: string]: string };\n\turl: string;\n\tvisible?: boolean;\n\tattribution?: string;\n\tmapId?: string;\n\tsourceOptions?: RasterSourceSpecification;\n\tlayerOptions?: RasterLayerSpecification;\n\tinsertBeforeLayer?: string;\n\tlayerId?: string;\n}\n/**\n * Adds a WMS raster source & layer to the maplibre-gl instance\n *\n * @param {object} props\n * @param {object} props.urlParameters URL query parameters that will be added to the WMS URL. A layers property (string) is mandatory. Any value defined on this attribute will extend the default object\n * @param {string} props.url WMS URL\n * @param {bool}\t props.visible Sets layer \"visibility\" property to \"visible\" if true or \"none\" if false\n * @param {string} props.attribution MapLibre attribution shown in the bottom right of the map, if this layer is visible\n * @param {string} props.mapId Id of the target MapLibre instance in mapContext\n * @param {object} props.sourceOptions Object that is passed to the MapLibre.addSource call as config option parameter\n * @param {object} props.layerOptions Object that is passed to the MapLibre.addLayer call as config option parameter\n * @param {string} props.insertBeforeLayer Id of an existing layer in the mapLibre instance to help specify the layer order\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t This layer will be visually beneath the layer with the \"insertBeforeLayer\" id\n *\n * @component\n */\nconst MlWmsLayer = (props: MlWmsLayerProps) => {\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tconst initializedRef = useRef(false);\n\tconst layerId = useRef(props.layerId || 'MlWmsLayer-' + mapHook.componentId);\n\n\tconst tileUrl = useMemo(() => {\n\t\tlet _propsUrlParams;\n\t\tlet _wmsUrl = props.url;\n\t\tif (props.url.indexOf('?') !== -1) {\n\t\t\t_propsUrlParams = props.url.split('?');\n\t\t\t_wmsUrl = _propsUrlParams[0];\n\t\t}\n\t\tconst _urlParamsFromUrl = new URLSearchParams(_propsUrlParams?.[1]);\n\t\t// first spread in default props manually to enable overriding a single parameter without replacing the whole default urlParameters object\n\t\tconst urlParamsObj = {\n\t\t\t...defaultProps.urlParameters,\n\t\t\t...Object.fromEntries(_urlParamsFromUrl),\n\t\t\t...props.urlParameters,\n\t\t};\n\t\tconst urlParams = new URLSearchParams(urlParamsObj as unknown as Record<string, string>);\n\t\tconst urlParamsStr =\n\t\t\tdecodeURIComponent(urlParams.toString()) + ''.replace(/%2F/g, '/').replace(/%3A/g, ':');\n\n\t\treturn _wmsUrl + '?' + urlParamsStr;\n\t}, [props.urlParameters, props.url]);\n\n\tconst createLayer = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\n\t\tinitializedRef.current = true;\n\n\t\tif (mapHook.map.map.getLayer(layerId.current)) {\n\t\t\tmapHook.cleanup();\n\t\t}\n\n\t\tmapHook.map.addSource(\n\t\t\tlayerId.current,\n\t\t\t{\n\t\t\t\ttype: 'raster',\n\t\t\t\ttiles: [tileUrl],\n\t\t\t\ttileSize: 256,\n\t\t\t\tattribution: props.attribution,\n\t\t\t\t...props.sourceOptions,\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\n\t\tmapHook.map.addLayer(\n\t\t\t{\n\t\t\t\tid: layerId.current,\n\t\t\t\ttype: 'raster',\n\t\t\t\tsource: layerId.current,\n\t\t\t\t...props.layerOptions,\n\t\t\t},\n\t\t\tprops.insertBeforeLayer,\n\t\t\tmapHook.componentId\n\t\t);\n\n\t\t// recreate layer if map style.json has changed\n\t\tmapHook.map.on(\n\t\t\t'styledata',\n\t\t\t() => {\n\t\t\t\tif (initializedRef.current && !mapHook.map?.map.getLayer(layerId.current)) {\n\t\t\t\t\tconsole.log('Recreate Layer ' + layerId.current);\n\t\t\t\t\tcreateLayer();\n\t\t\t\t}\n\t\t\t},\n\t\t\tmapHook.componentId\n\t\t);\n\t\tif (!props.visible) {\n\t\t\tmapHook.map.map.setLayoutProperty(layerId.current, 'visibility', 'none');\n\t\t}\n\t}, [mapHook.map, props, tileUrl]);\n\n\tuseEffect(() => {\n\t\tif (initializedRef.current) return;\n\n\t\tcreateLayer();\n\t}, [createLayer]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !mapHook.map?.map?.style?.sourceCaches?.[layerId.current] || !initializedRef.current) return;\n\n\t\tconst source = mapHook.map.map.getSource(layerId.current) as RasterSourceSpecification;\n\t\tsource.tiles = [tileUrl];\n\n\t\tmapHook.map.map.style.sourceCaches[layerId.current].clearTiles();\n\n\t\tmapHook.map.map.style.sourceCaches[layerId.current].update(mapHook.map.map.transform);\n\n\t\tmapHook.map.map.triggerRepaint();\n\t}, [mapHook.map, tileUrl]);\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !initializedRef.current) return;\n\n\t\t// toggle layer visibility by changing the layout object's visibility property\n\t\tif (props.visible) {\n\t\t\tmapHook.map.map.setLayoutProperty(layerId.current, 'visibility', 'visible');\n\t\t} else {\n\t\t\tmapHook.map.map.setLayoutProperty(layerId.current, 'visibility', 'none');\n\t\t}\n\t}, [props.visible, mapHook.map]);\n\n\treturn <></>;\n};\n\nMlWmsLayer.defaultProps = {\n\t...defaultProps,\n};\n\nMlWmsLayer.propTypes = {\n\t/**\n\t * WMS URL\n\t */\n\turl: PropTypes.string.isRequired,\n\t/**\n\t * URL query parameters that will be added to the WMS URL. A layers property (string) is mandatory. Any value defined on this attribute will extend the default object.\n\t */\n\turlParameters: PropTypes.shape({\n\t\tlayers: PropTypes.string.isRequired,\n\t\tbbox: PropTypes.string,\n\t\tformat: PropTypes.string,\n\t\tservice: PropTypes.string,\n\t\tversion: PropTypes.string,\n\t\trequest: PropTypes.string,\n\t\tsrs: PropTypes.string,\n\t\twidth: PropTypes.number,\n\t\theight: PropTypes.number,\n\t}),\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId: PropTypes.string,\n\t/**\n\t * MapLibre attribution shown in the bottom right of the map, if this layer is visible\n\t */\n\tattribution: PropTypes.string,\n\t/**\n\t * Object that is passed to the MapLibre.addLayer call as config option parameter\n\t */\n\tlayerOptions: PropTypes.object,\n\t/**\n\t * Object that is passed to the MapLibre.addSource call as config option parameter\n\t */\n\tsourceOptions: PropTypes.object,\n\t/**\n\t * Id of an existing layer in the mapLibre instance to help specify the layer order\n\t * This layer will be visually beneath the layer with the \"insertBeforeLayer\" id.\n\t */\n\tinsertBeforeLayer: PropTypes.string,\n\t/**\n\t * Sets layer \"visibility\" property to \"visible\" if true or \"none\" if false\n\t */\n\tvisible: PropTypes.bool,\n};\nexport default MlWmsLayer;\n","import { useState, useEffect } from \"react\";\nimport WMSCapabilities, { WMSCapabilitiesJSON } from \"wms-capabilities\";\n\nexport interface useWmsProps{\n\turl?:string;\n\turlParameters?:{[key: string]: string};\n}\n\nexport interface useWmsReturnType{\n\t\tcapabilities:WMSCapabilitiesJSON | null | undefined;\n\t\tgetFeatureInfoUrl:string | undefined;\n\t\twmsUrl:string | undefined;\n\t\terror:string | undefined;\n\t\tsetUrl:(value:string|undefined) => void;\n}\n\nfunction useWms(props:useWmsProps):useWmsReturnType {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tconst [getFeatureInfoUrl, setGetFeatureInfoUrl] = useState<string>();\n\tconst [url, setUrl] = useState(props.url);\n\tconst [wmsUrl, setWmsUrl] = useState(\"\");\n\tconst [capabilities, setCapabilities] = useState<WMSCapabilitiesJSON | null | undefined>();\n\tconst [error, setError] = useState();\n\n\tconst clearState = () => {\n\t\tsetGetFeatureInfoUrl(undefined);\n\t\tsetCapabilities(undefined);\n\t\t//setLayers([]);\n\t\tsetWmsUrl(\"\");\n\t};\n\n\tuseEffect(() => {\n\t\t// extract URL parameters from the given URL\n\t\tclearState();\n\t\tsetError(undefined);\n\n\t\tif (!url) return;\n\n\t\tlet _propsUrlParams;\n\t\tlet _wmsUrl = url;\n\t\tif (url.indexOf(\"?\") !== -1) {\n\t\t\t_propsUrlParams = url.split(\"?\");\n\t\t\t_wmsUrl = _propsUrlParams[0];\n\t\t}\n\t\tconst _urlParamsFromUrl = new URLSearchParams(_propsUrlParams?.[1]);\n\n\t\tconst urlParamsObj = {\n\t\t\t...Object.fromEntries(_urlParamsFromUrl),\n\t\t\t...props.urlParameters,\n\t\t};\n\t\t// create URLSearchParams object to assemble the URL Parameters\n\t\tconst urlParams = new URLSearchParams(urlParamsObj);\n\n\t\tconst urlParamsStr =\n\t\t\tdecodeURIComponent(urlParams.toString()) + \"\".replace(/%2F/g, \"/\").replace(/%3A/g, \":\");\n\n\t\tfetch(_wmsUrl + \"?\" + urlParamsStr)\n\t\t\t.then((res) => {\n\t\t\t\tif (!res.ok) {\n\t\t\t\t\tthrow Error(res.statusText + \" (\" + res.status + \" - \" + res.type + \")\");\n\t\t\t\t} else {\n\t\t\t\t\treturn res.text();\n\t\t\t\t}\n\t\t\t})\n\t\t\t.then((data:string) => {\n\t\t\t\tsetCapabilities(new WMSCapabilities(data, window.DOMParser).toJSON());\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\t//reset local state\n\t\t\t\tclearState();\n\t\t\t\tconsole.log(error);\n\t\t\t\tsetError(error.message);\n\t\t\t});\n\t}, [url, props.urlParameters]);\n\n\tuseEffect(() => {\n\t\tif (!capabilities?.Service) return;\n\n\t\tsetWmsUrl(capabilities.Capability?.Request?.GetMap?.DCPType?.[0]?.HTTP?.Get?.OnlineResource);\n\t\t// set getFeatureInfo url\n\t\tsetGetFeatureInfoUrl(\n\t\t\tcapabilities.Capability?.Request?.GetFeatureInfo?.DCPType?.[0]?.HTTP?.Get?.OnlineResource\n\t\t);\n\t}, [capabilities]);\n\n\treturn {\n\t\tcapabilities,\n\t\tgetFeatureInfoUrl,\n\t\twmsUrl,\n\t\terror,\n\t\tsetUrl,\n\t};\n}\n\nuseWms.defaultProps = {\n\turl: \"\",\n\turlParameters: {\n\t\tSERVICE: \"WMS\",\n\t\tVERSION: \"1.3.0\",\n\t\tREQUEST: \"GetCapabilities\",\n\t},\n};\n\nexport default useWms;\n","import React, { useRef, useEffect, useContext, useCallback, useState, useMemo } from 'react';\n\nimport MapContext, { MapContextType } from '../../contexts/MapContext';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport MlWmsLayer from '../MlWmsLayer/MlWmsLayer';\nimport MlMarker from '../MlMarker/MlMarker';\nimport useWms, { useWmsProps } from '../../hooks/useWms';\n\nimport VisibilityIcon from '@mui/icons-material/Visibility';\nimport VisibilityOffIcon from '@mui/icons-material/VisibilityOff';\nimport List from '@mui/material/List';\nimport ListItem from '@mui/material/ListItem';\nimport ListItemText from '@mui/material/ListItemText';\nimport IconButton from '@mui/material/IconButton';\nimport { LngLat, MapMouseEvent } from 'maplibre-gl';\nimport MapLibreGlWrapper from '../MapLibreMap/lib/MapLibreGlWrapper';\nimport { Layer2, Layer3 } from 'wms-capabilities';\nimport { useWmsReturnType } from '../../hooks/useWms';\n\nconst originShift = (2 * Math.PI * 6378137) / 2.0;\nconst lngLatToMeters = function (lnglat: LngLat, accuracy = { enable: true, decimal: 1 }) {\n\tconst lng = lnglat.lng;\n\tconst lat = lnglat.lat;\n\tlet x = (lng * originShift) / 180.0;\n\tlet y = Math.log(Math.tan(((90 + lat) * Math.PI) / 360.0)) / (Math.PI / 180.0);\n\ty = (y * originShift) / 180.0;\n\tif (accuracy.enable) {\n\t\tx = Number(x.toFixed(accuracy.decimal));\n\t\ty = Number(y.toFixed(accuracy.decimal));\n\t}\n\treturn [x, y];\n};\n\nexport interface MlWmsLoaderProps {\n\t/**\n\t * WMS URL\n\t */\n\turl: string;\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId: string;\n\t/**\n\t * URL parameters that will be used in the getCapabilities request\n\t */\n\turlParameters?: useWmsProps['urlParameters'];\n\t/**\n\t * URL parameters that will be added when requesting WMS capabilities\n\t */\n\twmsUrlParameters?: { [key: string]: string };\n\tlngLat?: LngLat;\n\tidPrefix?: string;\n}\n\nexport type LayerType = {\n\tvisible: boolean;\n\tName: string;\n\tAttribution?: { Title: string };\n} & Omit<Layer2, 'Layer'> &\n\tPartial<Pick<Layer2, 'Layer'>>;\n/**\n * Loads a WMS getCapabilities xml document and adds a MlWmsLayer component for each layer that is\n * offered by the WMS.\n *\n * TODO: EaseTo the extend offered by the WMS in a zoom level that is supported\n *\n * @component\n */\nconst MlWmsLoader = (props: MlWmsLoaderProps) => {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\tconst mapContext: MapContextType = useContext(MapContext);\n\tconst { capabilities, error, setUrl, getFeatureInfoUrl, wmsUrl }: useWmsReturnType = useWms({\n\t\turlParameters: props.urlParameters,\n\t});\n\n\tconst initializedRef = useRef(false);\n\tconst mapRef = useRef<MapLibreGlWrapper>();\n\tconst componentId = useRef((props.idPrefix ? props.idPrefix : 'MlWmsLoader-') + uuidv4());\n\tconst [layers, setLayers] = useState<Array<LayerType>>([]);\n\n\tconst [featureInfoLngLat, setFeatureInfoLngLat] = useState<\n\t\t{ lng: number; lat: number } | undefined\n\t>();\n\tconst [featureInfoContent, setFeatureInfoContent] = useState<string | undefined>(undefined);\n\n\tuseEffect(() => {\n\t\tconst _componentId = componentId.current;\n\n\t\treturn () => {\n\t\t\t// This is the cleanup function, it is called when this react component is removed from react-dom\n\t\t\t// try to remove anything this component has added to the MapLibre-gl instance\n\t\t\t// e.g.: remove the layer\n\t\t\t// mapContext.getMap(props.mapId).removeLayer(layerRef.current);\n\t\t\t// check for the existence of map.style before calling getLayer or getSource\n\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.cleanup(_componentId);\n\t\t\t\tmapRef.current = undefined;\n\t\t\t}\n\t\t\tinitializedRef.current = false;\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!initializedRef.current) return;\n\n\t\tsetUrl(props.url);\n\t}, [props.url]);\n\n\tconst attribution = useMemo(() => {\n\t\treturn layers\n\t\t\t.filter((el) => el.visible && el?.Attribution?.Title)\n\t\t\t.map((el) => el?.Attribution?.Title)\n\t\t\t.filter((value, index, self) => self.indexOf(value) === index)\n\t\t\t.join(' ');\n\t}, [layers]);\n\n\tconst getFeatureInfo = useCallback(\n\t\t// eslint-disable-next-line @typescript-eslint/ban-types\n\t\t(ev:(MapMouseEvent & Object)) => {\n\t\t\tif (!mapRef.current) return;\n\t\t\tsetFeatureInfoLngLat(undefined);\n\t\t\tsetFeatureInfoContent(undefined);\n\t\t\tconst _bounds = mapRef.current.map.getBounds();\n\t\t\tconst _sw = lngLatToMeters(_bounds._sw);\n\t\t\tconst _ne = lngLatToMeters(_bounds._ne);\n\t\t\tconst bbox = [_sw[0], _sw[1], _ne[0], _ne[1]];\n\t\t\tconst _getFeatureInfoUrlParams = {\n\t\t\t\tREQUEST: 'GetFeatureInfo',\n\n\t\t\t\tBBOX: bbox.join(','),\n\t\t\t\tSERVICE: 'WMS',\n\t\t\t\tINFO_FORMAT:\n\t\t\t\t\tcapabilities?.Capability?.Request?.GetFeatureInfo.Format.indexOf('text/html') !== -1\n\t\t\t\t\t\t? 'text/html'\n\t\t\t\t\t\t: 'text/plain',\n\t\t\t\tFEATURE_COUNT: '10',\n\t\t\t\tLAYERS: layers\n\t\t\t\t\t.map((layer: LayerType) => (layer.visible && layer.queryable ? layer.Title : undefined))\n\t\t\t\t\t.filter((n) => n),\n\t\t\t\tQUERY_LAYERS: layers\n\t\t\t\t\t.map((layer: LayerType) => (layer.visible && layer.queryable ? layer.Title : undefined))\n\t\t\t\t\t.filter((n) => n),\n\t\t\t\tWIDTH: mapRef.current?.map._container.clientWidth,\n\t\t\t\tHEIGHT: mapRef.current?.map._container.clientHeight,\n\t\t\t\tsrs: 'EPSG:3857',\n\t\t\t\tCRS: 'EPSG:3857',\n\t\t\t\tversion: '1.3.0',\n\t\t\t\tX: ev.point.x,\n\t\t\t\tY: ev.point.y,\n\t\t\t\tI: ev.point.x,\n\t\t\t\tJ: ev.point.y,\n\t\t\t\tbuffer: '50',\n\t\t\t};\n\n\t\t\tlet _gfiUrl: string | undefined = getFeatureInfoUrl;\n\t\t\tlet _gfiUrlParts;\n\t\t\tif (_gfiUrl?.indexOf?.('?') !== -1) {\n\t\t\t\t_gfiUrlParts = props.url.split('?');\n\t\t\t\t_gfiUrl = _gfiUrlParts[0];\n\t\t\t}\n\t\t\tconst _urlParamsFromUrl = new URLSearchParams(_gfiUrlParts?.[1]);\n\n\t\t\tconst urlParamsObj = {\n\t\t\t\t...Object.fromEntries(_urlParamsFromUrl),\n\t\t\t\t..._getFeatureInfoUrlParams,\n\t\t\t};\n\t\t\t// create URLSearchParams object to assemble the URL Parameters\n\t\t\t// \"as any\" can be removed once the URLSearchParams ts spec is fixed\n\t\t\tconst urlParams = new URLSearchParams(urlParamsObj as unknown as Record<string, string>);\n\n\t\t\tfetch(props.url + '?' + urlParams.toString())\n\t\t\t\t.then((res) => {\n\t\t\t\t\tif (!res.ok) {\n\t\t\t\t\t\tthrow new Error('FeatureInfo could not be fetched');\n\t\t\t\t\t}\n\t\t\t\t\treturn res.text();\n\t\t\t\t})\n\t\t\t\t.then((text) => {\n\t\t\t\t\tsetFeatureInfoLngLat(ev.lngLat);\n\t\t\t\t\tsetFeatureInfoContent(text);\n\t\t\t\t})\n\t\t\t\t.catch((error) => console.log(error));\n\t\t},\n\t\t[capabilities, getFeatureInfoUrl]\n\t);\n\n\tuseEffect(() => {\n\t\tif (!mapRef.current) return;\n\n\t\tconst _getFeatureInfo = getFeatureInfo;\n\n\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t// @ts-ignore: ts appears not to consider overloads\n\t\tmapRef.current.map.on('click', _getFeatureInfo, componentId.current);\n\t\treturn () => {\n\t\t\tmapRef.current?.map.off?.('click', _getFeatureInfo);\n\t\t};\n\t}, [getFeatureInfo]);\n\n\tuseEffect(() => {\n\t\tif (!capabilities?.Service) return;\n\n\t\tif (capabilities?.Capability?.Layer?.CRS?.indexOf?.('EPSG:3857') === -1 && capabilities?.Capability?.Layer?.CRS?.indexOf?.('CRS:84') === -1) {\n\t\t\tconsole.log(\n\t\t\t\t'MlWmsLoader (' + capabilities.Service.Title + '): No WGS 84/Pseudo-Mercator support'\n\t\t\t);\n\t\t} else {\n\t\t\tconsole.log(\n\t\t\t\t'MlWmsLoader (' + capabilities.Service.Title + '): WGS 84/Pseudo-Mercator supported'\n\t\t\t);\n\n\t\t\tlet _LatLonBoundingBox: Array<number> = [];\n\n\t\t\t// collect aueriable Layer2 layers\n\t\t\tlet _layers: LayerType[] = capabilities?.Capability?.Layer?.Layer.filter(\n\t\t\t\t(el) => !el.Layer?.length\n\t\t\t).map((layer: Layer2 & { Name: string }, idx: number) => {\n\t\t\t\tif (idx === 0) {\n\t\t\t\t\t_LatLonBoundingBox = layer.EX_GeographicBoundingBox;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tvisible: capabilities?.Capability?.Layer?.Layer?.length > 2 ? idx > 1 : true,\n\t\t\t\t\tAttribution: { Title: '' },\n\t\t\t\t\t...layer,\n\t\t\t\t};\n\t\t\t});\n\n\t\t\t// collect aueriable Layer3 layers\n\t\t\tcapabilities?.Capability?.Layer?.Layer.forEach((el) => {\n\t\t\t\tconst tmpLayers = el?.Layer?.filter((el) => el.CRS.length).map(\n\t\t\t\t\t(layer: Layer3, idx: number) => {\n\t\t\t\t\t\tif (idx === 0) {\n\t\t\t\t\t\t\t_LatLonBoundingBox = layer.EX_GeographicBoundingBox;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tvisible: false,\n\t\t\t\t\t\t\tAttribution: { Title: '' },\n\t\t\t\t\t\t\t...layer,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif (tmpLayers) {\n\t\t\t\t\t_layers = [..._layers, ...tmpLayers];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tsetLayers(_layers);\n\n\t\t\t// zoom to extent of first layer\n\t\t\tif (mapRef.current && _LatLonBoundingBox.length > 3) {\n\t\t\t\tmapRef.current.map.fitBounds([\n\t\t\t\t\t[_LatLonBoundingBox[0], _LatLonBoundingBox[1]],\n\t\t\t\t\t[_LatLonBoundingBox[2], _LatLonBoundingBox[3]],\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}, [capabilities]);\n\n\tuseEffect(() => {\n\t\tif (!mapContext?.mapExists?.(props.mapId) || initializedRef.current) return;\n\t\t// the MapLibre-gl instance (mapContext.map) is accessible here\n\t\t// initialize the layer and add it to the MapLibre-gl instance or do something else with it\n\t\tinitializedRef.current = true;\n\t\tmapRef.current = mapContext.getMap(props.mapId);\n\t\tsetUrl(props.url);\n\t}, [mapContext.mapIds, mapContext, props.mapId, props.url]);\n\n\treturn (\n\t\t<>\n\t\t\t{error && <p>{error}</p>}\n\t\t\t<h3 key=\"title\">{capabilities?.Service?.Title}</h3>\n\t\t\t<List dense key=\"layers\">\n\t\t\t\t{wmsUrl &&\n\t\t\t\t\tlayers?.map?.((layer, idx) => {\n\t\t\t\t\t\treturn layer?.Name ? (\n\t\t\t\t\t\t\t<ListItem\n\t\t\t\t\t\t\t\tkey={layer.Name + idx}\n\t\t\t\t\t\t\t\tsecondaryAction={\n\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\tedge=\"end\"\n\t\t\t\t\t\t\t\t\t\taria-label=\"toggle visibility\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\tconst _layers: Array<LayerType> = [...layers];\n\t\t\t\t\t\t\t\t\t\t\t_layers[idx].visible = !_layers[idx].visible;\n\t\t\t\t\t\t\t\t\t\t\tsetLayers([..._layers]);\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{layers[idx].visible ? <VisibilityIcon /> : <VisibilityOffIcon />}\n\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ListItemText primary={layer?.Title} />\n\t\t\t\t\t\t\t</ListItem>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<></>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t</List>\n\t\t\t{wmsUrl && layers?.length && (\n\t\t\t\t<MlWmsLayer\n\t\t\t\t\tkey={componentId.current}\n\t\t\t\t\turl={wmsUrl}\n\t\t\t\t\tattribution={attribution}\n\t\t\t\t\turlParameters={{\n\t\t\t\t\t\t...props.wmsUrlParameters,\n\t\t\t\t\t\tlayers: layers\n\t\t\t\t\t\t\t?.filter?.((layer) => layer.visible)\n\t\t\t\t\t\t\t.map((el) => el.Name)\n\t\t\t\t\t\t\t.reverse()\n\t\t\t\t\t\t\t.join(','),\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t<p key=\"description\" style={{ fontSize: '.7em' }}>\n\t\t\t\t{capabilities?.Capability?.Layer?.['Abstract']}\n\t\t\t</p>\n\n\t\t\t{featureInfoLngLat && <MlMarker {...featureInfoLngLat} content={featureInfoContent} />}\n\t\t</>\n\t);\n};\n\nMlWmsLoader.defaultProps = {\n\turl: '',\n\turlParameters: {\n\t\tSERVICE: 'WMS',\n\t\tVERSION: '1.3.0',\n\t\tREQUEST: 'GetCapabilities',\n\t},\n\twmsUrlParameters: {\n\t\tTRANSPARENT: 'TRUE',\n\t},\n};\n\nexport default MlWmsLoader;\n","import React, { useEffect, useContext } from \"react\";\n\nimport MapContext from \"../contexts/MapContext\";\n\n/**\n * This component is deprecated and will be removed in the next major release\n */\nconst MlBasicComponent = (props) => {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\t// without the requirement of adding it to the dependency list (ignore the false eslint exhaustive deps warning)\n\t// const layerRef = useRef(null);\n\tconst mapContext = useContext(MapContext);\n\n\tuseEffect(() => {\n\t\tif (!mapContext.mapExists()) return;\n\t\treturn () => {\n\t\t\t// This is the cleanup function, it is called when this react component is removed from react-dom\n\t\t\t// try to remove anything this component has added to the MapLibre-gl instance\n\t\t\t// e.g.: remove the layer\n\t\t\t// mapContext.map.removeLayer(layerRef.current);\n\t\t\tif (typeof props.cleanup === \"function\") {\n\t\t\t\tprops.cleanup(mapContext.getMap(props.mapId));\n\t\t\t}\n\t\t};\n\t});\n\n\tuseEffect(() => {\n\t\tif (!mapContext.mapExists(props.mapId)) return;\n\t\t// the MapLibre-gl instance (mapContext.map) is accessible here\n\t\t// initialize the layer and add it to the MapLibre-gl instance\n\t\tif (typeof props.mapIsReady === \"function\") {\n\t\t\tprops.mapIsReady(mapContext.getMap(props.mapId));\n\t\t}\n\t}, [mapContext.mapIds, mapContext, props]);\n\n\treturn <></>;\n};\n\nexport default MlBasicComponent;\n","import { useEffect, useCallback, useRef } from 'react';\n\nimport * as turf from '@turf/turf';\nimport useMap from '../useMap';\nimport { LngLatBoundsLike, LngLatLike } from 'maplibre-gl';\n\ninterface useCameraFollowPathProps {\n\t/**\n\t * Id of the target MapLibre instance in mapContext\n\t */\n\tmapId?: string;\n\t/**\n\t * Id of an existing layer in the mapLibre instance to help specify the layer order\n\t * This layer will be visually beneath the layer with the \"insertBeforeLayer\" id.\n\t */\n\tinsertBeforeLayer?: string;\n\t/* pause is an useRef const and is triggerd in the storie */\n\tpause?: boolean;\n\t/* zoom is an useRef const and is triggerd in the storie */\n\tzoom?: number;\n\t/* pitch is an useRef const and is triggerd in the storie */\n\tpitch?: number;\n\t/* speed is an useRef const and is triggerd in the storie */\n\tspeed?: number;\n\t/* kmPerStep is an useRef const */\n\tkmPerStep?: number;\n\t/* route is a json file, which is defined loaded in the storie */\n\troute?: any;\n\t/* stepDuration is a const */\n\tstepDuration?: number;\n\t/* timeoutId is an useRef const */\n\ttimeoutId?: number;\n}\nexport type { useCameraFollowPathProps };\n\n/**\n * Component template\n *\n */\nconst useCameraFollowPath = (props: useCameraFollowPathProps) => {\n\t// Use a useRef hook to reference the layer object to be able to access it later inside useEffect hooks\n\t// without the requirement of adding it to the dependency list (ignore the false eslint exhaustive deps warning)\n\tconst initializedRef = useRef(false);\n\tconst pause = useRef<boolean | undefined>(props.pause);\n\tconst zoom = useRef<number | undefined>(props.zoom);\n\tconst pitch = useRef<number | undefined>(props.pitch);\n\tconst step = useRef(1);\n\tconst speed = useRef<number | undefined>(props.speed);\n\tconst timeoutId = useRef();\n\n\tconst kmPerStep = props.kmPerStep || 0.01;\n\tconst routeDistance = turf.lineDistance(props.route);\n\tconst stepDuration = props.stepDuration || 70;\n\n\tconst mapHook = useMap({\n\t\tmapId: props.mapId,\n\t\twaitForLayer: props.insertBeforeLayer,\n\t});\n\n\tuseEffect(() => {\n\t\tpause.current = props.pause;\n\t\tif (!pause.current) {\n\t\t\tplay();\n\t\t}\n\t}, [props.pause]);\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\t\tzoom.current = props.zoom;\n\t\tif (typeof zoom.current !== 'undefined' && mapHook.map.map.getZoom() !== zoom.current) {\n\t\t\tmapHook.map.map.setZoom(zoom.current);\n\t\t}\n\t}, [mapHook.map, props.zoom]);\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return;\n\t\tpitch.current = props.pitch;\n\t\tif (typeof pitch.current !== 'undefined' && pitch.current !== mapHook.map.map.getPitch()) {\n\t\t\tmapHook.map.map.setPitch(pitch.current);\n\t\t}\n\t}, [mapHook.map, props.pitch]);\n\tuseEffect(() => {\n\t\tspeed.current = props.speed;\n\t}, [props.speed]);\n\n\tconst disableInteractivity = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\t\tmapHook.map.map['scrollZoom'].disable();\n\t\tmapHook.map.map['boxZoom'].disable();\n\t\tmapHook.map.map['dragRotate'].disable();\n\t\tmapHook.map.map['dragPan'].disable();\n\t\tmapHook.map.map['keyboard'].disable();\n\t\tmapHook.map.map['doubleClickZoom'].disable();\n\t\tmapHook.map.map['touchZoomRotate'].disable();\n\t}, [mapHook.map]);\n\tconst enableInteractivity = useCallback(() => {\n\t\tif (!mapHook.map) return;\n\t\tmapHook.map.map['scrollZoom'].enable();\n\t\tmapHook.map.map['boxZoom'].enable();\n\t\tmapHook.map.map['dragRotate'].enable();\n\t\tmapHook.map.map['dragPan'].enable();\n\t\tmapHook.map.map['keyboard'].enable();\n\t\tmapHook.map.map['doubleClickZoom'].enable();\n\t\tmapHook.map.map['touchZoomRotate'].enable();\n\t}, [mapHook.map]);\n\n\tfunction centerRoute() {\n\t\tif (!mapHook.map || !props.route) return;\n\t\tconst bbox = turf.bbox(props.route);\n\t\tlet bounds: LngLatBoundsLike;\n\t\tif (bbox && bbox.length > 3) {\n\t\t\tbounds = [\n\t\t\t\t[bbox[0], bbox[1]],\n\t\t\t\t[bbox[2], bbox[3]],\n\t\t\t];\n\t\t\tmapHook.map.map.fitBounds(bounds, { padding: 100 });\n\t\t}\n\t}\n\tfunction play() {\n\t\tif (!mapHook.map) return;\n\n\t\tif (!pause.current) {\n\t\t\tdisableInteractivity();\n\t\t\tif (typeof zoom.current !== 'undefined' && mapHook.map.map.getZoom() !== zoom.current) {\n\t\t\t\tmapHook.map.map.setZoom(zoom.current);\n\t\t\t}\n\n\t\t\tconst alongRoutelati: number[] = turf.along(props.route, step.current * kmPerStep).geometry\n\t\t\t\t.coordinates;\n\n\t\t\tif (step.current * kmPerStep < routeDistance) {\n\t\t\t\tmapHook.map.map.easeTo({\n\t\t\t\t\tcenter: alongRoutelati as LngLatLike,\n\t\t\t\t\tbearing: turf.bearing(\n\t\t\t\t\t\tturf.point([mapHook.map.map.getCenter().lng, mapHook.map.map.getCenter().lat]),\n\t\t\t\t\t\tturf.point(alongRoutelati)\n\t\t\t\t\t),\n\t\t\t\t\tduration: stepDuration,\n\t\t\t\t\tessential: true,\n\t\t\t\t});\n\t\t\t\tif (typeof speed.current !== 'undefined') {\n\t\t\t\t\tstep.current = step.current + speed.current;\n\t\t\t\t} else {\n\t\t\t\t\tstep.current++;\n\t\t\t\t}\n\t\t\t\tconsole.log('PAN MOVE');\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tplay();\n\t\t\t\t}, 100);\n\t\t\t} else {\n\t\t\t\tmapHook.map.map.setPitch(0);\n\t\t\t\tcenterRoute();\n\t\t\t\tenableInteractivity();\n\t\t\t\tconsole.log('ENABLE CONTROLS');\n\t\t\t\tstep.current = 1;\n\t\t\t}\n\t\t} else {\n\t\t\tenableInteractivity();\n\t\t}\n\t}\n\n\tfunction reset() {\n\t\tif (!mapHook.map) return;\n\t\tcenterRoute();\n\t\tenableInteractivity();\n\t\tstep.current = 1;\n\t}\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || initializedRef.current) return;\n\t\tinitializedRef.current = true;\n\t\tcenterRoute();\n\t}, [mapHook.map]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (timeoutId.current) {\n\t\t\t\tclearTimeout(timeoutId.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\treturn {\n\t\tplay: play,\n\t\treset: reset,\n\t};\n};\n\nuseCameraFollowPath.defaultProps = {\n\tmapId: undefined,\n\tzoom: 18,\n};\n\nexport default useCameraFollowPath;\n","import { useEffect } from 'react';\nimport useMap from '../useMap';\nimport { FilterSpecification } from 'maplibre-gl';\n\nexport interface UseLayerFilterProps {\n\tmapId?: string;\n\tlayerId?: string;\n\tfilter?: FilterSpecification;\n}\n\nfunction useLayerFilter(props: UseLayerFilterProps) {\n\tconst mapHook = useMap({ mapId: props.mapId });\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map || !props.layerId || !props.filter) return;\n\n\t\tif (mapHook.map.map.getLayer(props.layerId)) {\n\t\t\tconst _layerId = props.layerId;\n\n\t\t\tmapHook.map.map.setFilter(_layerId, props.filter);\n\t\t\treturn () => {\n\t\t\t\tif (mapHook.map) {\n\t\t\t\t\tmapHook.map.map.setFilter(_layerId, null);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\treturn;\n\t}, [props, mapHook.map]);\n\n\treturn {};\n}\n\nexport default useLayerFilter;\n","import React from 'react';\nimport { useEffect } from 'react';\nimport useMapState from './useMapState';\nimport useMap from './useMap';\n\nconst touchEquivalents = {\n\tmousedown: 'touchstart',\n\tmouseup: 'touchend',\n\tmousemove: 'touchmove',\n};\nconst touchEquivalentsKeys = Object.keys(touchEquivalents);\nfunction useLayerEvent(props) {\n\tconst mapState = useMapState({ mapId: props.mapId, watch: { layers: true } });\n\tconst mapHook = useMap({ mapId: props.mapId });\n\n\tuseEffect(() => {\n\t\tif (!mapHook.map) return true;\n\t\tif (typeof props.condition !== 'undefined' && props.condition === false) return;\n\t\t//console.log('useLayerEvent');\n\t\t//console.log(mapState);\n\n\t\tif (mapHook.map.map.getLayer(props.layerId)) {\n\t\t\t//console.log(\"layer avail\");\n\t\t\tvar _event = props.event;\n\t\t\tvar _layerId = props.layerId;\n\t\t\tvar _eventHandler = props.eventHandler;\n\n\t\t\t//console.log(_event);\n\t\t\tmapHook.map.on(_event, _layerId, _eventHandler, mapHook.componentId);\n\t\t\tif (props?.addTouchEvents === true) {\n\t\t\t\tif (touchEquivalentsKeys.indexOf(_event) !== -1) {\n\t\t\t\t\tmapHook.map.on(touchEquivalents[_event], _layerId, _eventHandler, mapHook.componentId);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn () => {\n\t\t\t\tmapHook.map.off(_event, _layerId, _eventHandler);\n\t\t\t\tif (props?.addTouchEvents === true) {\n\t\t\t\t\tif (touchEquivalentsKeys.indexOf(_event) !== -1) {\n\t\t\t\t\t\tmapHook.map.off(touchEquivalents[_event], _layerId, _eventHandler, mapHook.componentId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}, [props, mapState, mapHook.map]);\n\n\treturn {};\n}\n\nexport default useLayerEvent;\n","import React from \"react\";\n\nconst SimpleDataContext = React.createContext({});\n\nexport const SimpleDataContextProvider = SimpleDataContext.Provider;\nexport default SimpleDataContext;\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { SimpleDataContextProvider } from \"./SimpleDataContext\";\nimport * as d3 from \"d3\";\n\nconst SimpleDataProvider = (props) => {\n\tconst [data, setData] = useState(null);\n\tuseEffect(() => {\n\t\tif (!props.url) return;\n\n\t\tlet data_promise = null;\n\t\tif (props.format === \"json\") {\n\t\t\tdata_promise = d3.json(props.url);\n\t\t} else if (props.format === \"csv\") {\n\t\t\tdata_promise = d3.csv(props.url);\n\t\t} else if (props.format === \"xml\") {\n\t\t\tdata_promise = d3.xml(props.url);\n\t\t}\n\n\t\tif (data_promise) {\n\t\t\tdata_promise.then((received_data) => {\n\t\t\t\tif (props.format === \"xml\") {\n\t\t\t\t\tif (props.nodeType) {\n\t\t\t\t\t\tlet dataTmp = [];\n\t\t\t\t\t\treceived_data.querySelectorAll(props.nodeType).forEach((el) => {\n\n\t\t\t\t\t\t\tdataTmp.push(props.formatData(el));\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetData(dataTmp);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (props.data_property) {\n\t\t\t\t\t\treceived_data = received_data[props.data_property];\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof props.formatData === \"function\") {\n\t\t\t\t\t\tsetData(received_data.map(props.formatData));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetData(received_data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (typeof props.onData === \"function\") {\n\t\t\t\t\tprops.onData();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}, [props.url, props]);\n\n\tconst value = {\n\t\tdata: data,\n\t\tsetData: setData,\n\t};\n\n\treturn (\n\t\t<SimpleDataContextProvider value={value}>\n\t\t\t{props.children}\n\t\t</SimpleDataContextProvider>\n\t);\n};\n\nSimpleDataProvider.propTypes = {\n\tchildren: PropTypes.node.isRequired,\n};\n\nexport default SimpleDataProvider;\n","import { List } from '@mui/material';\nimport React from 'react';\n\ntype Props = {\n\tchildren: JSX.Element | JSX.Element[];\n};\n\nfunction LayerList({ children }: Props) {\n\treturn <List sx={{marginTop:'15px'}}>{children}</List>;\n}\n\nexport default LayerList;\n","\nimport { ColorResult } from 'react-color';\n\nexport const DEFAULT_CONVERTER = 'rgba_hex'\nexport const converters = {\n rgba: (c:ColorResult) => `rgba(${c.rgb.r}, ${c.rgb.g}, ${c.rgb.b}, ${c.rgb.a})`,\n rgb: (c:ColorResult) => `rgb(${c.rgb.r}, ${c.rgb.g}, ${c.rgb.b})`,\n hex: (c:ColorResult) => c.hex,\n\n rgba_rgb: (c:ColorResult) => c.rgb.a === 1 ? converters.rgb(c) : converters.rgba(c),\n rgba_hex: (c:ColorResult) => c.rgb.a === 1 ? converters.hex(c) : converters.rgba(c)\n}\n\nexport default converters","import React, { useState } from 'react';\n\nimport { ChromePicker } from 'react-color';\nimport { Button, Grid, TextField } from '@mui/material';\nimport { converters } from './transformers';\n\nexport interface ColorPickerProps {\n\tonChange?: (value: string) => void;\n\tconvert: 'rgb' | 'rgba' | 'rgba_hex' | 'hex' | 'rgba_rgb';\n\tinternalValue?: string;\n\tsetValue?: (value: string) => void;\n\tvalue?: string;\n}\n\nconst ColorPicker = ({ convert, ...props }: ColorPickerProps) => {\n\tconst [showPicker, setShowPicker] = useState(false);\n\tconst [value, setValue] = useState(props?.value || '');\n\n\treturn (\n\t\t<>\n\t\t\t<Grid container sx={{ flexWrap: 'nowrap' }}>\n\t\t\t\t<Grid xs={2} item>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\t\tonClick={() => setShowPicker(true)}\n\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\tminWidth: 'initial',\n\t\t\t\t\t\t\tpadding: '5px',\n\t\t\t\t\t\t\tborderColor: (theme) => theme.palette.text.primary,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div style={{ width: '25px', height: '25px', backgroundColor: value }} />\n\t\t\t\t\t</Button>\n\t\t\t\t</Grid>\n\t\t\t\t<Grid xs={10} item>\n\t\t\t\t\t<TextField\n\t\t\t\t\t\tonClick={() => setShowPicker(true)}\n\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\t\tdisabled={true}\n\t\t\t\t\t/>\n\t\t\t\t</Grid>\n\t\t\t</Grid>\n\t\t\t{showPicker && (\n\t\t\t\t<div style={{ position: 'relative', marginTop: 0 }}>\n\t\t\t\t\t<div style={{ position: 'absolute', zIndex: 1000 }}>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{ position: 'fixed', top: '0px', right: '0px', bottom: '0px', left: '0px' }}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tsetShowPicker(false);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ChromePicker\n\t\t\t\t\t\t\tcolor={value}\n\t\t\t\t\t\t\tonChange={(c) => {\n\t\t\t\t\t\t\t\tconst newValue = converters[convert](c);\n\t\t\t\t\t\t\t\tsetValue(newValue);\n\t\t\t\t\t\t\t\tprops?.onChange?.(newValue);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</>\n\t);\n};\n\nColorPicker.defaultProps = {\n\tconvert: 'rgba_hex',\n\tlabel: 'Color',\n\tname: 'color',\n};\n\nexport default ColorPicker;\n","import ColorPicker from '../../../ColorPicker/ColorPicker';\nimport React from 'react';\nimport { paintPropsType } from '../LayerPropertyForm';\n\ntype Props = {\n\tkey: string;\n\tvalue: string;\n\tpropKey: string;\n\tsetPaintProps: (\n\t\tpaintProps: paintPropsType | ((current: paintPropsType) => paintPropsType)\n\t) => void;\n};\n\nexport default function PaintPropsColorPicker({ propKey, value, setPaintProps }: Props) {\n\treturn (\n\t\t<ColorPicker\n\t\t\tvalue={value}\n\t\t\tlabel=\"Color\"\n\t\t\tonChange={(value: string) => {\n\t\t\t\tsetPaintProps((current: paintPropsType): paintPropsType => {\n\t\t\t\t\tconst newProps = {\n\t\t\t\t\t\t...current,\n\t\t\t\t\t\t[propKey]: value,\n\t\t\t\t\t};\n\n\t\t\t\t\treturn newProps;\n\t\t\t\t});\n\t\t\t}}\n\t\t/>\n\t);\n}\n","import {\n\tCircleLayerSpecification,\n\tFillLayerSpecification,\n\tLineLayerSpecification,\n} from 'maplibre-gl';\nimport React, { useRef } from 'react';\nimport ColorPicker from './input/ColorPicker';\nimport { Box, ListItem, Paper, Slider, TextField, Typography } from '@mui/material';\nimport {useCallback} from 'react';\n\nexport type paintPropsType =\n\t| CircleLayerSpecification['paint']\n\t| FillLayerSpecification['paint']\n\t| LineLayerSpecification['paint'];\n\ntype Props = {\n\tpaintProps: paintPropsType;\n\tsetPaintProps: (\n\t\tpaintProps: paintPropsType | ((current: paintPropsType) => paintPropsType)\n\t) => void;\n\tlayerType: string;\n};\n\nconst mapPropKeyToFormInputType = {\n\t'circle-color': 'colorpicker',\n\t'circle-radius': 'slider',\n\t'circle-stroke-color': 'colorpicker',\n\t'circle-stroke-width': 'slider',\n\t'fill-color': 'colorpicker',\n\t'fill-outline-color': 'colorpicker',\n\t'line-color': 'colorpicker',\n\t'line-width': 'slider',\n\t'line-blur': 'slider',\n};\nconst mapPropKeyToFormInputTypeKeys = Object.keys(mapPropKeyToFormInputType);\n\nconst inputPropsByPropKey = {\n\t'circle-stroke-width': {\n\t\tstep: 1,\n\t\tmin: 1,\n\t\tmax: 20,\n\t},\n\t'circle-radius': {\n\t\tstep: 1,\n\t\tmin: 1,\n\t\tmax: 100,\n\t},\n\t'line-blur': {\n\t\tstep: 1,\n\t\tmin: 1,\n\t\tmax: 100,\n\t},\n\t'line-width': {\n\t\tstep: 1,\n\t\tmin: 1,\n\t\tmax: 100,\n\t},\n};\n\nexport default function LayerPropertyForm({ paintProps = {}, setPaintProps }: Props) {\n\tconst key = useRef(Math.round(Math.random() * 10000000000));\n\t//const onChange = (event) => {};\n\n\tconst getFormInputByType = useCallback((key: string) => {\n\t\tif (mapPropKeyToFormInputTypeKeys.indexOf(key) !== -1) {\n\t\t\tconst label = (\n\t\t\t\t<Typography id={key + '_label'} gutterBottom>\n\t\t\t\t\t{key}\n\t\t\t\t</Typography>\n\t\t\t);\n\t\t\tswitch (mapPropKeyToFormInputType[key]) {\n\t\t\t\tcase 'slider':\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t<Slider\n\t\t\t\t\t\t\t\t{...inputPropsByPropKey[key]}\n\t\t\t\t\t\t\t\tinputProps={{ inputMode: 'decimal', pattern: '[0-9]*' }}\n\t\t\t\t\t\t\t\tvalue={paintProps[key]}\n\t\t\t\t\t\t\t\tvalueLabelDisplay=\"auto\"\n\t\t\t\t\t\t\t\tonChange={(_ev: Event, value: number) => {\n\t\t\t\t\t\t\t\t\tif (value) {\n\t\t\t\t\t\t\t\t\t\tsetPaintProps((current) => ({ ...current, [key]: value }));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'numberfield':\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t<TextField\n\t\t\t\t\t\t\t\tinputProps={{ inputMode: 'decimal', pattern: '[0-9]*' }}\n\t\t\t\t\t\t\t\tvalue={paintProps[key]}\n\t\t\t\t\t\t\t\tonChange={(ev: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\t\t\t\t\t\t\tif (ev?.target?.value) {\n\t\t\t\t\t\t\t\t\t\tsetPaintProps((current) => ({ ...current, [key]: parseInt(ev.target.value) }));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'colorpicker':\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t<Box sx={{ '& > div': { width: 'initial !important' } }}>\n\t\t\t\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\t\t\t\tvalue={paintProps[key]}\n\t\t\t\t\t\t\t\t\tpropKey={key}\n\t\t\t\t\t\t\t\t\tsetPaintProps={setPaintProps}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t</>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t},[paintProps]);\n\n\treturn (\n\t\t<>\n\t\t\t<ListItem key={key + '_paintPropForm'}>\n\t\t\t\t<Paper\n\t\t\t\t\tsx={{\n\t\t\t\t\t\tpadding: '15px',\n\t\t\t\t\t\tboxShadow: 'inset 0px 0px 10px rgb(50 50 50 / 10%)',\n\t\t\t\t\t\tborderRadius: '5px',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{Object.keys(paintProps).map((el: string) => getFormInputByType(el))}\n\t\t\t\t</Paper>\n\t\t\t</ListItem>\n\t\t</>\n\t);\n}\n","import { ExpandLess, ExpandMore } from '@mui/icons-material';\nimport { ListItemIcon, ListItemText, List, Checkbox, ListItem, IconButton } from '@mui/material';\nimport { Box } from '@mui/system';\nimport React, { useMemo, useState } from 'react';\n\ntype Props = {\n\tvisible: boolean;\n\tname?: string;\n\tchildren: JSX.Element | JSX.Element[];\n\tsetVisible?: (visible: boolean | ((val: unknown) => boolean)) => void;\n};\n\nexport default function LayerListFolder({ visible = true, name, children, setVisible }: Props) {\n\tconst [open, setOpen] = useState(false);\n\tconst [localVisible, setLocalVisible] = useState(true);\n\tconst _visible = useMemo(() => {\n\t\tif (!visible) {\n\t\t\treturn false;\n\t\t}\n\t\treturn localVisible;\n\t}, [visible, localVisible]);\n\n\tconst _children = useMemo(() => {\n\t\tif (children) {\n\t\t\tif (Array.isArray(children)) {\n\t\t\t\treturn children.map((element) => {\n\t\t\t\t\treturn React.cloneElement(element, {\n\t\t\t\t\t\tvisible: _visible,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn React.cloneElement(children, {\n\t\t\t\tvisible: _visible,\n\t\t\t});\n\t\t}\n\t\treturn <></>;\n\t}, [_visible]);\n\n\treturn (\n\t\t<>\n\t\t\t<ListItem\n\t\t\t\tsecondaryAction={\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\tsx={{ padding: '4px', marginTop: '-3px' }}\n\t\t\t\t\t\tedge=\"end\"\n\t\t\t\t\t\taria-label=\"open\"\n\t\t\t\t\t\tonClick={() => setOpen(!open)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{open ? <ExpandLess /> : <ExpandMore />}\n\t\t\t\t\t</IconButton>\n\t\t\t\t}\n\t\t\t\tsx={{\n\t\t\t\t\tpaddingRight: 0,\n\t\t\t\t\tpaddingLeft: 0,\n\t\t\t\t\tpaddingTop: 0,\n\t\t\t\t\tpaddingBottom: '4px',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<ListItemIcon sx={{ minWidth: '30px' }}>\n\t\t\t\t\t<Checkbox\n\t\t\t\t\t\tsx={{ padding: 0 }}\n\t\t\t\t\t\tdisabled={setVisible ? false : !visible}\n\t\t\t\t\t\tchecked={setVisible?visible:localVisible}\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tif (setVisible) {\n\t\t\t\t\t\t\t\tsetVisible((val) => !val);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetLocalVisible((val) => !val);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</ListItemIcon>\n\t\t\t\t<ListItemText primary={name} />\n\t\t\t</ListItem>\n\t\t\t<Box sx={{ display: open ? 'block' : 'none' }}>\n\t\t\t\t<List component=\"div\" disablePadding sx={{ paddingLeft: '18px' }}>\n\t\t\t\t\t{_children}\n\t\t\t\t</List>\n\t\t\t</Box>\n\t\t</>\n\t);\n}\n","import { ListItem, IconButton, ListItemIcon, Checkbox, ListItemText } from '@mui/material';\nimport React, { useEffect, useState } from 'react';\nimport LayerPropertyForm from './LayerPropertyForm';\nimport TuneIcon from '@mui/icons-material/Tune';\nimport { MlVectorTileLayerProps } from '../../../components/MlVectorTileLayer/MlVectorTileLayer';\n\ntype Props = {\n\tid: string;\n\tconfigurable?: boolean;\n\tvtProps: MlVectorTileLayerProps;\n\tsetVtProps: ((state: unknown) => void) | undefined;\n};\n\nexport default function LayerListItemVectorLayer({ configurable, vtProps, setVtProps, id }: Props) {\n\tconst [paintPropsFormVisible, setPaintPropsFormVisible] = useState(false);\n\tconst [visible, setVisible] = useState(true);\n\tconst [paintProps, setPaintProps] = useState(vtProps.layers[id].paint);\n\n\tuseEffect(() => {\n\t\tif (!setVtProps) return;\n\n\t\tconst _layers = [...vtProps.layers];\n\t\tif (!_layers[id].layout) {\n\t\t\t_layers[id].layout = { visibility: visible ? 'visible' : 'none' };\n\t\t} else {\n\t\t\t_layers[id].layout.visibility = visible ? 'visible' : 'none';\n\t\t}\n\n\t\tsetVtProps({ ...vtProps, layers: _layers });\n\t}, [visible, id, setVtProps, vtProps]);\n\n\tuseEffect(() => {\n\t\tif (!setVtProps) return;\n\n\t\tconst _paintProps = { ...paintProps };\n\t\tconst _layers = [...vtProps.layers];\n\t\t_layers[id].paint = _paintProps;\n\n\t\tsetVtProps({ ...vtProps, layers: _layers });\n\t}, [paintProps, id, setVtProps, vtProps]);\n\n\treturn (\n\t\t<>\n\t\t\t<ListItem\n\t\t\t\tkey={id}\n\t\t\t\tsx={{\n\t\t\t\t\tpaddingRight: configurable ? '56px' : 0,\n\t\t\t\t\tpaddingLeft: 0,\n\t\t\t\t\tpaddingTop: 0,\n\t\t\t\t\tpaddingBottom: '4px',\n\t\t\t\t}}\n\t\t\t\tsecondaryAction={\n\t\t\t\t\tconfigurable ? (\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\tedge=\"end\"\n\t\t\t\t\t\t\taria-label=\"comments\"\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tsetPaintPropsFormVisible((current) => {\n\t\t\t\t\t\t\t\t\treturn !current;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tsx={{ padding: '4px', marginTop: '-3px' }}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TuneIcon />\n\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t) : undefined\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<ListItemIcon sx={{ minWidth: '30px' }}>\n\t\t\t\t\t<Checkbox\n\t\t\t\t\t\tchecked={visible}\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tsetVisible((val) => !val);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</ListItemIcon>\n\t\t\t\t<ListItemText primary={vtProps.layers[id].id} />\n\t\t\t</ListItem>\n\t\t\t{configurable && paintPropsFormVisible && (\n\t\t\t\t<LayerPropertyForm\n\t\t\t\t\tpaintProps={paintProps}\n\t\t\t\t\tsetPaintProps={setPaintProps}\n\t\t\t\t\tlayerType={vtProps.layers[id].type}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nLayerListItemVectorLayer.defaultProps = {\n\tconfigurable: true,\n};\n","import { Checkbox, IconButton, ListItem, ListItemIcon, ListItemText } from '@mui/material';\nimport TuneIcon from '@mui/icons-material/Tune';\nimport React, { useMemo, useRef, useState } from 'react';\nimport getDefaulLayerTypeByGeometry from '../../components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry';\nimport LayerPropertyForm from './util/LayerPropertyForm';\nimport getDefaultPaintPropsByType from '../../components/MlGeoJsonLayer/util/getDefaultPaintPropsByType';\nimport LayerListFolder from './LayerListFolder';\nimport { LayerSpecification } from 'maplibre-gl';\nimport LayerListItemVectorLayer from './util/LayerListItemVectorLayer';\nimport { useEffect } from 'react';\n\ntype Props = {\n\tlayerComponent: JSX.Element;\n\tvisible: boolean;\n\tconfigurable: boolean;\n\ttype?: 'background' | 'background-labels' | 'layer' | 'wms-layer' | 'vector-tile-layer';\n\tname: string;\n\tdescription?: string;\n\tsetLayerState?: (state: unknown) => void;\n};\n\nfunction LayerListItem({\n\tlayerComponent,\n\tvisible,\n\ttype,\n\tname,\n\tdescription,\n\tconfigurable,\n\tsetLayerState,\n}: Props) {\n\tconst [localVisible, setLocalVisible] = useState(true);\n\tconst [paintPropsFormVisible, setPaintPropsFormVisible] = useState(false);\n\tconst visibleRef = useRef<boolean>(visible);\n\n\t// this state variable is used for layer components that provide a paint attribute\n\tconst [paintProps, setPaintProps] = useState(\n\t\tlayerComponent?.props?.paint ||\n\t\t\tgetDefaultPaintPropsByType(\n\t\t\t\tlayerComponent?.props?.type || getDefaulLayerTypeByGeometry(layerComponent.props.geojson)\n\t\t\t)\n\t);\n\n\tconst _visible = useMemo(() => {\n\t\tif (!visible) {\n\t\t\treturn false;\n\t\t}\n\t\treturn localVisible;\n\t}, [visible, localVisible]);\n\n\tuseEffect(() => {\n\t\tif (!setLayerState || !layerComponent?.props?.layers || _visible === visibleRef.current) return;\n\n\t\tvisibleRef.current = _visible;\n\n\t\tconst state = { ...layerComponent?.props };\n\t\tstate.layers = layerComponent?.props?.layers.map((el: LayerSpecification) => {\n\t\t\tif (el.layout) {\n\t\t\t\tel.layout['visibility'] = _visible ? 'visible' : 'none';\n\t\t\t} else {\n\t\t\t\tel.layout = { visibility: _visible ? 'visible' : 'none' };\n\t\t\t}\n\t\t\treturn el;\n\t\t});\n\t\tsetLayerState(state);\n\t}, [_visible, setLayerState, layerComponent?.props?.layers]);\n\n\tuseEffect(() => {\n\t\tif (!setLayerState || !paintProps) return;\n\n\t\tsetLayerState({ ...layerComponent.props, paint: paintProps });\n\t}, [paintProps, setLayerState]);\n\n\tconst _layerComponent = useMemo(() => {\n\t\tif (layerComponent && type === 'layer') {\n\t\t\tswitch (layerComponent.type.displayName) {\n\t\t\t\tcase 'MlWmsLayer':\n\t\t\t\t\treturn React.cloneElement(layerComponent, {\n\t\t\t\t\t\t...layerComponent?.props,\n\t\t\t\t\t\tvisible: _visible,\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'MlVectorTileLayer':\n\t\t\t\t\treturn React.cloneElement(layerComponent, {\n\t\t\t\t\t\t...layerComponent?.props,\n\t\t\t\t\t\tlayers: layerComponent?.props?.layers,\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\tcase 'MlGeoJsonLayer':\n\t\t\t\t\treturn React.cloneElement(layerComponent, {\n\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\tvisibility: _visible ? 'visible' : 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t...(setLayerState ? {} : { paint: paintProps }),\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn <></>;\n\t}, [type, layerComponent, paintProps, _visible, layerComponent?.props?.layers]);\n\n\tconst layerType = useMemo(() => {\n\t\tif (layerComponent && type === 'layer') {\n\t\t\tif (layerComponent.props.type) {\n\t\t\t\treturn layerComponent.props.type;\n\t\t\t}\n\t\t\tif (layerComponent.props.geojson) {\n\t\t\t\treturn getDefaulLayerTypeByGeometry(layerComponent.props.geojson);\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}, [layerComponent]);\n\n\treturn (\n\t\t<>\n\t\t\t{!layerComponent?.props?.layers && (\n\t\t\t\t<ListItem\n\t\t\t\t\tsx={{\n\t\t\t\t\t\tpaddingRight: configurable ? '56px' : 0,\n\t\t\t\t\t\tpaddingLeft: 0,\n\t\t\t\t\t\tpaddingTop: 0,\n\t\t\t\t\t\tpaddingBottom: '4px',\n\t\t\t\t\t}}\n\t\t\t\t\tsecondaryAction={\n\t\t\t\t\t\tconfigurable ? (\n\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\tedge=\"end\"\n\t\t\t\t\t\t\t\taria-label=\"comments\"\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tsetPaintPropsFormVisible((current) => {\n\t\t\t\t\t\t\t\t\t\treturn !current;\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tsx={{ padding: '4px', marginTop: '-3px' }}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TuneIcon />\n\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t) : undefined\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<ListItemIcon sx={{ minWidth: '30px' }}>\n\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\tdisabled={!visible}\n\t\t\t\t\t\t\tchecked={localVisible}\n\t\t\t\t\t\t\tsx={{ padding: 0 }}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tsetLocalVisible((val) => !val);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ListItemIcon>\n\t\t\t\t\t<ListItemText\n\t\t\t\t\t\tprimary={name}\n\t\t\t\t\t\tprimaryTypographyProps={{ sx: { fontSize: '0.9rem' } }}\n\t\t\t\t\t\tsecondary={description}\n\t\t\t\t\t\tsecondaryTypographyProps={{ sx: { fontSize: '0.7rem' } }}\n\t\t\t\t\t/>\n\t\t\t\t</ListItem>\n\t\t\t)}\n\t\t\t{_layerComponent}\n\t\t\t{!layerComponent?.props?.layers && configurable && paintPropsFormVisible && (\n\t\t\t\t<LayerPropertyForm\n\t\t\t\t\tpaintProps={paintProps}\n\t\t\t\t\tsetPaintProps={setPaintProps}\n\t\t\t\t\tlayerType={layerType}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{layerComponent?.props?.layers && (\n\t\t\t\t<LayerListFolder visible={localVisible} setVisible={setLocalVisible} name={name}>\n\t\t\t\t\t{layerComponent?.props?.layers?.map?.((_el: LayerSpecification, idx: number) => (\n\t\t\t\t\t\t<LayerListItemVectorLayer\n\t\t\t\t\t\t\tvtProps={layerComponent?.props}\n\t\t\t\t\t\t\tsetVtProps={setLayerState}\n\t\t\t\t\t\t\tid={'' + idx}\n\t\t\t\t\t\t\tkey={'' + idx}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</LayerListFolder>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nLayerListItem.defaultProps = {\n\ttype: 'layer',\n\tvisible: true,\n};\n\nexport default LayerListItem;\n","import * as React from 'react';\nimport { useState } from 'react';\nimport AppBar from '@mui/material/AppBar';\nimport Box from '@mui/material/Box';\nimport Toolbar from '@mui/material/Toolbar';\nimport IconButton from '@mui/material/IconButton';\nimport Menu from '@mui/material/Menu';\nimport MenuIcon from '@mui/icons-material/Menu';\nimport { useTheme } from '@mui/material/styles';\n\nexport interface TopToolbarProps {\n\tchildren?: React.ReactNode;\n\tunmovableButtons?: React.ReactNode;\n\tbuttons?: React.ReactNode;\n\tlogo?: React.ReactNode;\n}\n\nconst ghPagesUrl = 'https://mapcomponents.github.io/react-map-components-maplibre/';\nconst logoUrl = ghPagesUrl + 'assets/WG-MapComponents-Logo_rgb.svg';\nconst logoUrl_dark = ghPagesUrl + 'assets/WG-MapComponents-Logo_rgb-weisse-schrift.svg';\nconst logoUrl_mobile = ghPagesUrl + 'assets/mapcomponents_logo.png';\n\nfunction TopToolbar(props: TopToolbarProps) {\n\tconst theme = useTheme();\n\n\tconst [anchorElNav, setAnchorElNav] = useState<null | HTMLElement>(null);\n\n\tconst handleOpenNavMenu = (event: React.MouseEvent<HTMLElement>) => {\n\t\tsetAnchorElNav(event.currentTarget);\n\t};\n\n\tconst handleCloseNavMenu = () => {\n\t\tsetAnchorElNav(null);\n\t};\n\n\treturn (\n\t\t<AppBar\n\t\t\tsx={{\n\t\t\t\tminHeight: '62px',\n\t\t\t\tposition: 'absolute',\n\t\t\t\tzIndex: 1300,\n\t\t\t}}\n\t\t\tposition=\"static\"\n\t\t>\n\t\t\t<Toolbar disableGutters>\n\t\t\t\t{props.logo || (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Box\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\tmarginLeft: '25px',\n\t\t\t\t\t\t\t\tdisplay: { xs: 'none', md: 'flex' },\n\t\t\t\t\t\t\t\tflexGrow: { md: '30' },\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\tsrc={theme.palette.mode === 'dark' ? logoUrl_dark : logoUrl}\n\t\t\t\t\t\t\t\tstyle={{ width: '100%', maxWidth: '250px' }}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t<Box\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\tmarginLeft: '25px',\n\t\t\t\t\t\t\t\tdisplay: { xs: 'flex', sm: 'flex', md: 'none' },\n\t\t\t\t\t\t\t\tflexGrow: { xs: '500' },\n\t\t\t\t\t\t\t\tmr: { sm: '0px' },\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<img src={logoUrl_mobile} width=\"50px\" height=\"50px\" />\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t<Box sx={{ flexGrow: 1, display: { xs: 'flex' } }}>{props.unmovableButtons}</Box>\n\t\t\t\t{props.buttons ? (\n\t\t\t\t\t<Box sx={{ flexGrow: 22, display: { xs: 'flex', sm: 'none' } }}>\n\t\t\t\t\t\t<IconButton onClick={handleOpenNavMenu}>\n\t\t\t\t\t\t\t<MenuIcon />\n\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t<Menu\n\t\t\t\t\t\t\tid=\"menu-appbar\"\n\t\t\t\t\t\t\tanchorEl={anchorElNav}\n\t\t\t\t\t\t\tanchorOrigin={{\n\t\t\t\t\t\t\t\tvertical: 'bottom',\n\t\t\t\t\t\t\t\thorizontal: 'left',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tkeepMounted\n\t\t\t\t\t\t\ttransformOrigin={{\n\t\t\t\t\t\t\t\tvertical: 'top',\n\t\t\t\t\t\t\t\thorizontal: 'left',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\topen={Boolean(anchorElNav)}\n\t\t\t\t\t\t\tonClose={handleCloseNavMenu}\n\t\t\t\t\t\t\tPaperProps={{\n\t\t\t\t\t\t\t\televation: 24,\n\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\toverflow: 'visible',\n\t\t\t\t\t\t\t\t\tmt: '15px',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\tdisplay: { xs: 'block', sm: 'none' },\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Box sx={{ paddingLeft: '10px', paddingRight: '10px' }}>{props.buttons}</Box>\n\t\t\t\t\t\t</Menu>\n\t\t\t\t\t</Box>\n\t\t\t\t) : (\n\t\t\t\t\t''\n\t\t\t\t)}\n\t\t\t\t<Box sx={{ marginRight: '25px', display: { xs: 'none', sm: 'flex' } }}>{props.buttons}</Box>\n\t\t\t</Toolbar>\n\t\t</AppBar>\n\t);\n}\n\nexport default TopToolbar;\n","import React, { useState } from 'react';\nimport { styled } from '@mui/material/styles';\nimport CloseIcon from '@mui/icons-material/Close';\nimport { Paper, Drawer, IconButton, PaperProps, DrawerProps } from '@mui/material';\nimport useMediaQuery from '@mui/material/useMediaQuery';\nimport Box from '@mui/material/Box';\nimport { Global } from '@emotion/react';\nimport { Typography, SwipeableDrawer } from '@mui/material/';\n\nconst DrawerHeader = styled('div')(() => ({\n\tdisplay: 'flex',\n\talignItems: 'center',\n}));\n\ninterface SidebarProps {\n\tdrawerPaperProps?: PaperProps;\n\tdrawerHeaderProps?: Headers;\n\tchildren?: React.ReactNode;\n\topen?: boolean;\n\tsetOpen?: (val: boolean) => void;\n\tname?: string;\n}\n\nconst drawerBleeding = 56;\n\nconst Puller = styled(Box)(({ theme }) => ({\n\twidth: 30,\n\theight: 6,\n\tbackgroundColor: theme.palette.text.primary,\n\tborderRadius: 3,\n\tposition: 'absolute',\n\ttop: 8,\n\tleft: 'calc(50% - 15px)',\n}));\n\nexport default function Sidebar({\n\tdrawerPaperProps,\n\tdrawerHeaderProps,\n\t...props\n}: SidebarProps & DrawerProps) {\n\tconst mediaIsMobile = useMediaQuery('(max-width:600px)');\n\n\tconst [drawerOpen, setDrawerOpen] = useState(false);\n\n\treturn (\n\t\t<>\n\t\t\t{!mediaIsMobile ? (\n\t\t\t\t<Box sx={{ display: { xs: 'none', sm: 'flex' }, mr: 1 }}>\n\t\t\t\t\t<Drawer\n\t\t\t\t\t\ttransitionDuration={0}\n\t\t\t\t\t\tvariant=\"persistent\"\n\t\t\t\t\t\tanchor=\"left\"\n\t\t\t\t\t\topen={typeof props.open === 'undefined' ? drawerOpen : props.open}\n\t\t\t\t\t\tPaperProps={{\n\t\t\t\t\t\t\t...drawerPaperProps,\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tmaxWidth: { lg: '30%', md: '40%', sm: '50%', xs: '78%' },\n\t\t\t\t\t\t\t\tpadding: { sm: '84px 20px 20px 20px', xs: '74px 10px 10px 10px' },\n\t\t\t\t\t\t\t\twidth: {\n\t\t\t\t\t\t\t\t\txs: '80%',\n\t\t\t\t\t\t\t\t\tsm: '60%',\n\t\t\t\t\t\t\t\t\tmd: '350px',\n\t\t\t\t\t\t\t\t\tlg: '350px',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\t\t...drawerPaperProps?.sx,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\t\tzIndex: 105,\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\tbottom: 0,\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\t\tmaxWidth: { lg: '30%', md: '40%', sm: '50%', xs: '78%' },\n\t\t\t\t\t\t\t...(drawerOpen ? {} : { left: mediaIsMobile ? '-90vw' : '-20vw' }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DrawerHeader {...drawerHeaderProps}>\n\t\t\t\t\t\t\t<Typography variant=\"h6\">{props.name}</Typography>\n\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\tprops.setOpen\n\t\t\t\t\t\t\t\t\t\t? () => {\n\t\t\t\t\t\t\t\t\t\t\t\tprops.setOpen?.(false);\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: () => {\n\t\t\t\t\t\t\t\t\t\t\t\tsetDrawerOpen(false);\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\t\tright: '20px',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<CloseIcon />\n\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t</DrawerHeader>\n\t\t\t\t\t\t<Box>{props.children}</Box>\n\t\t\t\t\t</Drawer>\n\t\t\t\t</Box>\n\t\t\t) : (\n\t\t\t\t<Box sx={{ display: { xs: 'flex', sm: 'none' } }}>\n\t\t\t\t\t<Global\n\t\t\t\t\t\tstyles={{\n\t\t\t\t\t\t\t'.MuiDrawer-root > .MuiPaper-root': {\n\t\t\t\t\t\t\t\theight: `calc(50% - ${drawerBleeding}px)`,\n\t\t\t\t\t\t\t\toverflow: 'visible',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<SwipeableDrawer\n\t\t\t\t\t\tanchor=\"bottom\"\n\t\t\t\t\t\topen={typeof props.open === 'undefined' ? drawerOpen : props.open}\n\t\t\t\t\t\tonClose={\n\t\t\t\t\t\t\tprops.setOpen\n\t\t\t\t\t\t\t\t? () => {\n\t\t\t\t\t\t\t\t\t\tprops.setOpen?.(false);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: () => {\n\t\t\t\t\t\t\t\t\t\tsetDrawerOpen(false);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonOpen={\n\t\t\t\t\t\t\tprops.setOpen\n\t\t\t\t\t\t\t\t? () => {\n\t\t\t\t\t\t\t\t\t\tprops.setOpen?.(true);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: () => {\n\t\t\t\t\t\t\t\t\t\tsetDrawerOpen(true);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tswipeAreaWidth={drawerBleeding}\n\t\t\t\t\t\tdisableSwipeToOpen={false}\n\t\t\t\t\t\thideBackdrop={true}\n\t\t\t\t\t\tModalProps={{\n\t\t\t\t\t\t\tkeepMounted: true,\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\ttop: `calc(90%)`,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Paper\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\ttop: -drawerBleeding,\n\t\t\t\t\t\t\t\tborderTopLeftRadius: 8,\n\t\t\t\t\t\t\t\tborderTopRightRadius: 8,\n\t\t\t\t\t\t\t\tvisibility: 'visible',\n\t\t\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Puller />\n\t\t\t\t\t\t\t<Typography variant=\"h6\" sx={{ p: '13px' }}>\n\t\t\t\t\t\t\t\t{props.name}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</Paper>\n\n\t\t\t\t\t\t<Paper\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\tpx: '15px',\n\t\t\t\t\t\t\t\tpb: '15px',\n\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t\t\t\tpaddingTop: '20px',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{props.children}\n\t\t\t\t\t\t</Paper>\n\t\t\t\t\t</SwipeableDrawer>\n\t\t\t\t</Box>\n\t\t\t)}\n\t\t\t;\n\t\t</>\n\t);\n}\n"],"names":["Map","createTheme","React","useState","useRef","MUIThemeProvider","defaultProps","useContext","useEffect","uuidv4","useCallback","PropTypes","Button","GpsFixedIcon","jsPDF","useMemo","CircularProgress","PrinterIcon","templates","turf","ReactDOM","Moveable","FormControl","InputLabel","Select","MenuItem","FormLabel","RadioGroup","FormControlLabel","Radio","classes","CONTROL_BASE","CONTROL_PREFIX","CONTROL_BUTTON","CONTROL_BUTTON_LINE","CONTROL_BUTTON_POLYGON","CONTROL_BUTTON_POINT","CONTROL_BUTTON_TRASH","CONTROL_BUTTON_COMBINE_FEATURES","CONTROL_BUTTON_UNCOMBINE_FEATURES","CONTROL_GROUP","ATTRIBUTION","ACTIVE_BUTTON","BOX_SELECT","cursors","ADD","MOVE","DRAG","POINTER","NONE","types","POLYGON","LINE","POINT","geojsonTypes","FEATURE","LINE_STRING","FEATURE_COLLECTION","MULTI_PREFIX","MULTI_POINT","MULTI_LINE_STRING","MULTI_POLYGON","events","CREATE","DELETE","UPDATE","SELECTION_CHANGE","MODE_CHANGE","ACTIONABLE","RENDER","COMBINE_FEATURES","UNCOMBINE_FEATURES","updateActions","CHANGE_COORDINATES","meta","MIDPOINT","VERTEX","activeStates","ACTIVE","INACTIVE","LAT_MIN","LAT_RENDERED_MIN","LAT_MAX","LAT_RENDERED_MAX","LNG_MIN","LNG_MAX","isOfMetaType","type","e","featureTarget","properties","isShiftMousedown","originalEvent","shiftKey","button","isActiveFeature","active","Constants","isInactiveFeature","noTarget","undefined","isFeature","isVertex","isShiftDown","isEscapeKey","keyCode","isEnterKey","doubleClickZoom","enable","ctx","setTimeout","map","_ctx","store","getInitialConfigValue","disable","isEventAtCoordinates","event","coordinates","lngLat","lng","lat","create_vertex","parentId","path","selected","parent","coord_path","geometry","CustomPolygonMode","onSetup","console","log","polygon","newFeature","addFeature","clearSelectedFeatures","updateUIClasses","mouse","activateUIButton","setActionableState","trash","currentVertexPosition","clickAnywhere","state","changeMode","featureIds","id","updateCoordinate","fire","features","toGeoJSON","clickOnVertex","onMouseMove","CommonSelectors","onTap","onClick","onKeyUp","deleteFeature","silent","onStop","getFeature","removeCoordinate","isValid","toDisplayFeatures","geojson","display","isActivePolygon","length","coordinateCount","createVertex","endPos","lineCoordinates","onTrash","mouseEventPoint","mouseEvent","container","rect","getBoundingClientRect","Point","clientX","left","clientLeft","clientY","top","clientTop","create_midpoint","startVertex","endVertex","startCoord","endCoord","mid","createSupplementaryPoints","options","basePath","featureId","supplementaryPoints","push","isSelectedPath","forEach","line","lineIndex","processLine","String","indexOf","processMultiGeometry","lineBasePath","firstPointString","lastVertex","point","pointIndex","pointPath","vertex","midpoints","midpoint","createMidpoint","stringifiedPoint","JSON","stringify","selectedPaths","subType","replace","subCoordinates","index","subFeature","concat","StringSet","items","_items","_nums","_length","i","l","add","prototype","x","has","values","Object","keys","k","v","parse","sort","a","b","clear","geojsonCoords","require","traverse","extent","geojsonTypesByDataAttributes","geometries","dataAttributes","module","_","getExtent","bbox","geojsonExtent","value","some","attribute","update","ext","coords","include","constrain_feature_movement","geojsonFeatures","delta","northInnerEdge","southInnerEdge","northOuterEdge","southOuterEdge","westEdge","eastEdge","feature","bounds","featureSouthEdge","featureNorthEdge","featureWestEdge","featureEastEdge","constrainedDelta","Math","ceil","abs","move_features","constrainFeatureMovement","currentCoordinates","getCoordinates","moveCoordinate","coord","moveRing","ring","moveMultiPolygon","multi","nextCoordinates","incomingCoords","CustomSelectMode","opts","dragMoveLocation","boxSelectStartLocation","boxSelectElement","boxSelecting","canBoxSelect","dragMoving","canDragMove","initiallySelectedFeatureIds","setSelected","filter","fireActionable","combineFeatures","uncombineFeatures","fireUpdate","action","getSelected","f","selectedFeatures","multiFeatures","isInstanceOf","featureType","getUniqueIds","allFeatures","ids","s","reduce","memo","stopExtendedInteractions","parentNode","removeChild","dragPan","onMouseOut","clickOnFeature","wasSelected","getSelectedIds","doRender","coordPath","startPos","startOnActiveFeature","isShiftClick","selectedFeatureIds","isFeatureSelected","isSelected","deselect","select","onMouseDown","drawConfig","boxSelect","startBoxSelect","getContainer","onTouchStart","onDrag","dragMove","whileBoxSelect","document","createElement","classList","appendChild","current","minX","min","maxX","max","minY","y","maxY","translateValue","style","transform","WebkitTransform","width","height","stopPropagation","moveFeatures","onMouseUp","featuresInBox","featuresAt","idsToSelect","onCombineFeatures","featuresCombined","includes","subcoords","multiFeature","createdFeatures","deletedFeatures","onUncombineFeatures","featuresUncombined","getFeatures","drawUtils","getMatchingVertices","decimals","matchingVertices","v_lng","toFixed","v_lat","m","getDrawInstance","_controls","modes","SIMPLE_SELECT","isMidpoint","DirectSelect","selectedCoordPaths","startDragging","stopDragging","onVertex","about","selectedIndex","getAll","_geometry","groupMove_vertices","selectedCoordinates","pathsToCoordinates","setSelectedCoordinates","onMidpoint","addCoordinate","paths","feature_id","onFeature","dragFeature","dragVertex","selectedCoords","getCoordinate","selectedCoordPoints","coord_path_m","split","coord_m","clickNoTarget","clickInactive","clickActiveFeature","clearSelectedCoordinates","changed","Error","TypeError","localeCompare","numeric","noCoords","onTouchEnd","MapboxDraw","CustomDirectSelectMode","circle","lineArc","_extends","_g","styled","css","RotateRightIcon","NeedleIcon","RotateLeftIcon","useMediaQuery","Box","ButtonGroup","ControlPointIcon","RemoveCircleOutlineIcon","syncMove","_showNextTransitionSegment","props","transitionInProgressRef","transitionGeojsonDataRef","transitionGeojsonCommonDataRef","currentTransitionStepRef","msPerStep","transitionTimeoutRef","setDisplayGeojson","newData","lineString","onTransitionFrame","arguments","onTransitionEnd","_transitionToGeojson","oldGeojsonRef","transitionCoordinatesShort","transitionCoordinatesLong","targetCoordinates","srcCoordinates","sourceGeojson","targetGeojson","longerGeojson","shorterGeojson","reverseOrder","slice","len","transitionSteps","transitionTime","srcCoordinatesDistance","round","targetCoordinatesDistance","transitionDistance","srcCoordinatesShare","srcTransitionSteps","srcPerStepDistance","targetCoordinatesShare","targetTransitionSteps","targetPerStepDistance","transitionStepData","createTransitionSteps","reverse","linestringCoordinates","perStepDistance","stepCnt","tmpChunks","lineChunk","tmpLinestring","Paper","MlOsmLayer","mapHook","useMap","mapId","waitForLayer","insertBeforeLayer","layerId","componentId","addSource","_objectSpread","tileSize","sourceOptions","addLayer","source","minzoom","maxzoom","layerOptions","propTypes","string","idPrefix","object","removeSpace","trimSpace","splitSpace","okhash","h","charCodeAt","get","getElementsByTagName","attr","getAttribute","attrf","parseFloat","get1","n","norm","el","normalize","numarray","j","o","nodeVal","textContent","getMulti","ys","extend","coord1","coordPair","ll","ele","heartRate","time","isNaN","fc","serializer","XMLSerializer","isNodeEnv","process","browser","isTitaniumEnv","Titanium","exports","xml2str","str","xml","serializeToString","t","kml","doc","gj","styleIndex","styleByHash","styleMapIndex","geotypes","placemarks","styles","styleMaps","hash","toString","pairs","pairsMap","getPlacemark","kmlColor","color","opacity","substr","parseInt","gxCoord","gxCoords","root","elems","times","timeElems","getGeometry","geomNode","geomNodes","geoms","coordTimes","rings","track","geomsAndTimes","name","address","styleUrl","description","timeSpan","timeStamp","extendedData","lineStyle","polyStyle","visibility","styleHash","styleMapHash","normal","iconStyle","icon","href","begin","end","timespan","timestamp","linestyles","stroke","polystyles","pcolor","popacity","fill","outline","datas","simpleDatas","gpx","tracks","routes","waypoints","getTrack","getRoute","getPoint","initializeArray","arr","size","getPoints","node","pointname","pts","heartRates","c","segments","getProperties","getLineStyle","prop","routeObj","extensions","links","link","Popup","featureCollection","lineOffset","distance","MlWmsFeatureInfoPopup","mapContext","MapContext","initializedRef","mapRef","_componentId","cleanup","mapExists","getMap","setCenter","mapIds","WMSCapabilities","List","ListItem","IconButton","VisibilityIcon","VisibilityOffIcon","ListItemText","MlBasicComponent","mapIsReady","touchEquivalents","mousedown","mouseup","mousemove","touchEquivalentsKeys","useLayerEvent","mapState","useMapState","watch","layers","condition","getLayer","_event","_layerId","_eventHandler","eventHandler","on","addTouchEvents","off","SimpleDataContext","createContext","SimpleDataContextProvider","Provider","SimpleDataProvider","data","setData","url","data_promise","format","d3","json","csv","then","received_data","nodeType","dataTmp","querySelectorAll","formatData","data_property","onData","children","isRequired","Grid","TextField","ChromePicker","Typography","Slider","ColorPicker","ExpandLess","ExpandMore","ListItemIcon","Checkbox","TuneIcon","useTheme","AppBar","Toolbar","MenuIcon","Menu","Drawer","CloseIcon","Global","SwipeableDrawer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,IAAA,iBAAA,kBAAA,YAAA;AAoEC,IAAA,SAAA,iBAAA,CAAY,KAGX,EAAA;QAHD,IAsiBC,KAAA,GAAA,IAAA,CAAA;;;QAhiBA,IAAM,IAAI,GAAG,IAAI,CAAC;;AAGlB,QAAA,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;;AAG7B,QAAA,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;;AAGrB,QAAA,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;;QAGlC,IAAI,CAAC,aAAa,GAAG;AACpB,YAAA,WAAW,EAAE,EAAE;AACf,YAAA,cAAc,EAAE,EAAE;SAClB,CAAC;;;QAIF,IAAI,CAAC,OAAO,GAAG;AACd;;;;;;;;AAQG;YACH,EAAE,EAAE,UACH,SAAiB,EACjB,OAA8B,EAC9B,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