@mapcomponents/react-maplibre 0.1.66 → 0.1.67

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 (179) hide show
  1. package/.github/workflows/node_version_test.yml +1 -1
  2. package/.storybook/main.js +37 -31
  3. package/.storybook/preview.js +21 -0
  4. package/CHANGELOG.md +13 -0
  5. package/coverage/clover.xml +419 -344
  6. package/coverage/coverage-final.json +15 -14
  7. package/coverage/lcov-report/index.html +61 -61
  8. package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +24 -18
  9. package/coverage/lcov-report/src/components/MapLibreMap/index.html +14 -14
  10. package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +2 -2
  11. package/coverage/lcov-report/src/components/MlCenterPosition/index.html +1 -1
  12. package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
  13. package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
  14. package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx.html +1 -1
  15. package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx.html +1 -1
  16. package/coverage/lcov-report/src/components/MlCreatePdfForm/index.html +1 -1
  17. package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +1 -1
  18. package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
  19. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
  20. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
  21. package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +9 -9
  22. package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
  23. package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +1 -1
  24. package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
  25. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js.html +1 -1
  26. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js.html +1 -1
  27. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx.html +1 -1
  28. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx.html +1 -1
  29. package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/index.html +1 -1
  30. package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.tsx.html +1 -1
  31. package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/index.html +1 -1
  32. package/coverage/lcov-report/src/components/MlGpxViewer/MlGpxViewer.tsx.html +1 -1
  33. package/coverage/lcov-report/src/components/MlGpxViewer/index.html +1 -1
  34. package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
  35. package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
  36. package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
  37. package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
  38. package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +52 -40
  39. package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +10 -10
  40. package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +4 -4
  41. package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
  42. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
  43. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
  44. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
  45. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
  46. package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
  47. package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
  48. package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
  49. package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
  50. package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
  51. package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
  52. package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +1 -1
  53. package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
  54. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
  55. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +1 -1
  56. package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
  57. package/coverage/lcov-report/src/components/MlScaleReference/{MlScaleReference.js.html → MlScaleReference.tsx.html} +57 -36
  58. package/coverage/lcov-report/src/components/MlScaleReference/index.html +2 -2
  59. package/coverage/lcov-report/src/components/MlShareMapState/{MlShareMapState.js.html → MlShareMapState.tsx.html} +192 -84
  60. package/coverage/lcov-report/src/components/MlShareMapState/index.html +20 -20
  61. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/ColorPicker.tsx.html +1 -1
  62. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerList.tsx.html +1 -1
  63. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerListItem.tsx.html +1 -1
  64. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx.html +1 -1
  65. package/coverage/lcov-report/src/components/MlSketchTool/LayerList/index.html +1 -1
  66. package/coverage/lcov-report/src/components/MlSketchTool/MlSketchTool.tsx.html +1 -1
  67. package/coverage/lcov-report/src/components/MlSketchTool/index.html +1 -1
  68. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx.html +1 -1
  69. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
  70. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
  71. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreejsLayer.tsx.html +769 -0
  72. package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +25 -10
  73. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +1 -1
  74. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
  75. package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
  76. package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
  77. package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +1 -1
  78. package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +1 -1
  79. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +11 -11
  80. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +11 -11
  81. package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +1 -1
  82. package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
  83. package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +27 -18
  84. package/coverage/lcov-report/src/components/MlWmsLoader/index.html +11 -11
  85. package/coverage/lcov-report/src/contexts/MapContext.tsx.html +50 -26
  86. package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
  87. package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
  88. package/coverage/lcov-report/src/contexts/index.html +1 -1
  89. package/coverage/lcov-report/src/hooks/index.html +21 -21
  90. package/coverage/lcov-report/src/hooks/useCameraFollowPath/index.html +1 -1
  91. package/coverage/lcov-report/src/hooks/useCameraFollowPath/useCameraFollowPath.tsx.html +1 -1
  92. package/coverage/lcov-report/src/hooks/useExportMap/index.html +1 -1
  93. package/coverage/lcov-report/src/hooks/useExportMap/index.ts.html +1 -1
  94. package/coverage/lcov-report/src/hooks/useExportMap/lib.ts.html +1 -1
  95. package/coverage/lcov-report/src/hooks/useGpx/index.html +1 -1
  96. package/coverage/lcov-report/src/hooks/useGpx/useGpx.tsx.html +1 -1
  97. package/coverage/lcov-report/src/hooks/useLayer.ts.html +1 -1
  98. package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +9 -9
  99. package/coverage/lcov-report/src/hooks/useLayerFilter/index.html +1 -1
  100. package/coverage/lcov-report/src/hooks/useLayerFilter/useLayerFilter.ts.html +1 -1
  101. package/coverage/lcov-report/src/hooks/useLayerHoverPopup/index.html +1 -1
  102. package/coverage/lcov-report/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx.html +9 -6
  103. package/coverage/lcov-report/src/hooks/useMap.ts.html +2 -2
  104. package/coverage/lcov-report/src/hooks/useMapState.ts.html +8 -29
  105. package/coverage/lcov-report/src/hooks/useSource.ts.html +10 -10
  106. package/coverage/lcov-report/src/hooks/useWms.ts.html +1 -1
  107. package/coverage/lcov-report/src/index.html +1 -1
  108. package/coverage/lcov-report/src/index.ts.html +80 -11
  109. package/coverage/lcov.info +741 -604
  110. package/dist/components/MapLibreMap/MapLibreMap.stories.d.ts +3 -0
  111. package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +17 -15
  112. package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +1 -1
  113. package/dist/components/MlComponentTemplate/MlComponentTemplate.stories.d.ts +1 -1
  114. package/dist/components/MlCreatePdfButton/MlCreatePdfButton.stories.d.ts +1 -1
  115. package/dist/components/MlCreatePdfForm/MlCreatePdfForm.stories.d.ts +1 -1
  116. package/dist/components/MlFeatureEditor/lib/create_supplementary_points.d.ts +1 -1
  117. package/dist/components/MlFeatureEditor/lib/create_vertex.d.ts +1 -1
  118. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +1 -1
  119. package/dist/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.stories.d.ts +1 -1
  120. package/dist/components/MlGpxViewer/MlGpxViewer.stories.d.ts +1 -1
  121. package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.d.ts +1 -1
  122. package/dist/components/MlLayerMagnify/MlLayerMagnify.stories.d.ts +1 -1
  123. package/dist/components/MlLayerSwipe/MlLayerSwipe.stories.d.ts +1 -1
  124. package/dist/components/MlScaleReference/MlScaleReference.d.ts +7 -1
  125. package/dist/components/MlShareMapState/MlShareMapState.d.ts +32 -13
  126. package/dist/components/MlShareMapState/MlShareMapState.stories.d.ts +15 -9
  127. package/dist/components/MlSketchTool/MlSketchTool.stories.d.ts +1 -1
  128. package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.d.ts +1 -1
  129. package/dist/components/MlSpatialElevationProfile/util/getElevationData.d.ts +1 -1
  130. package/dist/components/MlThreeJsLayer/MlThreeJsLayer.stories.d.ts +1 -1
  131. package/dist/components/MlThreeJsLayer/MlThreejsLayer.d.ts +29 -0
  132. package/dist/components/MlThreeJsLayer/lib/GLTFLoader.d.ts +2 -1
  133. package/dist/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.stories.d.ts +1 -1
  134. package/dist/components/MlWmsLoader/MlWmsLoader.stories.d.ts +1 -1
  135. package/dist/contexts/MapContext.d.ts +13 -2
  136. package/dist/custom.d.d.ts +1 -1
  137. package/dist/decorators/MapContextDecorator.d.ts +1 -1
  138. package/dist/decorators/MapContextDecoratorHooks.d.ts +1 -1
  139. package/dist/decorators/MultiMapContextDecorator.d.ts +1 -1
  140. package/dist/decorators/NoNavToolsDecorator.d.ts +1 -1
  141. package/dist/decorators/ThemeWrapper.d.ts +1 -3
  142. package/dist/hooks/useCameraFollowPath/useCameraFollowPath.stories.d.ts +1 -1
  143. package/dist/hooks/useLayerFilter/useLayerFilter.stories.d.ts +1 -1
  144. package/dist/index.d.ts +18 -8
  145. package/dist/index.esm.js +5590 -3701
  146. package/dist/index.esm.js.map +1 -1
  147. package/dist/setupTests.d.ts +6 -6
  148. package/package.json +56 -49
  149. package/public/thumbnails/{MlGPXViewer.png → MlGpxViewer.png} +0 -0
  150. package/rollup.config.js +49 -48
  151. package/src/@types/assets/index.d.ts +20 -0
  152. package/src/components/MapLibreMap/MapLibreMap.stories.js +8 -1
  153. package/src/components/MapLibreMap/MapLibreMap.tsx +11 -9
  154. package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +49 -39
  155. package/src/components/MlCenterPosition/MlCenterPosition.tsx +1 -1
  156. package/src/components/MlFollowGps/MlFollowGps.tsx +8 -8
  157. package/src/components/MlLayerMagnify/MlLayerMagnify.tsx +21 -17
  158. package/src/components/MlLayerSwipe/MlLayerSwipe.tsx +3 -3
  159. package/src/components/MlScaleReference/{MlScaleReference.js → MlScaleReference.tsx} +38 -31
  160. package/src/components/MlShareMapState/MlShareMapState.stories.tsx +100 -0
  161. package/src/components/MlShareMapState/{MlShareMapState.js → MlShareMapState.tsx} +94 -58
  162. package/src/components/MlThreeJsLayer/MlThreejsLayer.tsx +228 -0
  163. package/src/components/MlWmsLoader/MlWmsLoader.tsx +7 -4
  164. package/src/contexts/MapContext.tsx +26 -19
  165. package/src/custom.d.ts +5 -0
  166. package/src/decorators/MapContextDecorator.js +39 -28
  167. package/src/decorators/MapContextDecoratorHooks.js +18 -8
  168. package/src/decorators/MultiMapContextDecorator.js +79 -69
  169. package/src/decorators/NoNavToolsDecorator.js +34 -25
  170. package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx +5 -4
  171. package/src/hooks/useMap.ts +1 -1
  172. package/src/hooks/useMapState.ts +6 -13
  173. package/src/hooks/useSource.ts +1 -1
  174. package/src/index.ts +31 -8
  175. package/src/ui_components/TopToolbar.tsx +1 -1
  176. package/tsconfig.json +1 -0
  177. package/src/components/MlShareMapState/MlShareMapState.stories.js +0 -100
  178. package/src/custom.d.tsx +0 -26
  179. package/src/decorators/ThemeWrapper.tsx +0 -9
