The WRLD iOS SDK is a framework for displaying beautiful, interactive 3D map views in Cocoa Touch apps for iPhone or iPad. Map views can be embedded into apps using iOS 8.0 or above, using Objective-C, or by simply hooking up in Xcode Interface Builder.
For more information, see the WRLD iOS API documentation page.
The WRLD iOS SDK is provided as a dynamic framework. To integrate the SDK with an app, you will need Xcode 7.3 or later.
You can install either using a direct download, or via CocoaPods.
wrld-ios-sdk
zip file.General
tab, find the Embedded Binaries
section.wrld-ios-sdk
zip file and drag WRLD.framework
into the Embedded Binaries
section. Check "Copy items if needed" in the resulting dialog box, then click "Finish". This links the WRLD.framework with your project.Info.plist
file.platform :ios, '8.0'
target 'MyAppTargetName' do
pod 'WRLD'
end
pod install
. This will download the SDK and create an xcworkspace
file. Open this file in Xcode.Info.plist
file.In order to use the WRLD iOS API, you must sign up for a free developer account.
After signing up, create an API key (for clarity, this is a token containing 32 characters). The API key is necessary in order to use WRLD map services. It is good practice to create a new API key for each of you apps - this limits the changes necessary should a key need to be revoked.
To provide your app with an API key, in Xcode, open your app's Info.plist
file (select it in the Project Navigator).
Now that you have the WRLD iOS SDK installed, you are ready to integrate a WRLD 3d map view into your app.
This step-by-step guide shows you how to use Xcode Interface Builder to integrate a WRLD map view into your iOS app.
In Xcode, select your app's Info.plist
file in the Project Navigator.
Add an entry with the columns set as follows:
WrldApiKey
String
UIView
and drag a new View
object into your storyboard.WRLDMapView
.WRLDMapView
still selected, open the Attributes Inspector.Start Latitude: 37.789069
Start Longitude: -122.401141
Start Zoom Level: 15
Start Direction: 0
This will configure the map view to start in San Francisco, with the top of the view aligned to North.
Currently the WRLD iOS SDK does not support Bitcode. Depending on the version of Xcode you are using, you may have to disable this in your project settings:
No
.You're now ready to try out your app.
The app will now install and run on your device. If you selected a Simulator iOS target device, Simulator will launch and then run your app.
Add an entry with the columns set as follows:
WrldApiKey
String
The walkthough above shows how to use Xcode Interface Builder to embed a WRLDMapView in an iOS app.
A WRLDMapView instance can also be instantiated and added to a view controller using Objective-C - see the following snippet.
@import Wrld;
@interface ViewController : UIViewController
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
WRLDMapView *mapView = [[WRLDMapView alloc] initWithFrame:self.view.bounds];
mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
// set the center of the map and the zoom level
[mapView setCenterCoordinate:CLLocationCoordinate2DMake(37.7858, -122.401)
zoomLevel:15
animated:NO];
[self.view addSubview:mapView];
}
@end
The WRLD iOS SDK is currently in alpha, and is undergoing active development - we will be expanding with further features and improvements.
See our API documentation and examples.
The example GitHub repository contains an open-source iOS app that illustrates the API features.
Questions, comments, or problems? All feedback is welcome - get in touch on the issues page.
The WRLD iOS SDK is released under the Simplified BSD License. See the LICENSE.md file for details.