2018-07-12 11:50:47 +02:00
|
|
|
import L from 'leaflet';
|
2018-10-13 10:37:16 +02:00
|
|
|
import {
|
|
|
|
drawLayer,
|
|
|
|
noEditStyle,
|
|
|
|
CADASTRE_POLYGON_STYLE,
|
|
|
|
QP_POLYGON_STYLE
|
|
|
|
} from '../../shared/carto';
|
2018-07-12 11:50:47 +02:00
|
|
|
|
2018-10-13 10:37:16 +02:00
|
|
|
export function drawCadastre(map, data) {
|
|
|
|
drawLayer(
|
|
|
|
map,
|
|
|
|
data.cadastres,
|
|
|
|
noEditStyle(CADASTRE_POLYGON_STYLE),
|
|
|
|
'cadastres'
|
|
|
|
);
|
2018-07-12 11:50:47 +02:00
|
|
|
}
|
|
|
|
|
2018-10-13 10:37:16 +02:00
|
|
|
export function drawQuartiersPrioritaires(map, data) {
|
|
|
|
drawLayer(
|
|
|
|
map,
|
|
|
|
data.quartiersPrioritaires,
|
|
|
|
noEditStyle(QP_POLYGON_STYLE),
|
|
|
|
'quartiersPrioritaires'
|
|
|
|
);
|
2018-07-12 11:50:47 +02:00
|
|
|
}
|
|
|
|
|
2018-10-13 10:37:16 +02:00
|
|
|
export function drawUserSelection(map, data) {
|
|
|
|
if (data.selection.length > 0) {
|
|
|
|
const polygon = L.polygon(data.selection, {
|
2018-07-12 11:50:47 +02:00
|
|
|
color: 'red',
|
|
|
|
zIndex: 3
|
|
|
|
}).addTo(map);
|
|
|
|
map.fitBounds(polygon.getBounds());
|
|
|
|
}
|
|
|
|
}
|