Merge pull request #685 from sgmap/fix_map_bug

Fix carte bug if user has not drawn on map
This commit is contained in:
gregoirenovel 2017-08-31 13:20:19 +02:00 committed by Mathieu Magnin
commit ff3120bf6c

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() {