ラベル Core Location の投稿を表示しています。 すべての投稿を表示
ラベル Core Location の投稿を表示しています。 すべての投稿を表示

CoreLocation - [5] MKPlacemark

2010年10月15日金曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加

[前回] Cocoaの日々: CoreLocation - [4] 緯度経度から住所情報を得る - MKReverseGeocoder

今回は MKPlacemark を触ってみた。


MKPlacemark


MKPlacemarkのオブジェクト は MKReverseGeocoder から生成され、国や住所情報が格納されている。

MKPlacemark Class Reference より


実際に MKReverseGeocoder を使い任意の緯度経度から MKPlacemarkを取得した時の例
addressDictionary['CountryCode']: JP
addressDictionary['Street']: 14丁目 236−1
addressDictionary['SubThoroughfare']: 236−1
addressDictionary['SubLocality']: 日本橋
addressDictionary['City']: 中央区
addressDictionary['State']: 東京都
addressDictionary['Thoroughfare']: 14丁目
addressDictionary['Country']: 日本
addressDictionary['FormattedAddressLines'][0]: 日本
addressDictionary['FormattedAddressLines'][1]: 東京都中央区日本橋14丁目236−1
----
thoroughfare : 14丁目
subThoroughfare : 236−1
locality : 中央区
subLocality : 日本橋
administrativeArea : 東京都
subAdministrativeArea : (null)
postalCode : (null)
country : 日本
countryCode : JP


addressDictionary の各キーは Address Book framework - ABPerson クラスの "Address Property" で定義されている。
ABPerson Reference より



<MKAnnotaction>


MKPlacemark は MKAnnotationプロトコルを実装している。ということはそのまま MKMapView へ追加することができる。前回のコードで自前の MKAnnotation実装オブジェクトを使うのをやめて単純に取得した MKPlacemarkオブジェクトを MKMapViewへ addAnnotation したところ地図上にピンが表示され、タップで住所が表示されるようになった。
- (void)reverseGeocoder:(MKReverseGeocoder*)geocoder didFindPlacemark:(MKPlacemark*)placemark {

 [self.mapView addAnnotation:placemark];

 /*
 self.label.text = placemark.title;
 [self logPlacemark:placemark];

 SimpleAnnotation* annotation =
  [self annotationForCoordinate:geocoder.coordinate];
 annotation.title = placemark.title;
  */
}
簡易な用途ならこれで十分。


ソースコード


GitHubからどうぞ。

CoreLocation - [4] 緯度経度から住所情報を得る - MKReverseGeocoder

2010年10月14日木曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加

[前回] Cocoaの日々: CoreLocation - [3] MKMapView の初期表示設定

今回は CLLocationManager から取得した緯度経度から住所情報を取得してみる。


MKReverseGeocoder


緯度経度から住所情報(文字列)を取得するには MKReverseGeocoder を使う。

使い方は簡単で緯度経度を引数としてインスタンスを生成し -start を投げるだけ。住所情報が取得できると MKReverseGeocoderDelegate で定義されたメソッドが呼び出される。
MKReverseGeocoder* reverseGeocoder = [[MKReverseGeocoder alloc] 
        initWithCoordinate:location.coordinate];
reverseGeocoder.delegate = self;
[reverseGeocoder start];
  :

- (void)reverseGeocoder:(MKReverseGeocoder*)geocoder
 didFindPlacemark:(MKPlacemark*)placemark {
    // 住所情報取得が成功した場合
}  

- (void) reverseGeocoder:(MKReverseGeocoder *)geocoder
 didFailWithError:(NSError*) error {  
    // 住所情報取得が失敗した場合
}


サンプル実装


前回までのプログラムに組み込んでみる。現在位置を表示する時にその緯度経度から住所情報を取得し表示するようにした。またピン(MKAnnotation実装クラス)に住所情報をもたせ、ピンをタップした時に吹き出しで表示するようにしてみた。