@@ -11,5 +11,8 @@ declare namespace storyoptions {
11
11
  }
12
12
  }
13
13
  }
14
+ export namespace parameters {
15
+ const sourceLink: string;
16
+ }
14
17
  }
15
18
  import MapLibreMap from "./MapLibreMap";
@@ -1,4 +1,4 @@
1
- import { Map, IControl, MapOptions as MapOptionsType, MapEventType, MapLayerEventType, StyleImageInterface, LayerSpecification, CustomLayerInterface, SourceSpecification, ControlPosition } from '!maplibre-gl';
1
+ import { Map, IControl, MapOptions as MapOptionsType, MapEventType, MapLayerEventType, StyleImageInterface, LayerSpecification, CustomLayerInterface, SourceSpecification, ControlPosition, StyleImageMetadata } from '!maplibre-gl';
2
2
  import { Map as MapType, Style } from 'maplibre-gl';
3
3
  type WrapperEventArgArray = [string, (arg0: unknown) => void];
4
4
  type EventArgArray = [
@@ -28,6 +28,18 @@ type ViewportState = {
28
28
  *
29
29
  * @class
30
30
  */
31
+ interface MapLibreGlWrapper extends MapType {
32
+ addImage: (id: string, image: HTMLImageElement | ImageBitmap | ImageData | {
33
+ width: number;
34
+ height: number;
35
+ data: Uint8Array | Uint8ClampedArray;
36
+ } | StyleImageInterface, key?: Partial<StyleImageMetadata> | string | undefined, componentId?: string | undefined) => this;
37
+ addLayer: (layer: (LayerSpecification & {
38
+ source?: string | SourceSpecification | undefined;
39
+ }) | (CustomLayerInterface & {
40
+ source?: string | SourceSpecification | undefined;
41
+ }), beforeId?: string | undefined, componentId?: string | undefined) => this;
42
+ }
31
43
  declare class MapLibreGlWrapper {
32
44
  registeredElements: {
33
45
  [key: string]: {
@@ -77,21 +89,11 @@ declare class MapLibreGlWrapper {
77
89
  initRegisteredElements: (componentId: string, force?: boolean | undefined) => void;
78
90
  addNativeMaplibreFunctionsAndProps: () => void;
79
91
  map: MapType;
80
- style: object;
92
+ style: Style;
81
93
  styleJson: object;
82
- addLayer: (layer: (LayerSpecification & {
83
- source?: string | SourceSpecification | undefined;
84
- }) | (CustomLayerInterface & {
85
- source?: string | SourceSpecification | undefined;
86
- }), beforeId?: string | undefined, componentId?: string | undefined) => Map | undefined;
87
- addSource: (id: string, source: SourceSpecification, componentId?: string | undefined) => Map | undefined;
88
- addControl: (control: IControl | unknown, position?: ControlPosition | undefined, componentId?: string | undefined) => Map | undefined;
89
- addImage: (id: string, image: HTMLImageElement | ImageBitmap | ImageData | {
90
- width: number;
91
- height: number;
92
- data: Uint8Array | Uint8ClampedArray;
93
- } | StyleImageInterface, componentId?: string | undefined) => void;
94
- on: (type: keyof MapLayerEventType | keyof MapEventType | string, layerId: string | ((ev: unknown) => void), handler?: ((ev: MapEventType & unknown) => Map | void) | string, componentId?: string | undefined) => Map | undefined;
94
+ addSource: (id: string, source: SourceSpecification, componentId?: string | undefined) => this;
95
+ addControl: (control: IControl | unknown, position?: ControlPosition | undefined, componentId?: string | undefined) => this;
96
+ on: (type: keyof MapLayerEventType | keyof MapEventType | string, layerId: string | ((ev: unknown) => void), handler?: ((ev: MapEventType & unknown) => Map | void) | string, componentId?: string | undefined) => this;
95
97
  cleanup: (componentId: string) => void;
96
98
  constructor(props: {
97
99
  mapOptions: MapOptionsType;
@@ -23,7 +23,7 @@ declare const storyoptions: {
23
23
  };
24
24
  };
25
25
  argTypes: {};
26
- decorators: ((Story: any) => JSX.Element)[];
26
+ decorators: ((Story: any, context: any) => JSX.Element)[];
27
27
  parameters: {
28
28
  docs: {
29
29
  source: {
@@ -7,7 +7,7 @@ declare const storyoptions: {
7
7
  };
8
8
  };
9
9
  argTypes: {};
10
- decorators: ((Story: any) => JSX.Element)[];
10
+ decorators: ((Story: any, context: any) => JSX.Element)[];
11
11
  };
12
12
  export default storyoptions;
13
13
  export declare const ExampleConfig: any;
@@ -7,7 +7,7 @@ declare const storyoptions: {
7
7
  };
8
8
  };
9
9
  argTypes: {};
10
- decorators: ((Story: any) => JSX.Element)[];
10
+ decorators: ((Story: any, context: any) => JSX.Element)[];
11
11
  };
12
12
  export default storyoptions;
13
13
  export declare const ExampleConfig: any;
@@ -8,7 +8,7 @@ declare const storyoptions: {
8
8
  };
9
9
  };
10
10
  argTypes: {};
11
- decorators: ((Story: any) => JSX.Element)[];
11
+ decorators: ((Story: any, context: any) => JSX.Element)[];
12
12
  };
13
13
  export default storyoptions;
14
14
  export declare const ExampleConfig: any;
@@ -1,2 +1,2 @@
1
1
  export default createSupplementaryPoints;
2
- declare function createSupplementaryPoints(geojson: any, options?: {}, basePath?: null): GeoJSON[];
2
+ declare function createSupplementaryPoints(geojson: any, options?: {}, basePath?: null): typeof import("geojson")[];
@@ -10,4 +10,4 @@ export default create_vertex;
10
10
  * @param {boolean} selected
11
11
  * @return {GeoJSON} Point
12
12
  */
13
- declare function create_vertex(parentId: string, coordinates: Array<number>, path: string, selected: boolean): GeoJSON;
13
+ declare function create_vertex(parentId: string, coordinates: Array<number>, path: string, selected: boolean): typeof import("geojson");
@@ -3,7 +3,7 @@ declare const storyoptions: {
3
3
  title: string;
4
4
  component: (props: MlGeoJsonLayerProps) => JSX.Element;
5
5
  argTypes: {};
6
- decorators: ((Story: any) => JSX.Element)[];
6
+ decorators: ((Story: any, context: any) => JSX.Element)[];
7
7
  };
8
8
  export default storyoptions;
9
9
  export declare const Linestring: any;
@@ -7,7 +7,7 @@ declare const storyoptions: {
7
7
  };
8
8
  };
9
9
  argTypes: {};
10
- decorators: ((Story: any) => JSX.Element)[];
10
+ decorators: ((Story: any, context: any) => JSX.Element)[];
11
11
  };
12
12
  export default storyoptions;
13
13
  export declare const ExampleConfig: any;
@@ -11,7 +11,7 @@ declare const storyoptions: {
11
11
  };
12
12
  };
13
13
  };
