|
@@ -61,11 +61,11 @@ const MapNavigator: React.FC = ({ }) => {
|
|
/**
|
|
/**
|
|
* Clear selected landmark when landmark details panel is closed
|
|
* Clear selected landmark when landmark details panel is closed
|
|
*/
|
|
*/
|
|
- useEffect(() => {
|
|
|
|
- if (!mapState.lmDetailsVisible) {
|
|
|
|
- mapState.setSelectedLandmarkId('')
|
|
|
|
- }
|
|
|
|
- }, [mapState.lmDetailsVisible])
|
|
|
|
|
|
+ // useEffect(() => {
|
|
|
|
+ // if (!mapState.lmDetailsVisible) {
|
|
|
|
+ // mapState.setSelectedLandmarkId('')
|
|
|
|
+ // }
|
|
|
|
+ // }, [mapState.lmDetailsVisible])
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
const refetchLandmarksOnFilterOptionsChange = async () => {
|
|
const refetchLandmarksOnFilterOptionsChange = async () => {
|
|
@@ -132,19 +132,15 @@ const MapNavigator: React.FC = ({ }) => {
|
|
*/
|
|
*/
|
|
const promptAddLandmark = async (longitude?: number, latitude?: number, floor?: number, lmCount?: string, parent?: string) => {
|
|
const promptAddLandmark = async (longitude?: number, latitude?: number, floor?: number, lmCount?: string, parent?: string) => {
|
|
console.log('[Map]: Opening add landmark panel...')
|
|
console.log('[Map]: Opening add landmark panel...')
|
|
- if (lmCount == "groupItem") { // Landmark is part of a group
|
|
|
|
|
|
+ if (lmCount == "groupItem") { // Adding landmark to an already established group
|
|
mapState.setNewLandmark({ latitude: latitude, longitude: longitude, floor: floor, voice: false, parent: parent, groupCount: -1 });
|
|
mapState.setNewLandmark({ latitude: latitude, longitude: longitude, floor: floor, voice: false, parent: parent, groupCount: -1 });
|
|
mapState.toggleLmAdd(true)
|
|
mapState.toggleLmAdd(true)
|
|
mapState.toggleLmDetails(false)
|
|
mapState.toggleLmDetails(false)
|
|
- } else if (lmCount == "newGroup") { // Adding 2nd landmark to existing landmark, making a new group
|
|
|
|
- mapState.setNewLandmark({ latitude: latitude, longitude: longitude, floor: floor, voice: false, parent: undefined, groupCount: -1 });
|
|
|
|
|
|
+ } else if (lmCount == "newGroup") { // Adding 2nd landmark to existing landmark, thus making a new group
|
|
|
|
+ mapState.setNewLandmark({ latitude: latitude, longitude: longitude, floor: floor, voice: false, parent: parent, groupCount: -2 });
|
|
mapState.toggleLmAdd(true)
|
|
mapState.toggleLmAdd(true)
|
|
mapState.toggleLmDetails(false)
|
|
mapState.toggleLmDetails(false)
|
|
- } else if (lmCount == "group") { // Landmark is the group itself
|
|
|
|
- mapState.setNewLandmark({ latitude: latitude, longitude: longitude, floor: floor, voice: false, landmark_type: 30 });
|
|
|
|
- mapState.toggleLmAdd(true)
|
|
|
|
- mapState.toggleLmDetails(false)
|
|
|
|
- } else { // Regular individial landmark
|
|
|
|
|
|
+ } else { // Adding a regular individial landmark
|
|
mapState.setNewLandmark({ latitude: latitude, longitude: longitude, floor: floor, voice: false });
|
|
mapState.setNewLandmark({ latitude: latitude, longitude: longitude, floor: floor, voice: false });
|
|
mapState.toggleLmAdd(true)
|
|
mapState.toggleLmAdd(true)
|
|
mapState.toggleLmDetails(false)
|
|
mapState.toggleLmDetails(false)
|
|
@@ -299,8 +295,7 @@ const MapNavigator: React.FC = ({ }) => {
|
|
setVisible={mapState.toggleLmAdd}
|
|
setVisible={mapState.toggleLmAdd}
|
|
newLandmark={mapState.newLandmark}
|
|
newLandmark={mapState.newLandmark}
|
|
visible={mapState.lmAddVisible}
|
|
visible={mapState.lmAddVisible}
|
|
- setLandmark={mapState.setSelectedLandmarkId}
|
|
|
|
- landmarks={landmarksQuery?.data} />
|
|
|
|
|
|
+ siblingID={mapState.selectedLandmarkId} />
|
|
<LandmarkDetails
|
|
<LandmarkDetails
|
|
markerWindowPosition={markerWindowPosition}
|
|
markerWindowPosition={markerWindowPosition}
|
|
authNavigation={authNavigation}
|
|
authNavigation={authNavigation}
|