5.1. NextGIS iOS SDK¶
NextGIS iOS SDK is a set of libraries used to support work with geodata in mobile applications for iPhone and iPad. The SDK includes:
The nextgis_datastore library is written in
С++11 and based on GDAL. The library supports the following functionality:
- create, modify and delete geodata (raster and vector)
- edit vector geodata (modify geometry and attributes)
- geodata management (copy, move, various formats import/export, etc.)
- geodata rendering as maps using OpenGL/OpenGL ES
- utility functions (network requests, oAuth2, json)
NextGIS Webintegration (under development)
The library has
С API and bindings to other programming languages using
The ios_maplib library is written in
Swift and acts as easy wrapper around C API nextgis_datastore.
To use SDK Xcode 8 or higher required. Also the
Carthage utility required. Carthage is intended to be the simplest way to add frameworks to your Cocoa application. To install Carthage follow instruction at Cathage site.
In your project folder create
Cartfile with following text:
In terminal execute command:
carthage update --platform "iOS"
The command will download and install all necessary components.
5.1.3. Add to project¶
To display current location on the map you need to add to Info.plist following pair fr key-value with
Privacy - Location When In Use Usage Description | String | Shows your location on the map
In your project
General settings tab in
Linked Frameworks and Libraries section, drag & drop``ngstore.framework`` and
Next you need to setup copying of
ngmaplib.framework to building directory. In
Build Phases tab click the
+ icon and in context menu select
New Run Script Phase. In
Run Script section add following text to the script area below the
Next add following lines to
Input Files field:
The details see in Carthage documentaion.
The library was build with disabled bitcode option, so you need to disable it in your project as well. In your project settings select
Build Settings tab and set option
Enable bitcode NO for both build types (Debug and Release).
In the end add to your View controller the
GLK View and set as a custom class
MapView class from
ngmaplib module or some derived class.
The SDK API can be found in documentation.
See demo projects at this page.