Enable tracks toggle when debug flag present

This commit is contained in:
Eugene Burmakin 2025-08-29 12:21:26 +02:00
parent cf987894fe
commit 289ce5dabb

View file

@ -214,7 +214,9 @@ export default class extends BaseController {
this.setupTracksSubscription();
// Handle routes/tracks mode selection
// this.addRoutesTracksSelector(); # Temporarily disabled
if (this.shouldShowTracksSelector()) {
this.addRoutesTracksSelector();
}
this.switchRouteMode('routes', true);
// Initialize layers based on settings
@ -1104,6 +1106,11 @@ export default class extends BaseController {
this.map.addControl(new TogglePanelControl({ position: 'topright' }));
}
shouldShowTracksSelector() {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get('tracks_debug') === 'true';
}
addRoutesTracksSelector() {
// Store reference to the controller instance for use in the control
const controller = this;