Description
The OpenCage geocoding API supports forward and reverse geocoding for the entire world and is based on various open datasources like OpenStreetMap.
OpenCageSDK alternatives and similar libraries
Based on the "Maps" category.
Alternatively, view OpenCageSDK alternatives based on common mentions on social networks and blogs.
-
Mapbox GL
Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL -
ClusterKit
An iOS map clustering framework targeting MapKit, Google Maps and Mapbox. -
PXGoogleDirections
Google Directions API helper for iOS, written in Swift -
NAMapKit
Allows you to use custom maps in iphone applications and attempts to mimics some of the behaviour of the MapKit framework -
CMMapLauncher
CMMapLauncher is a mini-library for iOS that makes it quick and easy to show directions in various mapping applications. -
JDSwiftHeatMap
JDSwiftMap is an IOS Native MapKit Library. You can easily make a highly customized HeatMap. -
MapViewPlus
Use any custom view as custom callout view of your MKMapView with cool animations. Also, easily use any image as annotation view. -
MSFlightMapView
MSFlightMapView allows you to easily add and animate geodesic flights to Google map -
GoogleMapsHelper
An easy to integrate Model Based Google Maps Helper (SVHTTPClient, AFNetworking) That lets you Geo Code , Reverse Geocode, Get Directions , Places Autocomplete. -
GLMap
Crossplatform offline vector map with MapCSS styling. Offline search and offline navigation are included.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of OpenCageSDK or a related project?
README
OpenCageSDK
Requirements
OpenCageSDK
works on iOS 9+ and requires ARC to build. It depends on the following Apple frameworks, which should already be included with most Xcode templates:
- Foundation.framework
You will need the latest developer tools in order to build OpenCageSDK
. Old Xcode versions might work, but compatibility will not be explicitly maintained.
You will also need an API key from OpenCage to initialise this SDK. The API key is retrieved from here: https://opencagedata.com
Adding OpenCageSDK to your project
CocoaPods
CocoaPods is the recommended way to add OpenCageSDK to your project.
- Add a pod entry for OpenCageSDK to your Podfile
pod 'OpenCageSDK'
- Install the pod(s) by running
pod install
- Include OpenCageSDK wherever you need it with
@import OpenCageSDK
Source files
Alternatively you can directly add the source files to your project, they are found under OpenCageSDK/Classes.
- Download the latest code version or add the repository as a git submodule to your git-tracked project.
- Open your project in Xcode, then drag and drop the classes onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project.
Static library
You can also add OpenCageSDK as a static library to your project or workspace.
- Download the latest code version or add the repository as a git submodule to your git-tracked project.
- Open your project in Xcode, then drag and drop
OpenCageSDK.xcodeproj
onto your project or workspace (use the "Product Navigator view"). - Select your target and go to the Build phases tab. In the Link Binary With Libraries section select the add button. On the sheet find and add
OpenCageSDK
. You might also need to addOpenCageSDK
to the Target Dependencies list. - In Objective-C you may need to include OpenCageSDK with
#import [yourprojectname]-swift.h
.
Usage
OpenCageSDK is built on top of NSURLSession with a completionBlock so the network requests happen on a background thread, for setting up the SDK there is a convenience initialiser.
let ocSDK :OCSDK = OCSDK(apiKey: "YOUR-API-KEY")
OCSDK *sdk = [[OCSDK alloc] initWithApiKey:@"YOUR-API-KEY"];
Reverse Geocoding is done through the method below, any errors with the request are on the completionBlock 'error'. The response from the server is parsed into objects for ease of access.
let ocSDK :OCSDK = OCSDK(apiKey: "YOUR-API-KEY")
ocSDK.reverseGeocode(latitude: NSNumber(value: 51.5159), longitude: NSNumber(value: 0.1297), withAnnotations: true) { (response, success, error) in
if success {
//Successful payload response
}
}
OCSDK *sdk = [[OCSDK alloc] initWithApiKey:@"YOUR-API-KEY"];
[sdk reverseGeocodeWithLatitude:@(51.5159) longitude:@(0.1297) withAnnotations:YES completionBlock:^(OCGeoResponse * _Nonnull response, BOOL success, NSError * _Nullable error) {
if (success) {
// Successful payload response
}
}];
Forward Geocoding is done through the method below, any errors with the request are on the completionBlock 'error'. The response from the server is parsed into objects for ease of access.
let ocSDK :OCSDK = OCSDK(apiKey: "YOUR-API-KEY")
ocSDK.forwardGeocode(address: "3 Walls Court, Tewkesbury, England", withAnnotations: true) { (response, success, error) in
if success {
//Successful payload response
}
}
OCSDK *sdk = [[OCSDK alloc] initWithApiKey:@"YOUR-API-KEY"];
[sdk forwardGeocodeWithAddress:@"3 Walls Court, Tewkesbury, England" withAnnotations:YES completionBlock:^(OCGeoResponse * _Nonnull response, BOOL success, NSError * _Nullable error) {
if (success) {
// Successful payload response
}
}];
Documentation is provided in the OCSDK.swift file as well.
License
This code is distributed under the terms and conditions of the [MIT license](LICENSE).
*Note that all licence references and agreements mentioned in the OpenCageSDK README section above
are relevant to that project's source code only.