fix(web): fix tactical map style.json and implement keep-alive views for instant tab switching

This commit is contained in:
Hamza-Ayed
2026-08-18 09:49:58 +03:00
parent 9247499f50
commit 2691eb68eb
2 changed files with 46 additions and 14 deletions
+6 -1
View File
@@ -90,7 +90,7 @@ export const TacticalDefenseView: React.FC = () => {
const initialMap = new maplibregl.Map({
container: mapContainer.current,
style: '/style-dark.json',
style: '/style.json',
center: [35.9106, 31.9539],
zoom: 11,
pitch: 35,
@@ -99,6 +99,11 @@ export const TacticalDefenseView: React.FC = () => {
map.current = initialMap;
const handleResize = () => {
if (initialMap) initialMap.resize();
};
window.addEventListener('resize', handleResize);
initialMap.on('mousemove', (e) => {
setCursorPos({
lat: Number(e.lngLat.lat.toFixed(5)),