demarches-normaliennes/app/javascript/new_design/carto.js

26 lines
548 B
JavaScript
Raw Normal View History

import { getData } from '../shared/data';
import {
2018-10-16 10:49:00 +02:00
initMap,
drawCadastre,
drawQuartiersPrioritaires,
drawUserSelection
2018-10-17 11:58:35 +02:00
} from '../shared/carte';
function initialize() {
2018-10-16 10:49:00 +02:00
const element = document.getElementById('map');
if (element) {
2018-10-13 10:36:14 +02:00
const data = getData('carto');
2018-10-16 10:49:00 +02:00
const map = initMap(element, data.position);
2018-10-13 10:36:14 +02:00
// draw external polygons
drawCadastre(map, data);
drawQuartiersPrioritaires(map, data);
// draw user polygon
drawUserSelection(map, data);
}
}
addEventListener('turbolinks:load', initialize);