@opengeoweb/webmap-react 9.37.0 → 10.1.0
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/index.esm.js +220 -59
- package/package.json +3 -2
- package/src/lib/components/Axis/ProfileAxis.stories.d.ts +7 -9
- package/src/lib/components/LayerInfo/LayerInfoDialog.d.ts +2 -1
- package/src/lib/components/LayerInfo/LayerInfoDialog.stories.d.ts +10 -25
- package/src/lib/components/Legend/Legend.stories.d.ts +8 -8
- package/src/lib/components/MapDimensionSelect/DimensionSelectDialog.stories.d.ts +13 -29
- package/src/lib/components/MapDimensionSelect/MapDimensionSelect.stories.d.ts +4 -1
- package/src/lib/components/MapDraw/MapDraw.stories.d.ts +13 -37
- package/src/lib/components/MapDrawTool/MapDrawTool.stories.d.ts +9 -13
- package/src/lib/components/MapDrawTool/MapDrawToolIntersection.stories.d.ts +7 -11
- package/src/lib/components/MapDrawTool/MapDrawToolMultipleDrawTools.stories.d.ts +6 -6
- package/src/lib/components/MapView/MapView.Error.stories.d.ts +8 -14
- package/src/lib/components/MapView/MapView.MapPin.stories.d.ts +6 -10
- package/src/lib/components/MapView/MapView.Passive.stories.d.ts +6 -10
- package/src/lib/components/MapView/MapView.ProfileSounding.stories.d.ts +6 -9
- package/src/lib/components/MapView/MapView.RadarAnimation.stories.d.ts +6 -10
- package/src/lib/components/MapView/MapView.RadarData.stories.d.ts +6 -10
- package/src/lib/components/MapView/MapView.SetProjectionBBox.stories.d.ts +6 -10
- package/src/lib/components/MapView/MapView.SetProjectionBBoxLocalState.stories.d.ts +6 -10
- package/src/lib/components/MapView/MapView.ShiftToZoom.stories.d.ts +6 -10
- package/src/lib/components/MapView/MapView.ShowLayerInfo.stories.d.ts +6 -10
- package/src/lib/components/MapView/MapView.TiledBaseLayers.stories.d.ts +6 -11
- package/src/lib/components/TanStackDemo/TanStackDemo.GetCapabilitiesLiveUpdate.stories.d.ts +9 -0
- package/src/lib/components/WMSViewerDemo/WebmapReact.stories.d.ts +6 -0
- package/src/lib/components/WMSViewerDemo/components/WMSDimTimeYearSelector.d.ts +18 -0
- package/src/lib/components/WMSViewerDemo/components/WMSLayerSelector.d.ts +9 -0
- package/src/lib/components/WMSViewerDemo/components/WMSStyleSelector.d.ts +8 -0
- package/src/lib/components/WMSViewerDemo/components/WMSTimeSlider.d.ts +8 -0
- package/src/lib/hooks/useHooksGetCapabilities.d.ts +46 -0
- package/src/lib/index.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { legendImageStore, WMImageEventType, webmapUtils, getLegendGraphicURLForLayer, getPixelCoordFromLatLong, WMJSMAP_LONLAT_EPSGCODE, getLatLongFromPixelCoord, LayerType, getWMJSMapById, debugLogger, DebugType, WMLayer, registerWMLayer, tilesettings, WMBBOX, getWMLayerById, WMJSMap } from '@opengeoweb/webmap';
|
|
1
|
+
import { legendImageStore, WMImageEventType, webmapUtils, getLegendGraphicURLForLayer, getPixelCoordFromLatLong, WMJSMAP_LONLAT_EPSGCODE, getLatLongFromPixelCoord, LayerType, getWMJSMapById, debugLogger, DebugType, WMLayer, registerWMLayer, tilesettings, WMBBOX, getWMLayerById, WMJSMap, privateWebMapUtils, generateLayerId } from '@opengeoweb/webmap';
|
|
2
2
|
export { WEBMAP_NAMESPACE, webmapTranslations } from '@opengeoweb/webmap';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -16,6 +16,7 @@ import { produce } from 'immer';
|
|
|
16
16
|
import { useResizeDetector } from 'react-resize-detector';
|
|
17
17
|
import Box$1 from '@mui/material/Box';
|
|
18
18
|
import Typography$1 from '@mui/material/Typography';
|
|
19
|
+
import { useQuery } from '@tanstack/react-query';
|
|
19
20
|
|
|
20
21
|
var en = {
|
|
21
22
|
"webmap-react-event": "event:",
|
|
@@ -2972,10 +2973,15 @@ var MapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
2972
2973
|
/* Draw selected feature to display it on top */
|
|
2973
2974
|
drawFeatureGeometry(this.getSelectedFeature(), selectedFeatureIndex);
|
|
2974
2975
|
/* Highlight polygon with mousehover */
|
|
2975
|
-
if (isInEditMode === true && this.mouseOverPolygonFeatureIndex === selectedFeatureIndex && this.mouseIsOverVertexNr === VERTEX.NONE && this.snappedPolygonIndex === SNAPPEDFEATURE.NONE && this.selectedEdge === EDGE.NONE || this.mouseIsOverVertexNr === VERTEX.MIDDLE_POINT_OF_FEATURE || linkedFeatures) {
|
|
2976
|
+
if (isInEditMode === true && this.mouseOverPolygonFeatureIndex === selectedFeatureIndex && this.mouseIsOverVertexNr === VERTEX.NONE && this.snappedPolygonIndex === SNAPPEDFEATURE.NONE && this.selectedEdge === EDGE.NONE || this.mouseIsOverVertexNr === VERTEX.MIDDLE_POINT_OF_FEATURE || linkedFeatures !== null && linkedFeatures !== void 0 && linkedFeatures.features && linkedFeatures.features.length > 0) {
|
|
2977
|
+
var _feature3$properties;
|
|
2976
2978
|
var _feature3 = this.getSelectedFeature();
|
|
2977
|
-
var
|
|
2978
|
-
|
|
2979
|
+
var isLinkedFeature = linkedFeatures === null || linkedFeatures === void 0 ? void 0 : linkedFeatures.features.some(function (linkedFeature) {
|
|
2980
|
+
return linkedFeature.id === _feature3.id;
|
|
2981
|
+
});
|
|
2982
|
+
var shouldHighlight = isLinkedFeature && ((_feature3$properties = _feature3.properties) === null || _feature3$properties === void 0 ? void 0 : _feature3$properties.selectionType) !== 'fir';
|
|
2983
|
+
if (shouldHighlight && this.mouseOverPolygonCoordinates.length >= 2) {
|
|
2984
|
+
var featureProperties = _feature3.properties;
|
|
2979
2985
|
ctx.beginPath();
|
|
2980
2986
|
ctx.moveTo(this.mouseOverPolygonCoordinates[0].x, this.mouseOverPolygonCoordinates[0].y);
|
|
2981
2987
|
for (var j = 1; j < this.mouseOverPolygonCoordinates.length; j += 1) {
|
|
@@ -6708,16 +6714,7 @@ var makeLayerPropListFromChildren = function makeLayerPropListFromChildren(child
|
|
|
6708
6714
|
return myChildren;
|
|
6709
6715
|
};
|
|
6710
6716
|
var parseWMJSLayer = function parseWMJSLayer(wmLayer, forceReload) {
|
|
6711
|
-
return
|
|
6712
|
-
var callback = function callback() {
|
|
6713
|
-
if (wmLayer.hasError) {
|
|
6714
|
-
reject(new Error(wmLayer.lastError));
|
|
6715
|
-
} else {
|
|
6716
|
-
resolve(wmLayer);
|
|
6717
|
-
}
|
|
6718
|
-
};
|
|
6719
|
-
wmLayer.parseLayer(callback, forceReload, 'ReactMapView parseWMJSLayer');
|
|
6720
|
-
});
|
|
6717
|
+
return wmLayer.parseLayer(forceReload);
|
|
6721
6718
|
};
|
|
6722
6719
|
var setWMLayerPropsBasedOnChildProps = function setWMLayerPropsBasedOnChildProps(child, wmLayer, mapViewProps) {
|
|
6723
6720
|
var needsRedraw = false;
|
|
@@ -6775,7 +6772,7 @@ var setWMLayerPropsBasedOnChildProps = function setWMLayerPropsBasedOnChildProps
|
|
|
6775
6772
|
};
|
|
6776
6773
|
var addWMLayerPropsBasedOnChildProps = function addWMLayerPropsBasedOnChildProps(child, mapId, props, onUpdateLayerInformation) {
|
|
6777
6774
|
var wmjsMap = getWMJSMapById(mapId);
|
|
6778
|
-
if (!wmjsMap) {
|
|
6775
|
+
if (!wmjsMap || wmjsMap.isDestroyed) {
|
|
6779
6776
|
return;
|
|
6780
6777
|
}
|
|
6781
6778
|
var keepOnTop = child.layerType === LayerType.overLayer || false;
|
|
@@ -6800,11 +6797,18 @@ var addWMLayerPropsBasedOnChildProps = function addWMLayerPropsBasedOnChildProps
|
|
|
6800
6797
|
if (newWMLayer.hasError === true) {
|
|
6801
6798
|
child.onLayerError && child.onLayerError(newWMLayer, new Error(newWMLayer.lastError));
|
|
6802
6799
|
}
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6800
|
+
// This ensures that MultiMapViewConnect works properly.
|
|
6801
|
+
setTimeout(function () {
|
|
6802
|
+
var wmjsMap = getWMJSMapById(mapId);
|
|
6803
|
+
if (!wmjsMap || wmjsMap.isDestroyed) {
|
|
6804
|
+
return;
|
|
6805
|
+
}
|
|
6806
|
+
setWMLayerPropsBasedOnChildProps(child, newWMLayer, props);
|
|
6807
|
+
var layerInfo = getLayerUpdateInfo(newWMLayer, mapId);
|
|
6808
|
+
onUpdateLayerInformation && onUpdateLayerInformation(layerInfo);
|
|
6809
|
+
child.onLayerReady && child.onLayerReady(newWMLayer, wmjsMap);
|
|
6810
|
+
wmjsMap.draw();
|
|
6811
|
+
}, 1);
|
|
6808
6812
|
})["catch"](function (e) {
|
|
6809
6813
|
child.onLayerError && child.onLayerError(e);
|
|
6810
6814
|
});
|
|
@@ -6901,10 +6905,6 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
6901
6905
|
*/
|
|
6902
6906
|
_this.onStartRefetchTimer = function (force) {
|
|
6903
6907
|
var shouldAutoFetch = _this.props.shouldAutoFetch;
|
|
6904
|
-
/* TODO, Maarten Plieger, 2021-09-02
|
|
6905
|
-
This causes many issues, we should improve the update strategy.
|
|
6906
|
-
Certain presets have >20 layers. This causes 20 times parsing the GetCapabilities for a minor update of the store.
|
|
6907
|
-
*/
|
|
6908
6908
|
_this.clearRefetchTimer();
|
|
6909
6909
|
var autoFetchInterval = Number(shouldAutoFetch); // Default true -> 1 minute
|
|
6910
6910
|
var refetch = function refetch() {
|
|
@@ -6914,20 +6914,40 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
6914
6914
|
var mapId = _this.props.mapId;
|
|
6915
6915
|
var wmjsMap = webmapUtils.getWMJSMapById(mapId);
|
|
6916
6916
|
var layers = wmjsMap === null || wmjsMap === void 0 ? void 0 : wmjsMap.getLayers();
|
|
6917
|
-
layers === null || layers === void 0 || layers.forEach(function (
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6917
|
+
layers === null || layers === void 0 || layers.forEach( /*#__PURE__*/function () {
|
|
6918
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(layer) {
|
|
6919
|
+
var _this2, _props, _mapId, onUpdateLayerInformation, layerInfo;
|
|
6920
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
6921
|
+
while (1) switch (_context.prev = _context.next) {
|
|
6922
|
+
case 0:
|
|
6923
|
+
if (!(layer.enabled !== false)) {
|
|
6924
|
+
_context.next = 13;
|
|
6925
|
+
break;
|
|
6926
|
+
}
|
|
6927
|
+
_context.prev = 1;
|
|
6928
|
+
_context.next = 4;
|
|
6929
|
+
return layer.parseLayer();
|
|
6930
|
+
case 4:
|
|
6931
|
+
_this2 = _this, _props = _this2.props;
|
|
6932
|
+
_mapId = _props.mapId, onUpdateLayerInformation = _props.onUpdateLayerInformation;
|
|
6933
|
+
layerInfo = getLayerUpdateInfo(layer, _mapId);
|
|
6934
|
+
onUpdateLayerInformation && onUpdateLayerInformation(layerInfo);
|
|
6935
|
+
_context.next = 13;
|
|
6936
|
+
break;
|
|
6937
|
+
case 10:
|
|
6938
|
+
_context.prev = 10;
|
|
6939
|
+
_context.t0 = _context["catch"](1);
|
|
6940
|
+
console.error(_context.t0);
|
|
6941
|
+
case 13:
|
|
6942
|
+
case "end":
|
|
6943
|
+
return _context.stop();
|
|
6944
|
+
}
|
|
6945
|
+
}, _callee, null, [[1, 10]]);
|
|
6946
|
+
}));
|
|
6947
|
+
return function (_x) {
|
|
6948
|
+
return _ref.apply(this, arguments);
|
|
6949
|
+
};
|
|
6950
|
+
}());
|
|
6931
6951
|
}
|
|
6932
6952
|
};
|
|
6933
6953
|
if (autoFetchInterval > 0) {
|
|
@@ -7210,13 +7230,13 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
7210
7230
|
// ReactWMJSLayer Layer Childs: Detect all ReactLayers connected to WMJSLayers, remove WMJSLayer if there is no ReactLayer
|
|
7211
7231
|
var wmjsLayers = wmjsMap.getLayers();
|
|
7212
7232
|
var onUpdateLayerInformation = props.onUpdateLayerInformation,
|
|
7213
|
-
|
|
7233
|
+
_mapId2 = props.mapId;
|
|
7214
7234
|
wmjsLayers.forEach(function (wmLayer) {
|
|
7215
7235
|
var isWMLayerInReactMapViewChildren = myChildren.find(function (child) {
|
|
7216
7236
|
return child.id === wmLayer.ReactWMJSLayerId;
|
|
7217
7237
|
});
|
|
7218
7238
|
if (!isWMLayerInReactMapViewChildren) {
|
|
7219
|
-
removeWMLayerFromMap(wmLayer,
|
|
7239
|
+
removeWMLayerFromMap(wmLayer, _mapId2, onUpdateLayerInformation);
|
|
7220
7240
|
}
|
|
7221
7241
|
});
|
|
7222
7242
|
// ReactWMJSLayer BaseLayer Childs: For the baseLayers, detect all ReactLayers connected to WMJSLayers, remove WMJSLayer if there is no ReactLayer
|
|
@@ -7243,29 +7263,29 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
7243
7263
|
var layerIsInThisMap = wmjsMap.hasLayer(wmLayer);
|
|
7244
7264
|
if (!layerIsInThisMap) {
|
|
7245
7265
|
// Add a new layer, it is not in the this map
|
|
7246
|
-
addWMLayerPropsBasedOnChildProps(child,
|
|
7266
|
+
addWMLayerPropsBasedOnChildProps(child, _mapId2, props, onUpdateLayerInformation);
|
|
7247
7267
|
needsRedraw = true;
|
|
7248
7268
|
} else {
|
|
7249
7269
|
// Handle existing layer
|
|
7250
7270
|
if (child.name !== undefined && wmLayer.name !== child.name) {
|
|
7251
7271
|
// Handle layer name change
|
|
7252
|
-
wmLayer.setName(child.name).then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
7272
|
+
wmLayer.setName(child.name).then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
7253
7273
|
var layerInfo;
|
|
7254
|
-
return _regeneratorRuntime().wrap(function
|
|
7255
|
-
while (1) switch (
|
|
7274
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
7275
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
7256
7276
|
case 0:
|
|
7257
|
-
|
|
7258
|
-
return
|
|
7277
|
+
_context2.next = 2;
|
|
7278
|
+
return wmLayer.parseLayer();
|
|
7259
7279
|
case 2:
|
|
7260
|
-
layerInfo = getLayerUpdateInfo(wmLayer,
|
|
7280
|
+
layerInfo = getLayerUpdateInfo(wmLayer, _mapId2);
|
|
7261
7281
|
setWMLayerPropsBasedOnChildProps(child, wmLayer, props);
|
|
7262
7282
|
onUpdateLayerInformation && onUpdateLayerInformation(layerInfo);
|
|
7263
7283
|
wmjsMap.draw();
|
|
7264
7284
|
case 6:
|
|
7265
7285
|
case "end":
|
|
7266
|
-
return
|
|
7286
|
+
return _context2.stop();
|
|
7267
7287
|
}
|
|
7268
|
-
},
|
|
7288
|
+
}, _callee2);
|
|
7269
7289
|
})))["catch"](function (e) {
|
|
7270
7290
|
child.onLayerError && child.onLayerError(wmLayer, e);
|
|
7271
7291
|
});
|
|
@@ -7412,7 +7432,6 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
7412
7432
|
linkedFeatures = _this$props5.linkedFeatures;
|
|
7413
7433
|
var adagucInitialised = this.state.adagucInitialised;
|
|
7414
7434
|
var featureLayers = getFeatureLayers(children);
|
|
7415
|
-
// TODO: Improve in https://gitlab.com/opengeoweb/opengeoweb/-/issues/4579
|
|
7416
7435
|
featureLayers.forEach(function (featureLayer) {
|
|
7417
7436
|
var wmFeatureLayer = getWMLayerById(featureLayer.id);
|
|
7418
7437
|
if (!wmFeatureLayer) {
|
|
@@ -8144,9 +8163,11 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
8144
8163
|
value: sliderValue,
|
|
8145
8164
|
onKeyDown: upDownNavigation,
|
|
8146
8165
|
onChange: function onChange(e, val) {
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8166
|
+
if (typeof val === 'number') {
|
|
8167
|
+
onChangeDimensionValue(values[val].toString());
|
|
8168
|
+
if (!managedValue) {
|
|
8169
|
+
setCurrentIndex(val);
|
|
8170
|
+
}
|
|
8150
8171
|
}
|
|
8151
8172
|
}
|
|
8152
8173
|
})
|
|
@@ -8440,7 +8461,12 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
8440
8461
|
order = _ref$order === void 0 ? 0 : _ref$order,
|
|
8441
8462
|
_ref$source = _ref.source,
|
|
8442
8463
|
source = _ref$source === void 0 ? 'app' : _ref$source,
|
|
8443
|
-
dialogHeight = _ref.dialogHeight
|
|
8464
|
+
dialogHeight = _ref.dialogHeight,
|
|
8465
|
+
_ref$startPosition = _ref.startPosition,
|
|
8466
|
+
startPosition = _ref$startPosition === void 0 ? {
|
|
8467
|
+
top: 150,
|
|
8468
|
+
left: 900
|
|
8469
|
+
} : _ref$startPosition;
|
|
8444
8470
|
var styles = getLayerStyles(layer);
|
|
8445
8471
|
var dimensions = getDimensionsList(layer.dimensions);
|
|
8446
8472
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
@@ -8452,10 +8478,7 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
8452
8478
|
width: 288,
|
|
8453
8479
|
height: dialogHeight || 650
|
|
8454
8480
|
},
|
|
8455
|
-
startPosition:
|
|
8456
|
-
top: 150,
|
|
8457
|
-
left: 900
|
|
8458
|
-
},
|
|
8481
|
+
startPosition: startPosition,
|
|
8459
8482
|
title: t('webmap-react-layer-info'),
|
|
8460
8483
|
isOpen: isOpen,
|
|
8461
8484
|
onMouseDown: onMouseDown,
|
|
@@ -9059,4 +9082,142 @@ var publicLayers = /*#__PURE__*/Object.freeze({
|
|
|
9059
9082
|
veiligheidsRegiosGebiedsIndelingenLabels: veiligheidsRegiosGebiedsIndelingenLabels
|
|
9060
9083
|
});
|
|
9061
9084
|
|
|
9062
|
-
|
|
9085
|
+
var privateWmsGetCapabilities = privateWebMapUtils.privateWmsGetCapabilities,
|
|
9086
|
+
privateGetWMSServiceInfo = privateWebMapUtils.privateGetWMSServiceInfo,
|
|
9087
|
+
privateWmsGetLayerTree = privateWebMapUtils.privateWmsGetLayerTree,
|
|
9088
|
+
privateWmsFlattenLayerTree = privateWebMapUtils.privateWmsFlattenLayerTree,
|
|
9089
|
+
QUERYWMS_GETCAPABILITIES = privateWebMapUtils.QUERYWMS_GETCAPABILITIES;
|
|
9090
|
+
/**
|
|
9091
|
+
* Queries the WMS GetCapabilities. This is the base TanStack hook for the other hooks in this file.
|
|
9092
|
+
*
|
|
9093
|
+
* @param {string} serviceUrl
|
|
9094
|
+
* @returns {UseQueryResult<GetCapabilitiesJson>}
|
|
9095
|
+
*/
|
|
9096
|
+
var useQueryGetWMSGetCapabilities = function useQueryGetWMSGetCapabilities(serviceUrl) {
|
|
9097
|
+
var uriKey = new URLSearchParams(serviceUrl).toString();
|
|
9098
|
+
return useQuery({
|
|
9099
|
+
queryKey: [uriKey, QUERYWMS_GETCAPABILITIES],
|
|
9100
|
+
queryFn: function queryFn() {
|
|
9101
|
+
return privateWmsGetCapabilities(serviceUrl);
|
|
9102
|
+
}
|
|
9103
|
+
});
|
|
9104
|
+
};
|
|
9105
|
+
/**
|
|
9106
|
+
* Returns details about the WMS service
|
|
9107
|
+
*
|
|
9108
|
+
* @param {string} serviceUrl
|
|
9109
|
+
* @returns {(WMSServiceInfo | null)}
|
|
9110
|
+
*/
|
|
9111
|
+
var useQueryGetWMSServiceInfo = function useQueryGetWMSServiceInfo(serviceUrl) {
|
|
9112
|
+
var _React$useState = React__default.useState(null),
|
|
9113
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
9114
|
+
serviceInfo = _React$useState2[0],
|
|
9115
|
+
setServiceInfo = _React$useState2[1];
|
|
9116
|
+
var _useQueryGetWMSGetCap = useQueryGetWMSGetCapabilities(serviceUrl),
|
|
9117
|
+
getCapabilitiesJSON = _useQueryGetWMSGetCap.data;
|
|
9118
|
+
React__default.useEffect(function () {
|
|
9119
|
+
if (!getCapabilitiesJSON) {
|
|
9120
|
+
setServiceInfo(null);
|
|
9121
|
+
} else {
|
|
9122
|
+
setServiceInfo(privateGetWMSServiceInfo(getCapabilitiesJSON, serviceUrl));
|
|
9123
|
+
}
|
|
9124
|
+
}, [serviceUrl, getCapabilitiesJSON]);
|
|
9125
|
+
return serviceInfo;
|
|
9126
|
+
};
|
|
9127
|
+
/**
|
|
9128
|
+
* Gets the layer tree in hierarchical order for a WMS service. Cached by TanStack. Uses the same store as in queryWMSGetCapabilities.
|
|
9129
|
+
*
|
|
9130
|
+
* @param {string} serviceUrl
|
|
9131
|
+
* @returns {(LayerTree | null)}
|
|
9132
|
+
*/
|
|
9133
|
+
var useQueryGetWMSLayersTree = function useQueryGetWMSLayersTree(serviceUrl) {
|
|
9134
|
+
var _React$useState3 = React__default.useState(null),
|
|
9135
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
9136
|
+
layerTree = _React$useState4[0],
|
|
9137
|
+
setLayerTree = _React$useState4[1];
|
|
9138
|
+
var _useQueryGetWMSGetCap2 = useQueryGetWMSGetCapabilities(serviceUrl),
|
|
9139
|
+
getCapabilitiesJSON = _useQueryGetWMSGetCap2.data;
|
|
9140
|
+
React__default.useEffect(function () {
|
|
9141
|
+
if (!getCapabilitiesJSON) {
|
|
9142
|
+
setLayerTree(null);
|
|
9143
|
+
} else {
|
|
9144
|
+
setLayerTree(privateWmsGetLayerTree(getCapabilitiesJSON));
|
|
9145
|
+
}
|
|
9146
|
+
}, [serviceUrl, getCapabilitiesJSON]);
|
|
9147
|
+
return layerTree;
|
|
9148
|
+
};
|
|
9149
|
+
/**
|
|
9150
|
+
* Gets the flat layer list (without hierarchy) for a WMS service. Cached by TanStack. Uses the same store as in queryWMSGetCapabilities.
|
|
9151
|
+
*
|
|
9152
|
+
* @param {string} serviceUrl
|
|
9153
|
+
* @returns {LayerProps[]}
|
|
9154
|
+
*/
|
|
9155
|
+
var useQueryGetWMSLayers = function useQueryGetWMSLayers(serviceUrl) {
|
|
9156
|
+
var _React$useState5 = React__default.useState([]),
|
|
9157
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
9158
|
+
layers = _React$useState6[0],
|
|
9159
|
+
setLayers = _React$useState6[1];
|
|
9160
|
+
var _useQueryGetWMSGetCap3 = useQueryGetWMSGetCapabilities(serviceUrl),
|
|
9161
|
+
getCapabilitiesJSON = _useQueryGetWMSGetCap3.data;
|
|
9162
|
+
React__default.useEffect(function () {
|
|
9163
|
+
if (!getCapabilitiesJSON) {
|
|
9164
|
+
setLayers([]);
|
|
9165
|
+
} else {
|
|
9166
|
+
setLayers(privateWmsFlattenLayerTree(privateWmsGetLayerTree(getCapabilitiesJSON)));
|
|
9167
|
+
}
|
|
9168
|
+
}, [serviceUrl, getCapabilitiesJSON]);
|
|
9169
|
+
return layers;
|
|
9170
|
+
};
|
|
9171
|
+
/**
|
|
9172
|
+
* Returns specific layer from the WMS service
|
|
9173
|
+
*
|
|
9174
|
+
* @param {string} serviceUrl
|
|
9175
|
+
* @param {string} name
|
|
9176
|
+
* @returns {(LayerProps | null)}
|
|
9177
|
+
*/
|
|
9178
|
+
var useQueryGetWMSLayer = function useQueryGetWMSLayer(serviceUrl, name) {
|
|
9179
|
+
var _React$useState7 = React__default.useState(null),
|
|
9180
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
9181
|
+
layer = _React$useState8[0],
|
|
9182
|
+
setLayer = _React$useState8[1];
|
|
9183
|
+
var layers = useQueryGetWMSLayers(serviceUrl);
|
|
9184
|
+
React__default.useEffect(function () {
|
|
9185
|
+
setLayer(layers.find(function (l) {
|
|
9186
|
+
return l.name === name;
|
|
9187
|
+
}) || null);
|
|
9188
|
+
}, [layers, name]);
|
|
9189
|
+
return layer;
|
|
9190
|
+
};
|
|
9191
|
+
/**
|
|
9192
|
+
* Returns WMLayer instance. The layer will contains parsed dimensions and styles and keeps a state for these properties.
|
|
9193
|
+
*
|
|
9194
|
+
* @param {string} serviceUrl
|
|
9195
|
+
* @param {string} name
|
|
9196
|
+
* @returns {(WMLayer | null)}
|
|
9197
|
+
*/
|
|
9198
|
+
var useGetWMLayerInstance = function useGetWMLayerInstance(serviceUrl, name) {
|
|
9199
|
+
var _React$useState9 = React__default.useState(null),
|
|
9200
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
9201
|
+
layer = _React$useState10[0],
|
|
9202
|
+
setLayer = _React$useState10[1];
|
|
9203
|
+
var layerId = useRef(generateLayerId()).current;
|
|
9204
|
+
React__default.useEffect(function () {
|
|
9205
|
+
var l = getWMLayerById(layerId);
|
|
9206
|
+
if (l) {
|
|
9207
|
+
return;
|
|
9208
|
+
}
|
|
9209
|
+
var wmLayer = new WMLayer({
|
|
9210
|
+
name: name,
|
|
9211
|
+
service: serviceUrl,
|
|
9212
|
+
layerType: LayerType.mapLayer,
|
|
9213
|
+
id: layerId
|
|
9214
|
+
});
|
|
9215
|
+
void wmLayer.parseLayer().then(function () {
|
|
9216
|
+
registerWMLayer(wmLayer, layerId);
|
|
9217
|
+
setLayer(wmLayer);
|
|
9218
|
+
});
|
|
9219
|
+
}, [layerId, name, serviceUrl]);
|
|
9220
|
+
return layer;
|
|
9221
|
+
};
|
|
9222
|
+
|
|
9223
|
+
export { DRAWMODE, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EDITMODE, EditModeButton as EditModeButtonField, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MINUTE_TO_MILLISECOND, MapControlButton, MapControls, MapDimensionSelect, MapDrawContainer, MapTime, MapView, MapViewLayer, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION, ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO, Proj4js, radarGetCapabilities_spec as RadarGetCapabilities, ReactMapView, ReactMapViewLayer, SelectField, StoryLayoutGrid, WEBMAP_REACT_NAMESPACE, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, addWMLayerPropsBasedOnChildProps, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, checkHoverFeatures, convertGeoCoordsToScreenCoords, createInterSections, currentlySupportedDrawModes, defaultBox, defaultDelete, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultModes, defaultPoint, defaultPolygon, defaultTimeFormat, dimensionConfig, distance, drawPolyStoryStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, featureBox, featureMultiPoint, featurePoint, featurePolygon, fillOptions, findClosestCoords, firSelectionType, formatTime, getCurrentDimensionValue, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawFunctionFromStore, getFeatureCollection, getFeatureExtent, getFeatureLayers, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getPixelCoordFromGeoCoord, getProj4, getTimeDimension, getToolIcon, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isAGeoJSONLayer, isAMapLayer, isBetween, isGeoJSONFeatureCreatedByTool, isPointFeatureCollection, lineString, lineStringCollection, makeLayerPropListFromChildren, marksByDimension, moveFeature, opacityOptions, orderLayers, parseWMJSLayer, projectorCache, publicLayers, publicServices, registerDrawFunction, removeWMLayerFromMap, rewindGeometry, setWMLayerPropsBasedOnChildProps, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, startToolExampleConfig, strokeWidthOptions, textStyle, textStyleWithMargin, updateEditModeButtonsWithFir, useGeoJSON, useGetWMLayerInstance, useMapDrawTool, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, webmapReactTranslations };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "GeoWeb react wrapper for webmap",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"react-resize-detector": "^9.1.0",
|
|
20
20
|
"i18next": "^23.11.5",
|
|
21
21
|
"@mui/material": "^6.1.1",
|
|
22
|
-
"react-i18next": "^15.1.1"
|
|
22
|
+
"react-i18next": "^15.1.1",
|
|
23
|
+
"@tanstack/react-query": "^5.61.5"
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|
|
25
26
|
"react": "18",
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare const
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ProfileAxis } from './ProfileAxis';
|
|
3
|
+
declare const meta: Meta<typeof ProfileAxis>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ProfileAxis>;
|
|
6
|
+
export declare const Component: Story;
|
|
7
|
+
export declare const ProfileAxisStory: Story;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Source } from '@opengeoweb/shared';
|
|
2
|
+
import { Position, Source } from '@opengeoweb/shared';
|
|
3
3
|
import { LayerProps } from '@opengeoweb/webmap';
|
|
4
4
|
export interface LayerInfoDialogProps {
|
|
5
5
|
layer: LayerProps;
|
|
@@ -10,5 +10,6 @@ export interface LayerInfoDialogProps {
|
|
|
10
10
|
order?: number;
|
|
11
11
|
source?: Source;
|
|
12
12
|
dialogHeight?: number;
|
|
13
|
+
startPosition?: Position;
|
|
13
14
|
}
|
|
14
15
|
export declare const LayerInfoDialog: React.FC<LayerInfoDialogProps>;
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
name: string;
|
|
12
|
-
link: string;
|
|
13
|
-
}[];
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export declare const LayerInfoDialogDark: {
|
|
17
|
-
(): React.ReactElement;
|
|
18
|
-
tags: string[];
|
|
19
|
-
parameters: {
|
|
20
|
-
zeplinLink: {
|
|
21
|
-
name: string;
|
|
22
|
-
link: string;
|
|
23
|
-
}[];
|
|
24
|
-
};
|
|
25
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { LayerInfoDialog } from './LayerInfoDialog';
|
|
3
|
+
declare const meta: Meta<typeof LayerInfoDialog>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof LayerInfoDialog>;
|
|
6
|
+
export declare const Component: Story;
|
|
7
|
+
export declare const LayerInfoDialogLightDoc: Story;
|
|
8
|
+
export declare const LayerInfoDialogLight: Story;
|
|
9
|
+
export declare const LayerInfoDialogDarkDoc: Story;
|
|
10
|
+
export declare const LayerInfoDialogDark: Story;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const SimpleLegend:
|
|
7
|
-
export declare const SimpleLegendWithMultiDimensions:
|
|
8
|
-
export declare const SimpleLegendWithoutDimensionsOrGraphic:
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Legend } from './Legend';
|
|
3
|
+
declare const meta: Meta<typeof Legend>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Legend>;
|
|
6
|
+
export declare const SimpleLegend: Story;
|
|
7
|
+
export declare const SimpleLegendWithMultiDimensions: Story;
|
|
8
|
+
export declare const SimpleLegendWithoutDimensionsOrGraphic: Story;
|
|
@@ -1,29 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const DimensionSelectEnsembleMemberLight: {
|
|
15
|
-
(): React.ReactElement;
|
|
16
|
-
tags: string[];
|
|
17
|
-
};
|
|
18
|
-
export declare const DimensionSelectEnsembleMemberDark: {
|
|
19
|
-
(): React.ReactElement;
|
|
20
|
-
tags: string[];
|
|
21
|
-
};
|
|
22
|
-
export declare const DimensionSelectInvalidSyncLight: {
|
|
23
|
-
(): React.ReactElement;
|
|
24
|
-
tags: string[];
|
|
25
|
-
};
|
|
26
|
-
export declare const DimensionSelectInvalidSyncDark: {
|
|
27
|
-
(): React.ReactElement;
|
|
28
|
-
tags: string[];
|
|
29
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import MapDimensionSelect from './MapDimensionSelect';
|
|
3
|
+
declare const meta: Meta<typeof MapDimensionSelect>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapDimensionSelect>;
|
|
6
|
+
export declare const Component: Story;
|
|
7
|
+
export declare const ComponentDark: Story;
|
|
8
|
+
export declare const DimensionSelectElevationLight: Story;
|
|
9
|
+
export declare const DimensionSelectElevationDark: Story;
|
|
10
|
+
export declare const DimensionSelectEnsembleMemberLight: Story;
|
|
11
|
+
export declare const DimensionSelectEnsembleMemberDark: Story;
|
|
12
|
+
export declare const DimensionSelectInvalidSyncLight: Story;
|
|
13
|
+
export declare const DimensionSelectInvalidSyncDark: Story;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
|
3
|
+
import MapDimensionSelect from './MapDimensionSelect';
|
|
2
4
|
declare const _default: {
|
|
3
5
|
title: string;
|
|
4
6
|
component: React.FC<import("../MapView").MapViewProps>;
|
|
5
7
|
};
|
|
6
8
|
export default _default;
|
|
7
|
-
|
|
9
|
+
type Story = StoryObj<typeof MapDimensionSelect>;
|
|
10
|
+
export declare const MapDimensionOnMap: Story;
|
|
@@ -1,37 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const Map1:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const Map3: {
|
|
15
|
-
(): React.ReactElement;
|
|
16
|
-
storyName: string;
|
|
17
|
-
};
|
|
18
|
-
export declare const Map4: {
|
|
19
|
-
(): React.ReactElement;
|
|
20
|
-
storyName: string;
|
|
21
|
-
};
|
|
22
|
-
export declare const Map5: {
|
|
23
|
-
(): React.ReactElement;
|
|
24
|
-
storyName: string;
|
|
25
|
-
};
|
|
26
|
-
export declare const Map6: {
|
|
27
|
-
(): React.ReactElement;
|
|
28
|
-
storyName: string;
|
|
29
|
-
};
|
|
30
|
-
export declare const Map7: {
|
|
31
|
-
(): React.ReactElement;
|
|
32
|
-
storyName: string;
|
|
33
|
-
};
|
|
34
|
-
export declare const Map8: {
|
|
35
|
-
(): React.ReactElement;
|
|
36
|
-
storyName: string;
|
|
37
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MapDrawGeoJSON } from './storyComponents/MapDrawGeoJSON';
|
|
3
|
+
declare const meta: Meta<typeof MapDrawGeoJSON>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapDrawGeoJSON>;
|
|
6
|
+
export declare const Map1: Story;
|
|
7
|
+
export declare const Map2: Story;
|
|
8
|
+
export declare const Map3: Story;
|
|
9
|
+
export declare const Map4: Story;
|
|
10
|
+
export declare const Map5: Story;
|
|
11
|
+
export declare const Map6: Story;
|
|
12
|
+
export declare const Map7: Story;
|
|
13
|
+
export declare const Map8: Story;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const BasicMapDrawTool: React.FC<BasicMapDrawToolProps>;
|
|
11
|
-
export declare const BasicMapDrawToolShape: () => React.ReactElement;
|
|
12
|
-
export declare const BasicMapDrawToolWithMultipleShapes: () => React.ReactElement;
|
|
13
|
-
export declare const BasicMapDrawToolWithMultipleShapesValues: () => React.ReactElement;
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { useMapDrawTool } from './useMapDrawTool';
|
|
3
|
+
declare const meta: Meta<typeof useMapDrawTool>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof useMapDrawTool>;
|
|
6
|
+
export declare const BasicMapDrawTool: Story;
|
|
7
|
+
export declare const BasicMapDrawToolShape: Story;
|
|
8
|
+
export declare const BasicMapDrawToolWithMultipleShapes: Story;
|
|
9
|
+
export declare const BasicMapDrawToolWithMultipleShapesValues: Story;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
mapDrawOptions: MapDrawToolOptions;
|
|
9
|
-
}
|
|
10
|
-
export declare const IntersectionDemo: React.FC<MapDrawToolIntersectDemoProps>;
|
|
11
|
-
export declare const IntersectionWithShapeDemo: () => React.ReactElement;
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { useMapDrawTool } from './useMapDrawTool';
|
|
3
|
+
declare const meta: Meta<typeof useMapDrawTool>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof useMapDrawTool>;
|
|
6
|
+
export declare const IntersectionDemo: Story;
|
|
7
|
+
export declare const IntersectionWithShapeDemo: Story;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const MultipleDrawToolsDemo:
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { useMapDrawTool } from './useMapDrawTool';
|
|
3
|
+
declare const meta: Meta<typeof useMapDrawTool>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof useMapDrawTool>;
|
|
6
|
+
export declare const MultipleDrawToolsDemo: Story;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export declare const MapError:
|
|
8
|
-
|
|
9
|
-
storyName: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const MapWithDuplicateLayerIdsError: {
|
|
12
|
-
(): React.ReactElement;
|
|
13
|
-
storyName: string;
|
|
14
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MapView } from '.';
|
|
3
|
+
declare const meta: Meta<typeof MapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapView>;
|
|
6
|
+
export declare const Component: Story;
|
|
7
|
+
export declare const MapError: Story;
|
|
8
|
+
export declare const MapWithDuplicateLayerIdsError: Story;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export declare const SetMapPin: {
|
|
8
|
-
(): React.ReactElement;
|
|
9
|
-
storyName: string;
|
|
10
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MapView } from '.';
|
|
3
|
+
declare const meta: Meta<typeof MapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapView>;
|
|
6
|
+
export declare const SetMapPin: Story;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export declare const PassiveMap: {
|
|
8
|
-
(): React.ReactElement;
|
|
9
|
-
storyName: string;
|
|
10
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MapView } from '.';
|
|
3
|
+
declare const meta: Meta<typeof MapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapView>;
|
|
6
|
+
export declare const PassiveMap: Story;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare const
|
|
7
|
-
title: string;
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MapView } from './MapView';
|
|
3
|
+
declare const meta: Meta<typeof MapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapView>;
|
|
6
|
+
export declare const MapViewProfile: Story;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export declare const RadarAnimation: {
|
|
8
|
-
(): React.ReactElement;
|
|
9
|
-
storyName: string;
|
|
10
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MapView } from '.';
|
|
3
|
+
declare const meta: Meta<typeof MapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapView>;
|
|
6
|
+
export declare const RadarAnimation: Story;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export declare const MapViewRadar: {
|
|
8
|
-
(): React.ReactElement;
|
|
9
|
-
storyName: string;
|
|
10
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MapView } from './MapView';
|
|
3
|
+
declare const meta: Meta<typeof MapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapView>;
|
|
6
|
+
export declare const MapViewRadar: Story;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export declare const SetProjectionBBox: {
|
|
8
|
-
(): React.ReactElement;
|
|
9
|
-
storyName: string;
|
|
10
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MapView } from '.';
|
|
3
|
+
declare const meta: Meta<typeof MapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapView>;
|
|
6
|
+
export declare const SetProjectionBBox: Story;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export declare const SetProjectionBBoxLocalState: {
|
|
8
|
-
(): React.ReactElement;
|
|
9
|
-
storyName: string;
|
|
10
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MapView } from '.';
|
|
3
|
+
declare const meta: Meta<typeof MapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapView>;
|
|
6
|
+
export declare const SetProjectionBBoxLocalState: Story;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export declare const HoldShiftToZoom: {
|
|
8
|
-
(): React.ReactElement;
|
|
9
|
-
storyName: string;
|
|
10
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MapView } from '.';
|
|
3
|
+
declare const meta: Meta<typeof MapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapView>;
|
|
6
|
+
export declare const HoldShiftToZoom: Story;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export declare const MapWithShowLayerInfoEnabled: {
|
|
8
|
-
(): React.ReactElement;
|
|
9
|
-
storyName: string;
|
|
10
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MapView } from '.';
|
|
3
|
+
declare const meta: Meta<typeof MapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapView>;
|
|
6
|
+
export declare const MapWithShowLayerInfoEnabled: Story;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default _default;
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MapView } from './MapView';
|
|
3
|
+
declare const meta: Meta<typeof MapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MapView>;
|
|
7
6
|
export interface MapDropDownItem {
|
|
8
7
|
name: string;
|
|
9
8
|
title: string;
|
|
@@ -15,8 +14,4 @@ export interface MapDropDownProps {
|
|
|
15
14
|
top?: number;
|
|
16
15
|
left?: number;
|
|
17
16
|
}
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const MapViewTiledBaseLayers: {
|
|
20
|
-
(): React.ReactElement;
|
|
21
|
-
storyName: string;
|
|
22
|
-
};
|
|
17
|
+
export declare const MapViewTiledBaseLayers: Story;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare enum TimeMode {
|
|
3
|
+
YEAR = 0,
|
|
4
|
+
MONTH = 1,
|
|
5
|
+
DAY = 2,
|
|
6
|
+
HOUR = 3,
|
|
7
|
+
MINUTE = 4,
|
|
8
|
+
SECOND = 5
|
|
9
|
+
}
|
|
10
|
+
interface WMSDimTimeYearSelectorProps {
|
|
11
|
+
selectedISOTime: string;
|
|
12
|
+
layerId: string;
|
|
13
|
+
onSelectTime: (time: string) => void;
|
|
14
|
+
mode: TimeMode;
|
|
15
|
+
}
|
|
16
|
+
export declare const increaseTime: (selectedISOTime: string, timeRes: string) => string;
|
|
17
|
+
declare const WMSDimTimeYearSelector: ({ selectedISOTime, layerId, onSelectTime, mode, }: WMSDimTimeYearSelectorProps) => React.ReactElement<WMSDimTimeYearSelectorProps> | null;
|
|
18
|
+
export default WMSDimTimeYearSelector;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LayerProps, LayerFoundation } from '@opengeoweb/webmap';
|
|
3
|
+
interface WMSLayerSelectorProps {
|
|
4
|
+
layer: LayerFoundation;
|
|
5
|
+
layers: LayerProps[];
|
|
6
|
+
onSelectLayer: (layer: LayerProps) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const WMSLayerSelector: ({ layer, layers, onSelectLayer, }: WMSLayerSelectorProps) => React.ReactElement<WMSLayerSelectorProps>;
|
|
9
|
+
export default WMSLayerSelector;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LayerFoundation } from '@opengeoweb/webmap';
|
|
3
|
+
interface WMSStyleSelectorProps {
|
|
4
|
+
layer: LayerFoundation;
|
|
5
|
+
onSelectStyle: (layer: LayerFoundation) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const WMSStyleSelector: ({ layer, onSelectStyle, }: WMSStyleSelectorProps) => React.ReactElement<WMSStyleSelectorProps> | null;
|
|
8
|
+
export default WMSStyleSelector;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface WMSTimeSliderProps {
|
|
3
|
+
selectedISOTime: string;
|
|
4
|
+
layerId: string;
|
|
5
|
+
onSelectTime: (time: string) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const WMSTimeSlider: ({ selectedISOTime, layerId, onSelectTime, }: WMSTimeSliderProps) => React.ReactElement<WMSTimeSliderProps> | null;
|
|
8
|
+
export default WMSTimeSlider;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { GetCapabilitiesJson, WMSServiceInfo, LayerTree, LayerProps, WMLayer } from '@opengeoweb/webmap';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
/**
|
|
4
|
+
* Queries the WMS GetCapabilities. This is the base TanStack hook for the other hooks in this file.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} serviceUrl
|
|
7
|
+
* @returns {UseQueryResult<GetCapabilitiesJson>}
|
|
8
|
+
*/
|
|
9
|
+
export declare const useQueryGetWMSGetCapabilities: (serviceUrl: string) => UseQueryResult<GetCapabilitiesJson>;
|
|
10
|
+
/**
|
|
11
|
+
* Returns details about the WMS service
|
|
12
|
+
*
|
|
13
|
+
* @param {string} serviceUrl
|
|
14
|
+
* @returns {(WMSServiceInfo | null)}
|
|
15
|
+
*/
|
|
16
|
+
export declare const useQueryGetWMSServiceInfo: (serviceUrl: string) => WMSServiceInfo | null;
|
|
17
|
+
/**
|
|
18
|
+
* Gets the layer tree in hierarchical order for a WMS service. Cached by TanStack. Uses the same store as in queryWMSGetCapabilities.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} serviceUrl
|
|
21
|
+
* @returns {(LayerTree | null)}
|
|
22
|
+
*/
|
|
23
|
+
export declare const useQueryGetWMSLayersTree: (serviceUrl: string) => LayerTree | null;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the flat layer list (without hierarchy) for a WMS service. Cached by TanStack. Uses the same store as in queryWMSGetCapabilities.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} serviceUrl
|
|
28
|
+
* @returns {LayerProps[]}
|
|
29
|
+
*/
|
|
30
|
+
export declare const useQueryGetWMSLayers: (serviceUrl: string) => LayerProps[];
|
|
31
|
+
/**
|
|
32
|
+
* Returns specific layer from the WMS service
|
|
33
|
+
*
|
|
34
|
+
* @param {string} serviceUrl
|
|
35
|
+
* @param {string} name
|
|
36
|
+
* @returns {(LayerProps | null)}
|
|
37
|
+
*/
|
|
38
|
+
export declare const useQueryGetWMSLayer: (serviceUrl: string, name: string) => LayerProps | null;
|
|
39
|
+
/**
|
|
40
|
+
* Returns WMLayer instance. The layer will contains parsed dimensions and styles and keeps a state for these properties.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} serviceUrl
|
|
43
|
+
* @param {string} name
|
|
44
|
+
* @returns {(WMLayer | null)}
|
|
45
|
+
*/
|
|
46
|
+
export declare const useGetWMLayerInstance: (serviceUrl: string, name: string) => WMLayer | null;
|
package/src/lib/index.d.ts
CHANGED