A more easy way to use Maps (MapKit, AMap, BMap)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
EasyMap
EasyMapDemo
.gitignore
LICENSE
README.md

README.md

EasyMap

EasyMap provids a more easy way to deal with maps. (MapKit, 百度地图, 高德地图 )

Why use EasyMap?

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
    
}

Usage

EasyMap contains three Map Services. There is just a slighty difference.

Locate
Map.getLocation(onSuccess: { (location) in
            
}) { (error) in
            
}
ReverseGeocoder
BMap.reverseGeocoder(coordinate: coordinate, onSuccess: { (result) in
    
}) { (errorCode) in
    
}
Geocoder
BMap.geocoder(address: "somewhere", city: "", onSuccess: { (result) in
            
}) { (errorCode) in
            
}
Get suggestions when typing
AMap.searchInputTips(keywords: "plaza", onSuccess: { (response) in
    
}, onFail: { (error) in
    
})
Search nearby pois
BMap.searchPoi(near: coordinate, radius: 1000, keyword: "hotel", onSuccess: { (result) in
    
}, onFail: { (errorCode) in
    
})

TODO

  • Demo Project
  • More Features
  • Cocopods

Aboud Demo Project

I don't suggest to download the demo project. The .framework files takes more than 100M, it may slow you down.

Contribute

  • Pull Request is more than welcome
  • Found a bug or need a new feature, feel free to open a issue.

License

MIT