@mapcomponents/react-maplibre 1.3.3 → 1.5.0-2

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.
Files changed (172) hide show
  1. package/CHANGELOG.md +163 -38
  2. package/CODE_OF_CONDUCT.md +70 -70
  3. package/CONTRIBUTING.md +157 -149
  4. package/README.md +1 -1
  5. package/docs_md/anatomy_of_a_mapcomponent.md +34 -37
  6. package/eslint.config.cjs +3 -0
  7. package/package.json +193 -224
  8. package/project.json +21 -0
  9. package/tsconfig.lib.json +29 -0
  10. package/vite.config.ts +61 -0
  11. package/.eslintrc.cjs +0 -33
  12. package/dist/assets/index.cjs-Iqz0mZaU.css +0 -98
  13. package/dist/assets/index.esm-Iqz0mZaU.css +0 -98
  14. package/dist/index.cjs.js +0 -22120
  15. package/dist/index.cjs.js.map +0 -1
  16. package/dist/index.esm.js +0 -22000
  17. package/dist/index.esm.js.map +0 -1
  18. package/dist/src/components/MapLibreMap/MapLibreMap.d.ts +0 -34
  19. package/dist/src/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +0 -120
  20. package/dist/src/components/MlCenterPosition/MlCenterPosition.d.ts +0 -36
  21. package/dist/src/components/MlClientSearch/MlClientSearch.d.ts +0 -30
  22. package/dist/src/components/MlClientSearch/lib/SearchContext.d.ts +0 -13
  23. package/dist/src/components/MlClientSearch/lib/SearchForm.d.ts +0 -2
  24. package/dist/src/components/MlClientSearch/lib/createGeojsonFeature.d.ts +0 -4
  25. package/dist/src/components/MlComponentTemplate/MlComponentTemplate.d.ts +0 -18
  26. package/dist/src/components/MlComponentTemplate/MlComponentTemplate.stories_.d.ts +0 -14
  27. package/dist/src/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +0 -22
  28. package/dist/src/components/MlCreatePdfForm/MlCreatePdfForm.d.ts +0 -13
  29. package/dist/src/components/MlCreatePdfForm/lib/PdfContext.d.ts +0 -8
  30. package/dist/src/components/MlCreatePdfForm/lib/PdfForm.d.ts +0 -25
  31. package/dist/src/components/MlCreatePdfForm/lib/PdfPreview.d.ts +0 -26
  32. package/dist/src/components/MlCreatePdfForm/lib/pdf.templates.d.ts +0 -11
  33. package/dist/src/components/MlCreatePngButton/MlCreatePngButton.d.ts +0 -22
  34. package/dist/src/components/MlFeatureEditor/MlFeatureEditor.d.ts +0 -5
  35. package/dist/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.d.ts +0 -62
  36. package/dist/src/components/MlFollowGps/MlFollowGps.d.ts +0 -81
  37. package/dist/src/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +0 -98
  38. package/dist/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.d.ts +0 -9
  39. package/dist/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.d.ts +0 -9
  40. package/dist/src/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.d.ts +0 -4
  41. package/dist/src/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.d.ts +0 -5
  42. package/dist/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.d.ts +0 -23
  43. package/dist/src/components/MlGlobeButton/MlGlobeButton.d.ts +0 -28
  44. package/dist/src/components/MlGpxViewer/MlGpxViewer.d.ts +0 -31
  45. package/dist/src/components/MlGpxViewer/util/GeoJsonContext.d.ts +0 -10
  46. package/dist/src/components/MlGpxViewer/util/GeoJsonProvider.d.ts +0 -5
  47. package/dist/src/components/MlGpxViewer/util/Metadata.d.ts +0 -7
  48. package/dist/src/components/MlGpxViewer/util/MlGpxDemoLoader.d.ts +0 -11
  49. package/dist/src/components/MlGpxViewer/util/MlGpxViewerInstructions.d.ts +0 -4
  50. package/dist/src/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +0 -39
  51. package/dist/src/components/MlLayer/MlLayer.d.ts +0 -33
  52. package/dist/src/components/MlLayerMagnify/MlLayerMagnify.d.ts +0 -33
  53. package/dist/src/components/MlLayerSwipe/MlLayerSwipe.d.ts +0 -26
  54. package/dist/src/components/MlLayerSwipe/assets/SwipeIcon.d.ts +0 -10
  55. package/dist/src/components/MlLayerSwitcher/MlLayerSwitcher.d.ts +0 -29
  56. package/dist/src/components/MlLayerSwitcher/components/LayerBox.d.ts +0 -10
  57. package/dist/src/components/MlMarker/MlMarker.d.ts +0 -29
  58. package/dist/src/components/MlMeasureTool/MlMeasureTool.d.ts +0 -37
  59. package/dist/src/components/MlMultiMeasureTool/MlMultiMeasureTool.d.ts +0 -55
  60. package/dist/src/components/MlNavigationCompass/MlNavigationCompass.d.ts +0 -33
  61. package/dist/src/components/MlNavigationCompass/assets/CompassBackground.d.ts +0 -9
  62. package/dist/src/components/MlNavigationCompass/assets/CompassNeedle.d.ts +0 -9
  63. package/dist/src/components/MlNavigationTools/MlNavigationTools.d.ts +0 -60
  64. package/dist/src/components/MlOgcApiFeatures/MlOgcApiFeatures.d.ts +0 -45
  65. package/dist/src/components/MlOrderLayers/MlOrderLayers.d.ts +0 -21
  66. package/dist/src/components/MlScaleReference/MlScaleReference.d.ts +0 -9
  67. package/dist/src/components/MlShareMapState/MlShareMapState.d.ts +0 -35
  68. package/dist/src/components/MlSketchTool/MlSketchTool.d.ts +0 -50
  69. package/dist/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +0 -40
  70. package/dist/src/components/MlSpatialElevationProfile/util/getElevationData.d.ts +0 -13
  71. package/dist/src/components/MlTemporalController/MlTemporalController.d.ts +0 -181
  72. package/dist/src/components/MlTemporalController/utils/MlTemporalControllerLabels.d.ts +0 -20
  73. package/dist/src/components/MlTemporalController/utils/TemporalControllerPlayer.d.ts +0 -22
  74. package/dist/src/components/MlTemporalController/utils/paintPicker.d.ts +0 -59
  75. package/dist/src/components/MlTemporalController/utils/useFilterData.d.ts +0 -14
  76. package/dist/src/components/MlTerrainLayer/MlTerrainLayer.d.ts +0 -28
  77. package/dist/src/components/MlThreeJsLayer/MlThreeJsLayer.d.ts +0 -13
  78. package/dist/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +0 -12
  79. package/dist/src/components/MlUseMapDebugger/MlUseMapDebugger.d.ts +0 -21
  80. package/dist/src/components/MlVectorTileLayer/MlVectorTileLayer.d.ts +0 -22
  81. package/dist/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.d.ts +0 -22
  82. package/dist/src/components/MlWmsLayer/MlWmsLayer.d.ts +0 -58
  83. package/dist/src/components/MlWmsLoader/MlWmsLoader.d.ts +0 -125
  84. package/dist/src/components/MlWmsLoader/utils/MlWmsLoaderInstructions.d.ts +0 -4
  85. package/dist/src/components/MlWmsLoader/utils/WMSLinks.d.ts +0 -8
  86. package/dist/src/contexts/LayerContext.d.ts +0 -59
  87. package/dist/src/contexts/MapContext.d.ts +0 -26
  88. package/dist/src/contexts/SimpleDataContext.d.ts +0 -4
  89. package/dist/src/contexts/SimpleDataProvider.d.ts +0 -12
  90. package/dist/src/decorators/EmptyMapDecorator.d.ts +0 -4
  91. package/dist/src/decorators/GeoJsonMapDecorator.d.ts +0 -4
  92. package/dist/src/decorators/LowZoomDecorator.d.ts +0 -4
  93. package/dist/src/decorators/MapContextDecorator.d.ts +0 -7
  94. package/dist/src/decorators/MapContextDecoratorHooks.d.ts +0 -4
  95. package/dist/src/decorators/MapContextReduxStoreDecorator.d.ts +0 -7
  96. package/dist/src/decorators/MultiMapContextDecorator.d.ts +0 -4
  97. package/dist/src/decorators/NoNavToolsDecorator.d.ts +0 -4
  98. package/dist/src/decorators/ThemeDecorator.d.ts +0 -5
  99. package/dist/src/hooks/useAddImage/useAddImage.d.ts +0 -20
  100. package/dist/src/hooks/useAddProtocol/useAddProtocol.d.ts +0 -23
  101. package/dist/src/hooks/useCameraFollowPath/useCameraFollowPath.d.ts +0 -35
  102. package/dist/src/hooks/useExportMap/index.d.ts +0 -11
  103. package/dist/src/hooks/useExportMap/lib.d.ts +0 -52
  104. package/dist/src/hooks/useFeatureEditor/useFeatureEditor.d.ts +0 -46
  105. package/dist/src/hooks/useFeatureEditor/utils/FeatureEditorStyle.d.ts +0 -116
  106. package/dist/src/hooks/useFitLayerBounds.d.ts +0 -8
  107. package/dist/src/hooks/useGpx/useGpx.d.ts +0 -26
  108. package/dist/src/hooks/useLayer.d.ts +0 -36
  109. package/dist/src/hooks/useLayerContext.d.ts +0 -2
  110. package/dist/src/hooks/useLayerFilter/useLayerFilter.d.ts +0 -8
  111. package/dist/src/hooks/useLayerHoverPopup/LayerHoverPopup.d.ts +0 -24
  112. package/dist/src/hooks/useMap.d.ts +0 -14
  113. package/dist/src/hooks/useMapState.d.ts +0 -37
  114. package/dist/src/hooks/useSource.d.ts +0 -17
  115. package/dist/src/hooks/useWms.d.ts +0 -26
  116. package/dist/src/index.d.ts +0 -126
  117. package/dist/src/omt_styles/bright.d.ts +0 -2495
  118. package/dist/src/omt_styles/config.d.ts +0 -7
  119. package/dist/src/omt_styles/gruvbox.d.ts +0 -2420
  120. package/dist/src/omt_styles/medieval_kingdom.d.ts +0 -2420
  121. package/dist/src/omt_styles/monokai.d.ts +0 -2420
  122. package/dist/src/omt_styles/oceanic_next.d.ts +0 -2420
  123. package/dist/src/omt_styles/solarized.d.ts +0 -2420
  124. package/dist/src/protocol_handlers/csv.d.ts +0 -8
  125. package/dist/src/protocol_handlers/mbtiles.d.ts +0 -74
  126. package/dist/src/protocol_handlers/osm.d.ts +0 -10
  127. package/dist/src/protocol_handlers/topojson.d.ts +0 -9
  128. package/dist/src/protocol_handlers/utils/getProtocolData.d.ts +0 -1
  129. package/dist/src/protocol_handlers/utils/protocolPathParser.d.ts +0 -7
  130. package/dist/src/protocol_handlers/xml.d.ts +0 -10
  131. package/dist/src/stores/map.store.d.ts +0 -105
  132. package/dist/src/ui_components/AddLayerButton/AddLayerButton.d.ts +0 -17
  133. package/dist/src/ui_components/AddLayerButton/AddLayerPopup.d.ts +0 -15
  134. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/GeoJsonLayerForm.d.ts +0 -8
  135. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/LayerTypeForm.d.ts +0 -10
  136. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/MbtilesLayerForm.d.ts +0 -13
  137. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/ProtocolHandlerLayerForm.d.ts +0 -10
  138. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/WmsLayerForm.d.ts +0 -10
  139. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/utils/CSVOptionsFomular.d.ts +0 -6
  140. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/utils/MbtilesLayerPropFormular.d.ts +0 -7
  141. package/dist/src/ui_components/AddLayerButton/LayerConfigForms/utils/OsmOptionsFomular.d.ts +0 -6
  142. package/dist/src/ui_components/ColorPicker/ColorPicker.d.ts +0 -15
  143. package/dist/src/ui_components/ColorPicker/transformers.d.ts +0 -10
  144. package/dist/src/ui_components/ConfirmDialog.d.ts +0 -16
  145. package/dist/src/ui_components/DemoDescriptions.d.ts +0 -12
  146. package/dist/src/ui_components/Dropzone.d.ts +0 -6
  147. package/dist/src/ui_components/ImageLoader.d.ts +0 -10
  148. package/dist/src/ui_components/LayerList/LayerList.d.ts +0 -7
  149. package/dist/src/ui_components/LayerList/LayerListFolder.d.ts +0 -9
  150. package/dist/src/ui_components/LayerList/LayerListItem.d.ts +0 -26
  151. package/dist/src/ui_components/LayerList/LayerListItemFactory.d.ts +0 -18
  152. package/dist/src/ui_components/LayerList/util/LayerListItemVectorLayer.d.ts +0 -19
  153. package/dist/src/ui_components/LayerList/util/LayerPropertyForm.d.ts +0 -10
  154. package/dist/src/ui_components/LayerList/util/SortableContainer.d.ts +0 -7
  155. package/dist/src/ui_components/LayerList/util/input/ColorPicker.d.ts +0 -10
  156. package/dist/src/ui_components/LayerTree/LayerOnMap.d.ts +0 -7
  157. package/dist/src/ui_components/LayerTree/LayerTree.d.ts +0 -6
  158. package/dist/src/ui_components/LayerTree/LayerTreeListItem.d.ts +0 -18
  159. package/dist/src/ui_components/LayerTree/util/LayerPropertyForm.d.ts +0 -9
  160. package/dist/src/ui_components/LayerTree/util/input/ColorPicker.d.ts +0 -7
  161. package/dist/src/ui_components/LoadingOverlayContext.d.ts +0 -4
  162. package/dist/src/ui_components/MapcomponentsTheme.d.ts +0 -36
  163. package/dist/src/ui_components/SelectStyleButton/SelectStyleButton.d.ts +0 -20
  164. package/dist/src/ui_components/SelectStyleButton/SelectStylePopup.d.ts +0 -18
  165. package/dist/src/ui_components/Sidebar.d.ts +0 -13
  166. package/dist/src/ui_components/SpeedDial/SpeedDial.d.ts +0 -14
  167. package/dist/src/ui_components/TopToolbar.d.ts +0 -9
  168. package/dist/src/ui_components/UploadButton.d.ts +0 -8
  169. package/dist/src/util/BubbleForInstructions.d.ts +0 -16
  170. package/dist/src/util/Instructions.d.ts +0 -14
  171. package/eslint.config.mjs +0 -73
  172. package/rollup.config.mjs +0 -62
