巡更路线图绘制

hmxc
张萌 4 years ago
parent 26dcc28925
commit 9084987b2b

@ -77,6 +77,7 @@ class _InspectionManageDetailsPageState
EasyRefreshController _refreshController; EasyRefreshController _refreshController;
bool _exit = false; bool _exit = false;
List<LatLng> _points = []; List<LatLng> _points = [];
List<Polyline> _polylines = [];
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -223,6 +224,7 @@ class _InspectionManageDetailsPageState
CupertinoDialogAction( CupertinoDialogAction(
child: '取消'.text.size(28.sp).black.light.isIntrinsic.bold.make(), child: '取消'.text.size(28.sp).black.light.isIntrinsic.bold.make(),
onPressed: () { onPressed: () {
_exit = false;
Get.back(); Get.back();
}, },
) )
@ -268,8 +270,11 @@ class _InspectionManageDetailsPageState
} }
_stopTimer() { _stopTimer() {
_canUploadLocation = false;
_timer?.cancel(); _timer?.cancel();
_timer = null; _timer = null;
_points.clear();
_polylines.clear();
} }
Widget _inspectionHeadCard() { Widget _inspectionHeadCard() {
@ -523,9 +528,31 @@ class _InspectionManageDetailsPageState
} else { } else {
_canUploadLocation = false; _canUploadLocation = false;
//TODO:线 //TODO:线
_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),
), ),
), ),
], ],
@ -537,6 +564,17 @@ class _InspectionManageDetailsPageState
.make(); .make();
} }
void _creatPolyline() {
final Polyline _polyline = Polyline(
points: _points,
color: Colors.red,
width: 5.w,
);
setState(() {
_polylines.add(_polyline);
});
}
Future _uploadLocation( Future _uploadLocation(
int executeId, double longitude, double latitude) async { int executeId, double longitude, double latitude) async {
BaseModel baseModel = await NetUtil().post(API.manage.uploadLocation, BaseModel baseModel = await NetUtil().post(API.manage.uploadLocation,

Loading…
Cancel
Save