diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos.xcodeproj/project.pbxproj b/GoogleMaps-Swift/GoogleMapsSwiftDemos.xcodeproj/project.pbxproj index e084ba0d..18e92197 100644 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos.xcodeproj/project.pbxproj +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -88,10 +88,10 @@ C997DD044658258CF28058BB /* AnimatedCurrentLocationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2566CE33406BE9F4AE26CFC0 /* AnimatedCurrentLocationViewController.swift */; }; CE0349DCBBE305F2A475E6ED /* MapLayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DEB41AE386954E4085FAA85 /* MapLayerViewController.swift */; }; D572786AC2A5D2604D3A6D6A /* popup_santa.png in Resources */ = {isa = PBXBuildFile; fileRef = 2D48B3FFC6D573CF2673D451 /* popup_santa.png */; }; + DAA0C6812D7153E40008A6B7 /* GoogleMaps in Frameworks */ = {isa = PBXBuildFile; productRef = DAA0C6802D7153E40008A6B7 /* GoogleMaps */; }; DC204BFAEB6DCDA7F7610536 /* GMSMapStyle+Bundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A9A391184A7EAD7C072E62 /* GMSMapStyle+Bundle.swift */; }; DFBE1D0F69ADD7B44416635D /* MapTypesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB2B29C49F7B36D477192D04 /* MapTypesViewController.swift */; }; E31E402B435CE656EAF45BD6 /* CustomIndoorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B08A9836FC58ADF5E6C36DC /* CustomIndoorViewController.swift */; }; - E3B3A787ED3769885A4481CD /* libPods-GoogleMapsSwiftDemos.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 36FB7115F969FAB84CDCB92A /* libPods-GoogleMapsSwiftDemos.a */; }; E3D9CA39859BD1CDB3863347 /* FitBoundsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBE707A4130CDA88BBCC2DD4 /* FitBoundsViewController.swift */; }; E899CA016F483DAF0998CF6B /* mapstyle-retro.json in Resources */ = {isa = PBXBuildFile; fileRef = 8E0F7227CD83A68A40D74050 /* mapstyle-retro.json */; }; E9EC783AAF928C3E9F018D40 /* step8.png in Resources */ = {isa = PBXBuildFile; fileRef = EFD1B4A1869A5ED24977724F /* step8.png */; }; @@ -116,7 +116,6 @@ 0EDDB89D7FC679C6141D5F7F /* argentina-large.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "argentina-large.png"; sourceTree = ""; }; 1730B1B4AD1EF5754F84355B /* FixedPanoramaViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FixedPanoramaViewController.swift; sourceTree = ""; }; 17C7DF8FF79FD6CE7012853F /* step4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = step4.png; sourceTree = ""; }; - 19D8B93DA5BF2119B4344281 /* Pods-GoogleMapsSwiftDemos.default.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GoogleMapsSwiftDemos.default.xcconfig"; path = "Target Support Files/Pods-GoogleMapsSwiftDemos/Pods-GoogleMapsSwiftDemos.default.xcconfig"; sourceTree = ""; }; 1DE0C90254383DA8C437CD0A /* MapsDemoAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = MapsDemoAssets.xcassets; sourceTree = ""; }; 1EAC16DE0E8CC752D17EB04A /* aeroplane@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "aeroplane@2x.png"; sourceTree = ""; }; 221F6743F6F3DB331816D7D3 /* arrow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "arrow@2x.png"; sourceTree = ""; }; @@ -128,7 +127,6 @@ 2C8E6590B2109C88BF5DF3BF /* australia-large@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "australia-large@2x.png"; sourceTree = ""; }; 2D48B3FFC6D573CF2673D451 /* popup_santa.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = popup_santa.png; sourceTree = ""; }; 30CF698467FA9E7F200017B3 /* mapstyle-silver.json */ = {isa = PBXFileReference; lastKnownFileType = text; path = "mapstyle-silver.json"; sourceTree = ""; }; - 36FB7115F969FAB84CDCB92A /* libPods-GoogleMapsSwiftDemos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GoogleMapsSwiftDemos.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3B0F56EA0940A859776C9DD3 /* track.json */ = {isa = PBXFileReference; lastKnownFileType = text; path = track.json; sourceTree = ""; }; 3B919F5AC728E794E349D4A3 /* SampleLevel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleLevel.swift; sourceTree = ""; }; 3EA1DB5D699D162AC375E1C9 /* StyledMapViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StyledMapViewController.swift; sourceTree = ""; }; @@ -190,6 +188,7 @@ D10973A4336C45EE56319A9B /* boat@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "boat@2x.png"; sourceTree = ""; }; D1A99C0C04795272C12DD9EF /* StructuredGeocoderViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StructuredGeocoderViewController.swift; sourceTree = ""; }; D27175E880CA9EEC63374BD4 /* PanoramaServiceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PanoramaServiceController.swift; sourceTree = ""; }; + DAA0C6E62D754F070008A6B7 /* GoogleMapsSwiftDemos.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = GoogleMapsSwiftDemos.xcconfig; sourceTree = ""; }; DE91B8EA42AFFCEDA758CE06 /* SDKConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SDKConstants.swift; sourceTree = ""; }; DF1488DDE60393FF03CF8A87 /* step1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "step1@2x.png"; sourceTree = ""; }; E18764F42392A93B39C775AB /* SampleMapStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleMapStyle.swift; sourceTree = ""; }; @@ -215,8 +214,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + DAA0C6812D7153E40008A6B7 /* GoogleMaps in Frameworks */, 4EA38ACBC98F34B1F0AF5BDD /* UIKit.framework in Frameworks */, - E3B3A787ED3769885A4481CD /* libPods-GoogleMapsSwiftDemos.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -298,7 +297,6 @@ isa = PBXGroup; children = ( 922338CA529F228A03DE6422 /* UIKit.framework */, - 36FB7115F969FAB84CDCB92A /* libPods-GoogleMapsSwiftDemos.a */, ); name = Frameworks; sourceTree = ""; @@ -314,10 +312,10 @@ D82B2453023AA1ECA43F9A8B = { isa = PBXGroup; children = ( + DAA0C6E62D754F070008A6B7 /* GoogleMapsSwiftDemos.xcconfig */, D0ED9A279E12177F7FDFA2FF /* Source */, AC723F443153D968479E59F3 /* Frameworks */, DD0B6FB690051F4443F4132B /* Products */, - E8482B677CDFAD11AD0CF175 /* Pods */, ); sourceTree = ""; }; @@ -329,15 +327,6 @@ name = Products; sourceTree = ""; }; - E8482B677CDFAD11AD0CF175 /* Pods */ = { - isa = PBXGroup; - children = ( - 19D8B93DA5BF2119B4344281 /* Pods-GoogleMapsSwiftDemos.default.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; E8E5C8B67F417779B6FF93C4 /* Resources */ = { isa = PBXGroup; children = ( @@ -409,11 +398,9 @@ isa = PBXNativeTarget; buildConfigurationList = 65556A7591C40D0E8B77989F /* Build configuration list for PBXNativeTarget "GoogleMapsSwiftDemos" */; buildPhases = ( - 0A2324DBEFF8D1A688DB9330 /* [CP] Check Pods Manifest.lock */, 2ADDADBB329E244AF7ED1FB2 /* Resources */, 22EB17F407E92B9B4F3B601A /* Sources */, B4530C282FE2BDE3D1071779 /* Frameworks */, - A6455A5AF886AD347389BC96 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -430,6 +417,8 @@ 5874A4B608088BA842B934C2 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1620; }; buildConfigurationList = C0C7530177213989B18ED3FC /* Build configuration list for PBXProject "GoogleMapsSwiftDemos" */; compatibilityVersion = "Xcode 3.2"; @@ -440,6 +429,9 @@ Base, ); mainGroup = D82B2453023AA1ECA43F9A8B; + packageReferences = ( + DAA0C67F2D7153E40008A6B7 /* XCRemoteSwiftPackageReference "ios-maps-sdk" */, + ); productRefGroup = DD0B6FB690051F4443F4132B /* Products */; projectDirPath = ""; projectRoot = ""; @@ -512,54 +504,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 0A2324DBEFF8D1A688DB9330 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-GoogleMapsSwiftDemos-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - A6455A5AF886AD347389BC96 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-GoogleMapsSwiftDemos/Pods-GoogleMapsSwiftDemos-resources.sh", - "${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64/GoogleMaps.framework/Resources/GoogleMaps.bundle", - "${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64_x86_64-simulator/GoogleMaps.framework/Resources/GoogleMaps.bundle", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - ); - outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMaps.bundle", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-GoogleMapsSwiftDemos/Pods-GoogleMapsSwiftDemos-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 22EB17F407E92B9B4F3B601A /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -616,7 +560,35 @@ /* Begin XCBuildConfiguration section */ 5BC265AFD5C3C8E67F030E30 /* Default */ = { isa = XCBuildConfiguration; + baseConfigurationReference = DAA0C6E62D754F070008A6B7 /* GoogleMapsSwiftDemos.xcconfig */; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; INTERMEDIATE_DIR = "$(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION)"; SDKROOT = iphoneos; SHARED_INTERMEDIATE_DIR = "$(SYMROOT)/DerivedSources/$(CONFIGURATION)"; @@ -625,19 +597,20 @@ }; 6798450D013ACAFF39CF0187 /* Default */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 19D8B93DA5BF2119B4344281 /* Pods-GoogleMapsSwiftDemos.default.xcconfig */; buildSettings = { - "ARCHS[sdk=iphonesimulator*]" = x86_64; + "ARCHS[sdk=iphonesimulator*]" = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; + DEVELOPMENT_TEAM = 6586N6K7KU; INFOPLIST_FILE = ./GoogleMapsSwiftDemos/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( ., "$(SDKROOT)/System/Library/Frameworks", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example-1.GoogleMapsDemos"; PRODUCT_NAME = GoogleMapsSwiftDemos; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -667,6 +640,25 @@ defaultConfigurationName = Default; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + DAA0C67F2D7153E40008A6B7 /* XCRemoteSwiftPackageReference "ios-maps-sdk" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/googlemaps/ios-maps-sdk"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 9.3.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + DAA0C6802D7153E40008A6B7 /* GoogleMaps */ = { + isa = XCSwiftPackageProductDependency; + package = DAA0C67F2D7153E40008A6B7 /* XCRemoteSwiftPackageReference "ios-maps-sdk" */; + productName = GoogleMaps; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 5874A4B608088BA842B934C2 /* Project object */; } diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Info.plist b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Info.plist index d5172fef..47e1e30a 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Info.plist +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.example.GoogleMapsDemos + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -22,6 +22,8 @@ 1.0 LSRequiresIPhoneOS + MAPS_API_KEY + $(MAPS_API_KEY) NSLocationWhenInUseUsageDescription Show your location on the map UILaunchStoryboardName diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/AppDelegate.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/AppDelegate.swift index 402352e0..f2f19d4b 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/AppDelegate.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/AppDelegate.swift @@ -21,10 +21,26 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate { _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - - GMSServices.provideAPIKey(SDKConstants.apiKey) - // Metal is the preferred renderer. - GMSServices.setMetalRendererEnabled(true) + + /* + API Key Setup: + 1. Create a .xcconfig file at the project root level + 2. Add this line: MAPS_API_KEY = your_api_key_here + 3. Get an API key from: https://developers.google.com/maps/documentation/ios-sdk/get-api-key + 4. Replace "your_api_key_here" with the API key obtained in step 3 + + Note: Never commit your actual API key to source control + */ + + guard let infoDictionary: [String: Any] = Bundle.main.infoDictionary else { + fatalError("Info.plist not found") + } + + guard let apiKey: String = infoDictionary["MAPS_API_KEY"] as? String else { + fatalError("MAPS_API_KEY not set in Info.plist") + } + + let _ = GMSServices.provideAPIKey(apiKey) return true } diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/SDKConstants.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/SDKConstants.swift index 95b43cf2..f1867930 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/SDKConstants.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/SDKConstants.swift @@ -13,12 +13,6 @@ import CoreLocation -enum SDKConstants { - - #error("Register for API Key and insert here. Then delete this line.") - static let apiKey = "" -} - extension CLLocationCoordinate2D { static let sydney = CLLocationCoordinate2D(latitude: -33.8683, longitude: 151.2086) // Victoria, Australia diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/SampleListViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/SampleListViewController.swift index bc267ab8..d942993c 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/SampleListViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/SampleListViewController.swift @@ -25,6 +25,9 @@ class SampleListViewController: UIViewController { super.viewDidLoad() view.addSubview(tableView) + tableView.rowHeight = UITableView.automaticDimension + tableView.estimatedRowHeight = 90 // Provide an estimate for optimization + tableView.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ tableView.topAnchor.constraint(equalTo: view.topAnchor), @@ -43,19 +46,40 @@ extension SampleListViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return sampleSections[section].samples.count } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell( - withIdentifier: SampleListViewController.sampleCellIdentifier, for: indexPath) - if let sample = sample(at: indexPath) { - cell.textLabel?.text = sample.title + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + // Create a new cell with value1 style (title on left, detail on right) + var cell = tableView.dequeueReusableCell( + withIdentifier: SampleListViewController.sampleCellIdentifier, for: indexPath) + + // Replace with subtitle style if needed + if cell.detailTextLabel == nil { + cell = UITableViewCell(style: .subtitle, reuseIdentifier: SampleListViewController.sampleCellIdentifier) + } + + if let sample = sample(at: indexPath) { + // Configure title - make it bold + cell.textLabel?.font = UIFont.boldSystemFont(ofSize: 17) + cell.textLabel?.text = sample.title + + // Configure subtitle - gray color, larger size, and multiline + cell.detailTextLabel?.textColor = UIColor.gray + cell.detailTextLabel?.font = UIFont.systemFont(ofSize: 15) // Increase font size here + cell.detailTextLabel?.text = sample.description + cell.detailTextLabel?.numberOfLines = 0 // Allow multiple lines + + // Add disclosure indicator (chevron) + cell.accessoryType = .disclosureIndicator + } + + return cell } - return cell - } + func numberOfSections(in tableView: UITableView) -> Int { return sampleSections.count } - + func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { return sampleSections[section].name } diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/AnimatedCurrentLocationViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/AnimatedCurrentLocationViewController.swift index 37521a45..4606b117 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/AnimatedCurrentLocationViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/AnimatedCurrentLocationViewController.swift @@ -21,8 +21,15 @@ final class AnimatedCurrentLocationViewController: UIViewController { private let locationManager = CLLocationManager() private lazy var mapView: GMSMapView = { - let camera = GMSCameraPosition(latitude: 38.8879, longitude: -77.0200, zoom: 17) - return GMSMapView(frame: .zero, camera: camera) + let camera = GMSCameraPosition(latitude: 38.8879, longitude: -77.0200, zoom: 17) + + // Create options object with your desired configuration + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + // Initialize map view with options + return GMSMapView(options: options) }() override func loadView() { @@ -34,31 +41,48 @@ final class AnimatedCurrentLocationViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - // Setup location services - guard CLLocationManager.locationServicesEnabled() else { - print("Please enable location services") - return + // Setup location manager + locationManager.delegate = self + locationManager.desiredAccuracy = kCLLocationAccuracyBest + locationManager.distanceFilter = 5.0 + + // Check authorization status + checkLocationAuthorization() + } + + private func checkLocationAuthorization() { + switch locationManager.authorizationStatus { + case .notDetermined: + locationManager.requestWhenInUseAuthorization() + case .restricted, .denied: + print("Please authorize location services") + // Consider showing an alert with instructions to enable location + case .authorizedWhenInUse, .authorizedAlways: + // Don't check locationServicesEnabled here, just start updates + locationManager.startUpdatingLocation() + @unknown default: + break + } } - if CLLocationManager.authorizationStatus() == .denied { - print("Please authorize location services") + // Remove the separate startLocationUpdates method that contains the warning-triggering check + + private func startLocationUpdates() { + guard CLLocationManager.locationServicesEnabled() else { + print("Please enable location services") return } - - locationManager.requestWhenInUseAuthorization() - locationManager.delegate = self - locationManager.desiredAccuracy = kCLLocationAccuracyBest - locationManager.distanceFilter = 5.0 + locationManager.startUpdatingLocation() } } extension AnimatedCurrentLocationViewController: CLLocationManagerDelegate { + func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) { + checkLocationAuthorization() + } + func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { - if CLLocationManager.authorizationStatus() == .denied { - print("Please authorize location services") - return - } print("Unable to get current location. Error: \(error.localizedDescription)") } diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/AnimatedUIViewMarkerViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/AnimatedUIViewMarkerViewController.swift index f4a16cb7..3f448357 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/AnimatedUIViewMarkerViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/AnimatedUIViewMarkerViewController.swift @@ -16,10 +16,17 @@ import UIKit // Sample code for customizing the marker. class AnimatedUIViewMarkerViewController: UIViewController { - + private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -33.8683, longitude: 151.2086, zoom: 5) - return GMSMapView(frame: .zero, camera: camera) + + // Create options object with your desired configuration + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + // Initialize map view with options + return GMSMapView(options: options) }() private var infoView: UIImageView? diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/BasicMapViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/BasicMapViewController.swift index b0f74cf9..43d7b907 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/BasicMapViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/BasicMapViewController.swift @@ -19,10 +19,15 @@ class BasicMapViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() + + // Sydney coordinates + let camera = GMSCameraPosition(target: .sydney, zoom: 12) - // Seattle coordinates - let camera = GMSCameraPosition(latitude: 47.6089945, longitude: -122.3410462, zoom: 14) - let mapView = GMSMapView(frame: view.bounds, camera: camera) + let options = GMSMapViewOptions() + options.camera = camera + options.frame = view.bounds + + let mapView = GMSMapView(options: options) mapView.delegate = self view = mapView navigationController?.navigationBar.isTranslucent = false diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/CameraViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/CameraViewController.swift index 67bf79ed..ee8e87ad 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/CameraViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/CameraViewController.swift @@ -24,7 +24,12 @@ class CameraViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(target: .victoria, zoom: 20, bearing: 0, viewingAngle: 0) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() private var timer: Timer? diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/CustomIndoorViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/CustomIndoorViewController.swift index 0ad261a7..a6bdc297 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/CustomIndoorViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/CustomIndoorViewController.swift @@ -17,8 +17,12 @@ import UIKit class CustomIndoorViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: 37.78318, longitude: -122.403874, zoom: 18) - let mapView = GMSMapView(frame: .zero, camera: camera) - return mapView + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() private lazy var levelPickerView: UIPickerView = UIPickerView() private var sampleLevels: [SampleLevel] = [] @@ -38,7 +42,6 @@ class CustomIndoorViewController: UIViewController { // This UIPicker will be populated with the levels of the active building. levelPickerView.delegate = self levelPickerView.dataSource = self - levelPickerView.showsSelectionIndicator = true levelPickerView.translatesAutoresizingMaskIntoConstraints = false view.addSubview(levelPickerView) diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/CustomMarkersViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/CustomMarkersViewController.swift index 8622b700..b0ed0525 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/CustomMarkersViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/CustomMarkersViewController.swift @@ -20,7 +20,12 @@ class CustomMarkersViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -37.81969, longitude: 144.966085, zoom: 4) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() override func loadView() { diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/DoubleMapViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/DoubleMapViewController.swift index eddf6fb3..cab5c488 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/DoubleMapViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/DoubleMapViewController.swift @@ -18,15 +18,23 @@ class DoubleMapViewController: UIViewController { private lazy var sanFranciscoCamera = GMSCameraPosition( latitude: 37.7847, longitude: -122.41, zoom: 5) + private lazy var mapView: GMSMapView = { - let mapView = GMSMapView(frame: .zero, camera: sanFranciscoCamera) - return mapView + let options = GMSMapViewOptions() + options.camera = sanFranciscoCamera + options.frame = .zero + + return GMSMapView(options: options) }() + private lazy var boundMapView: GMSMapView = { - let mapView = GMSMapView(frame: .zero, camera: sanFranciscoCamera) - return mapView + let options = GMSMapViewOptions() + options.camera = sanFranciscoCamera + options.frame = .zero + + return GMSMapView(options: options) }() - + override func viewDidLoad() { super.viewDidLoad() diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/FitBoundsViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/FitBoundsViewController.swift index 09128792..b612bfa4 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/FitBoundsViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/FitBoundsViewController.swift @@ -23,9 +23,14 @@ class FitBoundsViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(target: .victoria, zoom: 4) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() - + // Creates a list of markers, adding the Sydney marker. private lazy var markers: [GMSMarker] = { // Adds default markers around Sydney. diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/FrameRateViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/FrameRateViewController.swift index 481df239..54ff67db 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/FrameRateViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/FrameRateViewController.swift @@ -18,7 +18,12 @@ class FrameRateViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -33.868, longitude: 151.2086, zoom: 6) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() private lazy var statusTextView: UITextView = UITextView() diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GeocoderViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GeocoderViewController.swift index 9be36602..58030fe4 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GeocoderViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GeocoderViewController.swift @@ -19,9 +19,14 @@ class GeocoderViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -33.868, longitude: 151.2086, zoom: 12) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() - + private lazy var geocoder = GMSGeocoder() override func loadView() { diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GestureControlViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GestureControlViewController.swift index 2f551a64..fc4ffb3b 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GestureControlViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GestureControlViewController.swift @@ -20,8 +20,14 @@ class GestureControlViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -25.5605, longitude: 133.605097, zoom: 3) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() + private lazy var zoomSwitch: UISwitch = UISwitch(frame: .zero) override func viewDidLoad() { diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GradientPolylinesViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GradientPolylinesViewController.swift index 278f2b2b..6ca264d5 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GradientPolylinesViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GradientPolylinesViewController.swift @@ -37,9 +37,14 @@ final class GradientPolylinesViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition( - latitude: 44.1314, longitude: 9.6921, zoom: 14.059, bearing: 328, viewingAngle: 40) - return GMSMapView(frame: .zero, camera: camera) - }() + latitude: 44.1314, longitude: 9.6921, zoom: 14.059, bearing: 328, viewingAngle: 40) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) + }() override func loadView() { view = mapView diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GroundOverlayViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GroundOverlayViewController.swift index 99e18390..c1809e4d 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GroundOverlayViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/GroundOverlayViewController.swift @@ -23,7 +23,12 @@ final class GroundOverlayViewController: UIViewController { // Choose the midpoint of the coordinate to focus the camera on. let newark = GMSGeometryInterpolate(southWest, northEast, 0.5) let cameraPosition = GMSCameraPosition(target: newark, zoom: 12, bearing: 0, viewingAngle: 45) - let mapView = GMSMapView(frame: .zero, camera: cameraPosition) + + let options = GMSMapViewOptions() + options.camera = cameraPosition + options.frame = .zero + + let mapView = GMSMapView(options: options) mapView.delegate = self view = mapView diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/IndoorMuseumNavigationViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/IndoorMuseumNavigationViewController.swift index 8172f00e..c223c92c 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/IndoorMuseumNavigationViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/IndoorMuseumNavigationViewController.swift @@ -36,7 +36,13 @@ struct Exhibit: Decodable { class IndoorMuseumNavigationViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: 38.8879, longitude: -77.0200, zoom: 17) - let mapView = GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + let mapView = GMSMapView(options: options) + mapView.settings.myLocationButton = false mapView.settings.indoorPicker = false return mapView diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/IndoorViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/IndoorViewController.swift index e5fc54df..dc0b3c7f 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/IndoorViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/IndoorViewController.swift @@ -17,9 +17,15 @@ import UIKit class IndoorViewController: UIViewController { let mapStyleOptions: [SampleMapStyle] = [.retro, .grayscale, .night, .normal] + private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: 37.78318, longitude: -122.403874, zoom: 18) - let mapView = GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + let mapView = GMSMapView(options: options) mapView.settings.myLocationButton = true return mapView }() diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MapLayerViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MapLayerViewController.swift index a46a72df..beb3e692 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MapLayerViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MapLayerViewController.swift @@ -19,9 +19,14 @@ class MapLayerViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(target: .victoria, zoom: 4) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() - + override func loadView() { mapView.isMyLocationEnabled = true view = mapView diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MapTypesViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MapTypesViewController.swift index 51c70931..b1dfb5b1 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MapTypesViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MapTypesViewController.swift @@ -19,8 +19,13 @@ class MapTypesViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(target: .sydney, zoom: 12) - return GMSMapView(frame: .zero, camera: camera) - }() + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) + }() private lazy var segmentedControl: UISegmentedControl = { return UISegmentedControl(items: types.map { "\($0)" }) @@ -42,7 +47,7 @@ class MapTypesViewController: UIViewController { } } -extension GMSMapViewType: CustomStringConvertible { +extension GMSMapViewType: @retroactive CustomStringConvertible { //adding protocol conformances to type from libraries we don't control. public var description: String { switch self { case .normal: diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MapZoomViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MapZoomViewController.swift index 739d3e1e..db0c1a57 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MapZoomViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MapZoomViewController.swift @@ -57,16 +57,20 @@ enum ModeEnum: String { class MapZoomViewController: UIViewController { private let backgroundColor = UIColor(white: 1, alpha: 0.8) - private let zoomRangeViewHeight: CGFloat = 30 private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -33.868, longitude: 151.2086, zoom: 6) - let mapView = GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + let mapView = GMSMapView(options: options) mapView.settings.scrollGestures = false return mapView }() - + private lazy var zoomRangeView: UITextView = { let view = UITextView() view.text = "" diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkerEventsViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkerEventsViewController.swift index ab8d82bd..f1f17d82 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkerEventsViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkerEventsViewController.swift @@ -17,8 +17,13 @@ import UIKit final class MarkerEventsViewController: UIViewController { private lazy var mapView: GMSMapView = { - let camera = GMSCameraPosition(latitude: -37.81969, longitude: 144.966085, zoom: 4) - return GMSMapView(frame: .zero, camera: camera) + let camera = GMSCameraPosition(latitude: -37.81969, longitude: 144.966085, zoom: 4) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() private var melbourneMarker = GMSMarker( diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkerInfoWindowViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkerInfoWindowViewController.swift index 88c175d5..a5091a92 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkerInfoWindowViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkerInfoWindowViewController.swift @@ -29,9 +29,15 @@ final class MarkerInfoWindowViewController: UIViewController { return UIImageView(image: UIImage(named: "aeroplane")) }() + override func loadView() { let cameraPosition = GMSCameraPosition(latitude: -37.81969, longitude: 144.966085, zoom: 4) - let mapView = GMSMapView(frame: .zero, camera: cameraPosition) + + let options = GMSMapViewOptions() + options.camera = cameraPosition + options.frame = .zero + + let mapView = GMSMapView(options: options) mapView.delegate = self view = mapView diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkerLayerViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkerLayerViewController.swift index a3417893..e4651f0b 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkerLayerViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkerLayerViewController.swift @@ -40,9 +40,14 @@ final class MarkerLayerViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: 50.6042, longitude: 3.9599, zoom: 5) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() - + override func loadView() { mapView.isMyLocationEnabled = true view = mapView diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkersViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkersViewController.swift index de7d35da..3cbbcbf5 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkersViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MarkersViewController.swift @@ -24,7 +24,12 @@ class MarkersViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -37.81969, longitude: 144.966085, zoom: 4) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() override func loadView() { diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MyLocationViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MyLocationViewController.swift index efa62e69..7d98064b 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MyLocationViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/MyLocationViewController.swift @@ -24,10 +24,15 @@ class MyLocationViewController: UIViewController { lazy var mapView: GMSMapView = { let camera = GMSCameraPosition( - latitude: cameraLatitude, longitude: cameraLongitude, zoom: cameraZoom) - return GMSMapView(frame: .zero, camera: camera) + latitude: cameraLatitude, longitude: cameraLongitude, zoom: cameraZoom) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() - + var observation: NSKeyValueObservation? var location: CLLocation? { didSet { diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/PaddingBehaviorViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/PaddingBehaviorViewController.swift index 56c89e0f..cd00576c 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/PaddingBehaviorViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/PaddingBehaviorViewController.swift @@ -21,11 +21,18 @@ class PaddingBehaviorViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -33.868, longitude: 151.2086, zoom: 6) - let mapView = GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + let mapView = GMSMapView(options: options) mapView.padding = UIEdgeInsets(top: 0, left: 20, bottom: 40, right: 60) mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight] + return mapView }() + private lazy var panoramaView: GMSPanoramaView = GMSPanoramaView() lazy private var statusLabel: UILabel = UILabel() lazy private var changeBehaviorButton: UIButton = UIButton(type: .system) @@ -41,7 +48,9 @@ class PaddingBehaviorViewController: UIViewController { view.addSubview(mapView) // Add status label. - let statusBarHeight = UIApplication.shared.statusBarFrame.height + let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene + let statusBarHeight = windowScene?.statusBarManager?.statusBarFrame.height ?? 0 + let navigationHeight = navigationController?.navigationBar.frame.height ?? 0 let topYOffset = statusBarHeight + navigationHeight statusLabel.frame = CGRect(x: 30, y: topYOffset, width: 0, height: 30) diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/PolygonsViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/PolygonsViewController.swift index 349367e8..f3c81c81 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/PolygonsViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/PolygonsViewController.swift @@ -18,7 +18,12 @@ final class PolygonsViewController: UIViewController { private lazy var mapView: GMSMapView = { let cameraPosition = GMSCameraPosition(latitude: 39.13006, longitude: -77.508545, zoom: 4) - return GMSMapView(frame: .zero, camera: cameraPosition) + + let options = GMSMapViewOptions() + options.camera = cameraPosition + options.frame = .zero + + return GMSMapView(options: options) }() override func loadView() { diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/PolylinesViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/PolylinesViewController.swift index 679c0724..4d0a9dd4 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/PolylinesViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/PolylinesViewController.swift @@ -15,20 +15,27 @@ import GoogleMaps import UIKit final class PolylinesViewController: UIViewController { + private lazy var styles: [GMSStrokeStyle] = { let greenStyle = GMSStrokeStyle.gradient(from: .green, to: UIColor.green.withAlphaComponent(0)) let redStyle = GMSStrokeStyle.gradient(from: UIColor.red.withAlphaComponent(0), to: .red) return [greenStyle, redStyle, GMSStrokeStyle.solidColor(UIColor(white: 0, alpha: 0))] }() + private var pathLength: Double = 0 private var pos: Double = 0 private var polylines: [GMSPolyline] = [] private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -30, longitude: -175, zoom: 3) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() - + override func loadView() { view = mapView mapView.accessibilityElementsHidden = true diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/Samples.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/Samples.swift index 7bd187cf..427cce04 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/Samples.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/Samples.swift @@ -16,6 +16,7 @@ import UIKit struct Sample { let viewControllerClass: UIViewController.Type let title: String + let description: String } struct Section { @@ -26,61 +27,61 @@ struct Section { enum Samples { static func allSamples() -> [Section] { let mapSamples = [ - Sample(viewControllerClass: BasicMapViewController.self, title: "Basic Map"), - Sample(viewControllerClass: MapTypesViewController.self, title: "Map Types"), - Sample(viewControllerClass: StyledMapViewController.self, title: "Styled Map"), - Sample(viewControllerClass: TrafficMapViewController.self, title: "Traffic Layer"), - Sample(viewControllerClass: MyLocationViewController.self, title: "My Location"), - Sample(viewControllerClass: IndoorViewController.self, title: "Indoor"), + Sample(viewControllerClass: BasicMapViewController.self, title: "Basic Map", description: "Creates a map centered on Sydney, New South Wales, Australia"), + Sample(viewControllerClass: MapTypesViewController.self, title: "Map Types", description: "A segmented control is used to toggle between different map types"), + Sample(viewControllerClass: StyledMapViewController.self, title: "Styled Map", description: "Allows the user to choose between a variety of json-defined map styles"), + Sample(viewControllerClass: TrafficMapViewController.self, title: "Traffic Layer", description: "Displays local traffic superimposed on the map"), + Sample(viewControllerClass: MyLocationViewController.self, title: "My Location", description: "Panning to a users current location"), + Sample(viewControllerClass: IndoorViewController.self, title: "Indoor", description: "A map that displays the interior of a building"), Sample( viewControllerClass: CustomIndoorViewController.self, - title: "Indoor with Custom Level Select"), + title: "Indoor with Custom Level Select", description: "Employs a toggle which indoor level is displayed"), Sample( viewControllerClass: IndoorMuseumNavigationViewController.self, - title: "Indoor Museum Navigator"), - Sample(viewControllerClass: GestureControlViewController.self, title: "Gesture Control"), - Sample(viewControllerClass: SnapshotReadyViewController.self, title: "Snapshot Ready"), - Sample(viewControllerClass: DoubleMapViewController.self, title: "Two Maps"), - Sample(viewControllerClass: VisibleRegionViewController.self, title: "Visible Regions"), - Sample(viewControllerClass: MapZoomViewController.self, title: "Min/Max Zoom"), - Sample(viewControllerClass: FrameRateViewController.self, title: "Frame Rate"), - Sample(viewControllerClass: PaddingBehaviorViewController.self, title: "Padding Behavior"), + title: "Indoor Museum Navigator", description: "Moving the map to a different location inside the museum"), + Sample(viewControllerClass: GestureControlViewController.self, title: "Gesture Control", description: "Responding to zoom gestures when switch is toggled on"), + Sample(viewControllerClass: SnapshotReadyViewController.self, title: "Snapshot Ready", description: "Capture screenshots with buttons and gestures"), + Sample(viewControllerClass: DoubleMapViewController.self, title: "Two Maps", description: "Two stacked maps; top map controls both, bottom disabled"), + Sample(viewControllerClass: VisibleRegionViewController.self, title: "Visible Regions", description: "Shows/hides red overlay; controls adjust accordingly"), + Sample(viewControllerClass: MapZoomViewController.self, title: "Min/Max Zoom", description: "Map zooming restricted; Play button toggles between min/max zoom levels"), + Sample(viewControllerClass: FrameRateViewController.self, title: "Frame Rate", description: "Play button toggles between three frame rate settings"), + Sample(viewControllerClass: PaddingBehaviorViewController.self, title: "Padding Behavior", description: "Shows map display with padding behavior"), ] let overlaySamples = [ - Sample(viewControllerClass: MarkersViewController.self, title: "Markers"), - Sample(viewControllerClass: CustomMarkersViewController.self, title: "Custom Markers"), - Sample(viewControllerClass: AnimatedUIViewMarkerViewController.self, title: "UIView Markers"), - Sample(viewControllerClass: MarkerEventsViewController.self, title: "Marker Events"), - Sample(viewControllerClass: MarkerLayerViewController.self, title: "Marker Layer"), + Sample(viewControllerClass: MarkersViewController.self, title: "Markers", description: "Identifies a location on the map with a marker"), + Sample(viewControllerClass: CustomMarkersViewController.self, title: "Custom Markers", description: "Several markers are displayed with custom images"), + Sample(viewControllerClass: AnimatedUIViewMarkerViewController.self, title: "UIView Markers", description: "A marker is displayed using a custom image and animation"), + Sample(viewControllerClass: MarkerEventsViewController.self, title: "Marker Events", description: "Map shows two markers; tapping zooms/rotates to selected one"), + Sample(viewControllerClass: MarkerLayerViewController.self, title: "Marker Layer", description: "Plane marker slides between coordinates, rotating toward next destination"), Sample( - viewControllerClass: MarkerInfoWindowViewController.self, title: "Custom Info Windows"), - Sample(viewControllerClass: PolygonsViewController.self, title: "Polygons"), - Sample(viewControllerClass: PolylinesViewController.self, title: "Polylines"), - Sample(viewControllerClass: GroundOverlayViewController.self, title: "Ground Overlays"), - Sample(viewControllerClass: TileLayerViewController.self, title: "Tile Layers"), + viewControllerClass: MarkerInfoWindowViewController.self, title: "Custom Info Windows", description: "Marker shows at Australia's center; tapping displays info window."), + Sample(viewControllerClass: PolygonsViewController.self, title: "Polygons", description: "Shapes outline land and maritime borders of NY and NC"), + Sample(viewControllerClass: PolylinesViewController.self, title: "Polylines", description: "Animated red/green polylines change position/size over South Pacific map"), + Sample(viewControllerClass: GroundOverlayViewController.self, title: "Ground Overlays", description: "Custom image placed on ground layer; markers appear in front"), + Sample(viewControllerClass: TileLayerViewController.self, title: "Tile Layers", description: "Map tiles are colored to highlight the indoor layout of the selected floor"), Sample( viewControllerClass: AnimatedCurrentLocationViewController.self, - title: "Animated Current Location"), + title: "Animated Current Location", description: "A marker with a walking animation moves with the user's current location"), Sample( - viewControllerClass: GradientPolylinesViewController.self, title: "Gradient Polylines"), + viewControllerClass: GradientPolylinesViewController.self, title: "Gradient Polylines", description: "Polyline traces hiking trail; warmer colors show higher elevations"), ] let panoramaSamples = [ - Sample(viewControllerClass: PanoramaServiceController.self, title: "Panorama Service"), - Sample(viewControllerClass: PanoramaViewController.self, title: "Street View"), - Sample(viewControllerClass: FixedPanoramaViewController.self, title: "Fixed Street View"), + Sample(viewControllerClass: PanoramaServiceController.self, title: "Panorama Service", description: "Tests the panorama service and displays the response data"), + Sample(viewControllerClass: PanoramaViewController.self, title: "Street View", description: "Displays a full screen panoramic street view"), + Sample(viewControllerClass: FixedPanoramaViewController.self, title: "Fixed Street View", description: "This panoramic street view does not respond to gestures"), ] let cameraSamples = [ - Sample(viewControllerClass: FitBoundsViewController.self, title: "Fit Bounds"), - Sample(viewControllerClass: CameraViewController.self, title: "Camera Animation"), - Sample(viewControllerClass: MapLayerViewController.self, title: "Map Layer"), + Sample(viewControllerClass: FitBoundsViewController.self, title: "Fit Bounds", description: "Fit Bounds button pans/zooms camera to fit all markers"), + Sample(viewControllerClass: CameraViewController.self, title: "Camera Animation", description: "Camera zooms out and rotates showing Melbourne's surrounding buildings"), + Sample(viewControllerClass: MapLayerViewController.self, title: "Map Layer", description: "Triggers animations zooming to user's location"), ] let serviceSamples = [ - Sample(viewControllerClass: GeocoderViewController.self, title: "Geocoder"), + Sample(viewControllerClass: GeocoderViewController.self, title: "Geocoder", description: "Long-press sends coordinates for geocoding; displays marker with results"), Sample( - viewControllerClass: StructuredGeocoderViewController.self, title: "Structured Geocoder"), + viewControllerClass: StructuredGeocoderViewController.self, title: "Structured Geocoder", description: "Long-press sends coordinates for geocoding; displays address details in window"), ] return [ - Section(name: "Map", samples: mapSamples), + Section(name: "Map Basics", samples: mapSamples), Section(name: "Panorama", samples: panoramaSamples), Section(name: "Overlays", samples: overlaySamples), Section(name: "Camera", samples: cameraSamples), diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/SnapshotReadyViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/SnapshotReadyViewController.swift index ae9c57b8..9ed4f918 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/SnapshotReadyViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/SnapshotReadyViewController.swift @@ -15,10 +15,17 @@ import GoogleMaps import UIKit class SnapshotReadyViewController: UIViewController { + lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -33.868, longitude: 151.2086, zoom: 6) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() + private lazy var statusLabel: UILabel = UILabel() private lazy var waitButton: UIBarButtonItem = UIBarButtonItem() private var isAwaitingSnapshot = false { diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/StructuredGeocoderViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/StructuredGeocoderViewController.swift index 67f63878..d11d5663 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/StructuredGeocoderViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/StructuredGeocoderViewController.swift @@ -19,9 +19,14 @@ class StructuredGeocoderViewController: UIViewController { private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -33.868, longitude: 151.2086, zoom: 12) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() - + private lazy var geocoder = GMSGeocoder() override func loadView() { diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/StyledMapViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/StyledMapViewController.swift index 1c63a140..57d7dc9c 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/StyledMapViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/StyledMapViewController.swift @@ -15,11 +15,16 @@ import GoogleMaps import UIKit class StyledMapViewController: UIViewController { - lazy var mapView: GMSMapView = { - let camera = GMSCameraPosition(latitude: -33.868, longitude: 151.2086, zoom: 12) - return GMSMapView(frame: .zero, camera: camera) + lazy var mapView: GMSMapView = { + let camera = GMSCameraPosition(latitude: -33.868, longitude: 151.2086, zoom: 12) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() - + override func loadView() { view = mapView diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/TileLayerViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/TileLayerViewController.swift index 7f6855f3..faf0739f 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/TileLayerViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/TileLayerViewController.swift @@ -21,12 +21,17 @@ final class TileLayerViewController: UIViewController { } } private var tileLayer: GMSURLTileLayer? - + private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: 37.78318, longitude: -122.403874, zoom: 18) - return GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + return GMSMapView(options: options) }() - + private lazy var segmentedControl: UISegmentedControl = { let floorNames = ["1", "2", "3"] return UISegmentedControl(items: floorNames) diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/TrafficMapViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/TrafficMapViewController.swift index 33139b8e..70912a48 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/TrafficMapViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/TrafficMapViewController.swift @@ -18,11 +18,16 @@ class TrafficMapViewController: UIViewController { private var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -33.868, longitude: 151.2086, zoom: 12) - let mapView = GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + let mapView = GMSMapView(options: options) mapView.isTrafficEnabled = true return mapView }() - + override func loadView() { view = mapView } diff --git a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/VisibleRegionViewController.swift b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/VisibleRegionViewController.swift index e4af3c0f..b9fa3ce5 100755 --- a/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/VisibleRegionViewController.swift +++ b/GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/Samples/VisibleRegionViewController.swift @@ -17,15 +17,22 @@ import UIKit class VisibleRegionViewController: UIViewController { static let overlayHeight: CGFloat = 140 + private lazy var mapView: GMSMapView = { let camera = GMSCameraPosition(latitude: -37.81969, longitude: 144.966085, zoom: 4) - let mapView = GMSMapView(frame: .zero, camera: camera) + + let options = GMSMapViewOptions() + options.camera = camera + options.frame = .zero + + let mapView = GMSMapView(options: options) mapView.settings.myLocationButton = true mapView.isMyLocationEnabled = true mapView.padding = UIEdgeInsets( - top: 0, left: 0, bottom: VisibleRegionViewController.overlayHeight, right: 0) + top: 0, left: 0, bottom: VisibleRegionViewController.overlayHeight, right: 0) return mapView }() + private lazy var overlay: UIView = { let overlay = UIView(frame: .zero) overlay.backgroundColor = UIColor(hue: 0, saturation: 1, brightness: 1, alpha: 0.5) diff --git a/GoogleMaps-Swift/Podfile b/GoogleMaps-Swift/Podfile deleted file mode 100755 index ae12cac8..00000000 --- a/GoogleMaps-Swift/Podfile +++ /dev/null @@ -1,8 +0,0 @@ -source 'https://cdn.cocoapods.org/' - -platform :ios, '15.0' - -target 'GoogleMapsSwiftXCFrameworkDemos' do - project 'GoogleMapsSwiftXCFrameworkDemos' - pod 'GoogleMaps', '= 9.2.0' -end diff --git a/GoogleMaps-SwiftUI/GoogleMaps-SwiftUI/Samples/BasicMapWithMapID.swift b/GoogleMaps-SwiftUI/GoogleMaps-SwiftUI/Samples/BasicMapWithMapID.swift index a02c3e1d..3f2ac488 100644 --- a/GoogleMaps-SwiftUI/GoogleMaps-SwiftUI/Samples/BasicMapWithMapID.swift +++ b/GoogleMaps-SwiftUI/GoogleMaps-SwiftUI/Samples/BasicMapWithMapID.swift @@ -26,6 +26,7 @@ struct BasicMapWithMapID: View { 2. Provide your mapID here let mapID = GMSMapID(identifier: "YOUR_MAP_ID") + options.mapID = mapID */ let mapID: GMSMapID = .demoMapID //used for demostration only @@ -38,6 +39,18 @@ struct BasicMapWithMapID: View { VStack { GoogleMapView(options: mapOptions) .ignoresSafeAreaExceptTop() + .frame(maxWidth: .infinity, minHeight: 325) + + VStack(alignment: .leading) { + Text("Customize with Map ID's") + .font(.headline) + + Text("Create your own map ID to represent Google Map styling and Advanced mnarker settings stored in Google Cloud.") + .font(.body) + .foregroundColor(.secondary) + } + .padding(.horizontal) + } } } diff --git a/README.md b/README.md index 3edbe7a5..c6c89c62 100644 --- a/README.md +++ b/README.md @@ -47,11 +47,13 @@ For Swift (UIKit) samples: ``` $ cd GoogleMaps-Swift -$ pod install $ open GoogleMapsSwiftDemos.xcworkspace ``` -Add your API Key to `GoogleMapsDemos/SDKDemoAPIKey.h`. +You will need to add an API Key to your configuration. Please see the [documentation](https://developers.google.com/maps/documentation/ios-sdk/start#get-key) for details on how to get an API Key. + +This project uses Swift Package Manager and requires the [GoogleMaps package](https://github.com/googlemaps/ios-maps-sdk). The sample code demonstrates best practices for integrating Google Maps into Swift-based iOS applications. + ## GoogleMaps-SwiftUI