|
|
|
@ -501,59 +501,59 @@ class _InspectionManageDetailsPageState
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: 343.w,
|
|
|
|
|
child: AMapWidget(
|
|
|
|
|
rotateGesturesEnabled: false,
|
|
|
|
|
scaleEnabled: false,
|
|
|
|
|
scrollGesturesEnabled: false,
|
|
|
|
|
tiltGesturesEnabled: false,
|
|
|
|
|
zoomGesturesEnabled: false,
|
|
|
|
|
onMapCreated: (controller) {
|
|
|
|
|
_aMapController = controller;
|
|
|
|
|
LatLng _target = LatLng(
|
|
|
|
|
appProvider.location!['latitude'] as double,
|
|
|
|
|
appProvider.location!['longitude'] as double);
|
|
|
|
|
_aMapController!.moveCamera(CameraUpdate.newCameraPosition(
|
|
|
|
|
CameraPosition(target: _target, zoom: 19)));
|
|
|
|
|
},
|
|
|
|
|
myLocationStyleOptions: MyLocationStyleOptions(true,
|
|
|
|
|
circleFillColor: Colors.yellow.withOpacity(0.1),
|
|
|
|
|
circleStrokeColor: Colors.transparent,
|
|
|
|
|
icon: BitmapDescriptor.defaultMarkerWithHue(210)),
|
|
|
|
|
onLocationChanged: (argument) async {
|
|
|
|
|
_aMapController!.moveCamera(CameraUpdate.newCameraPosition(
|
|
|
|
|
CameraPosition(target: argument.latLng, zoom: 19)));
|
|
|
|
|
if (_canUploadLocation) {
|
|
|
|
|
BaseModel baseModel = await (_uploadLocation(widget.executeId,
|
|
|
|
|
argument.latLng.longitude, argument.latLng.latitude));
|
|
|
|
|
if (!baseModel.success) {
|
|
|
|
|
BotToast.showText(text: baseModel.msg);
|
|
|
|
|
} else {
|
|
|
|
|
_canUploadLocation = false;
|
|
|
|
|
//绘制折线
|
|
|
|
|
_points.add(argument.latLng);
|
|
|
|
|
if (_points.length % 5 == 0) {
|
|
|
|
|
if (_polylines.isEmpty) {
|
|
|
|
|
_polylines.add(Polyline(
|
|
|
|
|
points: _points,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
width: 10.w,
|
|
|
|
|
));
|
|
|
|
|
setState(() {});
|
|
|
|
|
} else {
|
|
|
|
|
_polylines[0] = (Polyline(
|
|
|
|
|
points: _points,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
width: 10.w,
|
|
|
|
|
));
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//绘制路线
|
|
|
|
|
polylines: Set<Polyline>.of(_polylines),
|
|
|
|
|
),
|
|
|
|
|
// child: AMapWidget(
|
|
|
|
|
// rotateGesturesEnabled: false,
|
|
|
|
|
// scaleEnabled: false,
|
|
|
|
|
// scrollGesturesEnabled: false,
|
|
|
|
|
// tiltGesturesEnabled: false,
|
|
|
|
|
// zoomGesturesEnabled: false,
|
|
|
|
|
// onMapCreated: (controller) {
|
|
|
|
|
// _aMapController = controller;
|
|
|
|
|
// LatLng _target = LatLng(
|
|
|
|
|
// appProvider.location!['latitude'] as double,
|
|
|
|
|
// appProvider.location!['longitude'] as double);
|
|
|
|
|
// _aMapController!.moveCamera(CameraUpdate.newCameraPosition(
|
|
|
|
|
// CameraPosition(target: _target, zoom: 19)));
|
|
|
|
|
// },
|
|
|
|
|
// myLocationStyleOptions: MyLocationStyleOptions(true,
|
|
|
|
|
// circleFillColor: Colors.yellow.withOpacity(0.1),
|
|
|
|
|
// circleStrokeColor: Colors.transparent,
|
|
|
|
|
// icon: BitmapDescriptor.defaultMarkerWithHue(210)),
|
|
|
|
|
// onLocationChanged: (argument) async {
|
|
|
|
|
// _aMapController!.moveCamera(CameraUpdate.newCameraPosition(
|
|
|
|
|
// CameraPosition(target: argument.latLng, zoom: 19)));
|
|
|
|
|
// if (_canUploadLocation) {
|
|
|
|
|
// BaseModel baseModel = await (_uploadLocation(widget.executeId,
|
|
|
|
|
// argument.latLng.longitude, argument.latLng.latitude));
|
|
|
|
|
// if (!baseModel.success) {
|
|
|
|
|
// BotToast.showText(text: baseModel.msg);
|
|
|
|
|
// } else {
|
|
|
|
|
// _canUploadLocation = false;
|
|
|
|
|
// //绘制折线
|
|
|
|
|
// _points.add(argument.latLng);
|
|
|
|
|
// if (_points.length % 5 == 0) {
|
|
|
|
|
// if (_polylines.isEmpty) {
|
|
|
|
|
// _polylines.add(Polyline(
|
|
|
|
|
// points: _points,
|
|
|
|
|
// color: Colors.red,
|
|
|
|
|
// width: 10.w,
|
|
|
|
|
// ));
|
|
|
|
|
// setState(() {});
|
|
|
|
|
// } else {
|
|
|
|
|
// _polylines[0] = (Polyline(
|
|
|
|
|
// points: _points,
|
|
|
|
|
// color: Colors.red,
|
|
|
|
|
// width: 10.w,
|
|
|
|
|
// ));
|
|
|
|
|
// setState(() {});
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// //绘制路线
|
|
|
|
|
// polylines: Set<Polyline>.of(_polylines),
|
|
|
|
|
// ),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|