fix(web): fix tactical map style.json and implement keep-alive views for instant tab switching
This commit is contained in:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user