14
- decorators: ((Story: any) => JSX.Element)[];
14
+ decorators: ((Story: any, context: any) => JSX.Element)[];
15
15
  };
16
16
  export default storyoptions;
17
17
  export declare const ExampleConfig: any;
@@ -2,7 +2,7 @@ declare const storyoptions: {
2
2
  title: string;
3
3
  component: (props: import("./MlImageMarkerLayer").MlImageMarkerLayerProps) => JSX.Element;
4
4
  argTypes: {};
5
- decorators: ((Story: any) => JSX.Element)[];
5
+ decorators: ((Story: any, context: any) => JSX.Element)[];
6
6
  };
7
7
  export default storyoptions;
8
8
  export declare const ExampleConfig: any;
@@ -8,7 +8,7 @@ declare const storyoptions: {
8
8
  };
9
9
  };
10
10
  argTypes: {};
11
- decorators: ((Story: any) => JSX.Element)[];
11
+ decorators: ((Story: any, context: any) => JSX.Element)[];
12
12
  };
13
13
  export default storyoptions;
14
14
  export declare const ExampleConfig: any;
@@ -7,7 +7,7 @@ declare const storyoptions: {
7
7
  };
8
8
  };
9
9
  argTypes: {};
10
- decorators: ((Story: any) => JSX.Element)[];
10
+ decorators: ((Story: any, context: any) => JSX.Element)[];
11
11
  };
