Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fms-byte committed May 11, 2024
2 parents 98700a7 + 88faeec commit 3d77203
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 149 deletions.
150 changes: 33 additions & 117 deletions android-app/app/src/main/assets/video_loading_bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.Polyline;
import com.google.android.gms.maps.model.PolylineOptions;
import com.karumi.dexter.Dexter;
import com.karumi.dexter.MultiplePermissionsReport;
import com.karumi.dexter.PermissionToken;
Expand Down Expand Up @@ -216,13 +215,13 @@ public void onRoutingSuccess(ArrayList<com.directions.route.Route> route, int sh
// map.moveCamera(center);
// map.moveCamera(zoom);

Toast.makeText(this, "Route Success", Toast.LENGTH_SHORT).show();
if (polyLines.size() > 0) {
for (Polyline poly : polyLines) {
poly.remove();
}
}
polyLines = new ArrayList<>();
// Toast.makeText(this, "Route Success", Toast.LENGTH_SHORT).show();
// if (polyLines.size() > 0) {
// for (Polyline poly : polyLines) {
// poly.remove();
// }
// }
// polyLines = new ArrayList<>();
//add route(s) to the map.


Expand All @@ -235,23 +234,23 @@ public void onRoutingSuccess(ArrayList<com.directions.route.Route> route, int sh
map.addMarker(options);
}

try {
for (int i = 0; i < route.size(); i++) {
//In case of more than 5 alternative routes
PolylineOptions polyOptions = new PolylineOptions();
//polyOptions.color(getResources().getColor(R.color.addColor));
polyOptions.width(15 + i * 3);
polyOptions.addAll(route.get(i).getPoints());
Polyline polyline = map.addPolyline(polyOptions);
polyLines.add(polyline);
}
} catch (Exception f) {
Toast.makeText(
this,
f.getLocalizedMessage(),
Toast.LENGTH_SHORT
).show();
}
// try {
// for (int i = 0; i < route.size(); i++) {
// //In case of more than 5 alternative routes
// PolylineOptions polyOptions = new PolylineOptions();
// //polyOptions.color(getResources().getColor(R.color.addColor));
// polyOptions.width(15 + i * 3);
// polyOptions.addAll(route.get(i).getPoints());
// Polyline polyline = map.addPolyline(polyOptions);
// polyLines.add(polyline);
// }
// } catch (Exception f) {
// Toast.makeText(
// this,
// f.getLocalizedMessage(),
// Toast.LENGTH_SHORT
// ).show();
// }

for (int i = 0; i < trip.getVehicleEntries().size(); i++) {
VehicleEntry vehicleEntry = trip.getVehicleEntries().get(i);
Expand Down Expand Up @@ -458,12 +457,20 @@ public void onResponse(Call<STSResponse> call, Response<STSResponse> response) {

// Add Marker for each STS
for (NearbySts sts : response1.sts) {
LatLng lt = new LatLng(sts.getLat(), sts.getLon());
stsList.add(new LatLng(sts.getLat(), sts.getLon()));
MarkerOptions options = new MarkerOptions();
options.position(new LatLng(sts.getLat(), sts.getLon()) );
options.position(lt);
options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
map.addMarker(options);
}



for (LatLng lt : stsList) {
MarkerOptions options = new MarkerOptions();
options.position(lt);
options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
// add a text to the marker
options.title(sts.getName());
map.addMarker(options);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
}
});

button.setOnClickListener(view12 -> mBottomSheetDialog.show());
button.setOnClickListener(view12 -> startPickImage());
}

private void setupAdapter(String tag) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
app:layout_constraintTop_toTopOf="parent">

<Spinner
android:id="@+id/spinner_class_level"
android:id="@+id/spinner_type"
android:layout_width="match_parent"
android:layout_height="50dp"
android:backgroundTint="#FFFFFF"
Expand Down
1 change: 1 addition & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
git pull
cd express-server
docker build -t cs_backend .
docker stop cs_backend || true
Expand Down
2 changes: 1 addition & 1 deletion express-server/src/services/pdf.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,5 +440,5 @@ const getHtml = (
</html>`;
}

export { getHtml2};
export { getHtml, getHtml2};

2 changes: 1 addition & 1 deletion react-app/utils/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ const url = process.env.API;
export const getBaseUrl = () => {
// console.log(process.env.API);
//return process.env.API || 'http://3.208.28.247:5000';
return 'http://localhost:5000';
return 'http://3.208.28.247:5000';
}

0 comments on commit 3d77203

Please sign in to comment.