まず住所取得箇所。前回のピン表示メソッドの最後に MKReverseGeocoder の処理を追加する。
- (void)setPinToCoordinate:(CLLocation*)location
{
 // add annotation
 SimpleAnnotation* annotation = [[[SimpleAnnotation alloc] init] autorelease];
 annotation.location = location;
 [self.mapView addAnnotation:annotation];

 [self setAnnotation:annotation
     forCoordinate:location.coordinate];  // ...(*1)

 // setup default span
 MKCoordinateSpan span;
 if (self.mapView.region.span.latitudeDelta > 100) {
  span = MKCoordinateSpanMake(0.005, 0.005);
 } else {
  span = self.mapView.region.span;
 }

 // set the map view to location
 CLLocationCoordinate2D centerCoordinate = location.coordinate;
 MKCoordinateRegion coordinateRegion =
  MKCoordinateRegionMake(centerCoordinate, span);
 [self.mapView setRegion:coordinateRegion animated:YES]; 
 
 MKReverseGeocoder* reverseGeocoder = [[MKReverseGeocoder alloc]
                initWithCoordinate:location.coordinate];
 reverseGeocoder.delegate = self;
 [reverseGeocoder start];
}
SimpleAnnotaion を緯度経度(CLLocationCoordinate2D)をキーにして辞書へとっておく(*1の箇所)。これは MKReverseGeocoder の住所取得が終わった時に住所情報を格納するため。住所取得処理は次の通り。
#pragma mark -
#pragma mark MKReverseGeocoderDelegate
- (void)reverseGeocoder:(MKReverseGeocoder*)geocoder
 didFindPlacemark:(MKPlacemark*)placemark {
 self.label.text = placemark.title;

 SimpleAnnotation* annotation =
  [self annotationForCoordinate:geocoder.coordinate];
 annotation.title = placemark.title;

}  

- (void) reverseGeocoder:(MKReverseGeocoder *)geocoder
 didFailWithError:(NSError*) error {  

 self.label.text = [error description];

 SimpleAnnotation* annotation =
 [self annotationForCoordinate:geocoder.coordinate];
 annotation.title = [error description];
}
成功(あるいは失敗)したら取っておいた SimpleAnnotation を coodinate(緯度経度)をキーにして取り出し、titleへ住所情報を格納している。
SimpleAnnotation には titleプロパティを追加してある。
@interface SimpleAnnotation : NSObject {

 CLLocation* location_;
 NSString* title_;
}
@property (nonatomic, copy) CLLocation* location;
@property (nonatomic, retain) NSString* title;

@end
SimpleAnnotation の管理は NSMutableDictionaryで行う。出し入れのメソッドは次の通り。
#pragma mark -
#pragma mark Management for annotationDictionary
- (void)setAnnotation:(SimpleAnnotation*)annotation
 forCoordinate:(CLLocationCoordinate2D)coordinate
{
 NSValue* coordinateValue = [NSValue value:&coordinate
         withObjCType:@encode(CLLocationCoordinate2D)];
 [self.annotationDictionary setObject:annotation
          forKey:coordinateValue];
}

- (SimpleAnnotation*)annotationForCoordinate:(CLLocationCoordinate2D)coordinate
{
 NSValue* coordinateValue = [NSValue value:&coordinate
         withObjCType:@encode(CLLocationCoordinate2D)];
 SimpleAnnotation* annotation = [self.annotationDictionary objectForKey:coordinateValue];
 [self.annotationDictionary removeObjectForKey:coordinateValue];
 
 return annotation;
}
辞書のキーとなる CLLocationCoordinate2D はCの構造体はそのままでは入れられないので一旦 NSValue へ詰め替えてから使用している。


サンプル実行


ピンをタップすると住所情報が表示される。

ソースコード


GitHub からどうぞ。
CoreLocationSample at 2010-10-14 from xcatsan's iOS-Sample-Code - GitHub


備考


MKReverseGeocoder は GoogleのAPIを利用しているらしいが、取得に失敗することが多いらしく評判があまりよくない。

琴線探査: MKReverseGeocoderは大きい道路上を指定すると常にエラーか?

MKReverseGeocoder not working? « Welcome to Mobile World !!!

PBRequesterErrorDomain errors with reverse geocoding - iPhone Dev SDK Forum

