Fix tracks layer

This commit is contained in:
Eugene Burmakin 2025-07-08 21:14:46 +02:00
parent f4687a101c
commit b7e5296235

View file

@ -232,7 +232,7 @@ export default class extends BaseController {
this.initializeDrawControl();
// Preload areas
fetchAndDrawAreas(this.areasLayer, this.map, this.apiKey);
fetchAndDrawAreas(this.areasLayer, this.apiKey);
// Add right panel toggle
this.addTogglePanelButton();
@ -1296,6 +1296,29 @@ export default class extends BaseController {
}
}
initializeLayersFromSettings() {
// Initialize layer visibility based on user settings or defaults
// This method sets up the initial state of overlay layers
// Note: Don't automatically add layers to map here - let the layer control and user preferences handle it
// The layer control will manage which layers are visible based on user interaction
// Initialize photos layer if user wants it visible
if (this.userSettings.photos_enabled) {
fetchAndDisplayPhotos(this.photoMarkers, this.apiKey, this.userSettings);
}
// Initialize fog of war if enabled in settings
if (this.userSettings.fog_of_war_enabled) {
this.updateFog(this.markers, this.clearFogRadius, this.fogLinethreshold);
}
// Initialize visits manager functionality
if (this.visitsManager && typeof this.visitsManager.fetchAndDisplayVisits === 'function') {
this.visitsManager.fetchAndDisplayVisits();
}
}
toggleRightPanel() {
if (this.rightPanel) {
const panel = document.querySelector('.leaflet-right-panel');