The recommended way to use tangram-es in an iOS project is to add it as a CocoaPods dependency. The library is hosted in CocoaPods under the pod name 'Tangram-es'. To find the latest version, check CocoaPods: https://cocoapods.org/pods/Tangram-es. For convenience, we also provide Debug snapshots and Releases at ios.mapzen.com.
This project uses CMake (minimum version 3.0), you can download it here or use your favorite installation package tool like homebrew.
brew install cmake
Make sure to update git submodules before you build:
git submodule update --init
You can optionally install xcpretty to produce much prettier and more legible output during the build process:
gem install xcpretty
You will need a Mapzen API key to use the vector-tile and terrain service that is being used from the stylesheet of the demo app. To get an API key visit: mapzen.com/developers/.
Building the iOS demo application requires Xcode 9.0 or newer. From the root directory of the project, run:
make ios MAPZEN_API_KEY=mapzen-xxxx
You can optionally append DEBUG=1
or RELEASE=1
to choose the build type.
Note: DEBUG version of the framework does not have bitcode enabled. If you need bitcode, make sure to get RELEASE version of the framework.
This will generate an Xcode project that you can use to deploy on device or simulator:
open build/ios/tangram.xcodeproj
Make sure to set up the code signing identity and code sign the framework on copy (select target tangram > Build Phases > Copy Files > TangramMap.framework > Code Sign On Copy).
Note on Code Signing and Provisioning Profiles:
- For Simulator: Does not need any code signing identity, so you can ignore any provionining profile failures on target tangram > General > Signing.
- For Device: You will have to modify the Bundle Identifier under target tangram > General > Identity > Bundle Identifier, to something other than
com.mapzen.tangram
, since this needs to be unique.
For development, you can use the Makefile option TANGRAM_IOS_FRAMEWORK_SLIM
to build for simulator only and faster your build times.
An iOS binary framework bundle targeted for ARM architectures can be produced by running the following:
make ios-framework
The framework will be output in '/build/ios-framework/lib/', in a folder named 'release' or 'debug' according to the build type.
To build a universal binary working on both device and simulator architectures run the following:
make ios-framework-universal
The universal framework will be output in '/build/ios-framework-universal/', in a folder named 'release' or 'debug' according to the build type.