Simple to use location picker. As for users, so for developers.
- Reverse geocoding for location chosen in map
- Location textual search
- History of chosen locations
- Multiple map types
- Custom annotations/pins
- Custom tint color
- Support for localizations
- Landscape as well as portrait orientation
To run the example project, clone the repo, and run
pod install from the Example directory first.
MZLocationPicker is available through CocoaPods. To install it, simply add the following line to your Podfile:
For simple usage just implement MZLocationPickerDelegate methods and present picker like this:
let picker = MZLocationPickerController() picker.delegate = self present(picker, animated: true, completion: nil)
However, you can also customize the picker a bit more:
let picker = MZLocationPickerController() picker.delegate = self picker.tintColor = .purple picker.annotation.image = #imageLiteral(resourceName: "custom_pin") picker.annotation.centerOffset = CGPoint(x: 0, y: 24) picker.mapType = .satellite picker.translator = self present(picker, animated: true, completion: nil)
- When map type is flyover, search is not displayed correctly. For best functionality, avoid using flyover map types.
Michal Ziman, email@example.com
MZLocationPicker is available under the MIT license. See the LICENSE file for more info.