Skip to content

Commit

Permalink
color changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adenjonah committed May 20, 2024
1 parent abc2030 commit 076baa7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server/json_databases/geojson/nav_path.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-95.08160677610833, 29.564802807347508], [-95.08150458035765, 29.564804390394595], [-95.08140354413766, 29.564807110489348], [-95.08133966110125, 29.564846265573188], [-95.08131348977675, 29.564888469011976]]}, "properties": {"name": "Rover Path"}}]}
{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-95.0815737733052, 29.564990707422616], [-95.08157175938487, 29.564884505749244], [-95.08154769442301, 29.564801568620513], [-95.08144097914406, 29.564805181063072], [-95.08134861439733, 29.564818385035885], [-95.08131356209536, 29.564887911378513]]}, "properties": {"name": "Rover Path"}}]}
2 changes: 1 addition & 1 deletion server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def find_point_by_id(file_path, point_id):

@app.post("/get_shortest_path")
async def get_shortest_path(point_request: PointIDRequest):
geojson_files = [BOUNDARY_LINES_FILE, DEFAULT_PINS_FILE, GEOLOGICAL_SITES_FILE, USER_PINS_FILE, ROVER_LOCATION_FILE]
geojson_files = [BOUNDARY_LINES_FILE, DEFAULT_PINS_FILE, GEOLOGICAL_SITES_FILE, USER_PINS_FILE, CURRENT_LOCATIONS_FILE]

start_feature = None
end_feature = None
Expand Down
13 changes: 10 additions & 3 deletions src/components/Map.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// MapboxComponent.js
import React, { useEffect, useState } from "react";
import mapboxgl from "mapbox-gl/dist/mapbox-gl.js";
import "mapbox-gl/dist/mapbox-gl.css";
Expand Down Expand Up @@ -46,7 +45,15 @@ const MapboxComponent = () => {
source: "geojson-source",
filter: ["==", "$type", "Point"],
paint: {
"circle-color": "#FF0000",
"circle-color": [
"case",
["==", ["get", "Name"], "Rover"], "#00FF00", // Green for rover
["==", ["get", "Name"], "Eva1"], "#0000FF", // Blue for ev1
["==", ["get", "Name"], "Eva2"], "#0000FF", // Blue for ev2
["==", ["get", "Name"], "UIA"], "#FFC0CB", // Blue for ev2
["==", ["get", "Name"], "Comm Tower"], "#FFC0CB", // Blue for ev2
"#FF0000" // Red for all other points
],
"circle-radius": 5,
},
});
Expand All @@ -57,7 +64,7 @@ const MapboxComponent = () => {
source: "geojson-source",
filter: ["==", "$type", "LineString"],
paint: {
"line-color": "#0000FF",
"line-color": "#FFFF00", // Yellow for lines
"line-width": 2,
},
});
Expand Down

0 comments on commit 076baa7

Please sign in to comment.