map updated to 6

This commit is contained in:
2023-12-06 11:16:17 +05:30
parent 8d1c84d9fb
commit fa0587178f
19 changed files with 631 additions and 596 deletions

View File

@ -1,33 +1,33 @@
import 'package:geojson/geojson.dart';
import 'package:http/http.dart' as http;
// import 'package:geojson/geojson.dart';
// import 'package:http/http.dart' as http;
import '../utils/const.dart';
// import '../utils/const.dart';
class LocationPolygonervice {
static Future<GeoJsonFeature?> loadLocationLines() async {
final geo = GeoJson();
GeoJsonFeature? fs;
// class LocationPolygonervice {
// static Future<GeoJsonFeature?> loadLocationLines() async {
// final geo = GeoJson();
// GeoJsonFeature? fs;
String serverUrl = ConstValues.currentServer();
String url = '$serverUrl/api/location_polygon/';
//print('++++++++$url');
final response = await http.get(
Uri.parse(url),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
);
// String serverUrl = ConstValues.currentServer();
// String url = '$serverUrl/api/location_polygon/';
// //print('++++++++$url');
// final response = await http.get(
// Uri.parse(url),
// headers: <String, String>{
// 'Content-Type': 'application/json; charset=UTF-8',
// },
// );
if (response.statusCode == 200) {
geo.processedFeatures.listen((fst) {
fs = fst;
});
// if (response.statusCode == 200) {
// geo.processedFeatures.listen((fst) {
// fs = fst;
// });
await geo.parse(response.body, verbose: true);
// await geo.parse(response.body, verbose: true);
return fs;
} else {
throw Exception('Failed to create album.');
}
}
}
// return fs;
// } else {
// throw Exception('Failed to create album.');
// }
// }
// }