@opengeoweb/webmap-react 9.27.0 → 9.28.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
CHANGED
|
@@ -10,7 +10,7 @@ import { Paper, Box, Typography, Grid, TextField, FormControl, InputLabel, Selec
|
|
|
10
10
|
import { Home, Add, Minus, List, Delete, Edit, DrawRegion, DrawPolygon, Location, DrawFIRLand, ArrowUp, Equalizer, DimensionsElevation, Link, LinkOff, Info, DimensionsOther, DimensionsRefTime, DimensionsTime } from '@opengeoweb/theme';
|
|
11
11
|
import _, { cloneDeep } from 'lodash';
|
|
12
12
|
import * as turf from '@turf/turf';
|
|
13
|
-
import {
|
|
13
|
+
import { polygonToLine, booleanClockwise, rewind } from '@turf/turf';
|
|
14
14
|
import proj4 from 'proj4';
|
|
15
15
|
import { produce } from 'immer';
|
|
16
16
|
import { debounce } from 'throttle-debounce';
|
|
@@ -6030,7 +6030,7 @@ const intersectPolygonGeoJSONS = (a, b, geoJSONProperties = {
|
|
|
6030
6030
|
};
|
|
6031
6031
|
const simplifiedA = turf.simplify(featureA, options);
|
|
6032
6032
|
const simplifiedB = turf.simplify(featureB, options);
|
|
6033
|
-
const intersection = turf.intersect(simplifiedA, simplifiedB);
|
|
6033
|
+
const intersection = turf.intersect(turf.featureCollection([simplifiedA, simplifiedB]));
|
|
6034
6034
|
return addFeatureProperties({
|
|
6035
6035
|
type: 'FeatureCollection',
|
|
6036
6036
|
features: intersection === null ? [{
|
|
@@ -6142,7 +6142,7 @@ const rewindGeometry = geoJSON => {
|
|
|
6142
6142
|
const {
|
|
6143
6143
|
geometry
|
|
6144
6144
|
} = geoJSON.features[0];
|
|
6145
|
-
const lineString =
|
|
6145
|
+
const lineString = polygonToLine(geometry);
|
|
6146
6146
|
if (booleanClockwise(lineString.geometry.coordinates)) {
|
|
6147
6147
|
// eslint-disable-next-line no-param-reassign
|
|
6148
6148
|
geoJSONDraft.features[0].geometry = rewind(geoJSONDraft.features[0].geometry);
|
|
@@ -9897,10 +9897,7 @@ class ReactMapView extends React.Component {
|
|
|
9897
9897
|
currentChildren: []
|
|
9898
9898
|
};
|
|
9899
9899
|
this.refetchTimer = null;
|
|
9900
|
-
|
|
9901
|
-
* Last epoch time the map was visible in millisecs. Null if the map is currently visible.
|
|
9902
|
-
*/
|
|
9903
|
-
this.lastVisible = null;
|
|
9900
|
+
this.lastRefetched = null;
|
|
9904
9901
|
this.handleVisibilityChange = () => {
|
|
9905
9902
|
const {
|
|
9906
9903
|
shouldAutoFetch
|
|
@@ -9908,14 +9905,14 @@ class ReactMapView extends React.Component {
|
|
|
9908
9905
|
const autoFetchInterval = Number(shouldAutoFetch); // Default true -> 1 minute
|
|
9909
9906
|
const autoFetchIntervalMilliSeconds = Math.abs(autoFetchInterval) * MINUTE_TO_MILLISECOND;
|
|
9910
9907
|
if (document.visibilityState === 'visible') {
|
|
9911
|
-
if (this.
|
|
9912
|
-
// skip if last
|
|
9913
|
-
new Date().getTime() - this.
|
|
9908
|
+
if (this.lastRefetched &&
|
|
9909
|
+
// skip if last refetch was within 1 minute (or the autoFetchInterval)
|
|
9910
|
+
new Date().getTime() - this.lastRefetched > autoFetchIntervalMilliSeconds) {
|
|
9914
9911
|
this.onStartRefetchTimer(true);
|
|
9912
|
+
} else {
|
|
9913
|
+
this.onStartRefetchTimer();
|
|
9915
9914
|
}
|
|
9916
|
-
this.lastVisible = null;
|
|
9917
9915
|
} else {
|
|
9918
|
-
this.lastVisible = new Date().getTime();
|
|
9919
9916
|
this.clearRefetchTimer();
|
|
9920
9917
|
}
|
|
9921
9918
|
};
|
|
@@ -9934,6 +9931,7 @@ class ReactMapView extends React.Component {
|
|
|
9934
9931
|
this.clearRefetchTimer();
|
|
9935
9932
|
const autoFetchInterval = Number(shouldAutoFetch); // Default true -> 1 minute
|
|
9936
9933
|
const refetch = () => {
|
|
9934
|
+
this.lastRefetched = new Date().getTime();
|
|
9937
9935
|
const {
|
|
9938
9936
|
mapId
|
|
9939
9937
|
} = this.props;
|
|
@@ -12018,14 +12016,9 @@ const KNMIgeoservicesKlimaatAtlas = {
|
|
|
12018
12016
|
};
|
|
12019
12017
|
const KNMIgeoservicesHarmonie = {
|
|
12020
12018
|
name: 'KNMIgeoservicesHarmonie',
|
|
12021
|
-
url: 'https://geoservices.knmi.nl/
|
|
12019
|
+
url: 'https://geoservices.knmi.nl/adagucserver?dataset=uwcw_ha43_dini_5p5km',
|
|
12022
12020
|
id: 'KNMIgeoservicesKliKNMIgeoservicesHarmoniemaatAtlas'
|
|
12023
12021
|
};
|
|
12024
|
-
const KNMIgeoservicesHarmonieMLService = {
|
|
12025
|
-
name: 'KNMI Harmonie ML',
|
|
12026
|
-
url: 'https://geoservices.knmi.nl/wms?DATASET=HARM_N25_ML&SERVICE=WMS&',
|
|
12027
|
-
id: 'harmonieML'
|
|
12028
|
-
};
|
|
12029
12022
|
const MetNorwayService = {
|
|
12030
12023
|
name: 'MetNorwayService',
|
|
12031
12024
|
url: 'https://wms-e1.geoweb.met.no/wms?',
|
|
@@ -12084,7 +12077,6 @@ var publicServices = /*#__PURE__*/Object.freeze({
|
|
|
12084
12077
|
FMIopenwms: FMIopenwms,
|
|
12085
12078
|
HeiGit: HeiGit,
|
|
12086
12079
|
KNMIgeoservicesHarmonie: KNMIgeoservicesHarmonie,
|
|
12087
|
-
KNMIgeoservicesHarmonieMLService: KNMIgeoservicesHarmonieMLService,
|
|
12088
12080
|
KNMIgeoservicesKlimaatAtlas: KNMIgeoservicesKlimaatAtlas,
|
|
12089
12081
|
KNMIgeoservicesObs: KNMIgeoservicesObs,
|
|
12090
12082
|
KNMIgeoservicesRadar: KNMIgeoservicesRadar,
|
|
@@ -12246,7 +12238,7 @@ const harmonieWindPl = {
|
|
|
12246
12238
|
};
|
|
12247
12239
|
const harmonieAirTemperature = {
|
|
12248
12240
|
service: KNMIgeoservicesHarmonie.url,
|
|
12249
|
-
name: '
|
|
12241
|
+
name: 'air_temperature_hagl',
|
|
12250
12242
|
id: webmapUtils.generateLayerId(),
|
|
12251
12243
|
layerType: LayerType.mapLayer,
|
|
12252
12244
|
enabled: true
|
|
@@ -12260,7 +12252,7 @@ const harmoniePrecipitation = {
|
|
|
12260
12252
|
};
|
|
12261
12253
|
const harmoniePressure = {
|
|
12262
12254
|
service: KNMIgeoservicesHarmonie.url,
|
|
12263
|
-
name: '
|
|
12255
|
+
name: 'air_pressure_at_mean_sea_level_hagl',
|
|
12264
12256
|
id: webmapUtils.generateLayerId(),
|
|
12265
12257
|
layerType: LayerType.mapLayer,
|
|
12266
12258
|
enabled: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap-react",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.28.0",
|
|
4
4
|
"description": "GeoWeb react wrapper for webmap",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"@opengeoweb/shared": "*",
|
|
15
15
|
"lodash": "^4.17.21",
|
|
16
16
|
"proj4": "^2.9.2",
|
|
17
|
-
"@turf/turf": "^
|
|
17
|
+
"@turf/turf": "^7.1.0",
|
|
18
18
|
"immer": "^10.0.3",
|
|
19
19
|
"react-resize-detector": "^9.1.0",
|
|
20
20
|
"throttle-debounce": "^5.0.0",
|
|
21
21
|
"i18next": "^23.11.5",
|
|
22
|
-
"@mui/material": "^
|
|
22
|
+
"@mui/material": "^6.1.1",
|
|
23
23
|
"react-i18next": "^14.1.2"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Feature } from '
|
|
2
|
-
import { FeatureCollection, GeoJsonProperties, Point } from 'geojson';
|
|
1
|
+
import { Feature, FeatureCollection, GeoJsonProperties, Point } from 'geojson';
|
|
3
2
|
import { Bbox } from '@opengeoweb/webmap';
|
|
4
3
|
import { DrawMode, SelectionType } from './types';
|
|
5
4
|
/**
|
|
@@ -22,10 +22,7 @@ export declare class ReactMapView extends React.Component<ReactMapViewProps, Rea
|
|
|
22
22
|
adagucContainerRef: React.RefObject<HTMLDivElement>;
|
|
23
23
|
adagucWebMapJSRef: React.RefObject<HTMLDivElement>;
|
|
24
24
|
refetchTimer: NodeJS.Timeout | number | null;
|
|
25
|
-
|
|
26
|
-
* Last epoch time the map was visible in millisecs. Null if the map is currently visible.
|
|
27
|
-
*/
|
|
28
|
-
lastVisible: number | null;
|
|
25
|
+
lastRefetched: number | null;
|
|
29
26
|
static defaultProps: {
|
|
30
27
|
srs: "EPSG:3857";
|
|
31
28
|
bbox: {
|
|
@@ -43,11 +43,6 @@ export declare const KNMIgeoservicesHarmonie: {
|
|
|
43
43
|
url: string;
|
|
44
44
|
id: string;
|
|
45
45
|
};
|
|
46
|
-
export declare const KNMIgeoservicesHarmonieMLService: {
|
|
47
|
-
name: string;
|
|
48
|
-
url: string;
|
|
49
|
-
id: string;
|
|
50
|
-
};
|
|
51
46
|
export declare const MetNorwayService: {
|
|
52
47
|
name: string;
|
|
53
48
|
url: string;
|