Refactor carto to share more code

This commit is contained in:
Paul Chavard 2018-10-16 11:49:00 +03:00
parent 902184fab2
commit febef735b8
8 changed files with 192 additions and 184 deletions

View file

@ -1,16 +1,17 @@
import { getData } from '../shared/data';
import { initMap } from '../shared/carto';
import {
initMap,
drawCadastre,
drawQuartiersPrioritaires,
drawUserSelection
} from './carto/draw';
} from '../shared/carto';
function initialize() {
if (document.getElementById('map')) {
const position = getData('carto').position;
const map = initMap(position);
const element = document.getElementById('map');
if (element) {
const data = getData('carto');
const map = initMap(element, data.position);
// draw external polygons
drawCadastre(map, data);