diff --git a/lib/union/location_map_page.dart b/lib/union/location_map_page.dart index e145f69a..4ec95009 100644 --- a/lib/union/location_map_page.dart +++ b/lib/union/location_map_page.dart @@ -455,7 +455,7 @@ class _LocationMap extends State with WidgetsBindingObserver { } updateMapLine(List coordinates, int needHours, int needMinutes, - double needDistance) async { + double needDistance) { try { //刪除之前的創建的點和綫 _mapController.cleanAllMarkers(); @@ -502,12 +502,12 @@ class _LocationMap extends State with WidgetsBindingObserver { draggable: false, ); _mapController.addMarker(terminalBmfMarker); - await _mapController.setVisibleMapBounds( - BMFCoordinateBounds( + _mapController.setVisibleMapRectWithPadding( + visibleMapBounds: BMFCoordinateBounds( northeast: startLocation, southwest: endLocation), - true,); - _mapController.setZoomBy(-1); - _mapController.setScrollBy(0,-200); + animated: true, + insets: + EdgeInsets.only(top: 500.h, bottom: 200.h, left: 200.w, right: 200.w)); hours = needHours == 0 ? "" : "$needHours小时"; minutes = needMinutes == 0 ? "" : "$needMinutes分钟";