25 lines
548 B
JavaScript
25 lines
548 B
JavaScript
import { getData } from '../shared/data';
|
|
import {
|
|
initMap,
|
|
drawCadastre,
|
|
drawQuartiersPrioritaires,
|
|
drawUserSelection
|
|
} from '../shared/carto';
|
|
|
|
function initialize() {
|
|
const element = document.getElementById('map');
|
|
|
|
if (element) {
|
|
const data = getData('carto');
|
|
const map = initMap(element, data.position);
|
|
|
|
// draw external polygons
|
|
drawCadastre(map, data);
|
|
drawQuartiersPrioritaires(map, data);
|
|
|
|
// draw user polygon
|
|
drawUserSelection(map, data);
|
|
}
|
|
}
|
|
|
|
addEventListener('turbolinks:load', initialize);
|