change modes
This commit is contained in:
@ -1,23 +1,24 @@
|
||||
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
|
||||
|
||||
class MatrixService{
|
||||
|
||||
static Future<Map<String, dynamic>> getDestinations(List<dynamic> destinations) async {
|
||||
static Future<Map<String, dynamic>> getDestinations(List<Destination> destinations) async {
|
||||
|
||||
String locs = "";
|
||||
String origin = "";
|
||||
int i = 0;
|
||||
for(Map<String, dynamic> loc in destinations){
|
||||
for(Destination d in destinations){
|
||||
|
||||
if(i==0){
|
||||
origin = "${loc["location"]["geometry"]["coordinates"][0][1]}, ${loc["location"]["geometry"]["coordinates"][0][0]}";
|
||||
origin = "${d.lat}, ${d.lon}";
|
||||
}
|
||||
|
||||
print("lat is ${loc["location"]["geometry"]["coordinates"][0][1]}, long is ${loc["location"]["geometry"]["coordinates"][0][0]}");
|
||||
locs += "${loc["location"]["geometry"]["coordinates"][0][1]}, ${loc["location"]["geometry"]["coordinates"][0][0]}|";
|
||||
print("lat is ${d.lat}, long is ${d.lon}");
|
||||
locs += "${d.lat}, ${d.lon}|";
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user