Skip to content

Commit

Permalink
Merge pull request #188 from merlos/feature/zoom-beyond-max
Browse files Browse the repository at this point in the history
Feature/zoom beyond max
  • Loading branch information
vincentneo authored Oct 6, 2020
2 parents 773f3a3 + 64f6c6e commit 8c4863c
Show file tree
Hide file tree
Showing 56 changed files with 2,056 additions and 1,049 deletions.
10 changes: 5 additions & 5 deletions OpenGpxTracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@
0175AC0523F01519003323C3 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
0175AC0723F01523003323C3 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
120DE70F22B274910055C4CB /* GPXSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GPXSession.swift; sourceTree = "<group>"; };
12A1A44324D561AC0057ED7A /* CoreDataHelper+FetchRequests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CoreDataHelper+FetchRequests.swift"; sourceTree = "<group>"; };
1262DD9624F9568F00B5C2EA /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Interface.strings; sourceTree = "<group>"; };
1262DD9724F9568F00B5C2EA /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = "<group>"; };
1262DD9824F9568F00B5C2EA /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1262DD9924F9568F00B5C2EA /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
12A1A44324D561AC0057ED7A /* CoreDataHelper+FetchRequests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CoreDataHelper+FetchRequests.swift"; sourceTree = "<group>"; };
12D4905424C448540065D995 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Interface.strings; sourceTree = "<group>"; };
12D4905524C448540065D995 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
12D4905624C448540065D995 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1040,7 +1040,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -1089,7 +1089,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -1108,7 +1108,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = OpenGpxTracker/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.7.2;
PRODUCT_BUNDLE_IDENTIFIER = org.merlos.OpenGpxTracker;
Expand All @@ -1129,7 +1129,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = OpenGpxTracker/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.7.2;
PRODUCT_BUNDLE_IDENTIFIER = org.merlos.OpenGpxTracker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -52,8 +50,8 @@
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -66,29 +64,16 @@
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "32">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/GPX Tracker">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BF692F562209AAF900F8A0F1"
BuildableName = "OpenGpxTracker-Watch.app"
BlueprintName = "OpenGpxTracker-Watch"
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BF692F562209AAF900F8A0F1"
BuildableName = "OpenGpxTracker-Watch.app"
BlueprintName = "OpenGpxTracker-Watch"
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand All @@ -97,27 +82,16 @@
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
launchAutomaticallySubstyle = "32">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/GPX Tracker">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BF692F562209AAF900F8A0F1"
BuildableName = "OpenGpxTracker-Watch.app"
BlueprintName = "OpenGpxTracker-Watch"
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BF692F562209AAF900F8A0F1"
BuildableName = "OpenGpxTracker-Watch.app"
BlueprintName = "OpenGpxTracker-Watch"
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -52,8 +50,8 @@
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -66,29 +64,16 @@
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "8">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/GPX Tracker">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BF692F562209AAF900F8A0F1"
BuildableName = "OpenGpxTracker-Watch.app"
BlueprintName = "OpenGpxTracker-Watch"
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BF692F562209AAF900F8A0F1"
BuildableName = "OpenGpxTracker-Watch.app"
BlueprintName = "OpenGpxTracker-Watch"
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand All @@ -97,27 +82,16 @@
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
launchAutomaticallySubstyle = "8">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/GPX Tracker">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BF692F562209AAF900F8A0F1"
BuildableName = "OpenGpxTracker-Watch.app"
BlueprintName = "OpenGpxTracker-Watch"
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BF692F562209AAF900F8A0F1"
BuildableName = "OpenGpxTracker-Watch.app"
BlueprintName = "OpenGpxTracker-Watch"
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -52,8 +50,8 @@
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -65,29 +63,16 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/GPX Tracker">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BF692F562209AAF900F8A0F1"
BuildableName = "OpenGpxTracker-Watch.app"
BlueprintName = "OpenGpxTracker-Watch"
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BF692F562209AAF900F8A0F1"
BuildableName = "OpenGpxTracker-Watch.app"
BlueprintName = "OpenGpxTracker-Watch"
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</BuildableProductRunnable>
<LocationScenarioReference
identifier = "Tokyo, Japan"
referenceType = "1">
Expand All @@ -99,27 +84,16 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/GPX Tracker">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BF692F562209AAF900F8A0F1"
BuildableName = "OpenGpxTracker-Watch.app"
BlueprintName = "OpenGpxTracker-Watch"
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BF692F562209AAF900F8A0F1"
BuildableName = "OpenGpxTracker-Watch.app"
BlueprintName = "OpenGpxTracker-Watch"
ReferencedContainer = "container:OpenGpxTracker.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
9 changes: 0 additions & 9 deletions OpenGpxTracker/GPXMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ class GPXMapView: MKMapView {
removeOverlay(tileServerOverlay)
}

/// Min distance to the floor of the camera
if #available(iOS 13, *) {
let zoomRange = MKMapView.CameraZoomRange(minCenterCoordinateDistance: newValue.minCameraDistance,
maxCenterCoordinateDistance: -1)
setCameraZoomRange(zoomRange, animated: true)
}

//add new overlay to map if not using Apple Maps
if newValue != .apple {
//Update cacheConfig
Expand All @@ -102,7 +95,6 @@ class GPXMapView: MKMapView {
}
}
didSet {

if #available(iOS 13, *) {
if tileServer == .apple {
overrideUserInterfaceStyle = .unspecified
Expand All @@ -112,7 +104,6 @@ class GPXMapView: MKMapView {
NotificationCenter.default.post(name: .updateAppearance, object: nil, userInfo: nil)
}
}

}
}

Expand Down
17 changes: 1 addition & 16 deletions OpenGpxTracker/GPXTileServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ enum GPXTileServer: Int {
case .openTopoMap: return ["a", "b", "c"]
}
}

/// Maximum zoom level the tile server supports
/// Tile servers provide files till a certain level of zoom that ranges from 0 to maximumZ.
/// If map zooms more than the limit level, tiles won't be requested.
Expand Down Expand Up @@ -109,22 +110,6 @@ enum GPXTileServer: Int {
return 0
}
}

/// Minimum distance from the floor of the camera (in meters)
///
/// Note that there is a relationship between the mazimumZ and the camera distance to the floor.
/// Because of that, this parameter be automatically calculated in the future.
/// For existing tile servers, it was calculated with trial and error.
///
/// Negative value means no limit.
var minCameraDistance: Double {
switch self {
case .apple: return -1.0 // Not limited
case .openStreetMap: return 750.0
case .cartoDB: return 200.0
case .openTopoMap: return 2850.0
}
}

/// Returns the number of tile servers currently defined
static var count: Int { return GPXTileServer.openTopoMap.rawValue + 1}
Expand Down
2 changes: 1 addition & 1 deletion OpenGpxTracker/MapViewDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MapViewDelegate: NSObject, MKMapViewDelegate, UIAlertViewDelegate {
/// Displays the line for each segment
func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer {
if overlay.isKind(of: MKTileOverlay.self) {
return MKTileOverlayRenderer(overlay: overlay)
return mapView.mapCacheRenderer(forOverlay: overlay)
}

if overlay is MKPolyline {
Expand Down
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ def shared_pods
end

target 'OpenGpxTracker' do
platform :ios, '8.0'
platform :ios, '9.0'
shared_pods
pod 'MapCache', '~> 0.6.0'
pod 'MapCache', '~> 0.9.0'
#pod 'MapCache', git: 'https://github.com/merlos/MapCache.git' :branch => 'master'

end
Expand Down
Loading

0 comments on commit 8c4863c

Please sign in to comment.