Skip to content

Commit

Permalink
Set index in feature for start_in_area to work (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvaut authored Jul 30, 2024
1 parent 61ac17e commit 6826f95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DB_PATH=./db
DOCKER_HOST=unix:///Users/cedric/.rd/docker.sock
WEB_DIR=./web/dist
#ROS_MASTER_URI=http://192.168.64.6:11311
ROS_MASTER_URI=http://10.0.0.134:11311
ROS_MASTER_URI=http://192.168.1.67:11311
MAP_TILE_SERVER=http://localhost:5000
#MAP_TILE_URI=/tiles/vt/lyrs=s,h&x={x}&y={y}&z={z}
HOMEKIT_ENABLED=false
Expand Down
7 changes: 4 additions & 3 deletions web/src/pages/MapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export const MapPage = () => {
const centroidPt = centroid(feature);
if (centroidPt.properties != null) {
centroidPt.properties.title = feature.properties?.title;
centroidPt.properties.index = feature.properties?.index;
}
centroidPt.id = feature.id
return [centroidPt];
Expand Down Expand Up @@ -363,7 +364,7 @@ export const MapPage = () => {
"color": type == "navigation" ? "white" : "#01d30d",
title: type == "area" ? type + " " + index : undefined,
index,
},
},
geometry: {
coordinates: [area.Area?.Points?.map((point) => {
return transpose(offsetX, offsetY, datum, point.Y!!, point.X!!)
Expand All @@ -377,7 +378,7 @@ export const MapPage = () => {
type: 'Feature',
properties: {
"color": "#bf0000",
},
},
geometry: {
coordinates: [obstacle.Points?.map((point) => {
return transpose(offsetX, offsetY, datum, point.Y!!, point.X!!)
Expand Down Expand Up @@ -928,7 +929,7 @@ export const MapPage = () => {
<AsyncDropDownButton size={"small"} menu={{
items: mowingAreas,
onAsyncClick: (e) => {
const item = mowingAreas.find(item => item.key == e.key)
const item = mowingAreas.find(item => item.key == e.key)
return mowerAction("start_in_area", {
area: item!!.feat.properties?.index,
})()
Expand Down

0 comments on commit 6826f95

Please sign in to comment.