Created
December 8, 2013 16:47
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
platform :ios, '5.0' | |
pod 'MapBox' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pod install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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