├── .circleci └── config.yml ├── .gitignore ├── .swift-version ├── Cartfile ├── Cartfile.resolved ├── Example ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── marker_normal.imageset │ │ ├── Contents.json │ │ ├── marker_normal@2x.png │ │ └── marker_normal@3x.png │ └── marker_selected.imageset │ │ ├── Contents.json │ │ ├── marker_selected@2x.png │ │ └── marker_selected@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist └── ViewController.swift ├── LICENSE ├── Package.resolved ├── Package.swift ├── Podfile ├── Podfile.lock ├── README.md ├── RxGoogleMaps-iOS ├── Info.plist └── RxGoogleMaps-iOS.h ├── RxGoogleMaps.podspec ├── RxGoogleMaps.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── RxGoogleMaps-iOS.xcscheme ├── RxGoogleMaps.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── RxGoogleMaps ├── Info.plist └── RxGoogleMaps.h └── Sources └── RxGoogleMaps ├── GMSCircle+Rx.swift ├── GMSGroundOverlay+Rx.swift ├── GMSMapView+Rx.swift ├── GMSMapViewDelegateProxy.swift ├── GMSMarker+Rx.swift ├── GMSOverlay+Rx.swift ├── GMSPolygon+Rx.swift └── GMSPolyline+Rx.swift /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | jobs: 4 | "RxGoogleMaps CI": 5 | macos: 6 | xcode: 14.3.1 # Specify the Xcode version to use 7 | 8 | steps: 9 | - checkout 10 | - run: 11 | name: Install Pods 12 | command: pod install 13 | - run: 14 | name: Setup PipeLine 15 | command: set -o pipefail 16 | - run: 17 | name: XCode Build Example 18 | command: xcodebuild build -scheme 'Example' -workspace 'RxGoogleMaps.xcworkspace' -sdk iphonesimulator -destination "name=iPhone 14 Pro Max" | xcpretty -c 19 | 20 | "RxGoogleMaps Release": 21 | working_directory: ~/RxSwiftCommunity/RxGoogleMaps 22 | parallelism: 1 23 | shell: /bin/bash --login 24 | environment: 25 | LANG: en_US.UTF-8 26 | macos: 27 | xcode: 14.3.1 28 | steps: 29 | - checkout 30 | - run: 31 | name: Setup CocoaPods 32 | command: pod setup 33 | - run: 34 | name: Override Circle CI Config 35 | command: rm ~/.cocoapods/config.yaml # This hack is needed since CircleCI forces --verbose 36 | - run: 37 | name: Push Podspec to Trunk 38 | command: pod trunk push --swift-version=5ץ0 --skip-tests --allow-warnings 39 | 40 | workflows: 41 | version: 2 42 | build: 43 | jobs: 44 | - "RxGoogleMaps CI": 45 | filters: 46 | tags: 47 | ignore: /[0-9]+(\.[0-9]+)*/ 48 | release: 49 | jobs: 50 | - "RxGoogleMaps Release": 51 | filters: 52 | branches: 53 | ignore: /.*/ 54 | tags: 55 | only: /[0-9]+(\.[0-9]+)*/ -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | 67 | Example/key.plist 68 | 69 | .DS_Store 70 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 5.0 -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "ReactiveX/RxSwift" ~> 6.0 -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "ReactiveX/RxSwift" "4.5.0" 2 | -------------------------------------------------------------------------------- /Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // Copyright (c) RxSwiftCommunity 2 | 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | import UIKit 22 | import GoogleMaps 23 | 24 | #if swift(>=4.2) 25 | typealias ApplicationLaunchOptionsKey = UIApplication.LaunchOptionsKey 26 | #else 27 | typealias ApplicationLaunchOptionsKey = UIApplicationLaunchOptionsKey 28 | #endif 29 | 30 | @UIApplicationMain 31 | class AppDelegate: UIResponder, UIApplicationDelegate { 32 | 33 | var window: UIWindow? 34 | 35 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [ApplicationLaunchOptionsKey: Any]?) -> Bool { 36 | // TODO: Replace with your API Key from https://developers.google.com/maps/documentation/ios-sdk/ 37 | GMSServices.provideAPIKey("YOUR-API-KEY") 38 | return true 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /Example/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/Assets.xcassets/marker_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "marker_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "marker_normal@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Assets.xcassets/marker_normal.imageset/marker_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RxSwiftCommunity/RxGoogleMaps/819e4801d05c18f562df56fd9d2ebedd52d0ad82/Example/Assets.xcassets/marker_normal.imageset/marker_normal@2x.png -------------------------------------------------------------------------------- /Example/Assets.xcassets/marker_normal.imageset/marker_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RxSwiftCommunity/RxGoogleMaps/819e4801d05c18f562df56fd9d2ebedd52d0ad82/Example/Assets.xcassets/marker_normal.imageset/marker_normal@3x.png -------------------------------------------------------------------------------- /Example/Assets.xcassets/marker_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "marker_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "marker_selected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Assets.xcassets/marker_selected.imageset/marker_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RxSwiftCommunity/RxGoogleMaps/819e4801d05c18f562df56fd9d2ebedd52d0ad82/Example/Assets.xcassets/marker_selected.imageset/marker_selected@2x.png -------------------------------------------------------------------------------- /Example/Assets.xcassets/marker_selected.imageset/marker_selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RxSwiftCommunity/RxGoogleMaps/819e4801d05c18f562df56fd9d2ebedd52d0ad82/Example/Assets.xcassets/marker_selected.imageset/marker_selected@3x.png -------------------------------------------------------------------------------- /Example/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 34 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 2.1.0 19 | CFBundleVersion 20 | 2.1.0 21 | LSRequiresIPhoneOS 22 | 23 | NSLocationWhenInUseUsageDescription 24 | App needs Locations service when in use 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Example/ViewController.swift: -------------------------------------------------------------------------------- 1 | // Copyright (c) RxSwiftCommunity 2 | 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | import UIKit 22 | import RxSwift 23 | import GoogleMaps 24 | import RxGoogleMaps 25 | 26 | class ViewController: UIViewController { 27 | 28 | @IBOutlet weak var mapView: GMSMapView! 29 | @IBOutlet weak var actionButton0: UIButton! 30 | @IBOutlet weak var actionButton1: UIButton! 31 | 32 | let disposeBag = DisposeBag() 33 | let locationManager = CLLocationManager() 34 | 35 | override func viewDidLoad() { 36 | super.viewDidLoad() 37 | 38 | mapView.settings.myLocationButton = true 39 | 40 | let startLocationManager = mapView.rx.didTapMyLocationButton.take(1).publish() 41 | _ = startLocationManager.subscribe({ [weak self] _ in self?.locationManager.requestWhenInUseAuthorization() }) 42 | _ = startLocationManager.map { _ in true }.bind(to: mapView.rx.myLocationEnabled) 43 | startLocationManager.connect().disposed(by: disposeBag) 44 | 45 | mapView.rx.handleTapMarker { marker in 46 | print("Handle tap marker: \(marker.title ?? "") (\(marker.position.latitude), \(marker.position.longitude))") 47 | return false 48 | } 49 | 50 | mapView.rx.handleTapOverlay { overlay in 51 | print("Handle tap overlay: \(overlay.title ?? "")") 52 | } 53 | 54 | mapView.rx.handleMarkerInfoWindow { marker in 55 | let label = UILabel(frame: CGRect(x: 0, y: 0, width: 180, height: 60)) 56 | label.textAlignment = .center 57 | label.textColor = UIColor.brown 58 | label.font = UIFont.boldSystemFont(ofSize: 16) 59 | label.backgroundColor = UIColor.yellow 60 | label.text = marker.title 61 | return label 62 | } 63 | 64 | mapView.rx.handleMarkerInfoContents { marker in 65 | let label = UILabel(frame: CGRect(x: 0, y: 0, width: 300, height: 100)) 66 | label.textAlignment = .center 67 | label.textColor = UIColor.green 68 | label.font = UIFont.boldSystemFont(ofSize: 16) 69 | label.backgroundColor = UIColor.yellow 70 | label.text = "Picles" 71 | return label 72 | } 73 | 74 | mapView.rx.handleTapMyLocationButton { 75 | print("Handle my location button") 76 | return false 77 | } 78 | 79 | mapView.rx.willMove.asDriver() 80 | .drive(onNext: { _ in 81 | print("Will move") }) 82 | .disposed(by: disposeBag) 83 | 84 | mapView.rx.didChange.asDriver() 85 | .drive(onNext: { 86 | print("Did change position: \($0)") }) 87 | .disposed(by: disposeBag) 88 | 89 | mapView.rx.idleAt 90 | .subscribe(onNext: { print("Idle at coordinate: \($0)") }) 91 | .disposed(by: disposeBag) 92 | 93 | mapView.rx.didTapAt.asDriver() 94 | .drive(onNext: { print("Did tap at coordinate: \($0)") }) 95 | .disposed(by: disposeBag) 96 | 97 | mapView.rx.didLongPressAt.asDriver() 98 | .drive(onNext: { print("Did long press at coordinate: \($0)") }) 99 | .disposed(by: disposeBag) 100 | 101 | mapView.rx.didTapInfoWindowOf.asDriver() 102 | .drive(onNext: { print("Did tap info window of marker: \($0)") }) 103 | .disposed(by: disposeBag) 104 | 105 | mapView.rx.didLongPressInfoWindowOf.asDriver() 106 | .drive(onNext: { print("Did long press info window of marker: \($0)") }) 107 | .disposed(by: disposeBag) 108 | 109 | mapView.rx.didTapAtPoi.asDriver() 110 | .drive(onNext: { (placeID, name, coordinate) in 111 | print("Did tap POI: [\(placeID)] \(name) (\(coordinate.latitude), \(coordinate.longitude))") 112 | }) 113 | .disposed(by: disposeBag) 114 | 115 | mapView.rx.didTapMyLocationButton.asDriver() 116 | .drive(onNext: { _ in print("Did tap my location button") }) 117 | .disposed(by: disposeBag) 118 | 119 | mapView.rx.didCloseInfoWindowOfMarker.asDriver() 120 | .drive(onNext: { print("Did close info window of marker: \($0)") }) 121 | .disposed(by: disposeBag) 122 | 123 | mapView.rx.didBeginDragging.asDriver() 124 | .drive(onNext: { print("Did begin dragging marker: \($0)") }) 125 | .disposed(by: disposeBag) 126 | 127 | mapView.rx.didEndDragging.asDriver() 128 | .drive(onNext: { print("Did end dragging marker: \($0)") }) 129 | .disposed(by: disposeBag) 130 | 131 | mapView.rx.didDrag.asDriver() 132 | .drive(onNext: { print("Did drag marker: \($0)") }) 133 | .disposed(by: disposeBag) 134 | 135 | mapView.rx.didStartTileRendering 136 | .subscribe(onNext: { print("Did start tile rendering") }) 137 | .disposed(by: disposeBag) 138 | 139 | mapView.rx.didFinishTileRendering 140 | .subscribe(onNext: { print("Did finish tile rendering") }) 141 | .disposed(by: disposeBag) 142 | 143 | mapView.rx.snapshotReady 144 | .subscribe(onNext: { print("Snapshot ready") }) 145 | .disposed(by: disposeBag) 146 | 147 | mapView.rx.myLocation 148 | .subscribe(onNext: { location in 149 | if let l = location { 150 | print("My location: (\(l.coordinate.latitude), \(l.coordinate.longitude))") 151 | } else { 152 | print("My location: nil") 153 | } 154 | }) 155 | .disposed(by: disposeBag) 156 | 157 | mapView.rx.selectedMarker.asDriver() 158 | .drive(onNext: { selected in 159 | if let marker = selected { 160 | print("Selected marker: \(marker.title ?? "") (\(marker.position.latitude), \(marker.position.longitude))") 161 | } else { 162 | print("Selected marker: nil") 163 | } 164 | }) 165 | .disposed(by: disposeBag) 166 | 167 | do { 168 | let s0 = mapView.rx.selectedMarker.asObservable() 169 | let s1 = s0.skip(1) 170 | 171 | Observable.zip(s0, s1) { ($0, $1) } 172 | .subscribe(onNext: { (prev, cur) in 173 | if let marker = prev { 174 | marker.icon = #imageLiteral(resourceName: "marker_normal") 175 | } 176 | if let marker = cur { 177 | marker.icon = #imageLiteral(resourceName: "marker_selected") 178 | } 179 | }) 180 | .disposed(by: disposeBag) 181 | } 182 | 183 | } 184 | 185 | override func viewDidAppear(_ animated: Bool) { 186 | super.viewDidAppear(animated) 187 | 188 | let center = CLLocationCoordinate2D(latitude: -23.565314, longitude: -46.651857) 189 | let place0 = CLLocationCoordinate2D(latitude: -23.549932, longitude: -46.653737) 190 | 191 | let camera = GMSCameraPosition.camera(withLatitude: center.latitude, longitude: center.longitude, zoom: 14, bearing: 30, viewingAngle: 0) 192 | mapView.camera = camera 193 | 194 | do { 195 | let marker = GMSMarker(position: center) 196 | marker.title = "Hello, RxSwift" 197 | marker.isDraggable = true 198 | marker.icon = #imageLiteral(resourceName: "marker_normal") 199 | marker.map = mapView 200 | 201 | } 202 | 203 | do { 204 | let marker = GMSMarker(position: place0) 205 | marker.title = "Hello, GoogleMaps" 206 | marker.isDraggable = true 207 | marker.icon = #imageLiteral(resourceName: "marker_normal") 208 | marker.map = mapView 209 | 210 | //Rotate marker upsidedown 211 | actionButton0.rx.tap.map{ 180.0 } 212 | .bind(to: marker.rx.rotation.asObserver()) 213 | .disposed(by: disposeBag) 214 | 215 | //Rotate marker back 216 | actionButton1.rx.tap.map{ 0 } 217 | .bind(to: marker.rx.rotation.asObserver()) 218 | .disposed(by: disposeBag) 219 | } 220 | 221 | do { 222 | let circle = GMSCircle() 223 | circle.title = "Circle" 224 | circle.radius = 1000 225 | circle.isTappable = true 226 | circle.position = center 227 | circle.fillColor = UIColor.green.withAlphaComponent(0.3) 228 | circle.strokeColor = UIColor.green.withAlphaComponent(0.8) 229 | circle.strokeWidth = 4 230 | circle.map = mapView 231 | 232 | //Change circle color to red 233 | actionButton0.rx.tap.map{ UIColor.red } 234 | .bind(to: circle.rx.fillColor.asObserver()) 235 | .disposed(by: disposeBag) 236 | 237 | //Change circle color to red 238 | actionButton1.rx.tap.map{ UIColor.green } 239 | .bind(to: circle.rx.fillColor.asObserver()) 240 | .disposed(by: disposeBag) 241 | 242 | } 243 | 244 | do { 245 | //Enable traffic 246 | actionButton0.rx.tap.map { true } 247 | .bind(to: mapView.rx.trafficEnabled.asObserver()) 248 | .disposed(by: disposeBag) 249 | 250 | //Disable traffic 251 | actionButton1.rx.tap.map { false } 252 | .bind(to: mapView.rx.trafficEnabled.asObserver()) 253 | .disposed(by: disposeBag) 254 | 255 | //Animated Zoom 256 | actionButton0.rx.tap.map { 14 } 257 | .bind(to: mapView.rx.zoomToAnimate) 258 | .disposed(by: disposeBag) 259 | 260 | //Move to camera position 261 | actionButton1.rx.tap 262 | .map { GMSCameraPosition.camera(withLatitude: place0.latitude, longitude: place0.longitude, zoom: 8, bearing: 10, viewingAngle: 30) } 263 | .bind(to: mapView.rx.cameraToAnimate) 264 | .disposed(by: disposeBag) 265 | 266 | //Enable zoom gesture 267 | actionButton0.rx.tap.map { true } 268 | .bind(to: mapView.rx.zoomGesturesEnabled) 269 | .disposed(by: disposeBag) 270 | 271 | //Disable zoom gesture 272 | actionButton1.rx.tap.map { false } 273 | .bind(to: mapView.rx.zoomGesturesEnabled) 274 | .disposed(by: disposeBag) 275 | 276 | } 277 | } 278 | 279 | } 280 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) RxSwiftCommunity 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "GoogleMaps", 6 | "repositoryURL": "https://github.com/gomore/GoogleMaps-SPM.git", 7 | "state": { 8 | "branch": null, 9 | "revision": "50acb0007868133ef9039c67ac04f6e4003c2b12", 10 | "version": "7.3.0" 11 | } 12 | }, 13 | { 14 | "package": "RxSwift", 15 | "repositoryURL": "https://github.com/ReactiveX/RxSwift.git", 16 | "state": { 17 | "branch": null, 18 | "revision": "9dcaa4b333db437b0fbfaf453fad29069044a8b4", 19 | "version": "6.6.0" 20 | } 21 | } 22 | ] 23 | }, 24 | "version": 1 25 | } 26 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.1 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "RxGoogleMaps", 7 | products: [ 8 | .library(name: "RxGoogleMaps", targets: ["RxGoogleMaps"]), 9 | ], 10 | dependencies: [ 11 | .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "6.6.0")), 12 | .package(url: "https://github.com/gomore/GoogleMaps-SPM.git", .upToNextMajor(from: "7.3.0")), 13 | ], 14 | targets: [ 15 | .target(name: "RxGoogleMaps", dependencies: ["RxSwift", "RxCocoa", "GoogleMaps", "GoogleMapsCore", "GoogleMapsBase"]), 16 | ] 17 | ) -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '14.0' 2 | source 'https://github.com/CocoaPods/Specs.git' 3 | 4 | target 'Example' do 5 | pod 'RxGoogleMaps', :path => './' 6 | end 7 | 8 | post_install do |installer| 9 | installer.pods_project.targets.each do |target| 10 | target.build_configurations.each do |config| 11 | config.build_settings['SWIFT_VERSION'] = '5.0' 12 | config.build_settings['ENABLE_USER_SCRIPT_SANDBOXING'] = 'NO' 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - GoogleMaps (7.3.0): 3 | - GoogleMaps/Maps (= 7.3.0) 4 | - GoogleMaps/Base (7.3.0) 5 | - GoogleMaps/Maps (7.3.0): 6 | - GoogleMaps/Base 7 | - RxCocoa (6.5.0): 8 | - RxRelay (= 6.5.0) 9 | - RxSwift (= 6.5.0) 10 | - RxGoogleMaps (7.3.0): 11 | - GoogleMaps (~> 7.3.0) 12 | - RxCocoa (~> 6) 13 | - RxSwift (~> 6) 14 | - RxRelay (6.5.0): 15 | - RxSwift (= 6.5.0) 16 | - RxSwift (6.5.0) 17 | 18 | DEPENDENCIES: 19 | - RxGoogleMaps (from `./`) 20 | 21 | SPEC REPOS: 22 | https://github.com/CocoaPods/Specs.git: 23 | - GoogleMaps 24 | - RxCocoa 25 | - RxRelay 26 | - RxSwift 27 | 28 | EXTERNAL SOURCES: 29 | RxGoogleMaps: 30 | :path: "./" 31 | 32 | SPEC CHECKSUMS: 33 | GoogleMaps: a146f275ee429d14822178c7a841c03366ec92a1 34 | RxCocoa: 94f817b71c07517321eb4f9ad299112ca8af743b 35 | RxGoogleMaps: 62355f79874c54bb5c3af1a31c4f1d5502962fdb 36 | RxRelay: 1de1523e604c72b6c68feadedd1af3b1b4d0ecbd 37 | RxSwift: 5710a9e6b17f3c3d6e40d6e559b9fa1e813b2ef8 38 | 39 | PODFILE CHECKSUM: b8fbb96e50fe23f05387790effa2fcc475d7bf39 40 | 41 | COCOAPODS: 1.12.1 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RxGoogleMaps 2 | [![CircleCI](https://img.shields.io/circleci/project/github/RxSwiftCommunity/RxGoogleMaps/master.svg)](https://circleci.com/gh/RxSwiftCommunity/RxGoogleMaps/tree/master) 3 | ![Swift](https://img.shields.io/badge/Swift-5.0-orange.svg) 4 | [![Version](https://img.shields.io/cocoapods/v/RxGoogleMaps.svg?style=flat)](http://cocoapods.org/pods/RxGoogleMaps) 5 | [![License](https://img.shields.io/cocoapods/l/RxGoogleMaps.svg?style=flat)](http://cocoapods.org/pods/RxGoogleMaps) 6 | [![Platform](https://img.shields.io/cocoapods/p/RxGoogleMaps.svg?style=flat)](http://cocoapods.org/pods/RxGoogleMaps) 7 | 8 | 9 | RxGoogleMaps is a [RxSwift](https://github.com/ReactiveX/RxSwift) wrapper for [GoogleMaps](https://developers.google.com/maps/documentation/ios-sdk/). 10 | 11 | ## Example Usages 12 | 13 | ### Setup GoogleMaps 14 | ```swift 15 | // Setup API Key 16 | GMSServices.provideAPIKey("Your-API-Key") 17 | ``` 18 | 19 | 20 | ```swift 21 | // Setup GMSMapview from Interface Builder 22 | @IBOutlet weak var mapView: GMSMapView! 23 | ``` 24 | or 25 | ```swift 26 | // Setup GMSMapview 27 | let mapView = GMSMapView(frame: self.view.bounds) 28 | self.view.addSubview(mapView) 29 | ``` 30 | 31 | ### Observing properties 32 | ```swift 33 | // Camera position 34 | 35 | mapView.rx.didChange.asDriver() 36 | .drive(onNext: { print("Did change position: \($0)") }) 37 | .disposed(by: disposeBag) 38 | 39 | // Marker tapped 40 | 41 | mapView.rx.didTapAt.asDriver() 42 | .drive(onNext: { print("Did tap at coordinate: \($0)") }) 43 | .disposed(by: disposeBag) 44 | 45 | // Location update 46 | 47 | mapView.rx.myLocation 48 | .subscribe(onNext: { location in 49 | if let l = location { 50 | print("My location: (\(l.coordinate.latitude), \(l.coordinate.longitude))") 51 | } else { 52 | print("My location: nil") 53 | } 54 | }) 55 | .disposed(by: disposeBag) 56 | 57 | ``` 58 | 59 | ### Binding properties 60 | ```Swift 61 | // Properties 62 | 63 | button.rx.tap 64 | .map { false } 65 | .bind(to: mapView.rx.trafficEnabled.asObserver()) 66 | .disposed(by: disposeBag) 67 | 68 | // Camera animations 69 | 70 | button.rx.tap 71 | .map { 14 } 72 | .bind(to: mapView.rx.zoomToAnimate) 73 | .disposed(by: disposeBag) 74 | 75 | button.rx.tap 76 | .map { GMSCameraPosition.camera(withLatitude: latitude, longitude: longitude, zoom: 8, bearing: 10, viewingAngle: 30) } 77 | .bind(to: mapView.rx.cameraToAnimate) 78 | .disposed(by: disposeBag) 79 | 80 | // Selected marker 81 | 82 | button.rx.tap 83 | .map { myMarker } 84 | .bind(to: mapView.rx.selectedMarker.asObserver()) 85 | .disposed(by: disposeBag) 86 | 87 | // GMSMarker or GMSOverlay properties 88 | 89 | button.rx.tap 90 | .map{ 180.0 } 91 | .bind(to: marker.rx.rotation.asObserver()) 92 | .disposed(by: disposeBag) 93 | 94 | button.rx.tap 95 | .map{ UIColor.red } 96 | .bind(to: circle.rx.fillColor.asObserver()) 97 | .disposed(by: disposeBag) 98 | 99 | ``` 100 | 101 | ### Delegates which have a return value 102 | ```Swift 103 | // func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool 104 | 105 | mapView.rx.handleTapMarker { false } 106 | 107 | // func mapView(_ mapView: GMSMapView, markerInfoWindow marker: GMSMarker) -> UIView? 108 | 109 | mapView.rx.handleMarkerInfoWindow { marker in 110 | let label = UILabel(frame: CGRect(x: 0, y: 0, width: 180, height: 60)) 111 | label.textAlignment = .center 112 | label.textColor = UIColor.brown 113 | label.font = UIFont.boldSystemFont(ofSize: 16) 114 | label.backgroundColor = UIColor.yellow 115 | label.text = marker.title 116 | return label 117 | } 118 | 119 | ``` 120 | 121 | *Note:* More examples can be found at the example project from this repo!. 122 | 123 | ## Installation 124 | 125 | ### Swift Package Manager 126 | 127 | Add as a dependecy to your Swift Package 128 | 129 | ```swift 130 | dependencies: [ 131 | .package(url: "https://github.com/RxSwiftCommunity/RxGoogleMaps.git", branch: "master") 132 | ] 133 | ``` 134 | 135 | ### CocoaPods 136 | 137 | *Note:* Due to the fact Google Maps is delivered as a static library, you must have CocoaPods 1.4.0 installed to install this library. 138 | 139 | 140 | - Add to your `Podfile`: 141 | 142 | ```ruby 143 | pod 'RxGoogleMaps' 144 | ``` 145 | 146 | Than run `pod install`, and you should be good to go! 147 | 148 | ## Example Project 149 | 150 | 1. Get your own API Key a key at https://developers.google.com/maps/documentation/ios-sdk/ 151 | 2. Open the example project and set your API Key in AppDelegate 152 | 153 | ## Requirements 154 | 155 | - Swift 5.0 156 | - [RxSwift](https://github.com/ReactiveX/RxSwift) >= 6.0 157 | - [RxCocoa](https://github.com/ReactiveX/RxSwift) >= 6.0 158 | 159 | ## License 160 | 161 | MIT 162 | -------------------------------------------------------------------------------- /RxGoogleMaps-iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.0.1 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /RxGoogleMaps-iOS/RxGoogleMaps-iOS.h: -------------------------------------------------------------------------------- 1 | // 2 | // RxGoogleMaps-iOS.h 3 | // RxGoogleMaps-iOS 4 | // 5 | // Created by kyamada on 2017/05/02. 6 | // Copyright © 2017年 Gen X Hippies Company. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for RxGoogleMaps-iOS. 12 | FOUNDATION_EXPORT double RxGoogleMaps_iOSVersionNumber; 13 | 14 | //! Project version string for RxGoogleMaps-iOS. 15 | FOUNDATION_EXPORT const unsigned char RxGoogleMaps_iOSVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /RxGoogleMaps.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "RxGoogleMaps" 3 | s.version = "7.3.0" 4 | s.summary = "RxSwift reactive wrapper for GoogleMaps SDK." 5 | s.homepage = "https://github.com/RxSwiftCommunity/RxGoogleMaps" 6 | s.license = 'MIT' 7 | s.author = { "RxSwift Community" => "community@rxswift.org" } 8 | s.platform = :ios, "14.0" 9 | s.source = { :git => "https://github.com/RxSwiftCommunity/RxGoogleMaps.git", :tag => s.version.to_s } 10 | s.requires_arc = true 11 | s.ios.deployment_target = '14.0' 12 | s.source_files = 'Sources/RxGoogleMaps/*.swift' 13 | 14 | s.static_framework = true 15 | s.dependency 'RxSwift', '~> 6' 16 | s.dependency 'RxCocoa', '~> 6' 17 | s.dependency 'GoogleMaps', '~> 7.3.0' 18 | end 19 | -------------------------------------------------------------------------------- /RxGoogleMaps.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 090646D61EB8C350007F53BA /* RxGoogleMaps-iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 090646D41EB8C350007F53BA /* RxGoogleMaps-iOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 4F0951D5D1A0A6BCFF5F114B /* libPods-Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A92896541D9A368FBDD85BED /* libPods-Example.a */; }; 12 | A90F9CBC1DAABB5600A3461E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A90F9CBB1DAABB5600A3461E /* AppDelegate.swift */; }; 13 | A90F9CBE1DAABB5600A3461E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A90F9CBD1DAABB5600A3461E /* ViewController.swift */; }; 14 | A90F9CC11DAABB5600A3461E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A90F9CBF1DAABB5600A3461E /* Main.storyboard */; }; 15 | A90F9CC31DAABB5600A3461E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A90F9CC21DAABB5600A3461E /* Assets.xcassets */; }; 16 | A90F9CC61DAABB5600A3461E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A90F9CC41DAABB5600A3461E /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 090646D21EB8C350007F53BA /* RxGoogleMaps.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxGoogleMaps.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 090646D41EB8C350007F53BA /* RxGoogleMaps-iOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RxGoogleMaps-iOS.h"; sourceTree = ""; }; 22 | 090646D51EB8C350007F53BA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 23 | 096B037D1EBD1F00008387E2 /* RxCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxCocoa.framework; path = Carthage/Build/iOS/RxCocoa.framework; sourceTree = ""; }; 24 | 096B037F1EBD1F16008387E2 /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxSwift.framework; path = Carthage/Build/iOS/RxSwift.framework; sourceTree = ""; }; 25 | 259DDC520C5E3D8FE4BA82D7 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; 26 | 53D0DB689702006F776EF1D4 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; 27 | A90F9CB91DAABB5600A3461E /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | A90F9CBB1DAABB5600A3461E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 29 | A90F9CBD1DAABB5600A3461E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 30 | A90F9CC01DAABB5600A3461E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 31 | A90F9CC21DAABB5600A3461E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 32 | A90F9CC51DAABB5600A3461E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 33 | A90F9CC71DAABB5600A3461E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | A92896541D9A368FBDD85BED /* libPods-Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | E58C77E01FABF78500521822 /* libRxGoogleMaps.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRxGoogleMaps.a; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | /* End PBXFileReference section */ 37 | 38 | /* Begin PBXFrameworksBuildPhase section */ 39 | 090646CE1EB8C350007F53BA /* Frameworks */ = { 40 | isa = PBXFrameworksBuildPhase; 41 | buildActionMask = 2147483647; 42 | files = ( 43 | ); 44 | runOnlyForDeploymentPostprocessing = 0; 45 | }; 46 | A90F9CB61DAABB5600A3461E /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | 4F0951D5D1A0A6BCFF5F114B /* libPods-Example.a in Frameworks */, 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | /* End PBXFrameworksBuildPhase section */ 55 | 56 | /* Begin PBXGroup section */ 57 | 090646B81EB8C1AE007F53BA /* Sources */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | ); 61 | path = Sources; 62 | sourceTree = ""; 63 | }; 64 | 090646D31EB8C350007F53BA /* RxGoogleMaps-iOS */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 090646D41EB8C350007F53BA /* RxGoogleMaps-iOS.h */, 68 | 090646D51EB8C350007F53BA /* Info.plist */, 69 | ); 70 | path = "RxGoogleMaps-iOS"; 71 | sourceTree = ""; 72 | }; 73 | 75B80F02794213887976E6AD /* Frameworks */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | E58C77E01FABF78500521822 /* libRxGoogleMaps.a */, 77 | 096B037F1EBD1F16008387E2 /* RxSwift.framework */, 78 | 096B037D1EBD1F00008387E2 /* RxCocoa.framework */, 79 | A92896541D9A368FBDD85BED /* libPods-Example.a */, 80 | ); 81 | name = Frameworks; 82 | sourceTree = ""; 83 | }; 84 | 9B7A7BF2C222C22118C2FAA0 /* Pods */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 53D0DB689702006F776EF1D4 /* Pods-Example.debug.xcconfig */, 88 | 259DDC520C5E3D8FE4BA82D7 /* Pods-Example.release.xcconfig */, 89 | ); 90 | name = Pods; 91 | sourceTree = ""; 92 | }; 93 | A90F9C911DAAB67100A3461E = { 94 | isa = PBXGroup; 95 | children = ( 96 | 090646B81EB8C1AE007F53BA /* Sources */, 97 | A90F9CBA1DAABB5600A3461E /* Example */, 98 | 090646D31EB8C350007F53BA /* RxGoogleMaps-iOS */, 99 | A90F9C9C1DAAB67100A3461E /* Products */, 100 | 9B7A7BF2C222C22118C2FAA0 /* Pods */, 101 | 75B80F02794213887976E6AD /* Frameworks */, 102 | ); 103 | sourceTree = ""; 104 | }; 105 | A90F9C9C1DAAB67100A3461E /* Products */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | A90F9CB91DAABB5600A3461E /* Example.app */, 109 | 090646D21EB8C350007F53BA /* RxGoogleMaps.framework */, 110 | ); 111 | name = Products; 112 | sourceTree = ""; 113 | }; 114 | A90F9CBA1DAABB5600A3461E /* Example */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | A90F9CBB1DAABB5600A3461E /* AppDelegate.swift */, 118 | A90F9CBD1DAABB5600A3461E /* ViewController.swift */, 119 | A90F9CBF1DAABB5600A3461E /* Main.storyboard */, 120 | A90F9CC21DAABB5600A3461E /* Assets.xcassets */, 121 | A90F9CC41DAABB5600A3461E /* LaunchScreen.storyboard */, 122 | A90F9CC71DAABB5600A3461E /* Info.plist */, 123 | ); 124 | path = Example; 125 | sourceTree = ""; 126 | }; 127 | /* End PBXGroup section */ 128 | 129 | /* Begin PBXHeadersBuildPhase section */ 130 | 090646CF1EB8C350007F53BA /* Headers */ = { 131 | isa = PBXHeadersBuildPhase; 132 | buildActionMask = 2147483647; 133 | files = ( 134 | 090646D61EB8C350007F53BA /* RxGoogleMaps-iOS.h in Headers */, 135 | ); 136 | runOnlyForDeploymentPostprocessing = 0; 137 | }; 138 | /* End PBXHeadersBuildPhase section */ 139 | 140 | /* Begin PBXNativeTarget section */ 141 | 090646D11EB8C350007F53BA /* RxGoogleMaps-iOS */ = { 142 | isa = PBXNativeTarget; 143 | buildConfigurationList = 090646D71EB8C350007F53BA /* Build configuration list for PBXNativeTarget "RxGoogleMaps-iOS" */; 144 | buildPhases = ( 145 | 090646CD1EB8C350007F53BA /* Sources */, 146 | 090646CE1EB8C350007F53BA /* Frameworks */, 147 | 090646CF1EB8C350007F53BA /* Headers */, 148 | 090646D01EB8C350007F53BA /* Resources */, 149 | ); 150 | buildRules = ( 151 | ); 152 | dependencies = ( 153 | ); 154 | name = "RxGoogleMaps-iOS"; 155 | productName = "RxGoogleMaps-iOS"; 156 | productReference = 090646D21EB8C350007F53BA /* RxGoogleMaps.framework */; 157 | productType = "com.apple.product-type.framework"; 158 | }; 159 | A90F9CB81DAABB5600A3461E /* Example */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = A90F9CD31DAABB5600A3461E /* Build configuration list for PBXNativeTarget "Example" */; 162 | buildPhases = ( 163 | E60D97708A067C5B28366CED /* [CP] Check Pods Manifest.lock */, 164 | A90F9CB51DAABB5600A3461E /* Sources */, 165 | A90F9CB61DAABB5600A3461E /* Frameworks */, 166 | A90F9CB71DAABB5600A3461E /* Resources */, 167 | 6B2BC5CA30B5D2E4A6CED63E /* [CP] Copy Pods Resources */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | ); 173 | name = Example; 174 | productName = Example; 175 | productReference = A90F9CB91DAABB5600A3461E /* Example.app */; 176 | productType = "com.apple.product-type.application"; 177 | }; 178 | /* End PBXNativeTarget section */ 179 | 180 | /* Begin PBXProject section */ 181 | A90F9C921DAAB67100A3461E /* Project object */ = { 182 | isa = PBXProject; 183 | attributes = { 184 | BuildIndependentTargetsInParallel = YES; 185 | LastSwiftUpdateCheck = 0800; 186 | LastUpgradeCheck = 1500; 187 | ORGANIZATIONNAME = "Gen X Hippies Company"; 188 | TargetAttributes = { 189 | 090646D11EB8C350007F53BA = { 190 | CreatedOnToolsVersion = 8.3.2; 191 | ProvisioningStyle = Automatic; 192 | }; 193 | A90F9CB81DAABB5600A3461E = { 194 | CreatedOnToolsVersion = 8.0; 195 | DevelopmentTeam = H7VM6ZW9AJ; 196 | LastSwiftMigration = 1000; 197 | ProvisioningStyle = Automatic; 198 | }; 199 | }; 200 | }; 201 | buildConfigurationList = A90F9C951DAAB67100A3461E /* Build configuration list for PBXProject "RxGoogleMaps" */; 202 | compatibilityVersion = "Xcode 3.2"; 203 | developmentRegion = en; 204 | hasScannedForEncodings = 0; 205 | knownRegions = ( 206 | en, 207 | Base, 208 | ); 209 | mainGroup = A90F9C911DAAB67100A3461E; 210 | productRefGroup = A90F9C9C1DAAB67100A3461E /* Products */; 211 | projectDirPath = ""; 212 | projectRoot = ""; 213 | targets = ( 214 | A90F9CB81DAABB5600A3461E /* Example */, 215 | 090646D11EB8C350007F53BA /* RxGoogleMaps-iOS */, 216 | ); 217 | }; 218 | /* End PBXProject section */ 219 | 220 | /* Begin PBXResourcesBuildPhase section */ 221 | 090646D01EB8C350007F53BA /* Resources */ = { 222 | isa = PBXResourcesBuildPhase; 223 | buildActionMask = 2147483647; 224 | files = ( 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | A90F9CB71DAABB5600A3461E /* Resources */ = { 229 | isa = PBXResourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | A90F9CC61DAABB5600A3461E /* LaunchScreen.storyboard in Resources */, 233 | A90F9CC31DAABB5600A3461E /* Assets.xcassets in Resources */, 234 | A90F9CC11DAABB5600A3461E /* Main.storyboard in Resources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXResourcesBuildPhase section */ 239 | 240 | /* Begin PBXShellScriptBuildPhase section */ 241 | 6B2BC5CA30B5D2E4A6CED63E /* [CP] Copy Pods Resources */ = { 242 | isa = PBXShellScriptBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | ); 246 | inputPaths = ( 247 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources.sh", 248 | "${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64/GoogleMaps.framework/Resources/GoogleMaps.bundle", 249 | "${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64_x86_64-simulator/GoogleMaps.framework/Resources/GoogleMaps.bundle", 250 | ); 251 | name = "[CP] Copy Pods Resources"; 252 | outputPaths = ( 253 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMaps.bundle", 254 | ); 255 | runOnlyForDeploymentPostprocessing = 0; 256 | shellPath = /bin/sh; 257 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n"; 258 | showEnvVarsInLog = 0; 259 | }; 260 | E60D97708A067C5B28366CED /* [CP] Check Pods Manifest.lock */ = { 261 | isa = PBXShellScriptBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | ); 265 | inputPaths = ( 266 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 267 | "${PODS_ROOT}/Manifest.lock", 268 | ); 269 | name = "[CP] Check Pods Manifest.lock"; 270 | outputPaths = ( 271 | "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | shellPath = /bin/sh; 275 | 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"; 276 | showEnvVarsInLog = 0; 277 | }; 278 | /* End PBXShellScriptBuildPhase section */ 279 | 280 | /* Begin PBXSourcesBuildPhase section */ 281 | 090646CD1EB8C350007F53BA /* Sources */ = { 282 | isa = PBXSourcesBuildPhase; 283 | buildActionMask = 2147483647; 284 | files = ( 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | }; 288 | A90F9CB51DAABB5600A3461E /* Sources */ = { 289 | isa = PBXSourcesBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | A90F9CBE1DAABB5600A3461E /* ViewController.swift in Sources */, 293 | A90F9CBC1DAABB5600A3461E /* AppDelegate.swift in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | /* End PBXSourcesBuildPhase section */ 298 | 299 | /* Begin PBXVariantGroup section */ 300 | A90F9CBF1DAABB5600A3461E /* Main.storyboard */ = { 301 | isa = PBXVariantGroup; 302 | children = ( 303 | A90F9CC01DAABB5600A3461E /* Base */, 304 | ); 305 | name = Main.storyboard; 306 | sourceTree = ""; 307 | }; 308 | A90F9CC41DAABB5600A3461E /* LaunchScreen.storyboard */ = { 309 | isa = PBXVariantGroup; 310 | children = ( 311 | A90F9CC51DAABB5600A3461E /* Base */, 312 | ); 313 | name = LaunchScreen.storyboard; 314 | sourceTree = ""; 315 | }; 316 | /* End PBXVariantGroup section */ 317 | 318 | /* Begin XCBuildConfiguration section */ 319 | 090646D81EB8C350007F53BA /* Debug */ = { 320 | isa = XCBuildConfiguration; 321 | buildSettings = { 322 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 323 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 324 | CODE_SIGN_IDENTITY = ""; 325 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 326 | DEFINES_MODULE = YES; 327 | DEVELOPMENT_TEAM = ""; 328 | DYLIB_COMPATIBILITY_VERSION = 1; 329 | DYLIB_CURRENT_VERSION = 1; 330 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 331 | ENABLE_MODULE_VERIFIER = YES; 332 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 333 | INFOPLIST_FILE = "RxGoogleMaps-iOS/Info.plist"; 334 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 335 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 336 | LD_RUNPATH_SEARCH_PATHS = ( 337 | "$(inherited)", 338 | "@executable_path/Frameworks", 339 | "@loader_path/Frameworks", 340 | ); 341 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; 342 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; 343 | PRODUCT_BUNDLE_IDENTIFIER = "com.oo-v.RxGoogleMaps"; 344 | PRODUCT_NAME = RxGoogleMaps; 345 | SKIP_INSTALL = YES; 346 | }; 347 | name = Debug; 348 | }; 349 | 090646D91EB8C350007F53BA /* Release */ = { 350 | isa = XCBuildConfiguration; 351 | buildSettings = { 352 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 353 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 354 | CODE_SIGN_IDENTITY = ""; 355 | DEFINES_MODULE = YES; 356 | DEVELOPMENT_TEAM = ""; 357 | DYLIB_COMPATIBILITY_VERSION = 1; 358 | DYLIB_CURRENT_VERSION = 1; 359 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 360 | ENABLE_MODULE_VERIFIER = YES; 361 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 362 | INFOPLIST_FILE = "RxGoogleMaps-iOS/Info.plist"; 363 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 364 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 365 | LD_RUNPATH_SEARCH_PATHS = ( 366 | "$(inherited)", 367 | "@executable_path/Frameworks", 368 | "@loader_path/Frameworks", 369 | ); 370 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; 371 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; 372 | PRODUCT_BUNDLE_IDENTIFIER = "com.oo-v.RxGoogleMaps"; 373 | PRODUCT_NAME = RxGoogleMaps; 374 | SKIP_INSTALL = YES; 375 | }; 376 | name = Release; 377 | }; 378 | A90F9CAD1DAAB67100A3461E /* Debug */ = { 379 | isa = XCBuildConfiguration; 380 | buildSettings = { 381 | ALWAYS_SEARCH_USER_PATHS = NO; 382 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 383 | CLANG_ANALYZER_NONNULL = YES; 384 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 385 | CLANG_CXX_LIBRARY = "libc++"; 386 | CLANG_ENABLE_MODULES = YES; 387 | CLANG_ENABLE_OBJC_ARC = YES; 388 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 389 | CLANG_WARN_BOOL_CONVERSION = YES; 390 | CLANG_WARN_COMMA = YES; 391 | CLANG_WARN_CONSTANT_CONVERSION = YES; 392 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 393 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 394 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 395 | CLANG_WARN_EMPTY_BODY = YES; 396 | CLANG_WARN_ENUM_CONVERSION = YES; 397 | CLANG_WARN_INFINITE_RECURSION = YES; 398 | CLANG_WARN_INT_CONVERSION = YES; 399 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 400 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 401 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 402 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 403 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 404 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 405 | CLANG_WARN_STRICT_PROTOTYPES = YES; 406 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 407 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 408 | CLANG_WARN_UNREACHABLE_CODE = YES; 409 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 410 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 411 | COPY_PHASE_STRIP = NO; 412 | CURRENT_PROJECT_VERSION = 1; 413 | DEBUG_INFORMATION_FORMAT = dwarf; 414 | ENABLE_STRICT_OBJC_MSGSEND = YES; 415 | ENABLE_TESTABILITY = YES; 416 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 417 | GCC_C_LANGUAGE_STANDARD = gnu99; 418 | GCC_DYNAMIC_NO_PIC = NO; 419 | GCC_NO_COMMON_BLOCKS = YES; 420 | GCC_OPTIMIZATION_LEVEL = 0; 421 | GCC_PREPROCESSOR_DEFINITIONS = ( 422 | "DEBUG=1", 423 | "$(inherited)", 424 | ); 425 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 426 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 427 | GCC_WARN_UNDECLARED_SELECTOR = YES; 428 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 429 | GCC_WARN_UNUSED_FUNCTION = YES; 430 | GCC_WARN_UNUSED_VARIABLE = YES; 431 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 432 | MTL_ENABLE_DEBUG_INFO = YES; 433 | ONLY_ACTIVE_ARCH = YES; 434 | SDKROOT = iphoneos; 435 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 436 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 437 | SWIFT_VERSION = 5.0; 438 | TARGETED_DEVICE_FAMILY = "1,2"; 439 | VERSIONING_SYSTEM = "apple-generic"; 440 | VERSION_INFO_PREFIX = ""; 441 | }; 442 | name = Debug; 443 | }; 444 | A90F9CAE1DAAB67100A3461E /* Release */ = { 445 | isa = XCBuildConfiguration; 446 | buildSettings = { 447 | ALWAYS_SEARCH_USER_PATHS = NO; 448 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 449 | CLANG_ANALYZER_NONNULL = YES; 450 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 451 | CLANG_CXX_LIBRARY = "libc++"; 452 | CLANG_ENABLE_MODULES = YES; 453 | CLANG_ENABLE_OBJC_ARC = YES; 454 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 455 | CLANG_WARN_BOOL_CONVERSION = YES; 456 | CLANG_WARN_COMMA = YES; 457 | CLANG_WARN_CONSTANT_CONVERSION = YES; 458 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 459 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 460 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 461 | CLANG_WARN_EMPTY_BODY = YES; 462 | CLANG_WARN_ENUM_CONVERSION = YES; 463 | CLANG_WARN_INFINITE_RECURSION = YES; 464 | CLANG_WARN_INT_CONVERSION = YES; 465 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 466 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 467 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 468 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 469 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 470 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 471 | CLANG_WARN_STRICT_PROTOTYPES = YES; 472 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 473 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 474 | CLANG_WARN_UNREACHABLE_CODE = YES; 475 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 476 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 477 | COPY_PHASE_STRIP = NO; 478 | CURRENT_PROJECT_VERSION = 1; 479 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 480 | ENABLE_NS_ASSERTIONS = NO; 481 | ENABLE_STRICT_OBJC_MSGSEND = YES; 482 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 483 | GCC_C_LANGUAGE_STANDARD = gnu99; 484 | GCC_NO_COMMON_BLOCKS = YES; 485 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 486 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 487 | GCC_WARN_UNDECLARED_SELECTOR = YES; 488 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 489 | GCC_WARN_UNUSED_FUNCTION = YES; 490 | GCC_WARN_UNUSED_VARIABLE = YES; 491 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 492 | MTL_ENABLE_DEBUG_INFO = NO; 493 | SDKROOT = iphoneos; 494 | SWIFT_COMPILATION_MODE = wholemodule; 495 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 496 | SWIFT_VERSION = 5.0; 497 | TARGETED_DEVICE_FAMILY = "1,2"; 498 | VALIDATE_PRODUCT = YES; 499 | VERSIONING_SYSTEM = "apple-generic"; 500 | VERSION_INFO_PREFIX = ""; 501 | }; 502 | name = Release; 503 | }; 504 | A90F9CD41DAABB5600A3461E /* Debug */ = { 505 | isa = XCBuildConfiguration; 506 | baseConfigurationReference = 53D0DB689702006F776EF1D4 /* Pods-Example.debug.xcconfig */; 507 | buildSettings = { 508 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 509 | DEVELOPMENT_TEAM = H7VM6ZW9AJ; 510 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 511 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 512 | INFOPLIST_FILE = Example/Info.plist; 513 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 514 | LD_RUNPATH_SEARCH_PATHS = ( 515 | "$(inherited)", 516 | "@executable_path/Frameworks", 517 | ); 518 | PRODUCT_BUNDLE_IDENTIFIER = "com.oo-v.RxGoogleMaps.Example"; 519 | PRODUCT_NAME = "$(TARGET_NAME)"; 520 | }; 521 | name = Debug; 522 | }; 523 | A90F9CD51DAABB5600A3461E /* Release */ = { 524 | isa = XCBuildConfiguration; 525 | baseConfigurationReference = 259DDC520C5E3D8FE4BA82D7 /* Pods-Example.release.xcconfig */; 526 | buildSettings = { 527 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 528 | DEVELOPMENT_TEAM = H7VM6ZW9AJ; 529 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 530 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 531 | INFOPLIST_FILE = Example/Info.plist; 532 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 533 | LD_RUNPATH_SEARCH_PATHS = ( 534 | "$(inherited)", 535 | "@executable_path/Frameworks", 536 | ); 537 | PRODUCT_BUNDLE_IDENTIFIER = "com.oo-v.RxGoogleMaps.Example"; 538 | PRODUCT_NAME = "$(TARGET_NAME)"; 539 | }; 540 | name = Release; 541 | }; 542 | /* End XCBuildConfiguration section */ 543 | 544 | /* Begin XCConfigurationList section */ 545 | 090646D71EB8C350007F53BA /* Build configuration list for PBXNativeTarget "RxGoogleMaps-iOS" */ = { 546 | isa = XCConfigurationList; 547 | buildConfigurations = ( 548 | 090646D81EB8C350007F53BA /* Debug */, 549 | 090646D91EB8C350007F53BA /* Release */, 550 | ); 551 | defaultConfigurationIsVisible = 0; 552 | defaultConfigurationName = Release; 553 | }; 554 | A90F9C951DAAB67100A3461E /* Build configuration list for PBXProject "RxGoogleMaps" */ = { 555 | isa = XCConfigurationList; 556 | buildConfigurations = ( 557 | A90F9CAD1DAAB67100A3461E /* Debug */, 558 | A90F9CAE1DAAB67100A3461E /* Release */, 559 | ); 560 | defaultConfigurationIsVisible = 0; 561 | defaultConfigurationName = Release; 562 | }; 563 | A90F9CD31DAABB5600A3461E /* Build configuration list for PBXNativeTarget "Example" */ = { 564 | isa = XCConfigurationList; 565 | buildConfigurations = ( 566 | A90F9CD41DAABB5600A3461E /* Debug */, 567 | A90F9CD51DAABB5600A3461E /* Release */, 568 | ); 569 | defaultConfigurationIsVisible = 0; 570 | defaultConfigurationName = Release; 571 | }; 572 | /* End XCConfigurationList section */ 573 | }; 574 | rootObject = A90F9C921DAAB67100A3461E /* Project object */; 575 | } 576 | -------------------------------------------------------------------------------- /RxGoogleMaps.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RxGoogleMaps.xcodeproj/xcshareddata/xcschemes/RxGoogleMaps-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /RxGoogleMaps.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /RxGoogleMaps.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /RxGoogleMaps/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /RxGoogleMaps/RxGoogleMaps.h: -------------------------------------------------------------------------------- 1 | // 2 | // RxGoogleMaps.h 3 | // RxGoogleMaps 4 | // 5 | // Created by Yongha Yoo (inkyfox) on 2016. 10. 10.. 6 | // Copyright © 2016년 Gen X Hippies Company. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for RxGoogleMaps. 12 | FOUNDATION_EXPORT double RxGoogleMapsVersionNumber; 13 | 14 | //! Project version string for RxGoogleMaps. 15 | FOUNDATION_EXPORT const unsigned char RxGoogleMapsVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Sources/RxGoogleMaps/GMSCircle+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GMSCircle+Rx.swift 3 | // Example 4 | // 5 | // Created by Gabriel Araujo on 30/10/17. 6 | // Copyright © 2017 Gen X Hippies Company. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import CoreLocation 12 | import RxSwift 13 | import RxCocoa 14 | import GoogleMaps 15 | 16 | public extension Reactive where Base: GMSCircle { 17 | var position: Binder { 18 | return Binder(base) { control, position in 19 | control.position = position 20 | } 21 | } 22 | 23 | var radius: Binder { 24 | return Binder(base) { control, radius in 25 | control.radius = radius 26 | } 27 | } 28 | 29 | var strokeWidth: Binder { 30 | return Binder(base) { control, strokeWidth in 31 | control.strokeWidth = strokeWidth 32 | } 33 | } 34 | 35 | var strokeColor: Binder { 36 | return Binder(base) { control, strokeColor in 37 | control.strokeColor = strokeColor 38 | } 39 | } 40 | 41 | var fillColor: Binder { 42 | return Binder(base) { control, fillColor in 43 | control.fillColor = fillColor 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Sources/RxGoogleMaps/GMSGroundOverlay+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GMSGroundOverlay+Rx.swift 3 | // Example 4 | // 5 | // Created by Gabriel Araujo on 30/10/17. 6 | // Copyright © 2017 Gen X Hippies Company. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import CoreLocation 12 | import RxSwift 13 | import RxCocoa 14 | import GoogleMaps 15 | 16 | public extension Reactive where Base: GMSGroundOverlay { 17 | var position: Binder { 18 | return Binder(base) { control, position in 19 | control.position = position 20 | } 21 | } 22 | 23 | var anchor: Binder { 24 | return Binder(base) { control, anchor in 25 | control.anchor = anchor 26 | } 27 | } 28 | 29 | var icon: Binder { 30 | return Binder(base) { control, icon in 31 | control.icon = icon 32 | } 33 | } 34 | 35 | var opacity: Binder { 36 | return Binder(base) { control, opacity in 37 | control.opacity = opacity 38 | } 39 | } 40 | 41 | var bearing: Binder { 42 | return Binder(base) { control, bearing in 43 | control.bearing = bearing 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Sources/RxGoogleMaps/GMSMapView+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GMSMapView+Rx.swift 3 | // Example 4 | // 5 | // Created by Gabriel Araujo on 28/10/17. 6 | // Copyright © 2017 Gen X Hippies Company. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import CoreLocation 12 | import RxSwift 13 | import RxCocoa 14 | import GoogleMaps 15 | 16 | public extension Reactive where Base: GMSMapView { 17 | var camera: Binder { 18 | return Binder(base) { control, camera in 19 | control.camera = camera 20 | } 21 | } 22 | 23 | var cameraToAnimate: Binder { 24 | return Binder(base) { control, camera in 25 | control.animate(to: camera) 26 | } 27 | } 28 | 29 | var locationToAnimate: Binder { 30 | return Binder(base) { control, location in 31 | control.animate(toLocation: location) 32 | } 33 | } 34 | 35 | var zoomToAnimate: Binder { 36 | return Binder(base) { control, zoom in 37 | control.animate(toZoom: zoom) 38 | } 39 | } 40 | 41 | var bearingToAnimate: Binder { 42 | return Binder(base) { control, bearing in 43 | control.animate(toBearing: bearing) 44 | } 45 | } 46 | 47 | var viewingAngleToAnimate: Binder { 48 | return Binder(base) { control, viewingAngle in 49 | control.animate(toViewingAngle: viewingAngle) 50 | } 51 | } 52 | 53 | var myLocationEnabled: Binder { 54 | return Binder(base) { control, myLocationEnabled in 55 | control.isMyLocationEnabled = myLocationEnabled 56 | } 57 | } 58 | 59 | var myLocation: Observable { 60 | return observeWeakly(CLLocation.self, "myLocation") 61 | } 62 | 63 | var selectedMarker: ControlProperty { 64 | return ControlProperty(values: observeWeakly(GMSMarker.self, "selectedMarker"), valueSink: Binder(base) { control, selectedMarker in 65 | control.selectedMarker = selectedMarker 66 | } 67 | ) 68 | } 69 | 70 | var trafficEnabled: Binder { 71 | return Binder(base) { control, trafficEnabled in 72 | control.isTrafficEnabled = trafficEnabled 73 | } 74 | } 75 | 76 | var padding: Binder { 77 | return Binder(base) { control, padding in 78 | control.padding = padding 79 | } 80 | } 81 | 82 | var scrollGesturesEnabled: Binder { 83 | return Binder(base) { control, scrollGestures in 84 | control.settings.scrollGestures = scrollGestures 85 | } 86 | } 87 | 88 | var zoomGesturesEnabled: Binder { 89 | return Binder(base) { control, zoomGestures in 90 | control.settings.zoomGestures = zoomGestures 91 | } 92 | } 93 | 94 | var tiltGesturesEnabled: Binder { 95 | return Binder(base) { control, tiltGestures in 96 | control.settings.tiltGestures = tiltGestures 97 | } 98 | } 99 | 100 | var rotateGesturesEnabled: Binder { 101 | return Binder(base) { control, rotateGestures in 102 | control.settings.rotateGestures = rotateGestures 103 | } 104 | } 105 | 106 | var compassButtonVisible: Binder { 107 | return Binder(base) { control, compassButton in 108 | control.settings.compassButton = compassButton 109 | } 110 | } 111 | 112 | var myLocationButtonVisible: Binder { 113 | return Binder(base) { control, myLocationButton in 114 | control.settings.myLocationButton = myLocationButton 115 | } 116 | } 117 | } 118 | 119 | public extension Reactive where Base: GMSMapView { 120 | fileprivate var delegate: GMSMapViewDelegateProxy { 121 | return GMSMapViewDelegateProxy.proxy(for: base) 122 | } 123 | 124 | func handleTapMarkerWrapper(_ closure: GMSHandleTapMarker?) { 125 | delegate.handleTapMarker = closure 126 | } 127 | 128 | func handleTapOverlayWrapper(_ closure: @escaping GMSHandleTapOverlay) { 129 | delegate.handleTapOverlay = closure 130 | } 131 | 132 | func handleMarkerInfoWindowWrapper(_ closure: GMSHandleMarkerInfo?) { 133 | delegate.handleMarkerInfoWindow = closure 134 | } 135 | 136 | func handleMarkerInfoContentsWrapper(_ closure: GMSHandleMarkerInfo?) { 137 | delegate.handleMarkerInfoContents = closure 138 | } 139 | 140 | func handleTapMyLocationButton(_ closure: GMSHandleTapMyLocationButton?) { 141 | delegate.handleTapMyLocationButton = closure 142 | } 143 | 144 | var willMove: ControlEvent { 145 | let source = delegate 146 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:willMove:))) 147 | .map { a in 148 | return try castOrThrow(Bool.self, a[1]) 149 | } 150 | return ControlEvent(events: source) 151 | } 152 | 153 | var didChange: ControlEvent { 154 | let source = delegate 155 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:didChange:))) 156 | .map { a in 157 | return try castOrThrow(GMSCameraPosition.self, a[1]) 158 | } 159 | return ControlEvent(events: source) 160 | } 161 | 162 | var idleAt: ControlEvent { 163 | let source = delegate 164 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:idleAt:))) 165 | .map { a in 166 | return try castOrThrow(GMSCameraPosition.self, a[1]) 167 | } 168 | return ControlEvent(events: source) 169 | } 170 | 171 | var didTapAt: ControlEvent { 172 | let source = delegate 173 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:didTapAt:))) 174 | .map { a in 175 | return try castCoordinateOrThrow(a[1]) 176 | } 177 | return ControlEvent(events: source) 178 | } 179 | 180 | var didLongPressAt: ControlEvent { 181 | let source = delegate 182 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:didLongPressAt:))) 183 | .map { a in 184 | return try castCoordinateOrThrow(a[1]) 185 | } 186 | return ControlEvent(events: source) 187 | } 188 | 189 | var didTap: ControlEvent { 190 | let source = delegate 191 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:didTap:))) 192 | .map { a in 193 | return try castOrThrow(GMSMarker.self, a[1]) 194 | } 195 | return ControlEvent(events: source) 196 | } 197 | 198 | var didTapInfoWindowOf: ControlEvent { 199 | let source = delegate 200 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:didTapInfoWindowOf:))) 201 | .map { a in 202 | return try castOrThrow(GMSMarker.self, a[1]) 203 | } 204 | return ControlEvent(events: source) 205 | } 206 | 207 | var didLongPressInfoWindowOf: ControlEvent { 208 | let source = delegate 209 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:didLongPressInfoWindowOf:))) 210 | .map { a in 211 | return try castOrThrow(GMSMarker.self, a[1]) 212 | } 213 | return ControlEvent(events: source) 214 | } 215 | 216 | var didTapAtPoi : ControlEvent<(placeId: String, name: String, location: CLLocationCoordinate2D)> { 217 | let source = delegate 218 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:didTapPOIWithPlaceID:name:location:))) 219 | .map { a -> (placeId: String, name: String, location: CLLocationCoordinate2D) in 220 | let placeId = try castOrThrow(NSString.self, a[1]) as String 221 | let name = try castOrThrow(NSString.self, a[2]) as String 222 | let value = try castOrThrow(NSValue.self, a[3]) 223 | var coordinate = CLLocationCoordinate2D() 224 | value.getValue(&coordinate) 225 | return (placeId, name, coordinate) 226 | } 227 | return ControlEvent(events: source) 228 | } 229 | 230 | var didCloseInfoWindowOfMarker: ControlEvent { 231 | let source = delegate 232 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:didCloseInfoWindowOf:))) 233 | .map { a in return try castOrThrow(GMSMarker.self, a[1]) } 234 | return ControlEvent(events: source) 235 | } 236 | 237 | var didBeginDragging: ControlEvent { 238 | let source = delegate 239 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:didBeginDragging:))) 240 | .map { a in 241 | return try castOrThrow(GMSMarker.self, a[1]) 242 | } 243 | return ControlEvent(events: source) 244 | } 245 | 246 | var didEndDragging: ControlEvent { 247 | let source = delegate 248 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:didEndDragging:))) 249 | .map { a in return try castOrThrow(GMSMarker.self, a[1]) } 250 | return ControlEvent(events: source) 251 | } 252 | 253 | var didDrag: ControlEvent { 254 | let source = delegate 255 | .methodInvoked(#selector(GMSMapViewDelegate.mapView(_:didDrag:))) 256 | .map { a in return try castOrThrow(GMSMarker.self, a[1]) } 257 | return ControlEvent(events: source) 258 | } 259 | 260 | var didTapMyLocationButton: ControlEvent { 261 | return ControlEvent(events: delegate.didTapMyLocationButtonEvent) 262 | } 263 | 264 | var didStartTileRendering: Observable { 265 | return delegate 266 | .methodInvoked(#selector(GMSMapViewDelegate.mapViewDidStartTileRendering(_:))) 267 | .map { _ in return } 268 | } 269 | 270 | var didFinishTileRendering: Observable { 271 | return delegate 272 | .methodInvoked(#selector(GMSMapViewDelegate.mapViewDidFinishTileRendering(_:))) 273 | .map { _ in return } 274 | } 275 | 276 | var snapshotReady: Observable { 277 | return delegate 278 | .methodInvoked(#selector(GMSMapViewDelegate.mapViewSnapshotReady(_:))) 279 | .map { _ in return } 280 | } 281 | 282 | func handleTapMarker(_ closure: ((GMSMarker) -> (Bool))?) { 283 | if let c = closure { 284 | handleTapMarkerWrapper { c($0) } 285 | } else { 286 | handleTapMarkerWrapper(nil) 287 | } 288 | } 289 | 290 | func handleTapOverlay(_ closure: @escaping ((GMSOverlay) -> (Void))) { 291 | handleTapOverlayWrapper { closure($0) } 292 | } 293 | 294 | func handleMarkerInfoWindow(_ closure: ((GMSMarker) -> (UIView?))?) { 295 | if let c = closure { 296 | handleMarkerInfoWindowWrapper { c($0) } 297 | } else { 298 | handleMarkerInfoWindowWrapper(nil) 299 | } 300 | } 301 | 302 | func handleMarkerInfoContents(_ closure: ((GMSMarker) -> (UIView?))?) { 303 | if let c = closure { 304 | handleMarkerInfoContentsWrapper { c($0) } 305 | } else { 306 | handleMarkerInfoContentsWrapper(nil) 307 | } 308 | } 309 | } 310 | 311 | fileprivate func castCoordinateOrThrow(_ object: Any) throws -> CLLocationCoordinate2D { 312 | let value = try castOrThrow(NSValue.self, object) 313 | var coordinate = CLLocationCoordinate2D() 314 | value.getValue(&coordinate) 315 | return coordinate 316 | } 317 | -------------------------------------------------------------------------------- /Sources/RxGoogleMaps/GMSMapViewDelegateProxy.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GMSMapViewDelegateProxy.swift 3 | // Example 4 | // 5 | // Created by Gabriel Araujo on 28/10/17. 6 | // Copyright © 2017 Gen X Hippies Company. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import CoreLocation 12 | import RxSwift 13 | import RxCocoa 14 | import GoogleMaps 15 | 16 | public typealias GMSHandleTapMarker = (GMSMarker) -> (Bool) 17 | public typealias GMSHandleTapOverlay = (GMSOverlay) -> (Void) 18 | public typealias GMSHandleMarkerInfo = (GMSMarker) -> (UIView?) 19 | public typealias GMSHandleTapMyLocationButton = () -> (Bool) 20 | 21 | class GMSMapViewDelegateProxy : DelegateProxy, DelegateProxyType, GMSMapViewDelegate { 22 | 23 | var handleTapMarker: GMSHandleTapMarker? = nil 24 | var handleTapOverlay: GMSHandleTapOverlay? = nil 25 | var handleTapMyLocationButton: GMSHandleTapMyLocationButton? = nil 26 | var handleMarkerInfoWindow: GMSHandleMarkerInfo? = nil 27 | var handleMarkerInfoContents: GMSHandleMarkerInfo? = nil 28 | 29 | let didTapMyLocationButtonEvent = PublishSubject() 30 | let didTapMarkerEvent = PublishSubject() 31 | let didTapOverlayEvent = PublishSubject() 32 | 33 | /// Typed parent object. 34 | public weak private(set) var mapView: GMSMapView? 35 | 36 | /// - parameter tabBar: Parent object for delegate proxy. 37 | public init(gsMapView: ParentObject) { 38 | self.mapView = gsMapView 39 | super.init(parentObject: gsMapView, delegateProxy: GMSMapViewDelegateProxy.self) 40 | } 41 | 42 | // Register known implementations 43 | public static func registerKnownImplementations() { 44 | self.register { GMSMapViewDelegateProxy(gsMapView: $0) } 45 | } 46 | 47 | /// For more information take a look at `DelegateProxyType`. 48 | open class func currentDelegate(for object: ParentObject) -> GMSMapViewDelegate? { 49 | return object.delegate 50 | } 51 | 52 | /// For more information take a look at `DelegateProxyType`. 53 | open class func setCurrentDelegate(_ delegate: GMSMapViewDelegate?, to object: ParentObject) { 54 | object.delegate = delegate 55 | } 56 | 57 | public func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool { 58 | return self.didHandleTap(marker) 59 | } 60 | 61 | func mapView(_ mapView: GMSMapView, didTap overlay: GMSOverlay) -> Void { 62 | return self.didHandleTapOverlay(overlay) 63 | } 64 | 65 | public func mapView(_ mapView: GMSMapView, markerInfoWindow marker: GMSMarker) -> UIView? { 66 | return self.markerInfoWindow(marker: marker) 67 | } 68 | 69 | public func mapView(_ mapView: GMSMapView, markerInfoContents marker: GMSMarker) -> UIView? { 70 | return self.markerInfoContents(marker: marker) 71 | } 72 | 73 | public func didTapMyLocationButton(for mapView: GMSMapView) -> Bool { 74 | return self.didTapMyLocationButton() 75 | } 76 | } 77 | 78 | extension GMSMapViewDelegateProxy { 79 | 80 | public func didHandleTap(_ marker: GMSMarker) -> Bool { 81 | didTapMarkerEvent.onNext(marker) 82 | return handleTapMarker?(marker) ?? false 83 | } 84 | 85 | public func didHandleTapOverlay(_ overlay: GMSOverlay) -> Void { 86 | didTapOverlayEvent.onNext(overlay) 87 | return handleTapOverlay?(overlay) ?? () 88 | } 89 | 90 | public func didTapMyLocationButton() -> Bool { 91 | didTapMyLocationButtonEvent.onNext(()) 92 | return handleTapMyLocationButton?() ?? false 93 | } 94 | 95 | public func markerInfoWindow(marker: GMSMarker) -> UIView? { 96 | return handleMarkerInfoWindow?(marker) 97 | } 98 | 99 | public func markerInfoContents(marker: GMSMarker) -> UIView? { 100 | return handleMarkerInfoContents?(marker) 101 | } 102 | 103 | } 104 | 105 | // - MARK: Internal Helpers 106 | func castOptionalOrFatalError(_ value: Any?) -> T? { 107 | if value == nil { 108 | return nil 109 | } 110 | let v: T = castOrFatalError(value) 111 | return v 112 | } 113 | 114 | func castOrThrow(_ resultType: T.Type, _ object: Any) throws -> T { 115 | guard let returnValue = object as? T else { 116 | throw RxCocoaError.castingError(object: object, targetType: resultType) 117 | } 118 | return returnValue 119 | } 120 | 121 | func castOrFatalError(_ value: Any!) -> T { 122 | let maybeResult: T? = value as? T 123 | guard let result = maybeResult else { 124 | fatalError("Failure converting from \(value ?? "") to \(T.self)") 125 | } 126 | 127 | return result 128 | } 129 | -------------------------------------------------------------------------------- /Sources/RxGoogleMaps/GMSMarker+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GMSMarker+Rx.swift 3 | // Example 4 | // 5 | // Created by Gabriel Araujo on 30/10/17. 6 | // Copyright © 2017 Gen X Hippies Company. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import CoreLocation 12 | import RxSwift 13 | import RxCocoa 14 | import GoogleMaps 15 | 16 | public extension Reactive where Base: GMSMarker { 17 | var position: Binder { 18 | return Binder(base) { control, position in 19 | control.position = position 20 | } 21 | } 22 | 23 | var snippet: Binder { 24 | return Binder(base) { control, snippet in 25 | control.snippet = snippet 26 | } 27 | } 28 | 29 | var icon: Binder { 30 | return Binder(base) { control, icon in 31 | control.icon = icon 32 | } 33 | } 34 | 35 | var iconView: Binder { 36 | return Binder(base) { control, iconView in 37 | control.iconView = iconView 38 | } 39 | } 40 | 41 | var groundAnchor: Binder { 42 | return Binder(base) { control, groundAnchor in 43 | control.groundAnchor = groundAnchor 44 | } 45 | } 46 | 47 | var infoWindowAnchor: Binder { 48 | return Binder(base) { control, infoWindowAnchor in 49 | control.infoWindowAnchor = infoWindowAnchor 50 | } 51 | } 52 | 53 | var draggable: Binder { 54 | return Binder(base) { control, draggable in 55 | control.isDraggable = draggable 56 | } 57 | } 58 | 59 | var flat: Binder { 60 | return Binder(base) { control, flat in 61 | control.isFlat = flat 62 | } 63 | } 64 | 65 | var rotation: Binder { 66 | return Binder(base) { control, rotation in 67 | control.rotation = rotation 68 | } 69 | } 70 | 71 | var opacity: Binder { 72 | return Binder(base) { control, opacity in 73 | control.opacity = opacity 74 | } 75 | } 76 | 77 | var userData: Binder { 78 | return Binder(base) { control, userData in 79 | control.userData = userData 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Sources/RxGoogleMaps/GMSOverlay+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GMSOverlay+Rx.swift 3 | // Example 4 | // 5 | // Created by Gabriel Araujo on 30/10/17. 6 | // Copyright © 2017 Gen X Hippies Company. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import CoreLocation 12 | import RxSwift 13 | import RxCocoa 14 | import GoogleMaps 15 | 16 | public extension Reactive where Base: GMSOverlay { 17 | var title: Binder { 18 | return Binder(base) { control, title in 19 | control.title = title 20 | } 21 | } 22 | 23 | var tappable: Binder { 24 | return Binder(base) { control, tappable in 25 | control.isTappable = tappable 26 | } 27 | } 28 | 29 | var zIndex: Binder { 30 | return Binder(base) { control, zIndex in 31 | control.zIndex = zIndex 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sources/RxGoogleMaps/GMSPolygon+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GMSPolygon+Rx.swift 3 | // Example 4 | // 5 | // Created by Gabriel Araujo on 30/10/17. 6 | // Copyright © 2017 Gen X Hippies Company. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import CoreLocation 12 | import RxSwift 13 | import RxCocoa 14 | import GoogleMaps 15 | 16 | public extension Reactive where Base: GMSPolygon { 17 | var strokeWidth: Binder { 18 | return Binder(base) { control, strokeWidth in 19 | control.strokeWidth = strokeWidth 20 | } 21 | } 22 | 23 | var strokeColor: Binder { 24 | return Binder(base) { control, strokeColor in 25 | control.strokeColor = strokeColor 26 | } 27 | } 28 | 29 | var fillColor: Binder { 30 | return Binder(base) { control, fillColor in 31 | control.fillColor = fillColor 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sources/RxGoogleMaps/GMSPolyline+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GMSPolyline+Rx.swift 3 | // Example 4 | // 5 | // Created by Gabriel Araujo on 29/10/17. 6 | // Copyright © 2017 Gen X Hippies Company. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import CoreLocation 12 | import RxSwift 13 | import RxCocoa 14 | import GoogleMaps 15 | 16 | public extension Reactive where Base: GMSPolyline { 17 | var strokeWidth: Binder { 18 | return Binder(base) { control, strokeWidth in 19 | control.strokeWidth = strokeWidth 20 | } 21 | } 22 | 23 | var strokeColor: Binder { 24 | return Binder(base) { control, strokeColor in 25 | control.strokeColor = strokeColor 26 | } 27 | } 28 | } 29 | --------------------------------------------------------------------------------