MKReverseGeocoderは使わない方がいいみたい « wigglin’ bloggin’

上記ブログより抜粋。
良い時で1割くらい、悪いときは百発百中でこのエラーが発生します。
実際、少し試しただけでも数回に1回ぐらいの頻度で取得に失敗した。あるケースでは郵便番号だけが帰ってきたこともあった。
GoogleMapsのREST APIを使ったらうまくいったとの報告があったので、同じ事を試してみたらアッサリと解決したのでした。


実際サンプル作成中にも下記のエラーが発生した。
/SourceCache/GoogleMobileMaps_Sim/GoogleMobileMaps-257/
  googlenav/mac/Loader.mm:231 server returned error: 503


このあたり本格的な利用に際しては GoogleMapsのREST APIの利用も検討した方が良いかもしれない。あるいは何回かリトライしてみるとか?


参考情報


MKReverseGeocoder Class Reference
リファレンス

[iPhone] MapKit でリバースジオコーディング、緯度経度から住所を取得 | Sun Limited Mt.
MKReverseGeocoder の使い方で参考になった。

NSArrayにNSValueでC構造体を格納する - stoikheiaの日記
CLLocationCoordinate2D を NSMutableDictionary へ格納するのに参考になった。

琴線探査: MKReverseGeocoderでより精度の高い住所情報はMKPlacemark.addressDictionaryにあった!

CoreLocation - [3] MKMapView の初期表示設定

2010年10月13日水曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加

[前回] Cocoaの日々: CoreLocation - [2] マップに表示する

MKMapView はそのまま表示すると大西洋を中心とした世界地図が初期表示される。

今回はこの初期表示を現在地に変える。


MKCoordinateRegion


MKMapView で任意の場所を表示する場合、MKCoordinateRegionを使う。この MKCoordinateRegionはCの構造体で中心位置を表す CLLocationCoordinate2Dの値と、表示領域を示す MKCoordinateSpanの値を持つ。
typedef struct {
 CLLocationCoordinate2D center;
 MKCoordinateSpan span;
} MKCoordinateRegion;
中心位置は MKMapView を表示した時に中心にくる緯度経度を表す。MKCoordinateSpan は表示領域を表すために緯度経度方向の幅を表す値を持っている。
typedef struct {
    CLLocationDegrees latitudeDelta;
    CLLocationDegrees longitudeDelta;
} MKCoordinateSpan;
イメージはこんな感じ。
それぞれの構造体向けに生成用の関数が用意されているので利用時にはこれらを使う。
MKCoordinateSpan MKCoordinateSpanMake(
    CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta)

MKCoordinateRegion MKCoordinateRegionMake(
    CLLocationCoordinate2D centerCoordinate, MKCoordinateSpan span)
MKCoordinateRegion を用意できれば後は -[MKMapView setRegion:animated:] に渡して MKMapViewの表示を変えることができる。

それではサンプルで確認してみよう。


実装


指定した位置を中心に表示し、ピンを立てるメソッドを追加した。
- (void)setPinToCoordinate:(CLLocation*)location
{
 SimpleAnnotation* annotation = [[[SimpleAnnotation alloc] init] autorelease];
 annotation.location = self.locationManager.location; 
 [self.mapView addAnnotation:annotation];

 MKCoordinateSpan span = MKCoordinateSpanMake(0.5, 0.5);
 CLLocationCoordinate2D centerCoordinate = location.coordinate;
 MKCoordinateRegion coordinateRegion =
  MKCoordinateRegionMake(centerCoordinate, span);
 [self.mapView setRegion:coordinateRegion animated:YES]; 
}
これを起動直後と reloadボタンを押した時に呼び出す。


サンプル


実行してみよう。
一瞬大西洋が表示されるが、そこからアニメーションが始まり現在位置まで移動&ズームインする。


ソースコード


GitHubからどうぞ。
xcatsan's iOS-Sample-Code at 2010-10-13 - GitHub


参考情報


MKMapView Zoom and Reigon
MKCoordinateSpanの説明がわかりやすい。

Bugle Diary: [Objective-C][iPhone sdk][google maps]特定の住所を地図上に表示する
わかりやすくて参考になった。