@@ -1,125 +0,0 @@
1
- import React from 'react';
2
- import { useWmsProps } from '../../hooks/useWms';
3
- import { Layer2 } from 'wms-capabilities';
4
- import { useWmsReturnType } from '../../hooks/useWms';
5
- export interface WmsConfig {
6
- /**
7
- * The URL to use for the getFeatureInfo request
8
- */
9
- getFeatureInfoUrl: useWmsReturnType['getFeatureInfoUrl'];
10
- /**
11
- * The URL of the WMS service
12
- */
13
- wmsUrl: useWmsReturnType['wmsUrl'];
14
- /**
15
- * The layers to display on the map
16
- */
17
- layers: LayerType[];
18
- /**
19
- * If true, the WMS layer is visible
20
- */
21
- visible: boolean;
22
- /**
23
- * If true, the WMS layer is open
24
- */
25
- open: boolean;
26
- /**
27
- * The name of the WMS layer
28
- */
29
- name?: string;
30
- }
31
- export interface MlWmsLoaderProps {
32
- /**
33
- * WMS URL
34
- */
35
- url: string;
36
- /**
37
- * Id of the target MapLibre instance in mapContext
38
- */
39
- mapId?: string;
40
- layerId?: string;
41
- insertBeforeLayer?: string;
42
- /**
43
- * URL parameters that will be used in the getCapabilities request
44
- */
45
- urlParameters?: useWmsProps['urlParameters'];
46
- /**
47
- * URL parameters that will be added when requesting WMS capabilities
48
- */
49
- wmsUrlParameters?: {
50
- [key: string]: string;
51
- };
52
- /**
53
- * If true, zooms to the extent of the WMS layer after loading the getCapabilities response
54
- */
55
- zoomToExtent?: boolean;
56
- /**
57
- * The name of the ListItem element representing the WmsLoader
58
- */
59
- name?: string;
60
- /**
61
- * If true, enables the feature info functionality
62
- */
63
- featureInfoEnabled?: boolean;
64
- /**
65
- * If true, the feature info functionality is active
66
- */
67
- featureInfoActive?: boolean;
68
- /**
69
- * A function to set the feature info active state
70
- */
71
- setFeatureInfoActive?: (val: boolean | ((current: boolean) => boolean)) => void;
72
- /**
73
- * The WMS configuration object
74
- */
75
- config?: WmsConfig;
76
- /**
77
- * A function to handle changes to the WMS configuration
78
- */
79
- onConfigChange?: (config: WmsConfig | false) => void;
80
- /**
81
- * A function to update a LayerType config array that is passed to this component at props.config.layers
82
- */
83
- setLayers?: (layers: LayerType[]) => void;
84
- /**
85
- * If true, shows the delete button for the WMSLoader
86
- */
87
- showDeleteButton?: boolean;
88
- /**
89
- * Custom buttons to display for the WMSLoader
90
- */
91
- buttons?: React.JSX.Element;
92
- sortable?: boolean;
93
- }
94
- export type LayerType = {
95
- visible: boolean;
96
- Name: string;
97
- Attribution?: {
98
- Title: string;
99
- };
100
- } & Omit<Layer2, 'Layer' | 'CRS'> & Partial<Pick<Layer2, 'Layer'>>;
101
- /**
102
- * Loads a WMS getCapabilities xml document and adds a MlWmsLayer component for each layer that is
103
- * offered by the WMS.
104
- *
105
- * @component
106
- */
107
- declare const MlWmsLoader: {
108
- (props: MlWmsLoaderProps): React.JSX.Element;
109
- defaultProps: {
110
- mapId: undefined;
111
- url: string;
112
- urlParameters: {
113
- SERVICE: string;
114
- VERSION: string;
115
- REQUEST: string;
116
- };
117
- wmsUrlParameters: {
118
- TRANSPARENT: string;
119
- };
120
- featureInfoEnabled: boolean;
121
- zoomToExtent: boolean;
122
- showDeleteButton: boolean;
123
- };
124
- };
125
- export default MlWmsLoader;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export default function MlWmsLoaderInstructions(props: {
3
- open: boolean;
4
- }): React.JSX.Element;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export interface wmsLinksProps {
3
- load: (str: string) => void;
4
- open: boolean;
5
- close: () => void;
6
- openWMSLoader: (boolean: boolean) => void;
7
- }
8
- export default function WMSLinks(props: wmsLinksProps): React.JSX.Element;
@@ -1,59 +0,0 @@
1
- import { StyleSpecification } from 'maplibre-gl';
2
- import React from 'react';
3
- import { MlVectorTileLayerProps } from '../components/MlVectorTileLayer/MlVectorTileLayer';
4
- import { MlGeoJsonLayerProps } from '../components/MlGeoJsonLayer/MlGeoJsonLayer';
5
- import { Layer } from 'wms-capabilities';
6
- export interface LayerContextProps {
7
- children: React.ReactNode;
8
- }
9
- export interface wmsLoaderConfigProps {
10
- getFeatureInfoUrl: string;
11
- layers: Layer[];
12
- name: string;
13
- open: boolean;
14
- visible: boolean;
15
- wmsUrl: string;
16
- }
17
- export interface wmsConfig {
18
- featureInfoActive?: boolean;
19
- config?: wmsLoaderConfigProps;
20
- url: string;
21
- }
22
- export type WmsLayerConfig = {
23
- type: 'wms';
24
- name?: string;
25
- id?: string;
26
- config: wmsConfig;
27
- };
28
- export type GeojsonLayerConfig = {
29
- type: 'geojson';
30
- name?: string;
31
- id?: string;
32
- config: MlGeoJsonLayerProps;
33
- };
34
- export type VtLayerConfig = {
35
- type: 'vt';
36
- name?: string;
37
- id?: string;
38
- config: MlVectorTileLayerProps;
39
- };
40
- export type LayerConfig = WmsLayerConfig | GeojsonLayerConfig | VtLayerConfig;
41
- export interface LayerContextType {
42
- layers: LayerConfig[];
43
- setLayers: (layers: LayerConfig[] | ((layers: LayerConfig[]) => LayerConfig[])) => void;
44
- backgroundLayers: MlVectorTileLayerProps['layers'];
45
- setBackgroundLayers: (layers: MlVectorTileLayerProps['layers'] | ((layers: MlVectorTileLayerProps['layers']) => MlVectorTileLayerProps['layers'])) => void;
46
- symbolLayers: MlVectorTileLayerProps['layers'];
47
- setSymbolLayers: (layers: MlVectorTileLayerProps['layers'] | ((layers: MlVectorTileLayerProps['layers']) => MlVectorTileLayerProps['layers'])) => void;
48
- updateStyle: (style: StyleSpecification) => void;
49
- vtLayerConfig: Partial<MlVectorTileLayerProps>;
50
- setTileUrl: (url: string) => void;
51
- tileUrl: string;
52
- moveUp: (layerId: string) => void;
53
- moveDown: (layerId: string) => void;
54
- moveLayer: (layerId: string, getNewPos: (oldPos: number) => number) => void;
55
- }
56
- declare const LayerContext: React.Context<LayerContextType>;
57
- declare function LayerContextProvider(props: LayerContextProps): React.JSX.Element;
58
- export default LayerContext;
59
- export { LayerContextProvider };
@@ -1,26 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import MapLibreGlWrapper from '../components/MapLibreMap/lib/MapLibreGlWrapper';
3
- export interface MapContextType {
4
- mapIds: string[];
5
- mapExists: (map_id: string | undefined) => boolean;
6
- maps: {
7
- [key: string]: MapLibreGlWrapper;
8
- };
9
- map: MapLibreGlWrapper | undefined;
10
- getMap: (map_id: string | undefined) => MapLibreGlWrapper;
11
- setMap: (map: MapLibreGlWrapper) => void;
12
- removeMap: (map_id: string | undefined) => void;
13
- registerMap: (map_id: string | undefined, map: MapLibreGlWrapper) => void;
14
- }
15
- declare const MapContext: React.Context<MapContextType>;
16
- /**
17
- * 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.
18
- MapComponentsProvider must be used one level higher than the first use of MapContext.
19
- *
20
- * 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.
21
- */
22
- declare const MapComponentsProvider: ({ children }: {
23
- children: ReactNode;
24
- }) => React.JSX.Element;
25
- export { MapComponentsProvider };
26
- export default MapContext;
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- declare const SimpleDataContext: React.Context<{}>;
3
- export declare const SimpleDataContextProvider: React.Provider<{}>;
4
- export default SimpleDataContext;
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- export interface SimpleDataProviderProps {
3
- url: string;
4
- format: 'json' | 'csv' | 'xml';
5
- nodeType: string;
6
- data_property: string;
7
- formatData?: (data: any) => any;
8
- onData: () => void;
9
- children: React.ReactNode;
10
- }
11
- declare const SimpleDataProvider: (props: SimpleDataProviderProps) => React.JSX.Element;
12
- export default SimpleDataProvider;
@@ -1,4 +0,0 @@
1
- import './style.css';
2
- import { Decorator } from '@storybook/react-webpack5';
3
- declare const decorators: Decorator[];
4
- export default decorators;
@@ -1,4 +0,0 @@
1
- import './style.css';
2
- import { Decorator } from '@storybook/react-webpack5';
3
- declare const decorators: Decorator[];
4
- export default decorators;
@@ -1,4 +0,0 @@
1
- import './style.css';
2
- import { Decorator } from '@storybook/react-webpack5';
3
- declare const decorators: Decorator[];
4
- export default decorators;
@@ -1,7 +0,0 @@
1
- import { MapLibreMapProps } from '../components/MapLibreMap/MapLibreMap';
2
- import './style.css';
3
- import { Decorator } from '@storybook/react-webpack5';
4
- declare const makeMapContextDecorators: (options: MapLibreMapProps["options"]) => Decorator[];
5
- declare const _default: Decorator[];
6
- export default _default;
7
- export { makeMapContextDecorators };
@@ -1,4 +0,0 @@
1
- import "./style.css";
2
- import { Decorator } from '@storybook/react-webpack5';
3
- declare const decorators: Decorator[];
4
- export default decorators;
@@ -1,7 +0,0 @@
1
- import { MapLibreMapProps } from '../components/MapLibreMap/MapLibreMap';
2
- import './style.css';
3
- import { Decorator } from '@storybook/react-webpack5';
4
- declare const makeMapContextDecorators: (options: MapLibreMapProps["options"]) => Decorator[];
5
- declare const _default: Decorator[];
6
- export default _default;
7
- export { makeMapContextDecorators };
@@ -1,4 +0,0 @@
1
- import './style.css';
2
- import { Decorator } from '@storybook/react-webpack5';
3
- declare const decorators: Decorator[];
4
- export default decorators;
@@ -1,4 +0,0 @@
1
- import './style.css';
2
- import { Decorator } from '@storybook/react-webpack5';
3
- declare const decorators: Decorator[];
4
- export default decorators;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import './style.css';
3
- import { StoryContext } from '@storybook/react-webpack5';
4
- declare const decorators: ((Story: React.FC, context?: StoryContext) => React.ReactElement)[];
5
- export default decorators;
@@ -1,20 +0,0 @@
1
- export interface useAddImageProps {
2
- /**
3
- *
4
- */
5
- imageId: string;
6
- /**
7
- *
8
- */
9
- imagePath: string;
10
- }
11
- /**
12
- *
13
- */
14
- declare const useAddImage: {
15
- (props: useAddImageProps): void;
16
- defaultProps: {
17
- mapId: undefined;
18
- };
19
- };
20
- export default useAddImage;
@@ -1,23 +0,0 @@
1
- import { AddProtocolAction } from 'maplibre-gl';
2
- export interface useAddProtocolProps {
3
- /**
4
- * the protocol string, for example `mbtiles`
5
- * In this example the handler function is called for all tile requests that start with the string `mbtiles://`
6
- */
7
- protocol: string;
8
- /**
9
- * Custom load tile function that will be called when using a source that starts with a custom url schema.
10
- */
11
- handler: AddProtocolAction;
12
- }
13
- /**
14
- * Enables the use of custom protocols (basically custom tile load functions) in the maplibre-gl-js library.
15
- *
16
- */
17
- declare const useAddProtocol: {
18
- (props: useAddProtocolProps): {};
19
- defaultProps: {
20
- mapId: undefined;
21
- };
22
- };
23
- export default useAddProtocol;
@@ -1,35 +0,0 @@
1
- interface useCameraFollowPathProps {
2
- /**
3
- * Id of the target MapLibre instance in mapContext
4
- */
5
- mapId?: string;
6
- /**
7
- * Id of an existing layer in the mapLibre instance to help specify the layer order
8
- * This layer will be visually beneath the layer with the "insertBeforeLayer" id.
9
- */
10
- insertBeforeLayer?: string;
11
- pause?: boolean;
12
- zoom?: number;
13
- pitch?: number;
14
- speed?: number;
15
- kmPerStep?: number;
16
- route?: any;
17
- stepDuration?: number;
18
- timeoutId?: number;
19
- }
20
- export type { useCameraFollowPathProps };
21
- /**
22
- * Component template
23
- *
24
- */
25
- declare const useCameraFollowPath: {
26
- (props: useCameraFollowPathProps): {
27
- play: () => void;
28
- reset: () => void;
29
- };
30
- defaultProps: {
31
- mapId: undefined;
32
- zoom: number;
33
- };
34
- };
35
- export default useCameraFollowPath;
@@ -1,11 +0,0 @@
1
- import { createExportOptions } from './lib';
2
- interface exportMapProps {
3
- /**
4
- * Id of the target MapLibre instance in mapContext
5
- */
6
- mapId?: string;
7
- }
8
- export default function useExportMap(props: exportMapProps): {
9
- createExport: ((options: Omit<createExportOptions, "map"> & Partial<Pick<createExportOptions, "map">>) => Promise<import("./lib").createExportResolverParams>) | undefined;
10
- };
11
- export {};
@@ -1,52 +0,0 @@
1
- import { Map } from 'maplibre-gl';
2
- import jsPDF from 'jspdf';
3
- import MapLibreGlWrapper from '../../components/MapLibreMap/lib/MapLibreGlWrapper';
4
- import { BBox } from 'geojson';
5
- interface createExportOptions {
6
- map: MapLibreGlWrapper;
7
- width: number;
8
- height: number;
9
- bbox: BBox;
10
- bboxUnrotated: BBox;
11
- bearing: number;
12
- format: string;
13
- orientation: string;
14
- }
15
- export type { createExportOptions };
16
- declare const createExport: (options: createExportOptions) => Promise<createExportResolverParams>;
17
- interface createExportResolverParams extends createExportOptions {
18
- createPdf: (_options?: createJsPdfOptions) => Promise<createPdfResolverParams>;
19
- createPng: (_options?: createPngOptions) => Promise<createPngResolverParams>;
20
- renderMap: Map;
21
- hiddenContainer: HTMLDivElement;
22
- }
23
- export type { createExportResolverParams };
24
- interface createJsPdfOptions extends createExportOptions {
25
- renderMap: Map;
26
- hiddenContainer: HTMLDivElement;
27
- }
28
- export type { createJsPdfOptions };
29
- interface createPdfResolverParams extends createJsPdfOptions {
30
- formData: FormData;
31
- pdf: jsPDF;
32
- downloadPdf: (_options?: downloadPdfOptions) => Promise<downloadPdfOptions>;
33
- }
34
- interface downloadPdfOptions extends createJsPdfOptions {
35
- pdf: jsPDF;
36
- }
37
- export type { createPdfResolverParams };
38
- interface createPngOptions extends createExportOptions {
39
- renderMap: Map;
40
- hiddenContainer: HTMLDivElement;
41
- }
42
- export type { createPngOptions };
43
- interface createPngResolverParams extends createPngOptions {
44
- png: string;
45
- downloadPng: (_options?: downloadPngOptions) => Promise<downloadPngOptions>;
46
- }
47
- export type { createPngResolverParams };
48
- interface downloadPngOptions extends createPngOptions {
49
- png: string;
50
- name?: string;
51
- }
52
- export { createExport };
@@ -1,46 +0,0 @@
1
- import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
2
- import MapboxDraw from '@mapbox/mapbox-gl-draw';
3
- import { Feature } from 'geojson';
4
- export interface useFeatureEditorProps {
5
- /**
6
- * Id of the target MapLibre instance in mapContext
7
- */
8
- mapId?: string;
9
- /**
10
- * Id of an existing layer in the mapLibre instance to help specify the layer order
11
- * This layer will be visually beneath the layer with the "insertBeforeLayer" id.
12
- */
13
- insertBeforeLayer?: string;
14
- /**
15
- * Input GeoJson data at initialization
16
- */
17
- geojson?: Feature;
18
- /**
19
- * Callback function that is called each time the GeoJson data has changed within MlFeatureEditor.
20
- * First parameter is the new GeoJson feature.
21
- */
22
- onChange?: (para: Feature[]) => void;
23
- /**
24
- * Callback function that is called each time the GeoJson data within has been finished within MlFeatureEditor.
25
- * First parameter is the new GeoJson feature.
26
- */
27
- onFinish?: () => void;
28
- /**
29
- * Feature editor modes:
30
- * - draw_line_string
31
- * - draw_polygon
32
- * - draw_point
33
- * - simple_select
34
- * - direct_select
35
- */
36
- mode?: keyof MapboxDraw.Modes;
37
- }
38
- /**
39
- * GeoJson Feature editor that allows to create or manipulate GeoJson data
40
- */
41
- declare const useFeatureEditor: (props: useFeatureEditorProps) => {
42
- feature: Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>[] | undefined;
43
- drawToolsReady: boolean;
44
- draw: MapboxDraw | null;
45
- };
46
- export default useFeatureEditor;
@@ -1,116 +0,0 @@
1
- declare function featureEditorStyle(): ({
2
- id: string;
3
- type: string;
4
- filter: (string | string[])[];
5
- paint: {
6
- 'fill-color': string;
7
- 'fill-outline-color': string;
8
- 'fill-opacity': number;
9
- 'line-color'?: undefined;
10
- 'line-width'?: undefined;
11
- 'line-dasharray'?: undefined;
12
- 'circle-radius'?: undefined;
13
- 'circle-color'?: undefined;
14
- 'circle-stroke-color'?: undefined;
15
- 'circle-stroke-width'?: undefined;
16
- 'circle-opacity'?: undefined;
17
- };
18
- layout?: undefined;
19
- } | {
20
- id: string;
21
- type: string;
22
- filter: (string | string[])[];
23
- layout: {
24
- 'line-cap': string;
25
- 'line-join': string;
26
- };
27
- paint: {
28
- 'line-color': string;
29
- 'line-width': number;
30
- 'fill-color'?: undefined;
31
- 'fill-outline-color'?: undefined;
32
- 'fill-opacity'?: undefined;
33
- 'line-dasharray'?: undefined;
34
- 'circle-radius'?: undefined;
35
- 'circle-color'?: undefined;
36
- 'circle-stroke-color'?: undefined;
37
- 'circle-stroke-width'?: undefined;
38
- 'circle-opacity'?: undefined;
39
- };
40
- } | {
41
- id: string;
42
- type: string;
43
- filter: (string | string[])[];
44
- layout: {
45
- 'line-cap': string;
46
- 'line-join': string;
47
- };
48
- paint: {
49
- 'line-color': string;
50
- 'line-dasharray': number[];
51
- 'line-width': number;
52
- 'fill-color'?: undefined;
53
- 'fill-outline-color'?: undefined;
54
- 'fill-opacity'?: undefined;
55
- 'circle-radius'?: undefined;
56
- 'circle-color'?: undefined;
57
- 'circle-stroke-color'?: undefined;
58
- 'circle-stroke-width'?: undefined;
59
- 'circle-opacity'?: undefined;
60
- };
61
- } | {
62
- id: string;
63
- type: string;
64
- filter: (string | string[])[];
65
- paint: {
66
- 'circle-radius': number;
67
- 'circle-color': string;
68
- 'circle-stroke-color': string;
69
- 'circle-stroke-width': number;
70
- 'fill-color'?: undefined;
71
- 'fill-outline-color'?: undefined;
72
- 'fill-opacity'?: undefined;
73
- 'line-color'?: undefined;
74
- 'line-width'?: undefined;
75
- 'line-dasharray'?: undefined;
76
- 'circle-opacity'?: undefined;
77
- };
78
- layout?: undefined;
79
- } | {
80
- id: string;
81
- type: string;
82
- filter: (string | string[])[];
83
- paint: {
84
- 'circle-radius': number;
85
- 'circle-color': string;
86
- 'fill-color'?: undefined;
87
- 'fill-outline-color'?: undefined;
88
- 'fill-opacity'?: undefined;
89
- 'line-color'?: undefined;
90
- 'line-width'?: undefined;
91
- 'line-dasharray'?: undefined;
92
- 'circle-stroke-color'?: undefined;
93
- 'circle-stroke-width'?: undefined;
94
- 'circle-opacity'?: undefined;
95
- };
96
- layout?: undefined;
97
- } | {
98
- id: string;
99
- type: string;
100
- filter: (string | string[])[];
101
- paint: {
102
- 'circle-radius': number;
103
- 'circle-opacity': number;
104
- 'circle-color': string;
105
- 'fill-color'?: undefined;
106
- 'fill-outline-color'?: undefined;
107
- 'fill-opacity'?: undefined;
108
- 'line-color'?: undefined;
109
- 'line-width'?: undefined;
110
- 'line-dasharray'?: undefined;
111
- 'circle-stroke-color'?: undefined;
112
- 'circle-stroke-width'?: undefined;
113
- };
114
- layout?: undefined;
115
- })[];
116
- export default featureEditorStyle;
@@ -1,8 +0,0 @@
1
- import { FitBoundsOptions } from 'maplibre-gl';
2
- export interface useFitLayerBoundsPros {
3
- layerId: string;
4
- type: "geojson" | "wms" | "vt";
5
- fitBoundsOptions?: FitBoundsOptions;
6
- }
7
- declare function useFitLayerBounds(props: useFitLayerBoundsPros): void;
8
- export default useFitLayerBounds;
@@ -1,26 +0,0 @@
1
- import { FeatureCollection } from 'geojson';
2
- export interface useGpxProps {
3
- /**
4
- * a string containing GPX data that is supposed to be parsed and converted to GeoJSON by this hook
5
- */
6
- data?: string;
7
- }
8
- export interface MetadataType {
9
- title: string;
10
- value: string;
11
- id: number;
12
- }
13
- /**
14
- * useGpx hook converts GPX data to GeoJSON
15
- *
16
- */
17
- declare const useGpx: {
18
- (props: useGpxProps): {
19
- geojson: FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties> | undefined;
20
- metadata: MetadataType[];
21
- };
22
- defaultProps: {
23
- data: undefined;
24
- };
25
- };
26
- export default useGpx;