12
12
  export default storyoptions;
13
13
  export declare const ExampleConfig: any;
@@ -1,2 +1,8 @@
1
+ export interface MlScaleReferenceProps {
2
+ mapId?: string;
3
+ insertBeforeLayer?: string | undefined;
4
+ maxWidth?: number;
5
+ unit?: string;
6
+ }
7
+ declare const MlScaleReference: (props: MlScaleReferenceProps) => JSX.Element;
1
8
  export default MlScaleReference;
2
- declare function MlScaleReference(props: any): JSX.Element;
@@ -1,4 +1,15 @@
1
- export default MlShareMapState;
1
+ import PropTypes from 'prop-types';
2
+ export interface MapState {
3
+ lat?: number;
4
+ lng?: number;
5
+ zoom?: number;
6
+ bearing?: number;
7
+ pitch?: number;
8
+ layers?: {
9
+ visible: boolean;
10
+ id: string;
11
+ }[];
12
+ }
2
13
  /**
3
14
  * TODO: Add short & useful description
4
15
  *
@@ -7,16 +18,24 @@ export default MlShareMapState;
7
18
  *
8
19
  * @component
9
20
  */
10
- declare function MlShareMapState(props: {
11
- mapId: string;
12
- }): JSX.Element;
13
- declare namespace MlShareMapState {
14
- namespace defaultProps {
15
- const mapId: undefined;
16
- }
17
- namespace propTypes {
18
- const mapId_1: PropTypes.Requireable<string>;
19
- export { mapId_1 as mapId };
20
- }
21
+ export interface MlShareMapStateProps {
22
+ mapId?: string;
23
+ idPrefix?: string;
24
+ active?: boolean;
21
25
  }
22
- import PropTypes from "prop-types";
26
+ export interface LayerStatesInterface {
27
+ [key: string]: boolean;
28
+ }
29
+ declare const MlShareMapState: {
30
+ (props: MlShareMapStateProps): JSX.Element;
31
+ defaultProps: {
32
+ mapId: undefined;
33
+ };
34
+ propTypes: {
35
+ /**
36
+ * Id of the target MapLibre instance in mapContext
37
+ */
38
+ mapId: PropTypes.Requireable<string>;
39
+ };
40
+ };
41
+ export default MlShareMapState;
@@ -1,10 +1,16 @@
1
+ declare const storyoptions: {
2
+ title: string;
3
+ component: {
4
+ (props: import("./MlShareMapState").MlShareMapStateProps): JSX.Element;
5
+ defaultProps: {
6
+ mapId: undefined;
7
+ };
8
+ propTypes: {
9
+ mapId: import("prop-types").Requireable<string>;
10
+ };
11
+ };
12
+ argTypes: {};
13
+ decorators: ((Story: any, context: any) => JSX.Element)[];
14
+ };
1
15
  export default storyoptions;
2
- export const ExampleConfig: any;
3
- declare namespace storyoptions {
4
- export const title: string;
5
- export { MlShareMapState as component };
6
- export const argTypes: {};
7
- export { mapContextDecorator as decorators };
8
- }
9
- import MlShareMapState from "./MlShareMapState";
10
- import mapContextDecorator from "../../decorators/MapContextDecorator";
16
+ export declare const ExampleConfig: any;
@@ -8,7 +8,7 @@ declare const storyoptions: {
8
8
  };
9
9
  };
