Skip to content

Instantly share code, notes, and snippets.

@halsk
Created December 8, 2013 16:47
Show Gist options
  • Save halsk/7860059 to your computer and use it in GitHub Desktop.
Save halsk/7860059 to your computer and use it in GitHub Desktop.
MapBox for iOS SDK を使って、OpenStreetMap を iPhone で表示する ref: http://qiita.com/hal_sk/items/e0b3ca53303976bc0235
platform :ios, '5.0'
pod 'MapBox'
pod install
//
// GRViewController.m
// MapBoxSample
//
// Created by Haruyuki Seki on 12/9/13.
// Copyright (c) 2013 Georepublic. All rights reserved.
//
#import "GRViewController.h"
#import <MapBox/MapBox.h>
@interface GRViewController ()
{
RMMapView *_mapView;
}
@end
@implementation GRViewController
- (void)viewDidLoad
{
[super viewDidLoad];
RMMapBoxSource *tileSource = [[RMMapBoxSource alloc] initWithMapID:@"メモしておいた Map ID"];
_mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:tileSource];
[_mapView setZoom:5];
[self.view addSubview:_mapView];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
//
// GRViewController.m
// MapBoxSample
//
// Created by Haruyuki Seki on 12/9/13.
// Copyright (c) 2013 Georepublic. All rights reserved.
//
#import "GRViewController.h"
#import <MapBox/MapBox.h>
@interface GRViewController ()
{
RMMapView *_mapView;
}
@end
@implementation GRViewController
- (void)viewDidLoad
{
[super viewDidLoad];
RMMapBoxSource *tileSource = [[RMMapBoxSource alloc] initWithMapID:@"メモしておいた Map ID"];
_mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:tileSource];
[_mapView setZoom:5];
[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