실시간 중단 구성
실시간 중단은 경로 중의 중단에 관해 사용자에게 알리고 사용자가 발생한 중단을 신고하고 확인할 수 있는 기능 모음입니다. 차량 사고, 교통 혼잡, 경찰 및 속도 카메라 설치, 공사, 차선 폐쇄, 특정 날씨 등이 교통 체증의 예입니다. 이 페이지에서는 실시간 중단 기능과 맞춤 탐색 UI를 사용하는 앱에 관한 고려사항을 비롯한 구성 옵션을 설명합니다.
실시간 서비스 중단 기능
Navigation SDK에는 핵심 내비게이션 환경의 일부로 다음과 같은 실시간 중단 기능이 포함되어 있습니다.이러한 기능은 구성할 수 있으며 기본적으로 사용 설정되어 있습니다. 다음 섹션에서는 기능과 사용 가능한 구성 옵션에 대해 자세히 설명합니다.
경로의 대화형 서비스 중단 콜아웃
앱이 경로 개요 또는 활성 내비게이션 중에 경로를 표시하면 현재 중단된 구간이 경로에 콜아웃으로 표시됩니다. 콜아웃에는 서비스 중단 유형을 나타내는 아이콘이 포함됩니다.

shouldDisplayPrompts
를 사용하여 경로의 서비스 중단 콜아웃 표시를 제어할 수 있으며, 이때 사용자가 서비스 중단에 접근할 때 자동 알림 표시도 제어됩니다.
mapView.navigator.shouldDisplayPrompts = true
사용자가 콜아웃을 탭할 때 서비스 중단 세부정보 표시
사용자는 콜아웃을 탭하여 서비스 중단 유형, 마지막으로 신고된 시간, 경우에 따라 서비스 중단이 여전히 발생 중인지에 관한 투표 옵션을 비롯하여 서비스 중단에 관한 자세한 정보가 포함된 정보 카드를 표시할 수 있습니다. 사용자가 탐색 중인지에 따라 두 가지 유형의 정보 카드가 표시될 수 있으며 구성 옵션은 유형마다 다릅니다.
활성 내비게이션을 시작하기 전 경로 개요의 콜아웃 정보 카드
사용자가 경로 개요에서 콜아웃을 탭하면 활성 내비게이션을 시작하기 전에 서비스 중단에 관한 자세한 정보가 포함된 정보 카드가 표시됩니다.

showsIncidentCards
를 사용하여 사용자가 경로 개요에서 서비스 중단 콜아웃을 탭하여 자세한 정보를 표시할 수 있는 기능을 제어할 수 있습니다.
mapView.settings.showsIncidentCards = true
내비게이션이 진행 중일 때의 콜아웃 정보 카드
운전 중 경로에 서비스 중단 콜아웃이 표시되면 사용자는 콜아웃을 탭하여 서비스 중단 유형, 마지막으로 신고된 시간 등 서비스 중단에 관한 자세한 정보와 서비스 중단이 여전히 진행 중인지에 관한 투표 버튼이 포함된 정보 카드를 표시할 수 있습니다. 사용자가 제출한 투표는 Google에서 처리하며, 다른 Google 지도 사용자 및 Navigation SDK 사용자를 위해 지도에 표시될 수 있으며, 서비스 중단을 계속 표시할지 결정하는 데 사용될 수 있습니다.

shouldDisplayPrompts
를 사용하여 활성 내비게이션 중에 서비스 중단 콜아웃의 표시 및 탭 가능성을 제어할 수 있습니다. 이 함수는 경로의 콜아웃 표시 및 사용자가 서비스 중단에 접근할 때 자동 알림 표시도 제어합니다.
mapView.navigator.shouldDisplayPrompts = true
운전 중 투표를 통한 자동된 서비스 중단 알림
사용자가 경로를 따라 장애물에 접근하면 경로를 따라 장애물에 접근하면 장애물에 관한 정보와 장애물이 여전히 존재하는지 투표하는 버튼이 포함된 메시지가 표시됩니다. 사용자가 제출한 투표는 Google에서 처리하며, 다른 Google 지도 및 내비게이션 SDK 사용자를 위해 지도에 표시될 수 있으며, 장애를 계속 표시할지 결정하는 데 사용될 수 있습니다.

shouldDisplayPrompts
를 사용하여 활성 탐색 중에 알림 메시지의 표시를 구성할 수 있으며, 이 메시지는 경로의 콜아웃 표시도 제어합니다.
mapView.navigator.shouldDisplayPrompts = true
내비게이션 중 중단 보고
활성 내비게이션 모드 중에 내비게이션 UI에 버튼이 표시되어 사용자가 경로에서 새로운 중단을 신고할 수 있습니다. 사용자가 버튼을 탭하면 보고할 수 있는 중단 유형이 포함된 메뉴가 표시됩니다. 사용자가 제출한 신고는 Google에서 처리하며 다른 Google 지도 및 Navigation SDK 사용자를 위해 지도에 표시될 수 있습니다.


