Browse Source

Change bound from edit mode map

pull/2236/head
Vladyslav_Prykhodko 7 years ago
committed by Andrew Shvayka
parent
commit
8569b7dac2
  1. 11
      ui/src/app/widget/lib/map-widget2.js

11
ui/src/app/widget/lib/map-widget2.js

@ -781,7 +781,10 @@ export default class TbMapWidgetV2 {
return !(!ds[tbMap.locationSettings.latKeyName] && !ds[tbMap.locationSettings.lngKeyName]);
});
tbMap.initBounds = !dataValid;
tbMap.map.fitBounds(bounds, tbMap.isEdit && tbMap.markers.length === 1);
if(!tbMap.isEdit && tbMap.markers.length !== 1 || tbMap.polylines || tbMap.polygons) {
tbMap.map.fitBounds(bounds);
}
}
}
@ -845,7 +848,11 @@ export default class TbMapWidgetV2 {
})
}
}
map.fitBounds(bounds, map.isEdit && map.markers.length === 1);
if((!map.isEdit && map.markers && map.markers.length !== 1) ||
(this.polylines && this.polylines.length > 0) ||
(this.polygons && this.polygons.length > 0)) {
map.fitBounds(bounds);
}
}
}
}

Loading…
Cancel
Save