10
10
  argTypes: {};
11
- decorators: ((Story: any) => JSX.Element)[];
11
+ decorators: ((Story: any, context: any) => JSX.Element)[];
12
12
  };
13
13
  export default storyoptions;
14
14
  export declare const ExampleConfig: any;
@@ -13,7 +13,7 @@ declare const storyoptions: {
13
13
  };
14
14
  };
15
15
  };
16
- decorators: ((Story: any) => JSX.Element)[];
16
+ decorators: ((Story: any, context: any) => JSX.Element)[];
17
17
  };
18
18
  export default storyoptions;
19
19
  export declare const ExampleConfig: any;
@@ -8,7 +8,7 @@ interface _geojsonInfo {
8
8
  line: line;
9
9
  min: number;
10
10
  }
11
- export default function getElevationData(_geojsonInfo: _geojsonInfo, elevationFactor: number): import("@turf/turf").FeatureCollection<GeoJSON.Geometry, {
11
+ export default function getElevationData(_geojsonInfo: _geojsonInfo, elevationFactor: number): import("@turf/turf").FeatureCollection<import("geojson").Geometry, {
12
12
  [name: string]: any;
13
13
  }>;
14
14
  export {};
@@ -15,7 +15,7 @@ declare const storyoptions: {
15
15
  };
16
16
  };
