update waypoint marker positions

This commit is contained in:
2024-01-18 15:21:26 +05:30
parent 8e050267e1
commit 591b6f7aed
3 changed files with 22 additions and 11 deletions

View File

@ -115,9 +115,10 @@ class _GpsPageState extends State<GpsPage> {
]), ]),
zoom: 1, zoom: 1,
interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag, interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag,
onPositionChanged: (MapPosition pos, bool hasGesture) {
onPositionChanged: (MapPosition pos, isvalue) { if (hasGesture) {
indexController.currentBound = [pos.bounds!]; indexController.currentBound = [pos.bounds!];
}
}, },
onTap: (tapPos, cord) {}, // Hide popup when the map is tapped. onTap: (tapPos, cord) {}, // Hide popup when the map is tapped.
), ),
@ -126,13 +127,23 @@ class _GpsPageState extends State<GpsPage> {
MarkerLayer( MarkerLayer(
markers: gpsData.map((i) { markers: gpsData.map((i) {
return Marker( return Marker(
alignment: Alignment.center, width: 30.0, // Fixed width
height: 32.0, height: 30.0, // Fixed height
width: 120.0,
point: LatLng(i.lat, i.lon), point: LatLng(i.lat, i.lon),
child: getMarkerShape(i)); child: getMarkerShape(i),
alignment: Alignment.center);
}).toList(), }).toList(),
) ),
// MarkerLayer(
// markers: gpsData.map((i) {
// return Marker(
// alignment: Alignment.center,
// height: 32.0,
// width: 120.0,
// point: LatLng(i.lat, i.lon),
// child: getMarkerShape(i));
// }).toList(),
// )
], ],
), ),
)), )),

View File

@ -15,7 +15,7 @@ class MatrixService {
String destination = ""; String destination = "";
int i = 0; int i = 0;
for (Destination d in destinations) { for (Destination d in destinations) {
//print("---- getting matrix for $d ------------"); print("---- getting matrix for $d ------------");
if (i == 0) { if (i == 0) {
origin = "${d.lat}, ${d.lon}"; origin = "${d.lat}, ${d.lon}";
@ -52,7 +52,7 @@ class MatrixService {
Map<String, dynamic> cats = {}; Map<String, dynamic> cats = {};
String url = String url =
"https://maps.googleapis.com/maps/api/directions/json?destination=$destination&mode=$mode&waypoints=$locs&origin=$origin&key=AIzaSyAUBI1ablMKuJwGj2-kSuEhvYxvB1A-mOE"; "https://maps.googleapis.com/maps/api/directions/json?destination=$destination&mode=$mode&waypoints=$locs&origin=$origin&key=AIzaSyAUBI1ablMKuJwGj2-kSuEhvYxvB1A-mOE";
//print('++++++++$url'); print('++++++++$url');
final http.Response response = final http.Response response =
await http.get(Uri.parse(url), headers: <String, String>{ await http.get(Uri.parse(url), headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8', 'Content-Type': 'application/json; charset=UTF-8',

View File

@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.29+29 version: 1.0.30+30
environment: environment:
sdk: ">=3.1.0 <4.0.0" sdk: ">=3.1.0 <4.0.0"