Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
sirmmo committed Dec 5, 2024
1 parent 7da22eb commit 6dad1eb
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/app/components/Map/TWLSample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,30 @@ export const TWLSample = (props: any) => {
let dt = new Date(+data.time).getFullYear();
setCurrentYear(dt);

let layers = document.getElementsByClassName('leaflet-layer');
let tx = false;
//@ts-ignore
for (const t of layers) {
if (t.style.display === 'none') {
tx = true;
}
}

if (tx) {
let first = true;
setTimeout(() => {
let layers = document.getElementsByClassName('leaflet-layer');
let tx = false;
//@ts-ignore
for (const t of layers) {
if (t.style['z-index'] === '500') {
if (t.innerHTML.indexOf('time=' + (dt - 1).toString())) {
t.style.display = 'block';
} else {
t.style.display = 'none';
if (t.style.display === 'none') {
tx = true;
}
}

if (tx) {
let first = true;
//@ts-ignore
for (const t of layers) {
if (t.style['z-index'] === '500') {
if (t.innerHTML.indexOf('time=' + (dt - 1).toString()) >= 0) {
t.style.display = 'block';
} else {
t.style.display = 'none';
}
}
}
}
}
}, 250);
});
// @ts-ignore
//if (!map.setupFrontLayer) map.setupFrontLayer = setupFrontLayer;
Expand Down

0 comments on commit 6dad1eb

Please sign in to comment.