0
ナビゲーションモードでは、ステップの指示テキストは表示されません(テストした限り、音声の指示は表示されません)。ここで私はルートを取得するときに、私が呼び出す関数です。ナビゲーションモードでテキストの説明が表示されない(マップボックスiOS)
- (void)startNavigation:(MBRoute *)route {
MBNavigationLocationManager *locationManager = [[MBNavigationLocationManager alloc] init];
MBNavigationViewController *controller = [[MBNavigationViewController alloc] initWithRoute:route directions:[MBDirections sharedDirections] style:nil locationManager:locationManager];
[self presentViewController:controller animated:YES completion:^{ NSString *locationURL = [NSString stringWithFormat:@"https://DBNAME.firebaseio.com/realtime-location"];
FIRDatabaseReference *geofireRef = [[FIRDatabase database] referenceFromURL:locationURL];
GeoFire *geoFire = [[GeoFire alloc] initWithFirebaseRef:geofireRef];
CLLocation *center = [[CLLocation alloc] initWithLatitude:self.currentLocation.coordinate.latitude longitude:self.currentLocation.coordinate.longitude];
GFCircleQuery *circleQuery = [geoFire queryAtLocation:center withRadius:1.0];
FIRDatabaseHandle queryEntered = [circleQuery observeEventType:GFEventTypeKeyEntered withBlock:^(NSString *key, CLLocation *location) {
if (![key isEqualToString:self.carID]) {
for (MGLPointAnnotation *annotation in controller.mapView.annotations) {
if ([annotation.title isEqualToString:key]) {
break;
} else {
MGLPointAnnotation *point = [[MGLPointAnnotation alloc] init];
point.coordinate = location.coordinate;
point.title = key;
[controller.mapView addAnnotation:point];
NSLog(@"Added new surrounding annotation %@", key);
}
}
}
}];
FIRDatabaseHandle queryMoved = [circleQuery observeEventType:GFEventTypeKeyMoved withBlock:^(NSString *key, CLLocation *location) {
if (![key isEqualToString:self.carID]) {
for (MGLPointAnnotation *annotation in controller.mapView.annotations) {
if ([annotation.title isEqualToString:key]) {
[controller.mapView removeAnnotation:annotation];
MGLPointAnnotation *point = [[MGLPointAnnotation alloc] init];
point.coordinate = location.coordinate;
point.title = key;
[controller.mapView addAnnotation:point];
NSLog(@"Updated surrounding annotations %@", key);
}
}
}
}];
}];
self.navController = controller;
UIButton *cautionButton = [UIButton buttonWithType:UIButtonTypeCustom];
cautionButton.frame = CGRectMake(3, self.view.frame.size.height-122, 45, 39);
UIImage *buttonImage = [UIImage imageNamed:@"caution"];
[cautionButton setImage:buttonImage forState:UIControlStateNormal];
[cautionButton addTarget:self action:@selector(reportCaution) forControlEvents:UIControlEventTouchUpInside];
[controller.view addSubview:cautionButton];
}
スクリーンショット:ここ
は、私が使用していますMapbox関連ポッドのバージョンです。私の知る限りでは、彼らは、最新のバージョンにしている:
- Mapbox-iOS-SDK (3.7.2)
- MapboxCoreNavigation (0.12.0):
- MapboxDirections.swift (~> 0.15)
- MapboxMobileEvents (~> 0.2)
- Turf (~> 0.0.4)
- MapboxDirections.swift (0.15.1):
- Polyline (~> 4.2)
- MapboxMobileEvents (0.2.10)
- MapboxNavigation (0.12.0):
- AWSPolly (~> 2.6)
- Mapbox-iOS-SDK (~> 3.6)
- MapboxCoreNavigation (= 0.12.0)
- SDWebImage (~> 4.1)
- Solar (~> 2.1)
- Turf (~> 0.0.4)
- Masonry (1.1.0)
- MBProgressHUD (0.9.2)