Commit 8569b7dac248a0b27668ee01150c1ee68d3adc73
Committed by
Andrew Shvayka
1 parent
eafbc427
Change bound from edit mode map
Showing
1 changed file
with
9 additions
and
2 deletions
@@ -781,7 +781,10 @@ export default class TbMapWidgetV2 { | @@ -781,7 +781,10 @@ export default class TbMapWidgetV2 { | ||
781 | return !(!ds[tbMap.locationSettings.latKeyName] && !ds[tbMap.locationSettings.lngKeyName]); | 781 | return !(!ds[tbMap.locationSettings.latKeyName] && !ds[tbMap.locationSettings.lngKeyName]); |
782 | }); | 782 | }); |
783 | tbMap.initBounds = !dataValid; | 783 | tbMap.initBounds = !dataValid; |
784 | - tbMap.map.fitBounds(bounds, tbMap.isEdit && tbMap.markers.length === 1); | 784 | + |
785 | + if(!tbMap.isEdit && tbMap.markers.length !== 1 || tbMap.polylines || tbMap.polygons) { | ||
786 | + tbMap.map.fitBounds(bounds); | ||
787 | + } | ||
785 | } | 788 | } |
786 | } | 789 | } |
787 | 790 | ||
@@ -845,7 +848,11 @@ export default class TbMapWidgetV2 { | @@ -845,7 +848,11 @@ export default class TbMapWidgetV2 { | ||
845 | }) | 848 | }) |
846 | } | 849 | } |
847 | } | 850 | } |
848 | - map.fitBounds(bounds, map.isEdit && map.markers.length === 1); | 851 | + if((!map.isEdit && map.markers && map.markers.length !== 1) || |
852 | + (this.polylines && this.polylines.length > 0) || | ||
853 | + (this.polygons && this.polygons.length > 0)) { | ||
854 | + map.fitBounds(bounds); | ||
855 | + } | ||
849 | } | 856 | } |
850 | } | 857 | } |
851 | } | 858 | } |