Refactor typeZIndex

pull/1654/head
Piero Toffanin 2025-04-16 01:00:11 -04:00
rodzic 57b8f4b476
commit 1ba5e84d23
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -137,8 +137,8 @@ class Map extends React.Component {
return ""; return "";
} }
typeZIndex = (type, offset = 0) => { typeZIndex = (type, zIndexGroup = 1) => {
return ["dsm", "dtm", "orthophoto", "plant"].indexOf(type) + 1 + offset; return ["dsm", "dtm", "orthophoto", "plant"].indexOf(type) + 1 + zIndexGroup * 10;
} }
hasBands = (bands, orthophoto_bands) => { hasBands = (bands, orthophoto_bands) => {
@ -299,7 +299,7 @@ class Map extends React.Component {
tms: scheme === 'tms', tms: scheme === 'tms',
opacity: this.state.opacity / 100, opacity: this.state.opacity / 100,
detectRetina: true, detectRetina: true,
zIndex: this.typeZIndex(type, zIndexGroup * 10), zIndex: this.typeZIndex(type, zIndexGroup),
}); });
// Associate metadata with this layer // Associate metadata with this layer