Skip to content

Commit c3d0b9d

Browse files
committed
fix: cancel
1 parent 8edb3e1 commit c3d0b9d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/js/index/core/cross.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ TREM.variable.events.on('MapLoad', (map) => {
3434
'icon-allow-overlap': true,
3535
'icon-ignore-placement': true,
3636
},
37+
paint: {
38+
'icon-opacity': ['get', 'opacity'],
39+
},
3740
});
3841
});
3942

@@ -57,7 +60,7 @@ function refresh_cross(show) {
5760
}
5861
const sWaveSource = TREM.variable.map.getSource(`${eew.id}-s-wave`);
5962
const pWaveSource = TREM.variable.map.getSource(`${eew.id}-p-wave`);
60-
if (sWaveSource && pWaveSource) {
63+
if (eew.status == 3 || (sWaveSource && pWaveSource)) {
6164
eew_list.push(eew);
6265
}
6366
}
@@ -66,7 +69,7 @@ function refresh_cross(show) {
6669
const sWaveSource = TREM.variable.map.getSource(`${eew.id}-s-wave`);
6770
const pWaveSource = TREM.variable.map.getSource(`${eew.id}-p-wave`);
6871

69-
if (sWaveSource && pWaveSource) {
72+
if (eew.status == 3 || (sWaveSource && pWaveSource)) {
7073
const existingIndex = eew_list.findIndex((item) => item.id === eew.id);
7174
let no = existingIndex;
7275
if (eew_list.length > 1) {
@@ -75,7 +78,7 @@ function refresh_cross(show) {
7578

7679
if (no < 5) {
7780
if (show || eew.status == 3) {
78-
const opacity = eew.status == 3 ? 0.5 : 1;
81+
const opacity = eew.status == 3 ? 0.6 : 1;
7982
markerFeatures.push({
8083
type: 'Feature',
8184
geometry: {

src/js/index/core/eew.js

+4
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ TREM.variable.events.on('EewUpdate', (ans) => {
110110
eew_cache[ans.data.id] = ans.data;
111111
show_eew(false);
112112
refresh_cross(false);
113+
114+
if (eew_cache[ans.data.id].status == 3) {
115+
removeEewLayersAndSources(ans.data.id);
116+
}
113117
});
114118
TREM.variable.events.on('EewEnd', (ans) => {
115119
removeEewLayersAndSources(ans.data.id);

0 commit comments

Comments
 (0)