ElevationAPI 0.1.1

ElevationAPI 0.1.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Mar 2017

Maintained by iDevelopper.



  • By
  • iDevelopper

Get the elevation of (almost) any point on Earth

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

You can also run pod try ElevationAPI in your Terminal from anywhere.

Installation

The easiest way to install it is by copying the following to your project:

  • Elevation.h
  • Elevation.m

ElevationAPI is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "ElevationAPI"

Features

ElevationAPI is a simple class that interfaces with http://www.elevationapi.xyz . It permits you to get the elevation of almost any point on Earth.

Usage - Examples

  • Initialize an instance of a Elevation Class:
Elevation *elevation = [[Elevation alloc] initWithBaseUrl:nil andApiVersion:nil];

By default:

baseURL = "http://elevationapi.xyz/api" and apiVersion = "v1"

  • Get the elevation of a point:
NSArray *array = @[@44.582352, @6.695185];

[elevation getElevation:array completionHandler:^(id  _Nullable result, NSError * _Nullable error) {
NSLog(@"Result = %@", result);
}];
  • Get the elevation of a set of points:
NSArray *array = @[@[@44.582352, @6.695185],
@[@44.582879, @6.696953],
@[@44.584711, @6.697369],
@[@44.585488, @6.697193],
@[@44.587027, @6.695611]
];

[elevation getElevations:array completionHandler:^(id _Nullable result, NSError * _Nullable error) {
NSLog(@"Result = %@", result);
}];
  • This can be done with Array of Dictionaries too:

See Elevation.h where methods are documented and ViewController.m where examples are provided.

Requirements

  • iOS 9.0 or later.
  • ARC memory management.

Special Mention

A Special Thank to Frank For this great API.

Documentation here.

Author

iDevelopper, [email protected]

License

ElevationAPI is available under the MIT license. See the LICENSE file for more info.