@opengeoweb/webmap-react 19.1.1 → 19.3.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/dist/index.esm.js +13 -5
- package/dist/src/lib/components/OpenLayers/controls/OpenLayersGetFeatureInfo.d.ts +2 -0
- package/dist/src/lib/components/OpenLayers/layers/FeatureLayer.d.ts +1 -0
- package/dist/src/lib/components/OpenLayers/layers/OpenLayersFeatureLayer.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1257,7 +1257,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1257
1257
|
(_openLayersGetMapImag = openLayersGetMapImageStore.getImage(src)) === null || _openLayersGetMapImag === void 0 || _openLayersGetMapImag.clearError();
|
|
1258
1258
|
_context.n = 1;
|
|
1259
1259
|
return jobWrapper.loadAndResolve(extent, resolution, pixelRatio, projection, _this3._wmsUrl, _this3._extraWMSParams, _this3._layerName, _this3._styleName, dimPropsWithTime)["catch"](function (e) {
|
|
1260
|
-
console
|
|
1260
|
+
// Do not log errors, as they are not very useful and can better be inspected via the network console
|
|
1261
1261
|
});
|
|
1262
1262
|
case 1:
|
|
1263
1263
|
return _context.a(2, function (cancelled) {
|
|
@@ -5903,6 +5903,7 @@ var FeatureLayer = function FeatureLayer(_ref) {
|
|
|
5903
5903
|
hoverSelect = _ref.hoverSelect,
|
|
5904
5904
|
clickOnFeature = _ref.clickOnFeature,
|
|
5905
5905
|
boxSelect = _ref.boxSelect,
|
|
5906
|
+
layerId = _ref.layerId,
|
|
5906
5907
|
testId = _ref.testId,
|
|
5907
5908
|
opacity = _ref.opacity,
|
|
5908
5909
|
_ref$declutter = _ref.declutter,
|
|
@@ -5928,6 +5929,7 @@ var FeatureLayer = function FeatureLayer(_ref) {
|
|
|
5928
5929
|
zIndex: zIndex,
|
|
5929
5930
|
style: style,
|
|
5930
5931
|
properties: {
|
|
5932
|
+
layerId: layerId,
|
|
5931
5933
|
testId: testId
|
|
5932
5934
|
},
|
|
5933
5935
|
opacity: opacity,
|
|
@@ -5945,7 +5947,7 @@ var FeatureLayer = function FeatureLayer(_ref) {
|
|
|
5945
5947
|
};
|
|
5946
5948
|
// NOTE: style should not be part of this effect, as it changes always, causing the layer to be add/removed continuousely.
|
|
5947
5949
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5948
|
-
}, [map, zIndex, testId, visible]);
|
|
5950
|
+
}, [layerId, map, zIndex, testId, visible]);
|
|
5949
5951
|
useEffect(function () {
|
|
5950
5952
|
// Handle style function:
|
|
5951
5953
|
if (layerRef.current && style) {
|
|
@@ -6113,6 +6115,7 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
|
|
|
6113
6115
|
hoverSelect = _ref.hoverSelect,
|
|
6114
6116
|
clickOnFeature = _ref.clickOnFeature,
|
|
6115
6117
|
boxSelect = _ref.boxSelect,
|
|
6118
|
+
layerId = _ref.layerId,
|
|
6116
6119
|
testId = _ref.testId,
|
|
6117
6120
|
opacity = _ref.opacity,
|
|
6118
6121
|
_ref$declutter = _ref.declutter,
|
|
@@ -6144,6 +6147,7 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
|
|
|
6144
6147
|
declutter: declutter,
|
|
6145
6148
|
features: features.current,
|
|
6146
6149
|
hoverSelect: hoverSelect,
|
|
6150
|
+
layerId: layerId,
|
|
6147
6151
|
opacity: opacity,
|
|
6148
6152
|
style: style,
|
|
6149
6153
|
testId: testId,
|
|
@@ -7604,7 +7608,7 @@ var KNMIgeoservicesRadar = {
|
|
|
7604
7608
|
};
|
|
7605
7609
|
var KNMIgeoservicesObs = {
|
|
7606
7610
|
name: 'KNMIgeoservicesObs',
|
|
7607
|
-
url: 'https://geoservices.knmi.nl/adagucserver?dataset=
|
|
7611
|
+
url: 'https://geoservices.knmi.nl/adagucserver?dataset=10-minute-in-situ-meteorological-observations',
|
|
7608
7612
|
id: 'KNMIgeoservicesObs'
|
|
7609
7613
|
};
|
|
7610
7614
|
var KNMIgeoservicesKlimaatAtlas = {
|
|
@@ -8229,7 +8233,8 @@ var OpenLayersGetFeatureInfo = function OpenLayersGetFeatureInfo(_ref) {
|
|
|
8229
8233
|
var displayMapPin = _ref.displayMapPin,
|
|
8230
8234
|
disableMapPin = _ref.disableMapPin,
|
|
8231
8235
|
mapPinLocation = _ref.mapPinLocation,
|
|
8232
|
-
selectLocation = _ref.selectLocation
|
|
8236
|
+
selectLocation = _ref.selectLocation,
|
|
8237
|
+
shouldHandleClick = _ref.shouldHandleClick;
|
|
8233
8238
|
var _useContext = useContext(MapContext),
|
|
8234
8239
|
map = _useContext.map;
|
|
8235
8240
|
var _useIconStyle = useIconStyle({
|
|
@@ -8257,6 +8262,9 @@ var OpenLayersGetFeatureInfo = function OpenLayersGetFeatureInfo(_ref) {
|
|
|
8257
8262
|
return function () {};
|
|
8258
8263
|
}
|
|
8259
8264
|
var key = map.on('click', function (e) {
|
|
8265
|
+
if (shouldHandleClick && !shouldHandleClick(e)) {
|
|
8266
|
+
return;
|
|
8267
|
+
}
|
|
8260
8268
|
var projection = map.getView().getProjection();
|
|
8261
8269
|
var resolution = map.getView().getResolution();
|
|
8262
8270
|
var location = toLonLat(e.coordinate, projection);
|
|
@@ -8272,7 +8280,7 @@ var OpenLayersGetFeatureInfo = function OpenLayersGetFeatureInfo(_ref) {
|
|
|
8272
8280
|
return function () {
|
|
8273
8281
|
unByKey(key);
|
|
8274
8282
|
};
|
|
8275
|
-
}, [map, displayMapPin, selectLocation]);
|
|
8283
|
+
}, [map, displayMapPin, selectLocation, shouldHandleClick]);
|
|
8276
8284
|
if (!displayMapPin) {
|
|
8277
8285
|
return null;
|
|
8278
8286
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { MapBrowserEvent } from 'ol';
|
|
1
2
|
import type { MapLocation } from '../../../types/types';
|
|
2
3
|
export interface OpenLayersGetFeatureInfoProps {
|
|
3
4
|
displayMapPin?: boolean;
|
|
4
5
|
disableMapPin?: boolean;
|
|
5
6
|
mapPinLocation?: MapLocation;
|
|
6
7
|
selectLocation: (location: MapLocation) => void;
|
|
8
|
+
shouldHandleClick?: (event: MapBrowserEvent<KeyboardEvent | WheelEvent | PointerEvent>) => boolean;
|
|
7
9
|
}
|
|
8
10
|
export declare const OpenLayersGetFeatureInfo: React.FC<OpenLayersGetFeatureInfoProps>;
|