Я использую пакет google_maps_flutter, и мне нужно ограничить область прокрутки карты определенной областью. У меня есть углы SW и NE, но я не могу понять, как это сделать.
Я пробовал код ниже, но он не работает.
uniCampusSW и uniCampusNE обаLatLngs.
_userLocation == null // If user location has not been found
? Center(
// Display Progress Indicator
child: CircularProgressIndicator(
backgroundColor: UniColors.primaryColour[500],
),
)
: GoogleMap(
// Show Campus Map
onMapCreated: _onMapCreated,
initialCameraPosition: // required parameter that sets the starting camera position. Camera position describes which part of the world you want the map to point at.
CameraPosition(
target: _userLocation, zoom: defaultZoom, tilt: 0.0),
scrollGesturesEnabled: true,
tiltGesturesEnabled: true,
trafficEnabled: false,
compassEnabled: true,
rotateGesturesEnabled: true,
myLocationEnabled: true,
mapType: _currentMapType,
zoomGesturesEnabled: true,
cameraTargetBounds: new CameraTargetBounds(
new LatLngBounds(
northeast: UniCampusNE,
southwest: UniCampusSW,
),
),
),
Это ошибка, которую я получаю
/ flutter (12525): было выброшено следующее утверждение при построении TheMap (грязный, состояние: _TheMapState # a8840)): I / flutter (12525): 'package: google_maps_flutter / src / location.dart': Неудачное утверждение: строка 68 поз. 16: I / flutter (12525): 'southwest.latitude <= northeast.latitude': не соответствует действительности. </strong>
спасибо