39 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import GIS from './gis.js';
 | |
| import UI from './ui.js';
 | |
| import { Application } from '@hotwired/stimulus';
 | |
| import MenuController from './controllers/menu_controller.js';
 | |
| import ModalController from './controllers/modal_controller.js';
 | |
| import MarkerController from './controllers/marker_controller.js';
 | |
| import BiblioController from './controllers/biblio_controller.js';
 | |
| import TabsController from './controllers/tabs_controller.js';
 | |
| import LayerController from './controllers/layer_controller.js';
 | |
| 
 | |
| document.addEventListener('DOMContentLoaded', async () => {
 | |
|     // Register Stimulus controllers
 | |
|     initStimulus();
 | |
| 
 | |
|     let progress = document.querySelector('progress');
 | |
|     const map = await GIS.initMap('map');
 | |
|     progress.classList.add('is-hidden');
 | |
| 
 | |
|     map._container.setAttribute('aria-busy', false);
 | |
| 
 | |
|     // Trigger Stimulus buildMenu method...
 | |
|     const menuEvent = new Event('menu-ready');
 | |
|     document.dispatchEvent(menuEvent);
 | |
|     
 | |
|     GIS.toggleSpherical(map);
 | |
| 
 | |
|     UI.addCenterMapControl(map, GIS.CENTER_COORDS, GIS.INIT_ZOOM);
 | |
|     UI.toggleBurger('navbar-burger');
 | |
| });
 | |
| 
 | |
| function initStimulus() {
 | |
|     window.Stimulus = Application.start();
 | |
|     Stimulus.register("menu", MenuController);
 | |
|     Stimulus.register("modal", ModalController);
 | |
|     Stimulus.register("marker", MarkerController);
 | |
|     Stimulus.register("biblio", BiblioController);
 | |
|     Stimulus.register("tabs", TabsController);
 | |
|     Stimulus.register("layer", LayerController);
 | |
| } |