navigationReportIncidentButtonEnabled
를 사용하여 활성 탐색 중에 신고 버튼의 표시 여부를 구성할 수 있습니다.
// Enables the incident reporting FAB to show in situations where incident // reporting is possible. mapView.settings.navigationReportIncidentButtonEnabled = true
맞춤 탐색 UI 사용
Navigation SDK 구현에 맞춤 UI 요소가 포함된 경우 충돌을 방지하려면 실시간 중단 요소를 고려해야 합니다.
보고 버튼 위치
기본적으로 서비스 중단 신고 버튼은 지도의 하단 끝/뒷쪽 모서리에 있습니다. 왼쪽에서 오른쪽으로 쓰는 언어의 경우 오른쪽에, 오른쪽에서 왼쪽으로 쓰는 언어의 경우 왼쪽에 있습니다. 맞춤 UI 요소를 위한 공간을 만들기 위해 보고 버튼을 이동해야 하는 경우bottomTrailingButtonsLayoutGuide
를 사용하세요.
// Create a new layout guide let topRightLayoutGuide = UILayoutGuide() self.view.addLayoutGuide(topRightLayoutGuide) // Activate constraints using fixed constants here as an example // assuming the current reporting button is of fixed height topRightLayoutGuide.topAnchor.constraint(equalTo: _mapView.navigationHeaderLayoutGuide.bottomAnchor, constant: 50).isActive = true topRightLayoutGuide.trailingAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.trailingAnchor, constant: -14).isActive = true // Assign the layout guide _mapView.bottomTrailingButtonsLayoutGuide = topRightLayoutGuide // Create an alternate layout guide to use when the header and the footer are not full width let topRightAlternateLayoutGuide = UILayoutGuide() self.view.addLayoutGuide(topRightAlternateLayoutGuide) // Activate constraints using fixed constants here as an example // assuming the current RTD button is of fixed height topRightAlternateLayoutGuide.topAnchor.constraint(equalTo: _mapView.navigationHeaderLayoutGuide.bottomAnchor, constant: 20).isActive = true topRightAlternateLayoutGuide.trailingAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.trailingAnchor, constant: -10).isActive = true // Assign the layout guide _mapView.bottomTrailingButtonsAlternateLayoutGuide = topRightAlternateLayoutGuide
// Create a new layout guide UILayoutGuide *topRightLayoutGuide = [[UILayoutGuide alloc] init]; [self.view addLayoutGuide:topRightLayoutGuide]; // Activate constraints using fixed constants here as an example // assuming the current RTD button is of fixed height [[topRightLayoutGuide.topAnchor constraintEqualToAnchor:_mapView.navigationHeaderLayoutGuide.bottomAnchor constant:50] setActive:YES]; [[topRightLayoutGuide.trailingAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.trailingAnchor constant:-14] setActive:YES]; // Assign the layout guide _mapView.bottomTrailingButtonsLayoutGuide = topRightLayoutGuide; // Create an alternate layout guide to use when the header and the footer are not full width UILayoutGuide *topRightAlternateLayoutGuide = [[UILayoutGuide alloc] init]; [self.view addLayoutGuide:topRightAlternateLayoutGuide]; // Activate constraints using fixed constants here as an example // assuming the current RTD button is of fixed height [[topRightAlternateLayoutGuide.topAnchor constraintEqualToAnchor:_mapView.navigationHeaderLayoutGuide.bottomAnchor constant:50] setActive:YES]; [[topRightAlternateLayoutGuide.trailingAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.trailingAnchor constant:-14] setActive:YES]; // Assign the layout guide _mapView.bottomTrailingButtonsAlternateLayoutGuide = topRightAlternateLayoutGuide;
Prompt Visibility API (실험용)
Prompt Visibility API를 사용하면 Navigation SDK UI 요소가 표시되기 직전과 요소가 삭제되는 즉시 콜백을 수신하는 리스너를 추가하여 Navigation SDK에서 생성된 UI 요소와 자체 맞춤 UI 요소 간의 충돌을 방지할 수 있습니다. 정보 카드, 메시지, 서비스 중단 보고 메뉴를 비롯한 실시간 서비스 중단 요소와 Navigation SDK에서 생성된 기타 알림에 대한 콜백을 수신할 수 있습니다.// Additional methods added to GMSNavigatorListener ... func navigatorWillPresentPrompt(_ navigator: GMSNavigator) { // Hide any sort of custom UI element. } func navigatorDidDismissPrompt(_ navigator: GMSNavigator) { // Show any sort of custom UI element. } ...
// Additional methods added to GMSNavigatorListener ... - (void)navigatorWillPresentPrompt:(GMSNavigator *)navigator { // Hide any sort of custom UI element. } - (void)navigatorDidDismissPrompt:(GMSNavigator *)navigator { // Show any sort of custom UI element. } ...