@opengeoweb/webmap-react 9.22.0 → 9.23.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
|
@@ -63,48 +63,48 @@ var en = {
|
|
|
63
63
|
"webmap-react-linestring": "LineString"
|
|
64
64
|
};
|
|
65
65
|
var fi = {
|
|
66
|
-
"webmap-react-event": "
|
|
67
|
-
"webmap-react-sent": "
|
|
68
|
-
"webmap-react-utc": "
|
|
69
|
-
"webmap-react-expires": "
|
|
70
|
-
"webmap-react-sender": "
|
|
71
|
-
"webmap-react-identifier": "
|
|
72
|
-
"webmap-react-no-layers": "
|
|
73
|
-
"webmap-react-legend": "
|
|
74
|
-
"webmap-react-title": "
|
|
75
|
-
"webmap-react-name": "
|
|
76
|
-
"webmap-react-service": "
|
|
77
|
-
"webmap-react-abstract": "
|
|
78
|
-
"webmap-react-dimensions": "
|
|
79
|
-
"webmap-react-styles": "
|
|
80
|
-
"webmap-react-bounding-box": "
|
|
81
|
-
"webmap-react-groups": "
|
|
82
|
-
"webmap-react-keywords": "
|
|
83
|
-
"webmap-react-zoom-reset": "
|
|
84
|
-
"webmap-react-zoom-in": "
|
|
85
|
-
"webmap-react-zoom-out": "
|
|
86
|
-
"webmap-react-show": "
|
|
87
|
-
"webmap-react-click-disconnect": "
|
|
88
|
-
"webmap-react-click-connect": "
|
|
89
|
-
"webmap-react-layer-info": "
|
|
90
|
-
"webmap-react-vertical-level": "
|
|
91
|
-
"webmap-react-hpa": "
|
|
92
|
-
"webmap-react-ensemble-member": "
|
|
93
|
-
"webmap-react-member": "
|
|
94
|
-
"webmap-react-probability": "
|
|
95
|
-
"webmap-react-percent": "
|
|
96
|
-
"webmap-react-level": "
|
|
97
|
-
"webmap-react-west": "
|
|
98
|
-
"webmap-react-east": "
|
|
99
|
-
"webmap-react-north": "
|
|
100
|
-
"webmap-react-south": "
|
|
101
|
-
"webmap-react-new-linestring-created": "
|
|
102
|
-
"webmap-react-new-feature": "
|
|
103
|
-
"webmap-react-new-point": "
|
|
104
|
-
"webmap-react-point": "
|
|
105
|
-
"webmap-react-polygon": "
|
|
106
|
-
"webmap-react-box": "
|
|
107
|
-
"webmap-react-linestring": "
|
|
66
|
+
"webmap-react-event": "tapahtuma:",
|
|
67
|
+
"webmap-react-sent": "Lähetetty:",
|
|
68
|
+
"webmap-react-utc": "UTC",
|
|
69
|
+
"webmap-react-expires": "Vanhentunut",
|
|
70
|
+
"webmap-react-sender": "Lähettäjä:",
|
|
71
|
+
"webmap-react-identifier": "Tunniste",
|
|
72
|
+
"webmap-react-no-layers": "Ei karttatasoja",
|
|
73
|
+
"webmap-react-legend": "Selite",
|
|
74
|
+
"webmap-react-title": "Titteli",
|
|
75
|
+
"webmap-react-name": "Nimi",
|
|
76
|
+
"webmap-react-service": "Palvelu",
|
|
77
|
+
"webmap-react-abstract": "Tiivistelmä",
|
|
78
|
+
"webmap-react-dimensions": "Dimensiot",
|
|
79
|
+
"webmap-react-styles": "Tyylit",
|
|
80
|
+
"webmap-react-bounding-box": "Rajaava-alue",
|
|
81
|
+
"webmap-react-groups": "Ryhmät",
|
|
82
|
+
"webmap-react-keywords": "Avainsanat",
|
|
83
|
+
"webmap-react-zoom-reset": "Resetoi zoom",
|
|
84
|
+
"webmap-react-zoom-in": "Zoomaa sisään",
|
|
85
|
+
"webmap-react-zoom-out": "Zoomaa ulos",
|
|
86
|
+
"webmap-react-show": "Näytä",
|
|
87
|
+
"webmap-react-click-disconnect": "Irroita karttataso napsauttamalla",
|
|
88
|
+
"webmap-react-click-connect": "Yhdistä karttataso napsauttamalla",
|
|
89
|
+
"webmap-react-layer-info": "Karttatason tiedot",
|
|
90
|
+
"webmap-react-vertical-level": "pystytaso",
|
|
91
|
+
"webmap-react-hpa": "hPa",
|
|
92
|
+
"webmap-react-ensemble-member": "Yhdistelmämallijäsen",
|
|
93
|
+
"webmap-react-member": "jäsen",
|
|
94
|
+
"webmap-react-probability": "Todennäköisyys",
|
|
95
|
+
"webmap-react-percent": "%",
|
|
96
|
+
"webmap-react-level": "Taso",
|
|
97
|
+
"webmap-react-west": "länsi",
|
|
98
|
+
"webmap-react-east": "itä",
|
|
99
|
+
"webmap-react-north": "pohjoinen",
|
|
100
|
+
"webmap-react-south": "etelä",
|
|
101
|
+
"webmap-react-new-linestring-created": "Viivajonoon luotiin uusi piste",
|
|
102
|
+
"webmap-react-new-feature": "uusi kohde luotu",
|
|
103
|
+
"webmap-react-new-point": "uusi piste luotu",
|
|
104
|
+
"webmap-react-point": "Piste",
|
|
105
|
+
"webmap-react-polygon": "Monikulmio",
|
|
106
|
+
"webmap-react-box": "Laatikko",
|
|
107
|
+
"webmap-react-linestring": "Viivajono"
|
|
108
108
|
};
|
|
109
109
|
var no = {
|
|
110
110
|
"webmap-react-event": "hendelse:",
|
|
@@ -9814,26 +9814,49 @@ class ReactMapView extends React.Component {
|
|
|
9814
9814
|
currentChildren: []
|
|
9815
9815
|
};
|
|
9816
9816
|
this.refetchTimer = null;
|
|
9817
|
-
|
|
9817
|
+
/**
|
|
9818
|
+
* Last epoch time the map was visible in millisecs. Null if the map is currently visible.
|
|
9819
|
+
*/
|
|
9820
|
+
this.lastVisible = null;
|
|
9821
|
+
this.handleVisibilityChange = () => {
|
|
9822
|
+
const {
|
|
9823
|
+
shouldAutoFetch
|
|
9824
|
+
} = this.props;
|
|
9825
|
+
const autoFetchInterval = Number(shouldAutoFetch); // Default true -> 1 minute
|
|
9826
|
+
const autoFetchIntervalMilliSeconds = Math.abs(autoFetchInterval) * MINUTE_TO_MILLISECOND;
|
|
9827
|
+
if (document.visibilityState === 'visible') {
|
|
9828
|
+
if (this.lastVisible &&
|
|
9829
|
+
// skip if last visibility change was within 1 minute (or the autoFetchInterval)
|
|
9830
|
+
new Date().getTime() - this.lastVisible > autoFetchIntervalMilliSeconds) {
|
|
9831
|
+
this.onStartRefetchTimer(true);
|
|
9832
|
+
}
|
|
9833
|
+
this.lastVisible = null;
|
|
9834
|
+
} else {
|
|
9835
|
+
this.lastVisible = new Date().getTime();
|
|
9836
|
+
this.clearRefetchTimer();
|
|
9837
|
+
}
|
|
9838
|
+
};
|
|
9839
|
+
/**
|
|
9840
|
+
* Start the refetch timer
|
|
9841
|
+
* @param force - Force a fetch and wmLayer parse immediately
|
|
9842
|
+
*/
|
|
9843
|
+
this.onStartRefetchTimer = force => {
|
|
9818
9844
|
const {
|
|
9819
9845
|
shouldAutoFetch
|
|
9820
9846
|
} = this.props;
|
|
9821
|
-
/* TODO, Maarten Plieger, 2021-09-02
|
|
9847
|
+
/* TODO, Maarten Plieger, 2021-09-02
|
|
9822
9848
|
This causes many issues, we should improve the update strategy.
|
|
9823
9849
|
Certain presets have >20 layers. This causes 20 times parsing the GetCapabilities for a minor update of the store.
|
|
9824
9850
|
*/
|
|
9825
9851
|
this.clearRefetchTimer();
|
|
9826
9852
|
const autoFetchInterval = Number(shouldAutoFetch); // Default true -> 1 minute
|
|
9827
|
-
|
|
9853
|
+
const refetch = () => {
|
|
9828
9854
|
const {
|
|
9829
9855
|
mapId
|
|
9830
9856
|
} = this.props;
|
|
9831
9857
|
const wmjsMap = webmapUtils.getWMJSMapById(mapId);
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
}
|
|
9835
|
-
const layers = wmjsMap.getLayers();
|
|
9836
|
-
layers.forEach(layer => {
|
|
9858
|
+
const layers = wmjsMap === null || wmjsMap === void 0 ? void 0 : wmjsMap.getLayers();
|
|
9859
|
+
layers === null || layers === void 0 ? void 0 : layers.forEach(layer => {
|
|
9837
9860
|
if (layer.enabled !== false) {
|
|
9838
9861
|
parseWMJSLayer(layer, true).then(wmLayer => {
|
|
9839
9862
|
const {
|
|
@@ -9850,7 +9873,11 @@ class ReactMapView extends React.Component {
|
|
|
9850
9873
|
});
|
|
9851
9874
|
}
|
|
9852
9875
|
});
|
|
9853
|
-
}
|
|
9876
|
+
};
|
|
9877
|
+
this.refetchTimer = setInterval(refetch, Math.abs(autoFetchInterval) * MINUTE_TO_MILLISECOND);
|
|
9878
|
+
if (force) {
|
|
9879
|
+
refetch();
|
|
9880
|
+
}
|
|
9854
9881
|
};
|
|
9855
9882
|
this.clearRefetchTimer = () => {
|
|
9856
9883
|
if (this.refetchTimer) {
|
|
@@ -9865,6 +9892,7 @@ class ReactMapView extends React.Component {
|
|
|
9865
9892
|
this.drawDebounced = debounce(600, this.drawDebounced);
|
|
9866
9893
|
this.updateWMJSMapProps = this.updateWMJSMapProps.bind(this);
|
|
9867
9894
|
this.mountWMJSMap = this.mountWMJSMap.bind(this);
|
|
9895
|
+
this.handleVisibilityChange = this.handleVisibilityChange.bind(this);
|
|
9868
9896
|
this.onAfterSetBBoxListener = this.onAfterSetBBoxListener.bind(this);
|
|
9869
9897
|
this.onUpdateBBoxListener = this.onUpdateBBoxListener.bind(this);
|
|
9870
9898
|
this.onDimChangeListener = this.onDimChangeListener.bind(this);
|
|
@@ -9885,6 +9913,7 @@ class ReactMapView extends React.Component {
|
|
|
9885
9913
|
this.mountWMJSMap();
|
|
9886
9914
|
if (shouldAutoFetch) {
|
|
9887
9915
|
this.onStartRefetchTimer();
|
|
9916
|
+
document.addEventListener('visibilitychange', this.handleVisibilityChange);
|
|
9888
9917
|
}
|
|
9889
9918
|
onWMJSMount(mapId);
|
|
9890
9919
|
}
|
|
@@ -9898,6 +9927,7 @@ class ReactMapView extends React.Component {
|
|
|
9898
9927
|
} = this.props;
|
|
9899
9928
|
window.removeEventListener('resize', this.handleWindowResize);
|
|
9900
9929
|
this.clearRefetchTimer();
|
|
9930
|
+
document.removeEventListener('visibilitychange', this.handleVisibilityChange);
|
|
9901
9931
|
webmapUtils.unRegisterWMJSMap(mapId);
|
|
9902
9932
|
/* Reset adaguc properties */
|
|
9903
9933
|
this.adaguc.initialized = false;
|
package/package.json
CHANGED
|
@@ -22,6 +22,10 @@ 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
29
|
static defaultProps: {
|
|
26
30
|
srs: string;
|
|
27
31
|
bbox: {
|
|
@@ -47,7 +51,12 @@ export declare class ReactMapView extends React.Component<ReactMapViewProps, Rea
|
|
|
47
51
|
onDimChangeListener(): void;
|
|
48
52
|
onAfterSetBBoxListener(): void;
|
|
49
53
|
onUpdateBBoxListener(newBbox: WMBBOX): void;
|
|
50
|
-
|
|
54
|
+
handleVisibilityChange: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* Start the refetch timer
|
|
57
|
+
* @param force - Force a fetch and wmLayer parse immediately
|
|
58
|
+
*/
|
|
59
|
+
onStartRefetchTimer: (force?: boolean) => void;
|
|
51
60
|
clearRefetchTimer: () => void;
|
|
52
61
|
updateWMJSMapProps(prevProps: ReactMapViewProps, props: ReactMapViewProps): void;
|
|
53
62
|
drawDebounced(): void;
|