@opengeoweb/webmap-react 9.27.0 → 9.27.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/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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap-react",
|
|
3
|
-
"version": "9.27.
|
|
3
|
+
"version": "9.27.1",
|
|
4
4
|
"description": "GeoWeb react wrapper for webmap",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,7 +14,7 @@
|
|
|
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",
|
|
@@ -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: {
|