Just follow steps below to integrate GLMap framework into your application.

iOS

Integrate framework using CocoaPods

Framework is published as set of pods:

  • GLMap+DynamicLib

  • GLMap+StaticLib

  • GLMap+DefaultStyle

  • GLMap+WorldMap

For convenience we created two dependency only pods:

  • GLMap with dynamic library, map and style

  • GLMapStatic with static library, map and style.

There is also Swift extension for GLMap in GLMapSwift pod.

  • Run pod repo update to make CocoaPods aware of the latest available GLMap versions.

  • Add GLMap into your Podfile

platform :ios, '8.0'
use_frameworks!
target 'TargetName' do
pod 'GLMap'
# or pod 'GLMapStatic'
# or pod 'GLMapSwift'
end
  • Run pod install in project directory

  • Use the .xcworkspace file generated by CocoaPods to work on your project.

Integrate framework using Carthage

GLMap is published in Carthage as binary-only framework.

To add it into your project just add binary dependency into your Cartfile

binary "https://user.getyourmap.com/downloads/free/GLMap.json"

Unfortunately there is no way to add resource dependencies into Carhage, and you'll need to add them manually into your project.

GLMap requires world map and default style to work correctly.

For convenience we published all releases info json files:

https://user.getyourmap.com/downloads/free/GLMap.json
https://user.getyourmap.com/downloads/free/GLMapStatic.json
https://user.getyourmap.com/downloads/free/GLMapDefaultStyle.json
https://user.getyourmap.com/downloads/free/GLMapWorldMap.json

Use framework from Objective-C

Initialize GLMapManager inside AppDelegate.

#import <GLMap/GLMap.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GLMapManager sharedManager].apiKey = <#API key#>;
return YES;
}

Then add GLMapView into view hierarchy from code or using Interface Builder.

#import <GLMap/GLMap.h>
@implementation ViewController
-(void)viewDidLoad {
GLMapView *mapView = [[GLMapView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:mapView];
}

Now you're ready to write your app with GLMap framework. Consider our Demo App as source of examples and code snippets.

Objective-C Demo App / iOS API Documentation

Use framework from Swift

Initialize GLMapManager inside AppDelegate.

import GLMap
import GLMapSwift
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
GLMapManager.shared.apiKey = <#API key#>
return true
}
}

Then add GLMapView into view hierarchy from code or using Interface Builder.

class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let mapView = GLMapView(frame: self.view.bounds)
self.view.addSubview(mapView)
}
}

Now you're ready to write your app with GLMap framework. Consider our Demo App as source of examples and code snippets.

Swift Demo App / iOS API Documentation / Swift Extenstion API Documentation

Android

Add repository and dependency into module level build.gradle file.

repositories {
// other repositories
maven { url 'http://maven.getyourmap.com/artifactory/libs' }
}
dependencies {
// other dependencies
compile('com.getyourmap:glmap:0.9.4') {
transitive = true
}
}

Add GLMapView into layout file

<com.glmapview.GLMapView
android:id="@+id/map_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:keepScreenOn="true"/>

Initialize GLMapManager inside Application subclass.

public class YourApp extends Application
{
@Override
public void onCreate()
{
super.onCreate();
GLMapManager.initialize(this, <API_KEY>, null);
}
}

Then configure GLMapView.

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// set asset manager, and load style from bundle inside assets
GLMapView mapView = (GLMapView) this.findViewById(R.id.map_view);
mapView.loadStyle(this.getAssets(), "DefaultStyle.bundle");
}

Now you're ready to write your app with GLMap framework. Consider our Demo App as source of examples and code snippets.

Android Demo App / Android API Documentation