EasyMap provids a more easy way to deal with maps. (MapKit, 百度地图, 高德地图 )
Here is a sample code to get current location
class ViewController: UIViewController, CLLocationManagerDelegate
...
let clManager = CLLocationManager()
clManager.distanceFilter = kCLLocationAccuracyHundredMeters
clManager.desiredAccuracy = 100
clManager.delegate = self
clManager.startUpdatingLocation()
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
// Do something
}
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
}
Well, I'm a lazy person, too many lines of codes here.
Let's see how many lines left by using EasyMap.
Map.getLocation(onSuccess: { (location) in
// Do something
}) { (error) in
}
EasyMap contains three Map Services. There is just a slighty difference.
Map.getLocation(onSuccess: { (location) in
}) { (error) in
}
BMap.reverseGeocoder(coordinate: coordinate, onSuccess: { (result) in
}) { (errorCode) in
}
BMap.geocoder(address: "somewhere", city: "", onSuccess: { (result) in
}) { (errorCode) in
}
AMap.searchInputTips(keywords: "plaza", onSuccess: { (response) in
}, onFail: { (error) in
})
BMap.searchPoi(near: coordinate, radius: 1000, keyword: "hotel", onSuccess: { (result) in
}, onFail: { (errorCode) in
})
- Demo Project
- More Features
- Cocopods
I don't suggest to download the demo project. The .framework files takes more than 100M, it may slow you down.
- Pull Request is more than welcome
- Found a bug or need a new feature, feel free to open a issue.
MIT