@mapcomponents/react-maplibre 0.1.96 → 1.0.1
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/.eslintrc.cjs +32 -0
- package/CHANGELOG.md +6 -0
- package/dist/{index.esm.css → assets/index.cjs-Iqz0mZaU.css} +4 -4
- package/dist/assets/index.esm-Iqz0mZaU.css +98 -0
- package/dist/components/MapLibreMap/MapLibreMap.d.ts +30 -31
- package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +105 -105
- package/dist/components/MlCenterPosition/MlCenterPosition.d.ts +36 -36
- package/dist/components/MlComponentTemplate/MlComponentTemplate.d.ts +18 -18
- package/dist/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +22 -22
- package/dist/components/MlCreatePdfForm/MlCreatePdfForm.d.ts +30 -30
- package/dist/components/MlCreatePdfForm/lib/PdfContext.d.ts +8 -8
- package/dist/components/MlCreatePdfForm/lib/PdfForm.d.ts +11 -11
- package/dist/components/MlCreatePdfForm/lib/PdfPreview.d.ts +26 -26
- package/dist/components/MlCreatePdfForm/lib/pdf.templates.d.ts +11 -11
- package/dist/components/MlCreatePngButton/MlCreatePngButton.d.ts +22 -22
- package/dist/components/MlFeatureEditor/MlFeatureEditor.d.ts +5 -5
- package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.d.ts +62 -62
- package/dist/components/MlFollowGps/MlFollowGps.d.ts +81 -81
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +97 -97
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.d.ts +9 -2
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.d.ts +8 -2
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerCircleStyler.d.ts +4 -4
- package/dist/components/MlGeoJsonLayer/story_utils/MlGeojsonLayerHeatMapStyler.d.ts +4 -4
- package/dist/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.d.ts +2 -2
- package/dist/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.d.ts +5 -5
- package/dist/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.d.ts +23 -23
- package/dist/components/MlGpxViewer/MlGpxViewer.d.ts +31 -31
- package/dist/components/MlGpxViewer/util/GeoJsonContext.d.ts +10 -10
- package/dist/components/MlGpxViewer/util/GeoJsonProvider.d.ts +5 -5
- package/dist/components/MlGpxViewer/util/Metadata.d.ts +7 -7
- package/dist/components/MlGpxViewer/util/MlGpxDemoLoader.d.ts +11 -11
- package/dist/components/MlGpxViewer/util/MlGpxViewerInstructions.d.ts +4 -4
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +39 -39
- package/dist/components/MlLayer/MlLayer.d.ts +33 -33
- package/dist/components/MlLayerMagnify/MlLayerMagnify.d.ts +33 -33
- package/dist/components/MlLayerSwipe/MlLayerSwipe.d.ts +26 -26
- package/dist/components/MlLayerSwitcher/MlLayerSwitcher.d.ts +29 -30
- package/dist/components/MlLayerSwitcher/components/LayerBox.d.ts +10 -6
- package/dist/components/MlMarker/MlMarker.d.ts +34 -34
- package/dist/components/MlMeasureTool/MlMeasureTool.d.ts +36 -36
- package/dist/components/MlMultiMeasureTool/MlMultiMeasureTool.d.ts +55 -55
- package/dist/components/MlNavigationCompass/MlNavigationCompass.d.ts +33 -33
- package/dist/components/MlNavigationTools/MlNavigationTools.d.ts +55 -55
- package/dist/components/MlOrderLayers/MlOrderLayers.d.ts +21 -21
- package/dist/components/MlScaleReference/MlScaleReference.d.ts +9 -9
- package/dist/components/MlShareMapState/MlShareMapState.d.ts +42 -42
- package/dist/components/MlSketchTool/MlSketchTool.d.ts +42 -42
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +40 -40
- package/dist/components/MlSpatialElevationProfile/util/getElevationData.d.ts +12 -14
- package/dist/components/MlTemporalController/MlTemporalController.d.ts +181 -181
- package/dist/components/MlTemporalController/utils/MlTemporalControllerLabels.d.ts +20 -20
- package/dist/components/MlTemporalController/utils/TemporalControllerPlayer.d.ts +22 -22
- package/dist/components/MlTemporalController/utils/paintPicker.d.ts +59 -59
- package/dist/components/MlTemporalController/utils/useFilterData.d.ts +14 -14
- package/dist/components/MlTerrainLayer/MlTerrainLayer.d.ts +28 -28
- package/dist/components/MlThreeJsLayer/MlThreeJsLayer.d.ts +30 -30
- package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +12 -10
- package/dist/components/MlUseMapDebugger/MlUseMapDebugger.d.ts +18 -22
- package/dist/components/MlVectorTileLayer/MlVectorTileLayer.d.ts +19 -19
- package/dist/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.d.ts +29 -22
- package/dist/components/MlWmsLayer/MlWmsLayer.d.ts +104 -104
- package/dist/components/MlWmsLoader/MlWmsLoader.d.ts +125 -125
- package/dist/components/MlWmsLoader/utils/MlWmsLoaderInstructions.d.ts +4 -4
- package/dist/components/MlWmsLoader/utils/WMSLinks.d.ts +8 -8
- package/dist/contexts/LayerContext.d.ts +59 -59
- package/dist/contexts/MapContext.d.ts +24 -24
- package/dist/contexts/SimpleDataContext.d.ts +4 -4
- package/dist/contexts/SimpleDataProvider.d.ts +18 -8
- package/dist/decorators/EmptyMapDecorator.d.ts +4 -2
- package/dist/decorators/GeoJsonMapDecorator.d.ts +4 -2
- package/dist/decorators/LowZoomDecorator.d.ts +4 -2
- package/dist/decorators/MapContextDecorator.d.ts +4 -2
- package/dist/decorators/MapContextDecoratorHooks.d.ts +4 -2
- package/dist/decorators/MultiMapContextDecorator.d.ts +4 -2
- package/dist/decorators/NoNavToolsDecorator.d.ts +4 -2
- package/dist/decorators/ThemeDecorator.d.ts +5 -2
- package/dist/hooks/useAddImage/useAddImage.d.ts +20 -20
- package/dist/hooks/useAddProtocol/useAddProtocol.d.ts +23 -23
- package/dist/hooks/useCameraFollowPath/useCameraFollowPath.d.ts +35 -35
- package/dist/hooks/useExportMap/index.d.ts +11 -11
- package/dist/hooks/useExportMap/lib.d.ts +51 -51
- package/dist/hooks/useFeatureEditor/useFeatureEditor.d.ts +46 -46
- package/dist/hooks/useFeatureEditor/utils/FeatureEditorStyle.d.ts +88 -88
- package/dist/hooks/useFitLayerBounds.d.ts +8 -8
- package/dist/hooks/useGpx/useGpx.d.ts +26 -26
- package/dist/hooks/useLayer.d.ts +36 -36
- package/dist/hooks/useLayerContext.d.ts +2 -2
- package/dist/hooks/useLayerFilter/useLayerFilter.d.ts +8 -8
- package/dist/hooks/useLayerHoverPopup/{useLayerHoverPopup.d.ts → LayerHoverPopup.d.ts} +23 -24
- package/dist/hooks/useMap.d.ts +14 -14
- package/dist/hooks/useMapState.d.ts +62 -62
- package/dist/hooks/useSource.d.ts +17 -17
- package/dist/hooks/useWms.d.ts +26 -26
- package/dist/index.cjs.js +21050 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +87 -89
- package/dist/index.esm.js +19882 -20200
- package/dist/index.esm.js.map +1 -1
- package/dist/omt_styles/bright.d.ts +2495 -2495
- package/dist/omt_styles/config.d.ts +7 -7
- package/dist/omt_styles/gruvbox.d.ts +2420 -2420
- package/dist/omt_styles/medieval_kingdom.d.ts +2420 -2420
- package/dist/omt_styles/monokai.d.ts +2420 -2420
- package/dist/omt_styles/oceanic_next.d.ts +2420 -2420
- package/dist/omt_styles/solarized.d.ts +2420 -2420
- package/dist/protocol_handlers/csv.d.ts +8 -8
- package/dist/protocol_handlers/mbtiles.d.ts +33 -33
- package/dist/protocol_handlers/osm.d.ts +11 -11
- package/dist/protocol_handlers/topojson.d.ts +9 -9
- package/dist/protocol_handlers/utils/getProtocolData.d.ts +1 -1
- package/dist/protocol_handlers/utils/protocolPathParser.d.ts +7 -7
- package/dist/protocol_handlers/xml.d.ts +10 -10
- package/dist/ui_components/AddLayerButton/AddLayerButton.d.ts +17 -17
- package/dist/ui_components/AddLayerButton/AddLayerPopup.d.ts +15 -15
- package/dist/ui_components/AddLayerButton/LayerConfigForms/GeoJsonLayerForm.d.ts +8 -8
- package/dist/ui_components/AddLayerButton/LayerConfigForms/LayerTypeForm.d.ts +10 -10
- package/dist/ui_components/AddLayerButton/LayerConfigForms/MbtilesLayerForm.d.ts +13 -13
- package/dist/ui_components/AddLayerButton/LayerConfigForms/ProtocolHandlerLayerForm.d.ts +10 -10
- package/dist/ui_components/AddLayerButton/LayerConfigForms/WmsLayerForm.d.ts +10 -10
- package/dist/ui_components/AddLayerButton/LayerConfigForms/utils/CSVOptionsFomular.d.ts +6 -6
- package/dist/ui_components/AddLayerButton/LayerConfigForms/utils/MbtilesLayerPropFormular.d.ts +7 -7
- package/dist/ui_components/AddLayerButton/LayerConfigForms/utils/OsmOptionsFomular.d.ts +6 -6
- package/dist/ui_components/ColorPicker/ColorPicker.d.ts +17 -17
- package/dist/ui_components/ColorPicker/transformers.d.ts +10 -10
- package/dist/ui_components/ConfirmDialog.d.ts +16 -16
- package/dist/ui_components/DemoDescriptions.d.ts +12 -12
- package/dist/ui_components/Dropzone.d.ts +6 -6
- package/dist/ui_components/ImageLoader.d.ts +10 -10
- package/dist/ui_components/LayerList/LayerList.d.ts +7 -7
- package/dist/ui_components/LayerList/LayerListFolder.d.ts +9 -9
- package/dist/ui_components/LayerList/LayerListItem.d.ts +26 -26
- package/dist/ui_components/LayerList/LayerListItemFactory.d.ts +18 -18
- package/dist/ui_components/LayerList/util/LayerListItemVectorLayer.d.ts +23 -36
- package/dist/ui_components/LayerList/util/LayerPropertyForm.d.ts +10 -10
- package/dist/ui_components/LayerList/util/SortableContainer.d.ts +7 -7
- package/dist/ui_components/LayerList/util/input/ColorPicker.d.ts +10 -10
- package/dist/ui_components/LoadingOverlayContext.d.ts +10 -10
- package/dist/ui_components/MapcomponentsTheme.d.ts +35 -35
- package/dist/ui_components/SelectStyleButton/SelectStyleButton.d.ts +20 -20
- package/dist/ui_components/SelectStyleButton/SelectStylePopup.d.ts +18 -18
- package/dist/ui_components/Sidebar.d.ts +12 -12
- package/dist/ui_components/SpeedDial/SpeedDial.d.ts +14 -14
- package/dist/ui_components/TopToolbar.d.ts +9 -9
- package/dist/ui_components/UploadButton.d.ts +8 -8
- package/dist/util/BubbleForInstructions.d.ts +16 -2
- package/dist/util/Instructions.d.ts +14 -14
- package/package.json +207 -208
- package/rollup.config.mjs +62 -0
- package/dist/components/MapLibreMap/MapLibreMap.stories.d.ts +0 -20
- package/dist/components/MapLibreMap/MapLibreMap.test.d.ts +0 -1
- package/dist/components/MapLibreMap/lib/MapLibreGlWrapper.test.d.ts +0 -1
- package/dist/components/MlBasicComponent.d.ts +0 -5
- package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +0 -21
- package/dist/components/MlComponentTemplate/MlComponentTemplate.stories.d.ts +0 -14
- package/dist/components/MlCreatePdfButton/MlCreatePdfButton.stories.d.ts +0 -14
- package/dist/components/MlCreatePdfForm/MlCreatePdfForm.cy.d.ts +0 -1
- package/dist/components/MlCreatePdfForm/MlCreatePdfForm.stories.d.ts +0 -15
- package/dist/components/MlCreatePdfForm/lib/_PdfPreview.d.ts +0 -14
- package/dist/components/MlCreatePngButton/MlCreatePngButton.stories.d.ts +0 -14
- package/dist/components/MlFeatureEditor/MlFeatureEditor.stories.d.ts +0 -16
- package/dist/components/MlFeatureEditor/MlFeatureEditor.test.d.ts +0 -1
- package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.stories.d.ts +0 -27
- package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.test.d.ts +0 -1
- package/dist/components/MlFollowGps/MlFollowGps.stories.d.ts +0 -11
- package/dist/components/MlFollowGps/MlFollowGps.test.d.ts +0 -1
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +0 -18
- package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.test.d.ts +0 -1
- package/dist/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.stories.d.ts +0 -14
- package/dist/components/MlGpxViewer/MlGpxViewer.stories.d.ts +0 -18
- package/dist/components/MlGpxViewer/MlGpxViewer.test.d.ts +0 -1
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.stories.d.ts +0 -9
- package/dist/components/MlImageMarkerLayer/MlImageMarkerLayer.test.d.ts +0 -1
- package/dist/components/MlLayer/MlLayer.test.d.ts +0 -1
- package/dist/components/MlLayerMagnify/MlLayerMagnify.stories.d.ts +0 -15
- package/dist/components/MlLayerMagnify/MlLayerMagnify.test.d.ts +0 -1
- package/dist/components/MlLayerSwipe/MlLayerSwipe.stories.d.ts +0 -14
- package/dist/components/MlLayerSwipe/MlLayerSwipe.test.d.ts +0 -1
- package/dist/components/MlLayerSwitcher/MlLayerSwitcher.stories.d.ts +0 -13
- package/dist/components/MlMarker/MlMarker.stories.d.ts +0 -9
- package/dist/components/MlMeasureTool/MlMeasureTool.stories.d.ts +0 -12
- package/dist/components/MlMultiMeasureTool/MlMultiMeasureTool.stories.d.ts +0 -16
- package/dist/components/MlNavigationCompass/MlNavigationCompass.stories.d.ts +0 -10
- package/dist/components/MlNavigationCompass/MlNavigationCompass.test.d.ts +0 -1
- package/dist/components/MlNavigationTools/MlNavigationTools.stories.d.ts +0 -29
- package/dist/components/MlOrderLayers/MlOrderLayers.stories.d.ts +0 -15
- package/dist/components/MlOsmLayer/MlOsmLayer.d.ts +0 -18
- package/dist/components/MlOsmLayer/MlOsmLayer.stories_.d.ts +0 -16
- package/dist/components/MlOsmLayer/MlOsmLayer.test.d.ts +0 -1
- package/dist/components/MlScaleReference/MlScaleReference.stories.d.ts +0 -15
- package/dist/components/MlShareMapState/MlShareMapState.stories.d.ts +0 -17
- package/dist/components/MlSketchTool/MlSketchTool.stories.d.ts +0 -15
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.stories.d.ts +0 -20
- package/dist/components/MlSpatialElevationProfile/MlSpatialElevationProfile.test.d.ts +0 -1
- package/dist/components/MlTemporalController/MlTemporalController.stories.d.ts +0 -34
- package/dist/components/MlTerrainLayer/MlTerrainLayer.cy.d.ts +0 -1
- package/dist/components/MlTerrainLayer/MlTerrainLayer.stories.d.ts +0 -14
- package/dist/components/MlThreeJsLayer/MlThreeJsLayer.stories.d.ts +0 -22
- package/dist/components/MlThreeJsLayer/MlThreeJsLayer.test.d.ts +0 -1
- package/dist/components/MlThreeJsLayer/lib/GLTFLoader.d.ts +0 -18
- package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.stories.d.ts +0 -13
- package/dist/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.test.d.ts +0 -1
- package/dist/components/MlTransitionGeoJsonLayer/util/transitionFunctions.d.ts +0 -2
- package/dist/components/MlUseMapDebugger/MlUseMapDebugger.stories.d.ts +0 -13
- package/dist/components/MlVectorTileLayer/MlVectorTileLayer.stories.d.ts +0 -13
- package/dist/components/MlVectorTileLayer/MlVectorTileLayer.test.d.ts +0 -1
- package/dist/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.stories.d.ts +0 -22
- package/dist/components/MlWmsLayer/MlWmsLayer.stories.d.ts +0 -13
- package/dist/components/MlWmsLayer/MlWmsLayer.test.d.ts +0 -1
- package/dist/components/MlWmsLoader/MlWmsLoader.stories.d.ts +0 -30
- package/dist/contexts/MapComponentsProvider.test.d.ts +0 -1
- package/dist/contexts/SimpleDataProvider.test.d.ts +0 -1
- package/dist/hooks/useAddImage/useAddImage.stories.d.ts +0 -14
- package/dist/hooks/useAddImage/useaddImage.cy.d.ts +0 -1
- package/dist/hooks/useAddProtocol/useAddProtocol.stories.d.ts +0 -22
- package/dist/hooks/useCameraFollowPath/useCameraFollowPath.stories.d.ts +0 -18
- package/dist/hooks/useGpx/lib/gpxConverter.d.ts +0 -11
- package/dist/hooks/useGpx/useGpx.stories.d.ts +0 -10
- package/dist/hooks/useLayer.test.d.ts +0 -1
- package/dist/hooks/useLayerEvent.d.ts +0 -2
- package/dist/hooks/useLayerFilter/useLayerFilter.stories.d.ts +0 -10
- package/dist/hooks/useLayerHoverPopup/useLayerHoverPopup.stories.d.ts +0 -10
- package/dist/hooks/useMap.test.d.ts +0 -1
- package/dist/hooks/useMapState.stories.d.ts +0 -14
- package/dist/hooks/useSources.stories.d.ts +0 -13
- package/dist/setupTests.d.ts +0 -13
- package/dist/stories/components/Readme.d.ts +0 -2
- package/dist/ui_components/AddLayerButton/AddLayerButton.stories.d.ts +0 -13
- package/dist/ui_components/LayerList/LayerList.stories.d.ts +0 -15
- package/dist/ui_components/SelectStyleButton/SelectStyleButton.stories.d.ts +0 -15
- package/dist/ui_components/SpeedDial/SpeedDial.stories.d.ts +0 -21
- package/dist/util/index.d.ts +0 -3
- package/dist/util/layerRemovalTest.d.ts +0 -2
- package/dist/util/sourceRemovalTest.d.ts +0 -2
|
@@ -1,35 +1,35 @@
|
|
|
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
|
+
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 +1,11 @@
|
|
|
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
|
+
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,51 +1,51 @@
|
|
|
1
|
-
import { Map } from 'maplibre-gl';
|
|
2
|
-
import jsPDF from 'jspdf';
|
|
3
|
-
import MapLibreGlWrapper from '../../components/MapLibreMap/lib/MapLibreGlWrapper';
|
|
4
|
-
import { BBox } from '@turf/turf';
|
|
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
|
-
pdf: jsPDF;
|
|
31
|
-
downloadPdf: (_options?: downloadPdfOptions) => Promise<downloadPdfOptions>;
|
|
32
|
-
}
|
|
33
|
-
interface downloadPdfOptions extends createJsPdfOptions {
|
|
34
|
-
pdf: jsPDF;
|
|
35
|
-
}
|
|
36
|
-
export type { createPdfResolverParams };
|
|
37
|
-
interface createPngOptions extends createExportOptions {
|
|
38
|
-
renderMap: Map;
|
|
39
|
-
hiddenContainer: HTMLDivElement;
|
|
40
|
-
}
|
|
41
|
-
export type { createPngOptions };
|
|
42
|
-
interface createPngResolverParams extends createPngOptions {
|
|
43
|
-
png: string;
|
|
44
|
-
downloadPng: (_options?: downloadPngOptions) => Promise<downloadPngOptions>;
|
|
45
|
-
}
|
|
46
|
-
export type { createPngResolverParams };
|
|
47
|
-
interface downloadPngOptions extends createPngOptions {
|
|
48
|
-
png: string;
|
|
49
|
-
name?: string;
|
|
50
|
-
}
|
|
51
|
-
export { createExport };
|
|
1
|
+
import { Map } from 'maplibre-gl';
|
|
2
|
+
import jsPDF from 'jspdf';
|
|
3
|
+
import MapLibreGlWrapper from '../../components/MapLibreMap/lib/MapLibreGlWrapper';
|
|
4
|
+
import { BBox } from '@turf/turf';
|
|
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
|
+
pdf: jsPDF;
|
|
31
|
+
downloadPdf: (_options?: downloadPdfOptions) => Promise<downloadPdfOptions>;
|
|
32
|
+
}
|
|
33
|
+
interface downloadPdfOptions extends createJsPdfOptions {
|
|
34
|
+
pdf: jsPDF;
|
|
35
|
+
}
|
|
36
|
+
export type { createPdfResolverParams };
|
|
37
|
+
interface createPngOptions extends createExportOptions {
|
|
38
|
+
renderMap: Map;
|
|
39
|
+
hiddenContainer: HTMLDivElement;
|
|
40
|
+
}
|
|
41
|
+
export type { createPngOptions };
|
|
42
|
+
interface createPngResolverParams extends createPngOptions {
|
|
43
|
+
png: string;
|
|
44
|
+
downloadPng: (_options?: downloadPngOptions) => Promise<downloadPngOptions>;
|
|
45
|
+
}
|
|
46
|
+
export type { createPngResolverParams };
|
|
47
|
+
interface downloadPngOptions extends createPngOptions {
|
|
48
|
+
png: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
}
|
|
51
|
+
export { createExport };
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
|
|
2
|
-
import MapboxDraw from '@mapbox/mapbox-gl-draw';
|
|
3
|
-
import { GeoJSONObject, Feature } from '@turf/turf';
|
|
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: GeoJSONObject[]) => 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: GeoJSONObject[] | undefined;
|
|
43
|
-
drawToolsReady: boolean;
|
|
44
|
-
draw: MapboxDraw | undefined;
|
|
45
|
-
};
|
|
46
|
-
export default useFeatureEditor;
|
|
1
|
+
import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
|
|
2
|
+
import MapboxDraw from '@mapbox/mapbox-gl-draw';
|
|
3
|
+
import { GeoJSONObject, Feature } from '@turf/turf';
|
|
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: GeoJSONObject[]) => 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: GeoJSONObject[] | undefined;
|
|
43
|
+
drawToolsReady: boolean;
|
|
44
|
+
draw: MapboxDraw | undefined;
|
|
45
|
+
};
|
|
46
|
+
export default useFeatureEditor;
|
|
@@ -1,88 +1,88 @@
|
|
|
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
|
-
'circle-radius'?: undefined;
|
|
10
|
-
'circle-color'?: undefined;
|
|
11
|
-
'line-color'?: undefined;
|
|
12
|
-
'line-width'?: undefined;
|
|
13
|
-
'line-dasharray'?: undefined;
|
|
14
|
-
'circle-opacity'?: undefined;
|
|
15
|
-
};
|
|
16
|
-
layout?: undefined;
|
|
17
|
-
} | {
|
|
18
|
-
id: string;
|
|
19
|
-
type: string;
|
|
20
|
-
filter: (string | string[])[];
|
|
21
|
-
paint: {
|
|
22
|
-
'circle-radius': number;
|
|
23
|
-
'circle-color': string;
|
|
24
|
-
'fill-color'?: undefined;
|
|
25
|
-
'fill-outline-color'?: undefined;
|
|
26
|
-
'fill-opacity'?: undefined;
|
|
27
|
-
'line-color'?: undefined;
|
|
28
|
-
'line-width'?: undefined;
|
|
29
|
-
'line-dasharray'?: undefined;
|
|
30
|
-
'circle-opacity'?: undefined;
|
|
31
|
-
};
|
|
32
|
-
layout?: undefined;
|
|
33
|
-
} | {
|
|
34
|
-
id: string;
|
|
35
|
-
type: string;
|
|
36
|
-
filter: (string | string[])[];
|
|
37
|
-
layout: {
|
|
38
|
-
'line-cap': string;
|
|
39
|
-
'line-join': string;
|
|
40
|
-
};
|
|
41
|
-
paint: {
|
|
42
|
-
'line-color': string;
|
|
43
|
-
'line-width': number;
|
|
44
|
-
'fill-color'?: undefined;
|
|
45
|
-
'fill-outline-color'?: undefined;
|
|
46
|
-
'fill-opacity'?: undefined;
|
|
47
|
-
'circle-radius'?: undefined;
|
|
48
|
-
'circle-color'?: undefined;
|
|
49
|
-
'line-dasharray'?: undefined;
|
|
50
|
-
'circle-opacity'?: undefined;
|
|
51
|
-
};
|
|
52
|
-
} | {
|
|
53
|
-
id: string;
|
|
54
|
-
type: string;
|
|
55
|
-
filter: (string | string[])[];
|
|
56
|
-
layout: {
|
|
57
|
-
'line-cap': string;
|
|
58
|
-
'line-join': string;
|
|
59
|
-
};
|
|
60
|
-
paint: {
|
|
61
|
-
'line-color': string;
|
|
62
|
-
'line-dasharray': number[];
|
|
63
|
-
'line-width': number;
|
|
64
|
-
'fill-color'?: undefined;
|
|
65
|
-
'fill-outline-color'?: undefined;
|
|
66
|
-
'fill-opacity'?: undefined;
|
|
67
|
-
'circle-radius'?: undefined;
|
|
68
|
-
'circle-color'?: undefined;
|
|
69
|
-
'circle-opacity'?: undefined;
|
|
70
|
-
};
|
|
71
|
-
} | {
|
|
72
|
-
id: string;
|
|
73
|
-
type: string;
|
|
74
|
-
filter: (string | string[])[];
|
|
75
|
-
paint: {
|
|
76
|
-
'circle-radius': number;
|
|
77
|
-
'circle-opacity': number;
|
|
78
|
-
'circle-color': string;
|
|
79
|
-
'fill-color'?: undefined;
|
|
80
|
-
'fill-outline-color'?: undefined;
|
|
81
|
-
'fill-opacity'?: undefined;
|
|
82
|
-
'line-color'?: undefined;
|
|
83
|
-
'line-width'?: undefined;
|
|
84
|
-
'line-dasharray'?: undefined;
|
|
85
|
-
};
|
|
86
|
-
layout?: undefined;
|
|
87
|
-
})[];
|
|
88
|
-
export default featureEditorStyle;
|
|
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
|
+
'circle-radius'?: undefined;
|
|
10
|
+
'circle-color'?: undefined;
|
|
11
|
+
'line-color'?: undefined;
|
|
12
|
+
'line-width'?: undefined;
|
|
13
|
+
'line-dasharray'?: undefined;
|
|
14
|
+
'circle-opacity'?: undefined;
|
|
15
|
+
};
|
|
16
|
+
layout?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
id: string;
|
|
19
|
+
type: string;
|
|
20
|
+
filter: (string | string[])[];
|
|
21
|
+
paint: {
|
|
22
|
+
'circle-radius': number;
|
|
23
|
+
'circle-color': string;
|
|
24
|
+
'fill-color'?: undefined;
|
|
25
|
+
'fill-outline-color'?: undefined;
|
|
26
|
+
'fill-opacity'?: undefined;
|
|
27
|
+
'line-color'?: undefined;
|
|
28
|
+
'line-width'?: undefined;
|
|
29
|
+
'line-dasharray'?: undefined;
|
|
30
|
+
'circle-opacity'?: undefined;
|
|
31
|
+
};
|
|
32
|
+
layout?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
id: string;
|
|
35
|
+
type: string;
|
|
36
|
+
filter: (string | string[])[];
|
|
37
|
+
layout: {
|
|
38
|
+
'line-cap': string;
|
|
39
|
+
'line-join': string;
|
|
40
|
+
};
|
|
41
|
+
paint: {
|
|
42
|
+
'line-color': string;
|
|
43
|
+
'line-width': number;
|
|
44
|
+
'fill-color'?: undefined;
|
|
45
|
+
'fill-outline-color'?: undefined;
|
|
46
|
+
'fill-opacity'?: undefined;
|
|
47
|
+
'circle-radius'?: undefined;
|
|
48
|
+
'circle-color'?: undefined;
|
|
49
|
+
'line-dasharray'?: undefined;
|
|
50
|
+
'circle-opacity'?: undefined;
|
|
51
|
+
};
|
|
52
|
+
} | {
|
|
53
|
+
id: string;
|
|
54
|
+
type: string;
|
|
55
|
+
filter: (string | string[])[];
|
|
56
|
+
layout: {
|
|
57
|
+
'line-cap': string;
|
|
58
|
+
'line-join': string;
|
|
59
|
+
};
|
|
60
|
+
paint: {
|
|
61
|
+
'line-color': string;
|
|
62
|
+
'line-dasharray': number[];
|
|
63
|
+
'line-width': number;
|
|
64
|
+
'fill-color'?: undefined;
|
|
65
|
+
'fill-outline-color'?: undefined;
|
|
66
|
+
'fill-opacity'?: undefined;
|
|
67
|
+
'circle-radius'?: undefined;
|
|
68
|
+
'circle-color'?: undefined;
|
|
69
|
+
'circle-opacity'?: undefined;
|
|
70
|
+
};
|
|
71
|
+
} | {
|
|
72
|
+
id: string;
|
|
73
|
+
type: string;
|
|
74
|
+
filter: (string | string[])[];
|
|
75
|
+
paint: {
|
|
76
|
+
'circle-radius': number;
|
|
77
|
+
'circle-opacity': number;
|
|
78
|
+
'circle-color': string;
|
|
79
|
+
'fill-color'?: undefined;
|
|
80
|
+
'fill-outline-color'?: undefined;
|
|
81
|
+
'fill-opacity'?: undefined;
|
|
82
|
+
'line-color'?: undefined;
|
|
83
|
+
'line-width'?: undefined;
|
|
84
|
+
'line-dasharray'?: undefined;
|
|
85
|
+
};
|
|
86
|
+
layout?: undefined;
|
|
87
|
+
})[];
|
|
88
|
+
export default featureEditorStyle;
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
+
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 +1,26 @@
|
|
|
1
|
-
import { FeatureCollection } from '@turf/turf';
|
|
2
|
-
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("@turf/turf").Geometry | import("@turf/turf").GeometryCollection, import("@turf/turf").Properties> | undefined;
|
|
20
|
-
metadata: MetadataType[];
|
|
21
|
-
};
|
|
22
|
-
defaultProps: {
|
|
23
|
-
data: undefined;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export default useGpx;
|
|
1
|
+
import { FeatureCollection } from '@turf/turf';
|
|
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("@turf/turf").Geometry | import("@turf/turf").GeometryCollection, import("@turf/turf").Properties> | undefined;
|
|
20
|
+
metadata: MetadataType[];
|
|
21
|
+
};
|
|
22
|
+
defaultProps: {
|
|
23
|
+
data: undefined;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export default useGpx;
|
package/dist/hooks/useLayer.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { useMapType } from './useMap';
|
|
2
|
-
import { GeoJSONSourceSpecification, LayerSpecification, MapMouseEvent,
|
|
3
|
-
import MapLibreGlWrapper from '../components/MapLibreMap/lib/MapLibreGlWrapper';
|
|
4
|
-
import { GeoJSONObject } from '@turf/turf';
|
|
5
|
-
type getLayerType = Style['getLayer'];
|
|
6
|
-
type useLayerType = {
|
|
7
|
-
map: MapLibreGlWrapper | undefined;
|
|
8
|
-
layer: ReturnType<getLayerType> | undefined;
|
|
9
|
-
layerId: string;
|
|
10
|
-
componentId: string;
|
|
11
|
-
mapHook: useMapType;
|
|
12
|
-
};
|
|
13
|
-
export type MapEventHandler = (ev: MapMouseEvent & {
|
|
14
|
-
features?:
|
|
15
|
-
} & Record<string, unknown>) => void;
|
|
16
|
-
export interface useLayerProps {
|
|
17
|
-
mapId?: string;
|
|
18
|
-
layerId?: string;
|
|
19
|
-
idPrefix?: string;
|
|
20
|
-
insertBeforeLayer?: string;
|
|
21
|
-
insertBeforeFirstSymbolLayer?: boolean;
|
|
22
|
-
geojson?: GeoJSONObject;
|
|
23
|
-
options: Partial<LayerSpecification & {
|
|
24
|
-
source?: GeoJSONSourceSpecification | string;
|
|
25
|
-
id?: string;
|
|
26
|
-
filter?: FilterSpecification;
|
|
27
|
-
}>;
|
|
28
|
-
onHover?: (ev: MapEventType & unknown) => Map | void;
|
|
29
|
-
onClick?: (ev: MapEventType & unknown) => Map | void;
|
|
30
|
-
onLeave?: (ev: MapEventType & unknown) => Map | void;
|
|
31
|
-
}
|
|
32
|
-
declare function useLayer(props: useLayerProps): useLayerType;
|
|
33
|
-
declare namespace useLayer {
|
|
34
|
-
var defaultProps: {};
|
|
35
|
-
}
|
|
36
|
-
export default useLayer;
|
|
1
|
+
import { useMapType } from './useMap';
|
|
2
|
+
import { GeoJSONSourceSpecification, LayerSpecification, MapMouseEvent, Style, MapEventType, Map, FilterSpecification } from 'maplibre-gl';
|
|
3
|
+
import MapLibreGlWrapper from '../components/MapLibreMap/lib/MapLibreGlWrapper';
|
|
4
|
+
import { GeoJSONObject } from '@turf/turf';
|
|
5
|
+
type getLayerType = Style['getLayer'];
|
|
6
|
+
type useLayerType = {
|
|
7
|
+
map: MapLibreGlWrapper | undefined;
|
|
8
|
+
layer: ReturnType<getLayerType> | undefined;
|
|
9
|
+
layerId: string;
|
|
10
|
+
componentId: string;
|
|
11
|
+
mapHook: useMapType;
|
|
12
|
+
};
|
|
13
|
+
export type MapEventHandler = (ev: MapMouseEvent & {
|
|
14
|
+
features?: GeoJSON.Feature[] | undefined;
|
|
15
|
+
} & Record<string, unknown>) => void;
|
|
16
|
+
export interface useLayerProps {
|
|
17
|
+
mapId?: string;
|
|
18
|
+
layerId?: string;
|
|
19
|
+
idPrefix?: string;
|
|
20
|
+
insertBeforeLayer?: string;
|
|
21
|
+
insertBeforeFirstSymbolLayer?: boolean;
|
|
22
|
+
geojson?: GeoJSONObject | GeoJSON.Feature | GeoJSON.FeatureCollection;
|
|
23
|
+
options: Partial<LayerSpecification & {
|
|
24
|
+
source?: GeoJSONSourceSpecification | string;
|
|
25
|
+
id?: string;
|
|
26
|
+
filter?: FilterSpecification;
|
|
27
|
+
}>;
|
|
28
|
+
onHover?: (ev: MapEventType & unknown) => Map | void;
|
|
29
|
+
onClick?: (ev: MapEventType & unknown) => Map | void;
|
|
30
|
+
onLeave?: (ev: MapEventType & unknown) => Map | void;
|
|
31
|
+
}
|
|
32
|
+
declare function useLayer(props: useLayerProps): useLayerType;
|
|
33
|
+
declare namespace useLayer {
|
|
34
|
+
var defaultProps: {};
|
|
35
|
+
}
|
|
36
|
+
export default useLayer;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useLayerContext: () => import("../contexts/LayerContext").LayerContextType;
|
|
2
|
-
export default useLayerContext;
|
|
1
|
+
declare const useLayerContext: () => import("../contexts/LayerContext").LayerContextType;
|
|
2
|
+
export default useLayerContext;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FilterSpecification } from 'maplibre-gl';
|
|
2
|
-
export interface UseLayerFilterProps {
|
|
3
|
-
mapId?: string;
|
|
4
|
-
layerId?: string;
|
|
5
|
-
filter?: FilterSpecification;
|
|
6
|
-
}
|
|
7
|
-
declare function useLayerFilter(props: UseLayerFilterProps): {};
|
|
8
|
-
export default useLayerFilter;
|
|
1
|
+
import { FilterSpecification } from 'maplibre-gl';
|
|
2
|
+
export interface UseLayerFilterProps {
|
|
3
|
+
mapId?: string;
|
|
4
|
+
layerId?: string;
|
|
5
|
+
filter?: FilterSpecification;
|
|
6
|
+
}
|
|
7
|
+
declare function useLayerFilter(props: UseLayerFilterProps): {};
|
|
8
|
+
export default useLayerFilter;
|