add backend server setup with environment configuration, tile caching, and bus stop fetching functionality
This commit is contained in:
@@ -2,10 +2,11 @@ import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:rra_app/pages/map/constants.dart';
|
||||
|
||||
class OsrmRoutingService {
|
||||
const OsrmRoutingService({
|
||||
this.baseUrl = 'https://router.project-osrm.org',
|
||||
this.baseUrl = kBackendBaseUrl,
|
||||
this.profile = 'driving',
|
||||
});
|
||||
|
||||
@@ -21,8 +22,7 @@ class OsrmRoutingService {
|
||||
.map((point) => '${point.longitude},${point.latitude}')
|
||||
.join(';');
|
||||
final uri = Uri.parse(
|
||||
'$baseUrl/route/v1/$profile/$coordinates'
|
||||
'?overview=full&geometries=geojson',
|
||||
'$baseUrl/route?waypoints=$coordinates&profile=$profile',
|
||||
);
|
||||
|
||||
final response = await http.get(uri);
|
||||
|
||||
Reference in New Issue
Block a user