All Projects → fabiocaccamo → Fccurrentlocationgeocoder

fabiocaccamo / Fccurrentlocationgeocoder

Licence: mit
iOS Geocoder for forward geocode and reverse geocode user's current location using a block-based syntax. 📍🌍

Projects that are alternatives of or similar to Fccurrentlocationgeocoder

Fcipaddressgeocoder
iOS Geocoder for geocode device IP Address location using GeoIP service(s) and a block-based syntax. 💻🌍
Stars: ✭ 114 (-57.46%)
Mutual labels:  location, geocoding, geocoder, geoip, pod
Pelias Android Sdk
Android sdk for pelias
Stars: ✭ 20 (-92.54%)
Mutual labels:  location, geocoding, geocoder
svelte-mapbox
MapBox Map and Autocomplete components for Svelte (or Vanilla JS)
Stars: ✭ 267 (-0.37%)
Mutual labels:  geocoding, location
local-reverse-geocoder
Local reverse geocoder for Node.js based on GeoNames data
Stars: ✭ 155 (-42.16%)
Mutual labels:  geocoding, geocoder
leaflet-opencage-search
A Leaflet geocoding control that uses the OpenCage geocoding API
Stars: ✭ 18 (-93.28%)
Mutual labels:  geocoding, geocoder
Placepicker
Free Android Map Place Picker alternative using Geocoder instead of Google APIs
Stars: ✭ 126 (-52.99%)
Mutual labels:  location, geocoder
Geolocation
Flutter geolocation plugin for Android and iOS.
Stars: ✭ 205 (-23.51%)
Mutual labels:  location, geocoder
kirby-locator
A simple map & geolocation field, built on top of open-source services and Mapbox. Kirby 3 only.
Stars: ✭ 83 (-69.03%)
Mutual labels:  geocoding, location
Atlas
🌎 Atlas is a set of APIs for looking up information about locations
Stars: ✭ 21 (-92.16%)
Mutual labels:  geocoding, location
pinpoint
🌎 A python script for finding your Mac.
Stars: ✭ 56 (-79.1%)
Mutual labels:  location, geocoder
python-omgeo
OMGeocoder - A python geocoding abstraction layer
Stars: ✭ 34 (-87.31%)
Mutual labels:  geocoding, geocoder
Mobile Sdk
CARTO Mobile SDK core project
Stars: ✭ 116 (-56.72%)
Mutual labels:  location, geocoding
NominatimGeocoderBackend
UnifiedNlp geocoder backend that uses the OSM Nominatim service
Stars: ✭ 49 (-81.72%)
Mutual labels:  geocoding, geocoder
GeoLite2-City
GeoLite2-City.mmdb.gz CDN files based on Free Open Source CDN jsDelivr!
Stars: ✭ 170 (-36.57%)
Mutual labels:  location, geoip
Bblocationmanager
A Location Manager for easily implementing location services & geofencing in iOS. Ready for iOS 11.
Stars: ✭ 107 (-60.07%)
Mutual labels:  location, geocoder
geocoder
Geocoder is a Typescript library which helps you build geo-aware applications by providing a powerful abstraction layer for geocoding manipulations
Stars: ✭ 28 (-89.55%)
Mutual labels:  geocoding, geocoder
Rxgps
Finding current location cannot be easier on Android !
Stars: ✭ 307 (+14.55%)
Mutual labels:  location, geocoding
Googleapi
C# .NET Core Google Api (Maps, Places, Roads, Search, Translate). Supports all endpoints and requests / responses.
Stars: ✭ 346 (+29.1%)
Mutual labels:  location, geocoding
GeoLite2-Country
GeoLite2-Country.mmdb.gz CDN files based on Free Open Source CDN jsDelivr!
Stars: ✭ 69 (-74.25%)
Mutual labels:  location, geoip
Osmunda
An offline geocode library for android, powered by SQLite, using osm data. 离线地理编码Android库,基于SQLite,使用开放街道地图数据。
Stars: ✭ 37 (-86.19%)
Mutual labels:  geocoding, geocoder

FCCurrentLocationGeocoder Pod version Pod platforms Pod license

iOS Geocoder on top of LocationManager and CLGeocoder for forward geocode and reverse geocode user's current location using a block-based syntax.

It can also be used to geocode the user's approximate location (always country, almost always city) without asking for permission (using a free GeoIP service).

Requirements & Dependecies

Installation

CocoaPods:

pod 'FCCurrentLocationGeocoder'

Manual install:

  • Copy FCCurrentLocationGeocoder.h and FCCurrentLocationGeocoder.m to your project
  • Manual install FCIPAddressGeocoder

Usage

iOS 8

Since iOS 8 it is required to add NSLocationWhenInUseUsageDescription key to your Info.plist file. Value for this key will be a description of UIAlertView presented to user while asking for location permission. See Apple documentation for more info.

Basically all you need to do is to add single entry in your Info.plist file. Add key NSLocationWhenInUseUsageDescription, and select type String. The value you enter for this entry will be shown as text in UIAlertView presented to user first time you try to determine his location. In the end it should look similar to this:

Added entry to Info.plist

Code sample

//you can use the shared instance
[FCCurrentLocationGeocoder sharedGeocoder];

//you can also use as many shared instances as you need
[FCCurrentLocationGeocoder sharedGeocoderForKey:@"yourKey"];

//or create a new geocoder and set options
FCCurrentLocationGeocoder *geocoder = [FCCurrentLocationGeocoder new];
geocoder.canPromptForAuthorization = NO; //(optional, default value is YES)
geocoder.canUseIPAddressAsFallback = YES; //(optional, default value is NO. very useful if you need just the approximate user location, such as current country, without asking for permission)
geocoder.timeFilter = 30; //(cache duration, optional, default value is 5 seconds)
geocoder.timeoutErrorDelay = 10; //(optional, default value is 15 seconds)

//check if location services are enabled and the current app is authorized or could be authorized
[geocoder canGeocode]; //returns YES or NO
//current-location forward-geocoding
[geocoder geocode:^(BOOL success) {

    if(success)
    {
        //you can access the current location using 'geocoder.location'
    }
    else {
        //you can debug what's going wrong using: 'geocoder.error'
    }
}];
//current-location reverse-geocoding
[geocoder reverseGeocode:^(BOOL success) {

    if(success)
    {
        //you can access the current location using 'geocoder.location'
        //you can access the current location placemarks using 'geocoder.locationPlacemarks'
        //you can access the current location first-placemark using 'geocoder.locationPlacemark'
        //you can access the current location country using 'geocoder.locationCountry'
        //you can access the current location country-code using 'geocoder.locationCountryCode'
        //you can access the current location city using 'geocoder.locationCity'
        //you can access the current location zip-code using 'geocoder.locationZipCode'
        //you can access the current location address using 'geocoder.locationAddress'
    }
    else {
        //you can debug what's going wrong using: 'geocoder.error'
    }
}];
//check if geocoding
[geocoder isGeocoding]; //returns YES or NO
//cancel geocoding
[geocoder cancelGeocode];

License

Released under MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].