Fix carte bug if user has not draw on map

This commit is contained in:
Mathieu Magnin 2017-08-30 15:31:51 +02:00
parent 24a33a3714
commit 3e4ba4715d

View file

@ -22,8 +22,10 @@ function initCarto() {
$(document).on('turbolinks:load', initCarto);
function drawUserSelection(map) {
var polygon = L.polygon(dossierJsonLatLngs, { color: 'red', zIndex: 3 }).addTo(map);
map.fitBounds(polygon.getBounds());
if (dossierJsonLatLngs.length > 0) {
var polygon = L.polygon(dossierJsonLatLngs, { color: 'red', zIndex: 3 }).addTo(map);
map.fitBounds(polygon.getBounds());
}
}
function defaultGestionnairePosition() {