その他


StackOverflow の記事で MKMapView の初期表示指定で GooglMapの Zoomlevelのような設定ができるブログを知った。
Set the Zoom Level of an MKMapView

GoogleMapだとこんな感じで書ける。
map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13);
最後の 13 が zoomlevel

この記事で紹介されている MKMapViewのカテゴリメソッドを使うと同等のことを行うのにこう書ける。
CLLocationCoordinate2D centerCoord = { 37.4419, -122.1419 };
    [mapView setCenterCoordinate:centerCoord zoomLevel:13 animated:NO];
}

zoomlevelも GoogleMapのそれと同じ縮尺になるよう調整してあるなどの凝りよう。ブログにはこのカテゴリを使って表示した地図とGoogleMapを同じ ZoomLevelを指定して比較したスクリーンショットまである。

これはなかなかいい。使えそう。

CoreLocation - [2] マップに表示する

2010年10月12日火曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加

[前回] Cocoaの日々: CoreLocation - [1] 現在地の緯度経度を取得する

今回は現在位置を地図上にピンを立てて表示してみる。

実装


MKMapView を使うにはまず MapKit.framework をプロジェクトへ追加する。

そして必要なヘッダをインポートする。
#import <MapKit/MapKit.h>

続いてコントローラにアウトレットとアクションを追加する。
@interface CoreLocationSampleViewController : UIViewController  {

 CLLocationManager* locationManager_;
 
 MKMapView* mapView_;
 
}

Interface Builder を開き MKMapView を配置した後、コントローラのアウトレットへ接続しておく。また "reload"ボタンを配置してやはりコントローラをターゲットとしておく。

次に MKAnnotationプロトコルを実装したクラスをひとつ用意する。
@interface SimpleAnnotation : NSObject <MKAnnotation>{

 CLLocation* location_;
}
@property (nonatomic, copy) CLLocation* location;

@end
@implementation SimpleAnnotation
@synthesize location = location_;

#pragma mark -
#pragma mark MKAnnotation
- (CLLocationCoordinate2D)coordinate
{
    return self.location.coordinate;
}

- (NSString*)title
{
    return @"Hello!";
}

@end

これをコントローラで "reload"ボタンが押された時に MKMapView へ追加する。
#pragma mark -
#pragma mark Event
- (IBAction)reload:(id)sender
{
 SimpleAnnotation* annotation = [[[SimpleAnnotation alloc] init] autorelease];
 annotation.location = self.locationManager.location; 
 [self.mapView addAnnotation:annotation];
}


実行


さて実行してみよう。
実行直後は大西洋を中心とした世界地図が表示される。

reloadボタンを押した後、日本を探すと...あった。

拡大。

ピンをクリックすると -[MKAnnotation title] の文字列が噴出しで表示される。


ソースコード


GitHubからどうぞ。
CoreLocationSample at 2010-10-12 from xcatsan's iOS-Sample-Code - GitHub


参考情報


【コラム】実践! iPhoneアプリ開発 (16) ロギングアプリの作り方 (2) - Map Kitで地図を表示する | エンタープライズ | マイコミジャーナル

CoreLocation - [1] 現在地の緯度経度を取得する

2010年10月9日土曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加

CoreLocation を使って現在地の緯度経度を取得する。簡単なサンプルを作ってシミュレータ、iPhone3GS、iPadで動作確認をやってみた。

CoreLocation


CoreLocationManager を使う。使い方はリファレンスに書いてある。
CLLocationManager Class Reference より抜粋

To configure and use a CLLocationManager object to deliver events:
  1. Always check to see whether the desired services are available before starting any services and abandon the operation if they are not.
  2. Create an instance of the CLLocationManager class.
  3. Assign a custom object to the delegate property. This object must conform to theCLLocationManagerDelegate protocol.
  4. Configure any additional properties relevant to the desired service.
  5. Call the appropriate start method to begin the delivery of events.


サンプル


