Google マップ SDK を完全に使用することはできません。CLLocationManger フレームワークを使用して場所の更新を取得する必要があります。
locationManager を初期化して、重要な場所の変更を登録し、デリゲートを適切に設定します
if (nil == locationManager)
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
//Configure Accuracy depending on your needs, default is kCLLocationAccuracyBest
locationManager.desiredAccuracy = kCLLocationAccuracyKilometer;
// Set a movement threshold for new events.
locationManager.distanceFilter = 500; // meters, set according to the required value.
[locationManager startUpdatingLocation];
ロケーションマネージャーの代理人:
- (void)locationManager:(CLLocationManager *)manager
didUpdateLocations:(NSArray *)locations {
// If it's a relatively recent event, turn off updates to save power.
CLLocation* location = [locations lastObject];
NSDate* eventDate = location.timestamp;
NSTimeInterval howRecent = [eventDate timeIntervalSinceNow];
if (abs(howRecent) < 15.0) {
// Update your marker on your map using location.coordinate by using the GMSCameraUpdate object
GMSCameraUpdate *locationUpdate = [GMSCameraUpdate setTarget:location.coordinate zoom:YOUR_ZOOM_LEVEL];
[mapView_ animateWithCameraUpdate:locationUpdate];
}