@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,125 +1,125 @@
|
|
|
1
|
-
|
|
2
|
-
import { useWmsProps } from '../../hooks/useWms';
|
|
3
|
-
import { Layer2 } from 'wms-capabilities';
|
|
4
|
-
import { useWmsReturnType } from '../../hooks/useWms';
|
|
5
|
-
export interface WmsConfig {
|
|
6
|
-
/**
|
|
7
|
-
* The URL to use for the getFeatureInfo request
|
|
8
|
-
*/
|
|
9
|
-
getFeatureInfoUrl: useWmsReturnType['getFeatureInfoUrl'];
|
|
10
|
-
/**
|
|
11
|
-
* The URL of the WMS service
|
|
12
|
-
*/
|
|
13
|
-
wmsUrl: useWmsReturnType['wmsUrl'];
|
|
14
|
-
/**
|
|
15
|
-
* The layers to display on the map
|
|
16
|
-
*/
|
|
17
|
-
layers: LayerType[];
|
|
18
|
-
/**
|
|
19
|
-
* If true, the WMS layer is visible
|
|
20
|
-
*/
|
|
21
|
-
visible: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* If true, the WMS layer is open
|
|
24
|
-
*/
|
|
25
|
-
open: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The name of the WMS layer
|
|
28
|
-
*/
|
|
29
|
-
name?: string;
|
|
30
|
-
}
|
|
31
|
-
export interface MlWmsLoaderProps {
|
|
32
|
-
/**
|
|
33
|
-
* WMS URL
|
|
34
|
-
*/
|
|
35
|
-
url: string;
|
|
36
|
-
/**
|
|
37
|
-
* Id of the target MapLibre instance in mapContext
|
|
38
|
-
*/
|
|
39
|
-
mapId?: string;
|
|
40
|
-
layerId?: string;
|
|
41
|
-
insertBeforeLayer?: string;
|
|
42
|
-
/**
|
|
43
|
-
* URL parameters that will be used in the getCapabilities request
|
|
44
|
-
*/
|
|
45
|
-
urlParameters?: useWmsProps['urlParameters'];
|
|
46
|
-
/**
|
|
47
|
-
* URL parameters that will be added when requesting WMS capabilities
|
|
48
|
-
*/
|
|
49
|
-
wmsUrlParameters?: {
|
|
50
|
-
[key: string]: string;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* If true, zooms to the extent of the WMS layer after loading the getCapabilities response
|
|
54
|
-
*/
|
|
55
|
-
zoomToExtent?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* The name of the ListItem element representing the WmsLoader
|
|
58
|
-
*/
|
|
59
|
-
name?: string;
|
|
60
|
-
/**
|
|
61
|
-
* If true, enables the feature info functionality
|
|
62
|
-
*/
|
|
63
|
-
featureInfoEnabled?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* If true, the feature info functionality is active
|
|
66
|
-
*/
|
|
67
|
-
featureInfoActive?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* A function to set the feature info active state
|
|
70
|
-
*/
|
|
71
|
-
setFeatureInfoActive?: (val: boolean | ((current: boolean) => boolean)) => void;
|
|
72
|
-
/**
|
|
73
|
-
* The WMS configuration object
|
|
74
|
-
*/
|
|
75
|
-
config?: WmsConfig;
|
|
76
|
-
/**
|
|
77
|
-
* A function to handle changes to the WMS configuration
|
|
78
|
-
*/
|
|
79
|
-
onConfigChange?: (config: WmsConfig | false) => void;
|
|
80
|
-
/**
|
|
81
|
-
* A function to update a LayerType config array that is passed to this component at props.config.layers
|
|
82
|
-
*/
|
|
83
|
-
setLayers?: (layers: LayerType[]) => void;
|
|
84
|
-
/**
|
|
85
|
-
* If true, shows the delete button for the WMSLoader
|
|
86
|
-
*/
|
|
87
|
-
showDeleteButton?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Custom buttons to display for the WMSLoader
|
|
90
|
-
*/
|
|
91
|
-
buttons?: JSX.Element;
|
|
92
|
-
sortable?: boolean;
|
|
93
|
-
}
|
|
94
|
-
export type LayerType = {
|
|
95
|
-
visible: boolean;
|
|
96
|
-
Name: string;
|
|
97
|
-
Attribution?: {
|
|
98
|
-
Title: string;
|
|
99
|
-
};
|
|
100
|
-
} & Omit<Layer2, 'Layer' | 'CRS'> & Partial<Pick<Layer2, 'Layer'>>;
|
|
101
|
-
/**
|
|
102
|
-
* Loads a WMS getCapabilities xml document and adds a MlWmsLayer component for each layer that is
|
|
103
|
-
* offered by the WMS.
|
|
104
|
-
*
|
|
105
|
-
* @component
|
|
106
|
-
*/
|
|
107
|
-
declare const MlWmsLoader: {
|
|
108
|
-
(props: MlWmsLoaderProps): JSX.Element;
|
|
109
|
-
defaultProps: {
|
|
110
|
-
mapId: undefined;
|
|
111
|
-
url: string;
|
|
112
|
-
urlParameters: {
|
|
113
|
-
SERVICE: string;
|
|
114
|
-
VERSION: string;
|
|
115
|
-
REQUEST: string;
|
|
116
|
-
};
|
|
117
|
-
wmsUrlParameters: {
|
|
118
|
-
TRANSPARENT: string;
|
|
119
|
-
};
|
|
120
|
-
featureInfoEnabled: boolean;
|
|
121
|
-
zoomToExtent: boolean;
|
|
122
|
-
showDeleteButton: boolean;
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
export default MlWmsLoader;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useWmsProps } from '../../hooks/useWms';
|
|
3
|
+
import { Layer2 } from 'wms-capabilities';
|
|
4
|
+
import { useWmsReturnType } from '../../hooks/useWms';
|
|
5
|
+
export interface WmsConfig {
|
|
6
|
+
/**
|
|
7
|
+
* The URL to use for the getFeatureInfo request
|
|
8
|
+
*/
|
|
9
|
+
getFeatureInfoUrl: useWmsReturnType['getFeatureInfoUrl'];
|
|
10
|
+
/**
|
|
11
|
+
* The URL of the WMS service
|
|
12
|
+
*/
|
|
13
|
+
wmsUrl: useWmsReturnType['wmsUrl'];
|
|
14
|
+
/**
|
|
15
|
+
* The layers to display on the map
|
|
16
|
+
*/
|
|
17
|
+
layers: LayerType[];
|
|
18
|
+
/**
|
|
19
|
+
* If true, the WMS layer is visible
|
|
20
|
+
*/
|
|
21
|
+
visible: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* If true, the WMS layer is open
|
|
24
|
+
*/
|
|
25
|
+
open: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The name of the WMS layer
|
|
28
|
+
*/
|
|
29
|
+
name?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface MlWmsLoaderProps {
|
|
32
|
+
/**
|
|
33
|
+
* WMS URL
|
|
34
|
+
*/
|
|
35
|
+
url: string;
|
|
36
|
+
/**
|
|
37
|
+
* Id of the target MapLibre instance in mapContext
|
|
38
|
+
*/
|
|
39
|
+
mapId?: string;
|
|
40
|
+
layerId?: string;
|
|
41
|
+
insertBeforeLayer?: string;
|
|
42
|
+
/**
|
|
43
|
+
* URL parameters that will be used in the getCapabilities request
|
|
44
|
+
*/
|
|
45
|
+
urlParameters?: useWmsProps['urlParameters'];
|
|
46
|
+
/**
|
|
47
|
+
* URL parameters that will be added when requesting WMS capabilities
|
|
48
|
+
*/
|
|
49
|
+
wmsUrlParameters?: {
|
|
50
|
+
[key: string]: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* If true, zooms to the extent of the WMS layer after loading the getCapabilities response
|
|
54
|
+
*/
|
|
55
|
+
zoomToExtent?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The name of the ListItem element representing the WmsLoader
|
|
58
|
+
*/
|
|
59
|
+
name?: string;
|
|
60
|
+
/**
|
|
61
|
+
* If true, enables the feature info functionality
|
|
62
|
+
*/
|
|
63
|
+
featureInfoEnabled?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* If true, the feature info functionality is active
|
|
66
|
+
*/
|
|
67
|
+
featureInfoActive?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* A function to set the feature info active state
|
|
70
|
+
*/
|
|
71
|
+
setFeatureInfoActive?: (val: boolean | ((current: boolean) => boolean)) => void;
|
|
72
|
+
/**
|
|
73
|
+
* The WMS configuration object
|
|
74
|
+
*/
|
|
75
|
+
config?: WmsConfig;
|
|
76
|
+
/**
|
|
77
|
+
* A function to handle changes to the WMS configuration
|
|
78
|
+
*/
|
|
79
|
+
onConfigChange?: (config: WmsConfig | false) => void;
|
|
80
|
+
/**
|
|
81
|
+
* A function to update a LayerType config array that is passed to this component at props.config.layers
|
|
82
|
+
*/
|
|
83
|
+
setLayers?: (layers: LayerType[]) => void;
|
|
84
|
+
/**
|
|
85
|
+
* If true, shows the delete button for the WMSLoader
|
|
86
|
+
*/
|
|
87
|
+
showDeleteButton?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Custom buttons to display for the WMSLoader
|
|
90
|
+
*/
|
|
91
|
+
buttons?: JSX.Element;
|
|
92
|
+
sortable?: boolean;
|
|
93
|
+
}
|
|
94
|
+
export type LayerType = {
|
|
95
|
+
visible: boolean;
|
|
96
|
+
Name: string;
|
|
97
|
+
Attribution?: {
|
|
98
|
+
Title: string;
|
|
99
|
+
};
|
|
100
|
+
} & Omit<Layer2, 'Layer' | 'CRS'> & Partial<Pick<Layer2, 'Layer'>>;
|
|
101
|
+
/**
|
|
102
|
+
* Loads a WMS getCapabilities xml document and adds a MlWmsLayer component for each layer that is
|
|
103
|
+
* offered by the WMS.
|
|
104
|
+
*
|
|
105
|
+
* @component
|
|
106
|
+
*/
|
|
107
|
+
declare const MlWmsLoader: {
|
|
108
|
+
(props: MlWmsLoaderProps): React.JSX.Element;
|
|
109
|
+
defaultProps: {
|
|
110
|
+
mapId: undefined;
|
|
111
|
+
url: string;
|
|
112
|
+
urlParameters: {
|
|
113
|
+
SERVICE: string;
|
|
114
|
+
VERSION: string;
|
|
115
|
+
REQUEST: string;
|
|
116
|
+
};
|
|
117
|
+
wmsUrlParameters: {
|
|
118
|
+
TRANSPARENT: string;
|
|
119
|
+
};
|
|
120
|
+
featureInfoEnabled: boolean;
|
|
121
|
+
zoomToExtent: boolean;
|
|
122
|
+
showDeleteButton: boolean;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
export default MlWmsLoader;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export default function MlWmsLoaderInstructions(props: {
|
|
3
|
-
open: boolean;
|
|
4
|
-
}): JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function MlWmsLoaderInstructions(props: {
|
|
3
|
+
open: boolean;
|
|
4
|
+
}): React.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export interface wmsLinksProps {
|
|
3
|
-
load: (str: string) => void;
|
|
4
|
-
open: boolean;
|
|
5
|
-
close: () => void;
|
|
6
|
-
openWMSLoader: (boolean: boolean) => void;
|
|
7
|
-
}
|
|
8
|
-
export default function WMSLinks(props: wmsLinksProps): JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface wmsLinksProps {
|
|
3
|
+
load: (str: string) => void;
|
|
4
|
+
open: boolean;
|
|
5
|
+
close: () => void;
|
|
6
|
+
openWMSLoader: (boolean: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export default function WMSLinks(props: wmsLinksProps): React.JSX.Element;
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { StyleSpecification } from 'maplibre-gl';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { MlVectorTileLayerProps } from '../components/MlVectorTileLayer/MlVectorTileLayer';
|
|
4
|
-
import { MlGeoJsonLayerProps } from '../components/MlGeoJsonLayer/MlGeoJsonLayer';
|
|
5
|
-
import { Layer } from 'wms-capabilities';
|
|
6
|
-
export interface LayerContextProps {
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
}
|
|
9
|
-
export interface wmsLoaderConfigProps {
|
|
10
|
-
getFeatureInfoUrl: string;
|
|
11
|
-
layers: Layer[];
|
|
12
|
-
name: string;
|
|
13
|
-
open: boolean;
|
|
14
|
-
visible: boolean;
|
|
15
|
-
wmsUrl: string;
|
|
16
|
-
}
|
|
17
|
-
export interface wmsConfig {
|
|
18
|
-
featureInfoActive?: boolean;
|
|
19
|
-
config?: wmsLoaderConfigProps;
|
|
20
|
-
url: string;
|
|
21
|
-
}
|
|
22
|
-
export type WmsLayerConfig = {
|
|
23
|
-
type: 'wms';
|
|
24
|
-
name?: string;
|
|
25
|
-
id?: string;
|
|
26
|
-
config: wmsConfig;
|
|
27
|
-
};
|
|
28
|
-
export type GeojsonLayerConfig = {
|
|
29
|
-
type: 'geojson';
|
|
30
|
-
name?: string;
|
|
31
|
-
id?: string;
|
|
32
|
-
config: MlGeoJsonLayerProps;
|
|
33
|
-
};
|
|
34
|
-
export type VtLayerConfig = {
|
|
35
|
-
type: 'vt';
|
|
36
|
-
name?: string;
|
|
37
|
-
id?: string;
|
|
38
|
-
config: MlVectorTileLayerProps;
|
|
39
|
-
};
|
|
40
|
-
export type LayerConfig = WmsLayerConfig | GeojsonLayerConfig | VtLayerConfig;
|
|
41
|
-
export interface LayerContextType {
|
|
42
|
-
layers: LayerConfig[];
|
|
43
|
-
setLayers: (layers: LayerConfig[] | ((layers: LayerConfig[]) => LayerConfig[])) => void;
|
|
44
|
-
backgroundLayers: MlVectorTileLayerProps['layers'];
|
|
45
|
-
setBackgroundLayers: (layers: MlVectorTileLayerProps['layers'] | ((layers: MlVectorTileLayerProps['layers']) => MlVectorTileLayerProps['layers'])) => void;
|
|
46
|
-
symbolLayers: MlVectorTileLayerProps['layers'];
|
|
47
|
-
setSymbolLayers: (layers: MlVectorTileLayerProps['layers'] | ((layers: MlVectorTileLayerProps['layers']) => MlVectorTileLayerProps['layers'])) => void;
|
|
48
|
-
updateStyle: (style: StyleSpecification) => void;
|
|
49
|
-
vtLayerConfig: Partial<MlVectorTileLayerProps>;
|
|
50
|
-
setTileUrl: (url: string) => void;
|
|
51
|
-
tileUrl: string;
|
|
52
|
-
moveUp: (layerId: string) => void;
|
|
53
|
-
moveDown: (layerId: string) => void;
|
|
54
|
-
moveLayer: (layerId: string, getNewPos: (oldPos: number) => number) => void;
|
|
55
|
-
}
|
|
56
|
-
declare const LayerContext: React.Context<LayerContextType>;
|
|
57
|
-
declare function LayerContextProvider(props: LayerContextProps): JSX.Element;
|
|
58
|
-
export default LayerContext;
|
|
59
|
-
export { LayerContextProvider };
|
|
1
|
+
import { StyleSpecification } from 'maplibre-gl';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { MlVectorTileLayerProps } from '../components/MlVectorTileLayer/MlVectorTileLayer';
|
|
4
|
+
import { MlGeoJsonLayerProps } from '../components/MlGeoJsonLayer/MlGeoJsonLayer';
|
|
5
|
+
import { Layer } from 'wms-capabilities';
|
|
6
|
+
export interface LayerContextProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface wmsLoaderConfigProps {
|
|
10
|
+
getFeatureInfoUrl: string;
|
|
11
|
+
layers: Layer[];
|
|
12
|
+
name: string;
|
|
13
|
+
open: boolean;
|
|
14
|
+
visible: boolean;
|
|
15
|
+
wmsUrl: string;
|
|
16
|
+
}
|
|
17
|
+
export interface wmsConfig {
|
|
18
|
+
featureInfoActive?: boolean;
|
|
19
|
+
config?: wmsLoaderConfigProps;
|
|
20
|
+
url: string;
|
|
21
|
+
}
|
|
22
|
+
export type WmsLayerConfig = {
|
|
23
|
+
type: 'wms';
|
|
24
|
+
name?: string;
|
|
25
|
+
id?: string;
|
|
26
|
+
config: wmsConfig;
|
|
27
|
+
};
|
|
28
|
+
export type GeojsonLayerConfig = {
|
|
29
|
+
type: 'geojson';
|
|
30
|
+
name?: string;
|
|
31
|
+
id?: string;
|
|
32
|
+
config: MlGeoJsonLayerProps;
|
|
33
|
+
};
|
|
34
|
+
export type VtLayerConfig = {
|
|
35
|
+
type: 'vt';
|
|
36
|
+
name?: string;
|
|
37
|
+
id?: string;
|
|
38
|
+
config: MlVectorTileLayerProps;
|
|
39
|
+
};
|
|
40
|
+
export type LayerConfig = WmsLayerConfig | GeojsonLayerConfig | VtLayerConfig;
|
|
41
|
+
export interface LayerContextType {
|
|
42
|
+
layers: LayerConfig[];
|
|
43
|
+
setLayers: (layers: LayerConfig[] | ((layers: LayerConfig[]) => LayerConfig[])) => void;
|
|
44
|
+
backgroundLayers: MlVectorTileLayerProps['layers'];
|
|
45
|
+
setBackgroundLayers: (layers: MlVectorTileLayerProps['layers'] | ((layers: MlVectorTileLayerProps['layers']) => MlVectorTileLayerProps['layers'])) => void;
|
|
46
|
+
symbolLayers: MlVectorTileLayerProps['layers'];
|
|
47
|
+
setSymbolLayers: (layers: MlVectorTileLayerProps['layers'] | ((layers: MlVectorTileLayerProps['layers']) => MlVectorTileLayerProps['layers'])) => void;
|
|
48
|
+
updateStyle: (style: StyleSpecification) => void;
|
|
49
|
+
vtLayerConfig: Partial<MlVectorTileLayerProps>;
|
|
50
|
+
setTileUrl: (url: string) => void;
|
|
51
|
+
tileUrl: string;
|
|
52
|
+
moveUp: (layerId: string) => void;
|
|
53
|
+
moveDown: (layerId: string) => void;
|
|
54
|
+
moveLayer: (layerId: string, getNewPos: (oldPos: number) => number) => void;
|
|
55
|
+
}
|
|
56
|
+
declare const LayerContext: React.Context<LayerContextType>;
|
|
57
|
+
declare function LayerContextProvider(props: LayerContextProps): React.JSX.Element;
|
|
58
|
+
export default LayerContext;
|
|
59
|
+
export { LayerContextProvider };
|
|
@@ -1,24 +1,24 @@
|
|
|
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
|
-
}
|
|
13
|
-
declare const MapContext: React.Context<MapContextType>;
|
|
14
|
-
/**
|
|
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.
|
|
16
|
-
MapComponentsProvider must be used one level higher than the first use of MapContext.
|
|
17
|
-
*
|
|
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.
|
|
19
|
-
*/
|
|
20
|
-
declare const MapComponentsProvider: ({ children }: {
|
|
21
|
-
children: ReactNode;
|
|
22
|
-
}) => JSX.Element;
|
|
23
|
-
export { MapComponentsProvider };
|
|
24
|
-
export default MapContext;
|
|
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
|
+
}
|
|
13
|
+
declare const MapContext: React.Context<MapContextType>;
|
|
14
|
+
/**
|
|
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.
|
|
16
|
+
MapComponentsProvider must be used one level higher than the first use of MapContext.
|
|
17
|
+
*
|
|
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.
|
|
19
|
+
*/
|
|
20
|
+
declare const MapComponentsProvider: ({ children }: {
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}) => React.JSX.Element;
|
|
23
|
+
export { MapComponentsProvider };
|
|
24
|
+
export default MapContext;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const SimpleDataContext: React.Context<{}>;
|
|
3
|
+
export declare const SimpleDataContextProvider: React.Provider<{}>;
|
|
4
|
+
export default SimpleDataContext;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
export interface SimpleDataProviderProps {
|
|
4
|
+
url: string;
|
|
5
|
+
format: 'json' | 'csv' | 'xml';
|
|
6
|
+
nodeType: string;
|
|
7
|
+
data_property: string;
|
|
8
|
+
formatData?: (data: any) => any;
|
|
9
|
+
onData: () => void;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const SimpleDataProvider: {
|
|
13
|
+
(props: SimpleDataProviderProps): React.JSX.Element;
|
|
14
|
+
propTypes: {
|
|
15
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default SimpleDataProvider;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style.css';
|
|
3
|
+
import { StoryContext } from '@storybook/react';
|
|
4
|
+
declare const decorators: ((Story: React.FC, context?: StoryContext) => React.ReactElement)[];
|
|
5
|
+
export default decorators;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export interface useAddImageProps {
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
imageId: string;
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
imagePath: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
declare const useAddImage: {
|
|
15
|
-
(props: useAddImageProps): void;
|
|
16
|
-
defaultProps: {
|
|
17
|
-
mapId: undefined;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export default useAddImage;
|
|
1
|
+
export interface useAddImageProps {
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
imageId: string;
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
imagePath: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
declare const useAddImage: {
|
|
15
|
+
(props: useAddImageProps): void;
|
|
16
|
+
defaultProps: {
|
|
17
|
+
mapId: undefined;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default useAddImage;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface useAddProtocolProps {
|
|
3
|
-
/**
|
|
4
|
-
* the protocol string, for example `mbtiles`
|
|
5
|
-
* In this example the handler function is called for all tile requests that start with the string `mbtiles://`
|
|
6
|
-
*/
|
|
7
|
-
protocol: string;
|
|
8
|
-
/**
|
|
9
|
-
* Custom load tile function that will be called when using a source that starts with a custom url schema.
|
|
10
|
-
*/
|
|
11
|
-
handler:
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Enables the use of custom protocols (basically custom tile load functions) in the maplibre-gl-js library.
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
declare const useAddProtocol: {
|
|
18
|
-
(props: useAddProtocolProps): {};
|
|
19
|
-
defaultProps: {
|
|
20
|
-
mapId: undefined;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export default useAddProtocol;
|
|
1
|
+
import { AddProtocolAction } from 'maplibre-gl';
|
|
2
|
+
export interface useAddProtocolProps {
|
|
3
|
+
/**
|
|
4
|
+
* the protocol string, for example `mbtiles`
|
|
5
|
+
* In this example the handler function is called for all tile requests that start with the string `mbtiles://`
|
|
6
|
+
*/
|
|
7
|
+
protocol: string;
|
|
8
|
+
/**
|
|
9
|
+
* Custom load tile function that will be called when using a source that starts with a custom url schema.
|
|
10
|
+
*/
|
|
11
|
+
handler: AddProtocolAction;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Enables the use of custom protocols (basically custom tile load functions) in the maplibre-gl-js library.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
declare const useAddProtocol: {
|
|
18
|
+
(props: useAddProtocolProps): {};
|
|
19
|
+
defaultProps: {
|
|
20
|
+
mapId: undefined;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default useAddProtocol;
|