起動するとデバッガコンソールへ CLLocationの情報を書き出す簡単なサンプルを作った。
[3389:307] Start updating location.
[3389:307] ----------------------------------------------------
[3389:307] latitude,logitude : 35.433066, 139.720322
[3389:307] altitude          : 0.000000
[3389:307] cource            : -1.000000
[3389:307] horizontalAccuracy: 250.000000
[3389:307] verticalAccuracy  : -1.000000
[3389:307] speed             : -1.000000
[3389:307] timestamp         : 2010-10-20 06:31:09 +0900
画面表示は何もなし。



実装


準備

(1) Frameworks に CoreLocation.frameworkを追加する

(2) ヘッダファイル読み込み
#import <CoreLocation/CoreLocation.h>

コード


- (void)viewDidLoad {
    [super viewDidLoad];

 if ([CLLocationManager locationServicesEnabled]) {
  self.locationManager = [[CLLocationManager alloc] init];
  self.locationManager.delegate = self;
  [self.locationManager startUpdatingLocation];
  NSLog(@"Start updating location.");
  
 } else {
  NSLog(@"The location services is disabled.");
 }
}

- (void)logLocation:(CLLocation*)location
{
 CLLocationCoordinate2D coordinate = location.coordinate;
 NSLog(@"----------------------------------------------------");
 NSLog(@"latitude,logitude : %f, %f", coordinate.latitude, coordinate.longitude);
 NSLog(@"altitude          : %f", location.altitude);
 NSLog(@"cource            : %f", location.course);
 NSLog(@"horizontalAccuracy: %f", location.horizontalAccuracy);
 NSLog(@"verticalAccuracy  : %f", location.verticalAccuracy);
 NSLog(@"speed             : %f", location.speed);
 NSLog(@"timestamp         : %@", location.timestamp);
}

- (void)locationManager:(CLLocationManager *)manager
 didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {

 [self logLocation:newLocation];
}

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error{
 NSLog(@"Error: %@", error);
}



結果


シミュレータ (WiFi)

初回に確認ダイアログが表示される。

1回目
Start updating location.
----------------------------------------------------
latitude,logitude : 35.534066, 139.720422
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 150.000000
verticalAccuracy  : -1.000000
speed             : -1.000000
timestamp         : 2010-10-19 21:44:07 GMT
----------------------------------------------------
latitude,logitude : 35.533892, 139.720450
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 185.000000
verticalAccuracy  : -1.000000
speed             : 0.000000
timestamp         : 2010-10-19 21:44:38 GMT
----------------------------------------------------
latitude,logitude : 35.533892, 139.720450
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 185.000000
verticalAccuracy  : -1.000000
speed             : 0.000000
timestamp         : 2010-10-19 21:44:53 GMT

2回目
Start updating location.
----------------------------------------------------
latitude,logitude : 35.533892, 139.720450
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 185.000000
verticalAccuracy  : -1.000000
speed             : 0.000000
timestamp         : 2010-10-19 21:45:13 GMT
----------------------------------------------------
latitude,logitude : 35.533892, 139.720450
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 185.000000
verticalAccuracy  : -1.000000
speed             : 0.000000
timestamp         : 2010-10-19 21:45:23 GMT

実機 - iPhone 3GS (iOS4.0) ※屋内

初回にダイアログが表示される。

また実行中は位置情報使用中のインジゲータが表示される。

1回目 6:47起動
Start updating location.
----------------------------------------------------
latitude,logitude : 35.530754, 139.718766
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 620.000000
verticalAccuracy  : -1.000000
speed             : -1.000000
timestamp         : 2010-10-20 06:46:50 +0900
----------------------------------------------------
latitude,logitude : 35.530754, 139.718766
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 620.000000
verticalAccuracy  : -1.000000
speed             : -1.000000
timestamp         : 2010-10-20 06:46:50 +0900
----------------------------------------------------
latitude,logitude : 35.533505, 139.720757
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 80.000000
verticalAccuracy  : -1.000000
speed             : -1.000000
timestamp         : 2010-10-20 06:46:52 +0900
  :

2回目 6:47起動
Start updating location.
----------------------------------------------------
latitude,logitude : 35.533505, 139.720757
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 80.000000
verticalAccuracy  : -1.000000
speed             : -1.000000
timestamp         : 2010-10-20 06:47:47 +0900
  :

