@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.
- package/.github/workflows/node_version_test.yml +1 -1
- package/.storybook/main.js +37 -31
- package/.storybook/preview.js +21 -0
- package/CHANGELOG.md +13 -0
- package/coverage/clover.xml +419 -344
- package/coverage/coverage-final.json +15 -14
- package/coverage/lcov-report/index.html +61 -61
- package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +24 -18
- package/coverage/lcov-report/src/components/MapLibreMap/index.html +14 -14
- package/coverage/lcov-report/src/components/MlCenterPosition/MlCenterPosition.tsx.html +2 -2
- package/coverage/lcov-report/src/components/MlCenterPosition/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.cy.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/MlCreatePdfForm.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlCreatePdfForm/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +9 -9
- package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.js.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGeoJsonLayer/story_utils/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGeojsonLayerWithSource/index.html +1 -1
- package/coverage/lcov-report/src/components/MlGpxViewer/MlGpxViewer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlGpxViewer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +52 -40
- package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +10 -10
- package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +4 -4
- package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
- package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
- package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlMeasureTool/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +1 -1
- package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlScaleReference/{MlScaleReference.js.html → MlScaleReference.tsx.html} +57 -36
- package/coverage/lcov-report/src/components/MlScaleReference/index.html +2 -2
- package/coverage/lcov-report/src/components/MlShareMapState/{MlShareMapState.js.html → MlShareMapState.tsx.html} +192 -84
- package/coverage/lcov-report/src/components/MlShareMapState/index.html +20 -20
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/ColorPicker.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerList.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerListItem.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/LayerPropertyForm.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/LayerList/index.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/MlSketchTool.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSketchTool/index.html +1 -1
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
- package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreejsLayer.tsx.html +769 -0
- package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +25 -10
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
- package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
- package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +11 -11
- package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +11 -11
- package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
- package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +27 -18
- package/coverage/lcov-report/src/components/MlWmsLoader/index.html +11 -11
- package/coverage/lcov-report/src/contexts/MapContext.tsx.html +50 -26
- package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
- package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
- package/coverage/lcov-report/src/contexts/index.html +1 -1
- package/coverage/lcov-report/src/hooks/index.html +21 -21
- package/coverage/lcov-report/src/hooks/useCameraFollowPath/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useCameraFollowPath/useCameraFollowPath.tsx.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/index.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useExportMap/lib.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useGpx/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useGpx/useGpx.tsx.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayer.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerEvent.js.html +9 -9
- package/coverage/lcov-report/src/hooks/useLayerFilter/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerFilter/useLayerFilter.ts.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerHoverPopup/index.html +1 -1
- package/coverage/lcov-report/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx.html +9 -6
- package/coverage/lcov-report/src/hooks/useMap.ts.html +2 -2
- package/coverage/lcov-report/src/hooks/useMapState.ts.html +8 -29
- package/coverage/lcov-report/src/hooks/useSource.ts.html +10 -10
- package/coverage/lcov-report/src/hooks/useWms.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +80 -11
- package/coverage/lcov.info +741 -604
- package/dist/components/MapLibreMap/MapLibreMap.stories.d.ts +3 -0
- package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +17 -15
- package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +1 -1
- package/dist/components/MlComponentTemplate/MlComponentTemplate.stories.d.ts +1 -1
- package/dist/components/MlCreatePdfButton/MlCreatePdfButton.stories.d.ts +1 -1
- package/dist/components/MlCreatePdfForm/MlCreatePdfForm.stories.d.ts +1 -1
- package/dist/components/MlFeatureEditor/lib/create_supplementary_points.d.ts +1 -1
- package/dist/components/MlFeatureEditor/lib/create_vertex.d.ts +1 -1
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +1 -1
- package/dist/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.stories.d.ts +1 -1
- package/dist/components/MlGpxViewer/MlGpxViewer.stories.d.ts +1 -1
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.d.ts +1 -1
- package/dist/components/MlLayerMagnify/MlLayerMagnify.stories.d.ts +1 -1
- package/dist/components/MlLayerSwipe/MlLayerSwipe.stories.d.ts +1 -1
- package/dist/components/MlScaleReference/MlScaleReference.d.ts +7 -1
- package/dist/components/MlShareMapState/MlShareMapState.d.ts +32 -13
- package/dist/components/MlShareMapState/MlShareMapState.stories.d.ts +15 -9
- package/dist/components/MlSketchTool/MlSketchTool.stories.d.ts +1 -1
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.d.ts +1 -1
- package/dist/components/MlSpatialElevationProfile/util/getElevationData.d.ts +1 -1
- package/dist/components/MlThreeJsLayer/MlThreeJsLayer.stories.d.ts +1 -1
- package/dist/components/MlThreeJsLayer/MlThreejsLayer.d.ts +29 -0
- package/dist/components/MlThreeJsLayer/lib/GLTFLoader.d.ts +2 -1
- package/dist/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.stories.d.ts +1 -1
- package/dist/components/MlWmsLoader/MlWmsLoader.stories.d.ts +1 -1
- package/dist/contexts/MapContext.d.ts +13 -2
- package/dist/custom.d.d.ts +1 -1
- package/dist/decorators/MapContextDecorator.d.ts +1 -1
- package/dist/decorators/MapContextDecoratorHooks.d.ts +1 -1
- package/dist/decorators/MultiMapContextDecorator.d.ts +1 -1
- package/dist/decorators/NoNavToolsDecorator.d.ts +1 -1
- package/dist/decorators/ThemeWrapper.d.ts +1 -3
- package/dist/hooks/useCameraFollowPath/useCameraFollowPath.stories.d.ts +1 -1
- package/dist/hooks/useLayerFilter/useLayerFilter.stories.d.ts +1 -1
- package/dist/index.d.ts +18 -8
- package/dist/index.esm.js +5590 -3701
- package/dist/index.esm.js.map +1 -1
- package/dist/setupTests.d.ts +6 -6
- package/package.json +56 -49
- package/public/thumbnails/{MlGPXViewer.png → MlGpxViewer.png} +0 -0
- package/rollup.config.js +49 -48
- package/src/@types/assets/index.d.ts +20 -0
- package/src/components/MapLibreMap/MapLibreMap.stories.js +8 -1
- package/src/components/MapLibreMap/MapLibreMap.tsx +11 -9
- package/src/components/MapLibreMap/lib/MapLibreGlWrapper.ts +49 -39
- package/src/components/MlCenterPosition/MlCenterPosition.tsx +1 -1
- package/src/components/MlFollowGps/MlFollowGps.tsx +8 -8
- package/src/components/MlLayerMagnify/MlLayerMagnify.tsx +21 -17
- package/src/components/MlLayerSwipe/MlLayerSwipe.tsx +3 -3
- package/src/components/MlScaleReference/{MlScaleReference.js → MlScaleReference.tsx} +38 -31
- package/src/components/MlShareMapState/MlShareMapState.stories.tsx +100 -0
- package/src/components/MlShareMapState/{MlShareMapState.js → MlShareMapState.tsx} +94 -58
- package/src/components/MlThreeJsLayer/MlThreejsLayer.tsx +228 -0
- package/src/components/MlWmsLoader/MlWmsLoader.tsx +7 -4
- package/src/contexts/MapContext.tsx +26 -19
- package/src/custom.d.ts +5 -0
- package/src/decorators/MapContextDecorator.js +39 -28
- package/src/decorators/MapContextDecoratorHooks.js +18 -8
- package/src/decorators/MultiMapContextDecorator.js +79 -69
- package/src/decorators/NoNavToolsDecorator.js +34 -25
- package/src/hooks/useLayerHoverPopup/useLayerHoverPopup.tsx +5 -4
- package/src/hooks/useMap.ts +1 -1
- package/src/hooks/useMapState.ts +6 -13
- package/src/hooks/useSource.ts +1 -1
- package/src/index.ts +31 -8
- package/src/ui_components/TopToolbar.tsx +1 -1
- package/tsconfig.json +1 -0
- package/src/components/MlShareMapState/MlShareMapState.stories.js +0 -100
- package/src/custom.d.tsx +0 -26
- package/src/decorators/ThemeWrapper.tsx +0 -9
|
@@ -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:
|
|
92
|
+
style: Style;
|
|
81
93
|
styleJson: object;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default createSupplementaryPoints;
|
|
2
|
-
declare function createSupplementaryPoints(geojson: any, options?: {}, basePath?: null):
|
|
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):
|
|
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;
|
|
@@ -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;
|
|
@@ -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
|
-
|
|
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
|
-
|
|
11
|
-
mapId
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
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 @@ 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<
|
|
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 {};
|
|
@@ -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";
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import React from
|
|
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:
|
|
21
|
+
children: ReactNode;
|
|
11
22
|
}) => JSX.Element;
|
|
12
23
|
export { MapComponentsProvider };
|
|
13
24
|
export default MapContext;
|
package/dist/custom.d.d.ts
CHANGED
|
@@ -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)[];
|
|
@@ -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
|
|
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
|
|
41
|
+
export { default as useLayerEvent } from "./hooks/useLayerEvent";
|
|
30
42
|
export { default as useMap } from "./hooks/useMap";
|
|
31
|
-
export { default as
|
|
43
|
+
export { default as useMapState } from "./hooks/useMapState";
|
|
32
44
|
export { default as useSource } from "./hooks/useSource";
|
|
33
|
-
export { default as
|
|
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";
|