mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-03 19:33:49 +00:00
39 lines
892 B
Swift
39 lines
892 B
Swift
import SwiftUI
|
|
|
|
extension MapZoomButton {
|
|
/// The type of the map zoom button
|
|
enum Kind: String, Codable, CaseIterable, Identifiable {
|
|
case `in` = "In"
|
|
case out = "Out"
|
|
|
|
|
|
|
|
// MARK: Properties
|
|
|
|
/// The id
|
|
var id: Self { self }
|
|
|
|
|
|
/// The description text
|
|
var description: String {
|
|
switch self {
|
|
case .in:
|
|
return String(localized: "zoom_in")
|
|
case .out:
|
|
return String(localized: "zoom_out")
|
|
}
|
|
}
|
|
|
|
|
|
/// The image
|
|
var image: Image {
|
|
switch self {
|
|
case .in:
|
|
return Image(systemName: "plus")
|
|
case .out:
|
|
return Image(systemName: "minus")
|
|
}
|
|
}
|
|
}
|
|
}
|