17
17
  };
18
- decorators: ((Story: any) => JSX.Element)[];
18
+ decorators: ((Story: any, context: any) => JSX.Element)[];
19
19
  };
20
20
  export default storyoptions;
21
21
  export declare const ExampleConfig: any;
@@ -0,0 +1,29 @@
1
+ import PropTypes from 'prop-types';
2
+ /**
3
+ * Renders obj or gltf 3D Models on the MapLibreMap referenced by props.mapId
4
+ *
5
+ * @component
6
+ */
7
+ export interface MlThreeJsLayerProps {
8
+ mapId?: string;
9
+ init?: object;
10
+ onDone?: () => void;
11
+ }
12
+ declare const MlThreeJsLayer: {
13
+ (props: MlThreeJsLayerProps): JSX.Element;
14
+ propTypes: {
15
+ /**
16
+ * Id of the target MapLibre instance in mapContext
17
+ */
18
+ mapId: PropTypes.Requireable<string>;
19
+ /**
20
+ * function that gets called when initialized
21
+ */
22
+ init: PropTypes.Requireable<(...args: any[]) => any>;
23
+ /**
24
+ * function that gets called when models are loaded
25
+ */
26
+ onDone: PropTypes.Requireable<(...args: any[]) => any>;
27
+ };
28
+ };
29
+ export default MlThreeJsLayer;
@@ -1,5 +1,5 @@
1
1
  export default GLTFLoader;
2
- declare class GLTFLoader {
2
+ declare class GLTFLoader extends THREE.Loader {
3
3
  constructor(manager: any);
4
4
  dracoLoader: any;
5
5
  ktx2Loader: any;
@@ -15,3 +15,4 @@ declare class GLTFLoader {
15
15
  parse(data: any, path: any, onLoad: any, onError: any): void;
16
16
  parseAsync(data: any, path: any): Promise<any>;
17
17
  }
18
+ import * as THREE from "three";
@@ -15,7 +15,7 @@ declare const storyoptions: {
15
15
  url: {};
16
16
  layer: {};
17
17
  };
18
- decorators: ((Story: any) => JSX.Element)[];
18
+ decorators: ((Story: any, context: any) => JSX.Element)[];
19
19
  };
20
20
  export default storyoptions;
21
21
  export declare const ExampleConfig: any;
@@ -18,7 +18,7 @@ declare const storyoptions: {
18
18
  url: {};
19
19
  layer: {};
20
20
  };
21
- decorators: ((Story: any) => JSX.Element)[];
21
+ decorators: ((Story: any, context: any) => JSX.Element)[];
22
22
  };
