diff --git a/rit-driver-app/app/src/main/java/com/rit/driver/Config.java b/rit-driver-app/app/src/main/java/com/rit/driver/Config.java
index 1331d18..6bc95e9 100644
--- a/rit-driver-app/app/src/main/java/com/rit/driver/Config.java
+++ b/rit-driver-app/app/src/main/java/com/rit/driver/Config.java
@@ -1,8 +1,8 @@
package com.rit.driver;
public class Config {
- // Replace this with your VPS public IP address or production domain name
- public static final String BACKEND_URL = "http://15.206.182.201:8085";
+ // Local testing backend URL (Your PC Wi-Fi IP)
+ public static final String BACKEND_URL = "http://10.10.15.91:8085";
// Default driver security PIN
public static final String DEFAULT_PIN = "RITDRIVER";
diff --git a/rit-driver-app/app/src/main/java/com/rit/driver/TrackingService.java b/rit-driver-app/app/src/main/java/com/rit/driver/TrackingService.java
index e5d2391..fdd4515 100644
--- a/rit-driver-app/app/src/main/java/com/rit/driver/TrackingService.java
+++ b/rit-driver-app/app/src/main/java/com/rit/driver/TrackingService.java
@@ -133,18 +133,37 @@ public class TrackingService extends Service {
Log.d(TAG, "WakeLock acquired successfully");
}
- // 3. Register GPS location listener
+ // 3. Register Location Listeners (both GPS and Network for indoors/outdoors)
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
try {
if (locationManager != null) {
- // Request updates every 5 seconds (5000ms) or 2 meters
- locationManager.requestLocationUpdates(
- LocationManager.GPS_PROVIDER,
- 5000,
- 2.0f,
- locationListener
- );
- Log.d(TAG, "GPS Listener registered successfully");
+ // Request GPS updates
+ if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
+ locationManager.requestLocationUpdates(
+ LocationManager.GPS_PROVIDER,
+ 5000,
+ 0.0f,
+ locationListener
+ );
+ }
+ // Request Network/Wi-Fi location updates (essential indoors)
+ if (locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {
+ locationManager.requestLocationUpdates(
+ LocationManager.NETWORK_PROVIDER,
+ 5000,
+ 0.0f,
+ locationListener
+ );
+ }
+
+ // Immediately trigger initial fix if available
+ Location lastGps = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
+ Location lastNet = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
+ Location bestLocation = (lastGps != null) ? lastGps : lastNet;
+ if (bestLocation != null) {
+ locationListener.onLocationChanged(bestLocation);
+ }
+ Log.d(TAG, "Location Listeners registered successfully");
}
} catch (SecurityException e) {
Log.e(TAG, "SecurityException: Location permissions not granted", e);
diff --git a/src/components/BusRouteMap/BusRouteMap.tsx b/src/components/BusRouteMap/BusRouteMap.tsx
index 1ce4ff0..1ba994f 100644
--- a/src/components/BusRouteMap/BusRouteMap.tsx
+++ b/src/components/BusRouteMap/BusRouteMap.tsx
@@ -1,5 +1,5 @@
import { useEffect, useMemo, useState } from 'react';
-import { MapContainer, TileLayer, Marker, Popup, Polyline, useMap } from 'react-leaflet';
+import { MapContainer, TileLayer, Marker, Popup, useMap } from 'react-leaflet';
import L from 'leaflet';
import 'leaflet/dist/leaflet.css';
import type { BusRoute } from '@/types';
@@ -289,14 +289,6 @@ export default function BusRouteMap({ selectedRoute, allRoutes }: BusRouteMapPro
);
})}
- {selectedRoute && pathCoordinates.length > 1 && (
-
- )}