Skip to content

Instantly share code, notes, and snippets.

@esisa
Last active August 29, 2015 14:05
Show Gist options
  • Save esisa/f1956cbcaf001779c73b to your computer and use it in GitHub Desktop.
Save esisa/f1956cbcaf001779c73b to your computer and use it in GitHub Desktop.
Map layers in Mapbox iOS SDK
//
// ViewController.m
// MapboxTest
//
// Created by Espen Oldeman Lund on 28.08.14.
// Copyright (c) 2014 Espen Oldeman Lund. All rights reserved.
//
#import "ViewController.h"
#import "Mapbox.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[[RMConfiguration configuration] setAccessToken:@"pk.eyJ1IjoiZXNpc2EiLCJhIjoiRGJuWWFPdyJ9.9r5vGbd_Hza2UUbko1nYgg"];
/*RMMapboxSource *tileSource = [[RMMapboxSource alloc] initWithMapID:@"examples.map-y7l23tes"];
RMMapView *mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:tileSource];
[mapView addTileSource:[[RMMapboxSource alloc] initWithMapID:@"examples.location-formatter"]];
[self.view addSubview:mapView];*/
RMMapboxSource *tileSource1 = [[RMMapboxSource alloc] initWithMapID:@"examples.map-y7l23tes"];
RMMapboxSource *tileSource2 = [[RMMapboxSource alloc] initWithMapID:@"examples.location-formatter"];
NSArray *tilesourceArray = [NSArray arrayWithObjects:tileSource1, tileSource2, nil];
RMCompositeSource *composite = [[RMCompositeSource alloc] initWithTileSources:tilesourceArray tileCacheKey:@"combined"];
RMMapView *mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:composite];
[self.view addSubview:mapView];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment