Open map from timeline (#1199)

* Add navigation to expaneded map

* Add MapLibreMapView.Options

* Add AppActivityView

* Add ShareToMapsAppActivity

* Add share sheet presentation

* Add localisations

* Cleanup

* Fix UT build errors

* Revert breaking change

* Fix UIView setup

* Add support for location’s description

* Show popover on iPad

* Restore assets

* More cleanup
This commit is contained in:
Alfonso Grillo
2023-06-29 11:12:42 +02:00
committed by GitHub
parent 67e48e465f
commit 3f6bfbcc14
22 changed files with 489 additions and 150 deletions
@@ -43,9 +43,9 @@ struct GeoURI: Hashable {
var string: String {
if let uncertainty {
return "geo:\(latitude),\(longitude);u=\(uncertainty)"
return "geo:\(string(for: latitude)),\(string(for: longitude));u=\(string(for: uncertainty))"
} else {
return "geo:\(latitude),\(longitude)"
return "geo:\(string(for: latitude)),\(string(for: longitude))"
}
}
@@ -64,6 +64,10 @@ struct GeoURI: Hashable {
let uncertainty = matchOutput.uncertainty.flatMap(Double.init)
return .init(latitude: latitude, longitude: longitude, uncertainty: uncertainty)
}
private func string(for number: Double) -> String {
NumberFormatter.decimal.string(from: .init(floatLiteral: number)) ?? "\(number)"
}
}
// swiftlint:disable:next large_tuple
@@ -78,3 +82,13 @@ extension GeoURI {
self.init(latitude: coordinate.latitude, longitude: coordinate.longitude)
}
}
private extension NumberFormatter {
static let decimal: NumberFormatter = {
let numberFormatter = NumberFormatter()
numberFormatter.locale = Locale(identifier: "en_US_POSIX")
numberFormatter.numberStyle = .decimal
numberFormatter.maximumFractionDigits = 30
return numberFormatter
}()
}