3回目 6:53起動(5分後)
Start updating location.
----------------------------------------------------
latitude,logitude : 35.533505, 139.720757
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 80.000000
verticalAccuracy  : -1.000000
speed             : -1.000000
timestamp         : 2010-10-20 06:48:22 +0900
----------------------------------------------------
latitude,logitude : 35.533505, 139.720757
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 80.000000
verticalAccuracy  : -1.000000
speed             : -1.000000
timestamp         : 2010-10-20 06:54:22 +0900
----------------------------------------------------
latitude,logitude : 35.533505, 139.720757
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 80.000000
verticalAccuracy  : -1.000000
speed             : -1.000000
timestamp         : 2010-10-20 06:55:25 +0900
----------------------------------------------------
latitude,logitude : 35.533658, 139.720645
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 250.000000
verticalAccuracy  : -1.000000
speed             : -1.000000
timestamp         : 2010-10-20 06:56:27 +0900


実機 - iPad (iOS 3.2/WiFi)

1回目(6:52起動)
Start updating location.
----------------------------------------------------
latitude,logitude : 35.533658, 139.720645
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 250.000000
verticalAccuracy  : -1.000000
speed             : -1.000000
timestamp         : 2010-10-20 06:52:15 +0900
----------------------------------------------------
latitude,logitude : 35.533658, 139.720645
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 250.000000
verticalAccuracy  : -1.000000
speed             : -1.000000
timestamp         : 2010-10-20 06:53:17 +0900

2回目(6:53起動)
Start updating location.
----------------------------------------------------
latitude,logitude : 35.533658, 139.720645
altitude          : 0.000000
cource            : -1.000000
horizontalAccuracy: 250.000000
verticalAccuracy  : -1.000000
speed             : -1.000000
timestamp         : 2010-10-20 06:53:52 +0900


まとめ

  • 実機(iPhone3GS)では1分毎に CLLocationManagerDelegate のメソッドが呼び出される(位置情報が更新される)
  • 実機(iPhone3GS)では位置情報更新の度に精度 が上がっていった(CLLocation.horizontalAccuracyが低くなる)。ただし悪くなるケースも見られた。
  • 5分程度してから位置情報へアクセスすると前回キャッシュされた位置情報が最初に返された(CLLocation.timestampで確認可能)。
  • シミュレータでも WiFi経由で現在位置の取得が可能。確認ダイアログも表示される(昔はそうではなかったらしい)
  • locationServicesEnabledプロパティはiOS4.0から Deprecated。同名のクラスメソッドを使う。
  • 検証環境での精度は
    シミュレータ [150〜185m]
    iPhone3GS [80〜250m]
    iPad-Wifi [250m] ※固定?
  • CLLocation.verticalAccuracyはiOSの場合常に-1(リファレンスに書いてある)。

ソースコード


GitHub からどうぞ。
xcatsan's iOS-Sample-Code at 2010-10-09 - GitHub


参考情報


CLLocationManager Class Reference

リファレンス


LocateMe

iOS Reference Library のサンプル


【コラム】実践! iPhoneアプリ開発 (15) ロギングアプリの作り方 (1) - Core Locationで現在地を取得する | エンタープライズ | マイコミジャーナル
【コラム】実践! iPhoneアプリ開発 (16) ロギングアプリの作り方 (2) - Map Kitで地図を表示する | エンタープライズ | マイコミジャーナル
【コラム】実践! iPhoneアプリ開発 (17) ロギングアプリの作り方 (3) - アノテーションビューをカスタマイズする | エンタープライズ | マイコミジャーナル

木下氏の連載。わかりやすくとても参考になった。


GPSを利用する方法 - プログラミングノート

ソースコードを参考に。


Core Locationのaccuracyについて - The iPhone Development Playground

精度の話。タイムスタンプチェックや精度を上げる為には数回位置更新を待つ、など。昨年の記事なので iOS 3ベース。

- - - - -
今更ながら初めて CoreLocation を試してみた。なんか楽しい-。
次回はマップにピンを立てる。

人気の投稿(過去 30日間)