23
23
  export default storyoptions;
24
24
  export declare const ExampleConfig: any;
@@ -1,4 +1,15 @@
1
- import React from "react";
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: MapLibreGlWrapper[];
7
+ map: MapLibreGlWrapper | undefined;
8
+ getMap: (map_id: string | undefined) => MapLibreGlWrapper;
9
+ setMap: (map: MapLibreGlWrapper) => void;
10
+ removeMap: (map_id: string | undefined) => void;
11
+ registerMap: (map_id: string | undefined, map: MapLibreGlWrapper) => void;
12
+ }
2
13
  declare const MapContext: React.Context<MapContextType>;
3
14
  /**
4
15
  * 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.
@@ -7,7 +18,7 @@ MapComponentsProvider must be used one level higher than the first use of MapCon
7
18
  * 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.
8
19
  */
9
20
  declare const MapComponentsProvider: ({ children }: {
10
- children: any;
21
+ children: ReactNode;
11
22
  }) => JSX.Element;
12
23
  export { MapComponentsProvider };
13
24
  export default MapContext;
@@ -7,7 +7,7 @@ declare module "*.js" {
7
7
  const content: any;
8
8
  export default content;
9
9
  }
10
- type MapContextType = {
10
+ declare type MapContextType = {
11
11
  mapIds: [string?];
12
12
  mapExists: Function;
13
13
  maps: [];
@@ -1,2 +1,2 @@
1
1
  export default decorators;
2
- declare const decorators: ((Story: any) => JSX.Element)[];
2
+ declare const decorators: ((Story: any, context: any) => JSX.Element)[];
@@ -1,2 +1,2 @@
1
1
  export default decorators;
2
- declare const decorators: ((Story: any) => JSX.Element)[];
2
+ declare const decorators: ((Story: any, context: any) => JSX.Element)[];
@@ -1,2 +1,2 @@
1
1
  export default decorators;
2
- declare const decorators: ((Story: any) => JSX.Element)[];
2
+ declare const decorators: ((Story: any, context: any) => JSX.Element)[];
@@ -1,2 +1,2 @@
1
1
  export default decorators;
2
- declare const decorators: ((Story: any) => JSX.Element)[];
2
+ declare const decorators: ((Story: any, context: any) => JSX.Element)[];
@@ -1,3 +1 @@
1
- export default function ThemeWrapper(props: {
2
- children: unknown;
3
- }): JSX.Element;
1
+ export default function ThemeWrapper(props: any): JSX.Element;
@@ -11,7 +11,7 @@ declare const storyoptions: {
11
11
  };
12
12
  };
13
13
  argTypes: {};
14
- decorators: ((Story: any) => JSX.Element)[];
14
+ decorators: ((Story: any, context: any) => JSX.Element)[];
15
15
  };
16
16
  export default storyoptions;
17
17
  export declare const ExampleConfig: any;
@@ -3,7 +3,7 @@ declare const storyoptions: {
3
3
  title: string;
4
4
  component: typeof useLayerFilter;
5
5
  argTypes: {};
6
- decorators: ((Story: any) => JSX.Element)[];
6
+ decorators: ((Story: any, context: any) => JSX.Element)[];
7
7
  };
8
8
  export default storyoptions;
9
9
  export declare const ExampleConfig: any;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,12 @@
1
+ export { default as MapLibreGlWrapper } from './components/MapLibreMap/lib/MapLibreGlWrapper';
1
2
  export { default as MapLibreMap } from "./components/MapLibreMap/MapLibreMap";
3
+ export { default as MlCenterPosition } from "./components/MlCenterPosition/MlCenterPosition";
2
4
  export { default as MlComponentTemplate } from "./components/MlComponentTemplate/MlComponentTemplate";
3
5
  export { default as MlCreatePdfButton } from "./components/MlCreatePdfButton/MlCreatePdfButton";
4
6
  export { default as MlCreatePdfForm } from "./components/MlCreatePdfForm/MlCreatePdfForm";
5
7
  export { default as MlPdfPreview } from "./components/MlCreatePdfForm/lib/PdfPreview";
