Giter Site home page Giter Site logo

jimmyjose-dev / locationmanager Goto Github PK

View Code? Open in Web Editor NEW
711.0 44.0 121.0 174 KB

CLLocationManager wrapper in Swift, performs location update, geocoding and reverse geocoding using Apple and Google service

License: MIT License

Swift 98.34% Ruby 1.66%

locationmanager's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

locationmanager's Issues

Why i cannot retrieve my currently location?

Hi:
Recently, i used LocationManager to retrieve the user's current location with below codes:
var locationManager = LocationManager.sharedInstance
locationManager.showVerboseMessage = true
locationManager.autoUpdate = false
locationManager.startUpdatingLocationWithCompletionHandler { (latitude, longitude, status, verboseMessage, error) -> () in

        println("lat:\(latitude) lon:\(longitude) status:\(status) error:\(error)")

        println(verboseMessage)

    }

But i found the completion handler never be called with no reasons.

Could you help me to figure out how make it works?
Thank you in advance.

CocoaPod name is a duplicate

I just spent 10 minutes trying to figure out why your documentation didn't match the LocationManager source. Its because pod 'LocationManager', ~> '1' will download a different pod.

You should use a unique name

At the very least you should update your ReadMe to show that you need this to install your pod
pod 'LocationManager', :git => 'https://github.com/varshylmobile/LocationManager.git'

Error over_query_limit

Hi,
last time there is an always error when use geocodeUsingGoogleAddressString: Over query limit.
I think you should fix it in geoCodeUsignGoogleAddress and reverseGocodeUsingGoogle functions. Just add key parameters in the url string:

https://maps.googleapis.com/maps/api/geocode/json?address=\(address)&key=API_KEY

Crashes if types in address components is empty

In some cases Google Places API returns empty types array, for example Dallas/Fort Worth International Airport. In that case type = types.firstObject as NSString crashes
{
"long_name" = 2375;
"short_name" = 2375;
types = (
"street_number"
);
},
{
"long_name" = "Dallas/Fort Worth International Airport";
"short_name" = "Dallas/Fort Worth International Airport";
types = (
);
},
{
"long_name" = "International Parkway";
"short_name" = "International Pkwy";
types = (
route
);
},
{
"long_name" = Dallas;
"short_name" = Dallas;
types = (
locality,
political
);
},
{
"long_name" = "Tarrant County";
"short_name" = "Tarrant County";
types = (
"administrative_area_level_2",
political
);
},
{
"long_name" = Texas;
"short_name" = TX;
types = (
"administrative_area_level_1",
political
);
},
{
"long_name" = "United States";
"short_name" = US;
types = (
country,
political
);
},
{
"long_name" = 75261;
"short_name" = 75261;
types = (
"postal_code"
);
}
)

Swift 3: crash to "as! CLGeocodeCompletionHandler"

the fileprivate func geoCodeAddress(_ address:NSString){} caused an error due to a

warning: could not load any Objective-C class information from the dyld shared cache. This will significantly reduce the quality of type information available.

To correct it , it's enough to correct this line:

geocoder.geocodeAddressString(address as String, completionHandler: ({(placemarks: [CLPlacemark]?, error: NSError?) -> Void in

to:

geocoder.geocodeAddressString(address as String, completionHandler: ({(placemarks: [CLPlacemark]?, error: Error?) -> Void in

You can find more details also here in SO

You also don't need to force casting to as! CLGeocodeCompletionHandler, so it can be removed.

problem with LocationManager in Swift 2.1

In Swift 2.1 I have 2 problem:

  1. 'stringByAddingPercentEscapesUsingEncoding' was deprecated in iOS 9.0: Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid.
  2. 'sendAsynchronousRequest(_:queue:completionHandler:)' was deprecated in iOS 9.0: Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h

please correct it

Optional("Invalid Input")

2014-12-21 01:47:22.945 LocationManagerDemo[1043:662184] * Terminating app due to uncaught exception 'NSGenericException', reason: '* Collection <__NSArrayM: 0x1c824d30> was mutated while being enumerated.'
*** First throw call stack:
(0x2946249f 0x36c58c8b 0x29461f21 0x33f4ee59 0x33fd8715 0x33fd1455 0x5a19db 0x5a9e29 0x5a42c9 0x5ab567 0x5ab355 0x3731be93 0x3731be07 0x37319b90)

libc++abi.dylib: terminating with uncaught exception of type NSException

The problem starts here : self.mapView?.setRegion(theRegion, animated: true)

Pod name

Hi,

Thanks a lot for your work. Juste to notify that you specify

pod 'VMLocationManager', '~> 1.0.0'

in the documentation instead of

pod 'LocationManager', '~> 1.0.0'

Have a nice day !

Tom

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.