demarches-normaliennes/app/javascript/new_design/carto.js
2018-10-23 09:35:25 +02:00

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);