Skip to content

Commit 3f53584

Browse files
authored
Merge pull request #199 from TaskarCenterAtUW/feature-dynamic-map-annotation-icon
replace static map annotation (icon) with icons based on filter
2 parents 6f0877c + 17ca150 commit 3f53584

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

GoInfoGame/GoInfoGame/quests/LongQuests/Classes/LongElementQuest.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,21 @@ import osmparser
1010
import SwiftUI
1111

1212
class LongElementQuest: QuestBase, Quest {
13-
var icon: UIImage = #imageLiteral(resourceName: "mapPoint")
13+
14+
var icon: UIImage {
15+
let lowercasedFilter = filter.lowercased()
16+
17+
if lowercasedFilter.contains("ways with (highway=footway and footway=sidewalk)") {
18+
return UIImage(named: "sidewalk_surface.pdf")!
19+
} else if lowercasedFilter.contains("ways with (highway=footway and footway=crossing)") {
20+
return UIImage(named: "pedestrian")!
21+
} else if lowercasedFilter.contains("nodes with barrier=kerb") {
22+
return UIImage(named: "kerb_type")!
23+
} else {
24+
return UIImage(named: "mapPoint")!
25+
}
26+
}
27+
1428

1529
var title: String = ""
1630

0 commit comments

Comments
 (0)