Skip to content

Commit 0fb542c

Browse files
author
Illia Kucheriavyi
authored
Merge pull request #153 from kojiba/main
Changed all maps default zoom level to 200 mi
2 parents 8ed5445 + 55e5a5d commit 0fb542c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

o-fish-ios/Model/Settings.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ class Settings: ObservableObject {
1212
static let shared = Settings()
1313

1414
var menuData = MenuData()
15-
var intialZoomLevel = 1000 // Meters to show in map views
15+
16+
var intialZoomLevel = 322000 // Meters to show in map views, ~= 200 mi
1617
}

o-fish-ios/Views/PreboardingFlow/VesselRecordView/SnapshotManager/LocationSnapshotManager.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ class LocationSnapshotManager {
2222

2323
private var internalPicture: UIImage = UIImage()
2424

25+
let settings = Settings.shared
26+
2527
private enum Factors {
26-
static let regionScale: CGFloat = 10.0
2728
static let pinScale: CGFloat = 0.5
2829
static let pinWidthMultiplier: CGFloat = 0.25
2930
}
3031

3132
func createImageFrom(_ location: CLLocationCoordinate2D, in size: CGFloat, execute: @escaping () -> Void) {
3233
let options = MKMapSnapshotter.Options()
33-
let region = MKCoordinateRegion(center: location,
34-
latitudinalMeters: CLLocationDistance(size * Factors.regionScale),
35-
longitudinalMeters: CLLocationDistance(size * Factors.regionScale))
34+
let radius = CLLocationDistance(settings.intialZoomLevel)
35+
let region = MKCoordinateRegion(center: location, latitudinalMeters: radius, longitudinalMeters: radius)
36+
3637
options.region = region
3738
options.size = CGSize(width: size, height: size)
3839

@@ -61,6 +62,7 @@ class LocationSnapshotManager {
6162

6263
private func drawMKPinAnnotation(for point: CGPoint) {
6364
let pinView = MKPinAnnotationView()
65+
6466
let pinImage = pinView.image?.resize(scale: Factors.pinScale)
6567
guard let width = pinImage?.size.width,
6668
let height = pinImage?.size.height else { return }

0 commit comments

Comments
 (0)