8
+ export { default as PdfContext } from "./components/MlCreatePdfForm/lib/PdfContext";
9
+ export { default as PdfForm } from "./components/MlCreatePdfForm/lib/PdfForm";
6
10
  export { default as MlFeatureEditor } from "./components/MlFeatureEditor/MlFeatureEditor";
7
11
  export { default as MlFillExtrusionLayer } from "./components/MlFillExtrusionLayer/MlFillExtrusionLayer";
8
12
  export { default as MlFollowGps } from "./components/MlFollowGps/MlFollowGps";
@@ -12,27 +16,33 @@ export { default as MlMeasureTool } from "./components/MlMeasureTool/MlMeasureTo
12
16
  export { default as MlNavigationTools } from "./components/MlNavigationTools/MlNavigationTools";
13
17
  export { default as MlNavigationCompass } from "./components/MlNavigationCompass/MlNavigationCompass";
14
18
  export { default as MlLayer } from "./components/MlLayer/MlLayer";
15
- export { default as MlVectorTileLayer } from "./components/MlVectorTileLayer/MlVectorTileLayer";
16
- export { default as MlWmsLayer } from "./components/MlWmsLayer/MlWmsLayer";
17
19
  export { default as MlScaleReference } from "./components/MlScaleReference/MlScaleReference";
18
20
  export { default as MlLayerMagnify } from "./components/MlLayerMagnify/MlLayerMagnify";
19
21
  export { default as MlLayerSwipe } from "./components/MlLayerSwipe/MlLayerSwipe";
20
22
  export { default as MlTransitionGeoJsonLayer } from "./components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer";
21
23
  export { default as MlMarker } from "./components/MlMarker/MlMarker";
24
+ export { default as MlOsmLayer } from "./components/MlOsmLayer/MlOsmLayer.js";
22
25
  export { default as MlGpxViewer } from "./components/MlGpxViewer/MlGpxViewer";
23
26
  export { default as GeoJsonProvider } from "./components/MlGpxViewer/util/GeoJsonProvider";
24
27
  export { default as GeoJsonContext } from "./components/MlGpxViewer/util/GeoJsonContext";
28
+ export { default as MlShareMapState } from "./components/MlShareMapState/MlShareMapState";
25
29
  export { default as MlSpatialElevationProfile } from "./components/MlSpatialElevationProfile/MlSpatialElevationProfile";
26
- export { default as MlOsmLayer } from "./components/MlOsmLayer/MlOsmLayer.js";
30
+ export { default as MlVectorTileLayer } from "./components/MlVectorTileLayer/MlVectorTileLayer";
31
+ export { default as MlWmsFeatureInfoPopup } from "./components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup";
32
+ export { default as MlWmsLayer } from "./components/MlWmsLayer/MlWmsLayer";
33
+ export { default as MlWmsLoader } from "./components/MlWmsLoader/MlWmsLoader";
27
34
  export { default as MlBasicComponent } from "./components/MlBasicComponent.js";
35
+ export { default as useCameraFollowPath } from "./hooks/useCameraFollowPath/useCameraFollowPath";
36
+ export { default as useExportMap } from "./hooks/useExportMap";
37
+ export { default as useGpx } from "./hooks/useGpx/useGpx";
38
+ export { default as useLayerFilter } from "./hooks/useLayerFilter/useLayerFilter";
39
+ export { default as useLayerHoverPopup } from "./hooks/useLayerHoverPopup/useLayerHoverPopup";
28
40
  export { default as useLayer } from "./hooks/useLayer";
29
- export { default as useMapState } from "./hooks/useMapState";
41
+ export { default as useLayerEvent } from "./hooks/useLayerEvent";
30
42
  export { default as useMap } from "./hooks/useMap";
31
- export { default as useWms } from "./hooks/useWms";
43
+ export { default as useMapState } from "./hooks/useMapState";
32
44
  export { default as useSource } from "./hooks/useSource";
33
- export { default as useExportMap } from "./hooks/useExportMap";
34
- export { default as useCameraFollowPath } from "./hooks/useCameraFollowPath/useCameraFollowPath";
35
- export { default as useLayerFilter } from "./hooks/useLayerFilter/useLayerFilter";
45
+ export { default as useWms } from "./hooks/useWms";
36
46
  export { MapComponentsProvider } from "./contexts/MapContext";
37
47
  export { default as MapContext } from "./contexts/MapContext";
38
48
  export { default as SimpleDataProvider } from "./contexts/SimpleDataProvider";