Skip to content

Commit 6a3696b

Browse files
author
Achyut Kumar M
committed
remove unused code
1 parent 549ca65 commit 6a3696b

File tree

1 file changed

+2
-45
lines changed

1 file changed

+2
-45
lines changed

GoInfoGame/GoInfoGame/UI/Map/MapView.swift

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -137,30 +137,6 @@ struct MapView: View {
137137
UndoButton(
138138
onPreview: { id, type in
139139

140-
switch type {
141-
case .node:
142-
print("NODE")
143-
case .way:
144-
print("WAY")
145-
146-
//get item based on id
147-
let item = viewModel.items.first(where: { $0.id == id })
148-
mapViewRef?.addAnnotation(item!.annotation)
149-
mapViewRef!.setCenter(item!.annotation.coordinate, animated: true)
150-
151-
//build display unit
152-
// mapViewRef?.addAnnotation(item)
153-
154-
// if let item = item {
155-
// let annotation = DisplayUnitAnnotation(element: item)
156-
// mapViewRef?.addAnnotation(annotation)
157-
// mapViewRef?.setCenter(annotation.coordinate, animated: true)
158-
// }
159-
160-
case .relation:
161-
print("RELATION")
162-
163-
}
164140

165141
// if let element = DatabaseConnector.shared.getElement(withId: id, type: type) {
166142
// let annotation = DisplayUnitAnnotation(element: element)
@@ -169,11 +145,9 @@ struct MapView: View {
169145
// }
170146
},
171147
onRemovePreview: {
172-
// mapViewRef?.removeAnnotations(where: { $0.isPreview }) // however you tag temp annotations
173148
},
174149
onRevert: { id, type in
175-
// Do actual undo + keep annotation
176-
// Optionally, remove "preview" flag if needed
150+
177151
}
178152
)
179153
.padding(.bottom, 24)
@@ -185,24 +159,7 @@ struct MapView: View {
185159
}, useBingMaps: useBingMaps)
186160
}
187161
}
188-
189-
// if showUndoSidebar {
190-
// UndoSidebarView(
191-
// onUndo: { id, type in
192-
// MapUndoManager.shared.undo(for: Int64(id), type: type)
193-
// // undoItems = MapUndoManager.shared.getUndoItems() // refresh
194-
// },
195-
// onClose: {
196-
// withAnimation {
197-
// showUndoSidebar = false
198-
// }
199-
// }
200-
// )
201-
// .transition(.move(edge: .leading))
202-
// .padding(.top, 20)
203-
// }
204-
205-
162+
206163
if !viewModel.selectedAnnotaions.isEmpty,
207164
let selectedAnnotationType = viewModel.selectedAnnotationType,
208165
let image = viewModel.selectedAnnotaions.first?.displayUnit.parent?.icon {

0 commit comments

Comments
 (0)