|
|
@ -32,11 +32,17 @@ class OrderTrackingPageState extends State<OrderTrackingPage> {
|
|
|
|
Set<Marker> markers = {};
|
|
|
|
Set<Marker> markers = {};
|
|
|
|
Map<PolylineId, Polyline> polylines = {};
|
|
|
|
Map<PolylineId, Polyline> polylines = {};
|
|
|
|
|
|
|
|
|
|
|
|
LatLng startLocation = const LatLng(0,0);
|
|
|
|
LatLng startLocation = const LatLng(17.416806,78.4521704);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LocationController locationController = Get.put(LocationController());
|
|
|
|
LocationController locationController = Get.put(LocationController());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
@ -103,15 +109,15 @@ class OrderTrackingPageState extends State<OrderTrackingPage> {
|
|
|
|
PolylineId id = const PolylineId("poly");
|
|
|
|
PolylineId id = const PolylineId("poly");
|
|
|
|
Polyline polyline = Polyline(
|
|
|
|
Polyline polyline = Polyline(
|
|
|
|
polylineId: id,
|
|
|
|
polylineId: id,
|
|
|
|
color: Colors.blueAccent,
|
|
|
|
color: Colors.red,
|
|
|
|
points: polylineCoordinates,
|
|
|
|
points: polylineCoordinates,
|
|
|
|
width: 8,
|
|
|
|
width: 4,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
polylines[id] = polyline;
|
|
|
|
polylines[id] = polyline;
|
|
|
|
|
|
|
|
|
|
|
|
var position = CameraPosition(
|
|
|
|
var position = CameraPosition(
|
|
|
|
target: LatLng(startLocation.latitude, startLocation.longitude),
|
|
|
|
target: LatLng(startLocation.latitude, startLocation.longitude),
|
|
|
|
zoom: 21);
|
|
|
|
zoom: 18);
|
|
|
|
|
|
|
|
|
|
|
|
final GoogleMapController controller = await mapController.future;
|
|
|
|
final GoogleMapController controller = await mapController.future;
|
|
|
|
controller.animateCamera(CameraUpdate.newCameraPosition(position));
|
|
|
|
controller.animateCamera(CameraUpdate.newCameraPosition(position));
|
|
|
@ -129,7 +135,7 @@ class OrderTrackingPageState extends State<OrderTrackingPage> {
|
|
|
|
initialCameraPosition: CameraPosition(
|
|
|
|
initialCameraPosition: CameraPosition(
|
|
|
|
//innital position in map
|
|
|
|
//innital position in map
|
|
|
|
target: startLocation, //initial position
|
|
|
|
target: startLocation, //initial position
|
|
|
|
zoom: 5.0, //initial zoom level
|
|
|
|
zoom: 8.0, //initial zoom level
|
|
|
|
),
|
|
|
|
),
|
|
|
|
markers: markers,
|
|
|
|
markers: markers,
|
|
|
|
//markers to show on map
|
|
|
|
//markers to show on map
|
|
|
|