이 문서에서는 다음 두 가지 기능을 사용하여 앱의 경유지 환경설정을 관리하는 방법을 설명합니다.
도로 측면 경로 환경설정
스탑오버
도로 측면 라우팅 환경설정 지정
기본적으로 iOS용 Navigation SDK는 경유지까지 가장 빠른 경로를 찾지만, 이 경우 사용자가 원하는 도로 쪽(예: 차량 공유 운전자의 고객이 기다리는 도로 쪽)에 도착한다는 보장은 없습니다. 도로변 라우팅 환경설정 기능을 사용하면 차량이 올바른 도로변에 도착하도록 할 수 있습니다.
작동 방식
해당 정류장의 경유지를 만들 때 특정 도로 측면에 도착하도록 환경설정을 지정합니다. 두 가지 방법 중 하나로 환경설정을 지정할 수 있습니다.
같은 쪽 도로 선호
경로의 지리적 좌표를 제공한 다음 경로가 가장 가까운 인도로 스냅되어 경로와 동일한 도로 측면에 도착하는 것을 선호함을 나타내는 플래그 preferSameSideOfRoad을 설정합니다.
Navigation SDK는 경유지와 가장 가까운 도로 구간을 선택합니다. 이 도로 구간은 차선 방향이 경유지가 있는 도로 측면과 +/- 55도 이내로 정렬되어 있습니다.
경유지 환경설정 지정
특정 장소에서는 사용자가 안전하게 멈출 수 없습니다 (예: 고지대, 페리, 지하 장소, 접근이 제한된 기타 지역). 경유지 기능은 사용자가 정차하기에 적합하지 않은 위치인 경우 경유지를 근처 장소로 재배치합니다. vehicleStopover을 YES로 설정하면 대체 위치가 있는 경우 경로가 계산될 때 경유지가 자동으로 재배치됩니다.
작동 방식
정차 지점의 경유지를 만들 때 해당 정차 지점의 환경설정을 설정합니다. 이렇게 하려면 다음 예와 같이 GMSNavigationMutableWaypoint에서 경유지 환경설정을 설정합니다.
Swift
letlocation=CLLocationCoordinate2D(latitude:47.67,longitude:-122.20)letwaypoint=GMSNavigationMutableWaypoint(location:location,title:"waypoint from location")!waypoint.vehicleStopover=truemapView.navigator?.setDestinations([waypoint],routingOptions:routingOptions,callback:{...})
Objective-C
CLLocationCoordinate2Dlocation=CLLocationCoordinate2DMake(47.67,-122.20);GMSNavigationMutableWaypoint*waypoint=[[GMSNavigationMutableWaypointalloc]initWithLocation:locationtitle:@"waypoint from location"];waypoint.vehicleStopover=YES;[_mapView.navigatorsetDestinations:@[waypoint1]routingOptions:routingOptionscallback:^(GMSRouteStatusrouteStatus){...}];
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-27(UTC)"],[[["\u003cp\u003eThis document explains how to manage waypoint preferences for your app using Side of the Road Routing and Stopover features.\u003c/p\u003e\n"],["\u003cp\u003eSide of the Road Routing ensures arrival on the correct side of the road using \u003ccode\u003epreferSameSideOfRoad\u003c/code\u003e or \u003ccode\u003epreferredSegmentHeading\u003c/code\u003e when creating waypoints.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003epreferSameSideOfRoad\u003c/code\u003e snaps the waypoint to the nearest sidewalk, while \u003ccode\u003epreferredSegmentHeading\u003c/code\u003e aligns the arrival with traffic flow on the desired side of the road.\u003c/p\u003e\n"],["\u003cp\u003eThe Stopover feature automatically relocates waypoints to safe stopping areas when \u003ccode\u003evehicleStopover\u003c/code\u003e is set to \u003ccode\u003eYES\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Manage waypoints\n\nThis document describes how you can manage waypoint preferences for your app\nby using two features:\n\n- Side of the road routing preferences\n- Stopover\n\nSet side of the road routing preference\n---------------------------------------\n\nBy default, the Navigation SDK for iOS finds the quickest route to a\nwaypoint, however this doesn't guarantee that the user will arrive on the\ndesired side of the road, for example, the side of the road that a rideshare\ndriver's customer is waiting on. The **Side of the Road Routing Preference**\nfeature lets you ensure that the vehicle arrives on the correct side of the\nroad.\n\n### How it works\n\nYou set the preference for arriving on a particular side of the road when you\ncreate the waypoint for that stop. You can specify the preference in one of two\nways.\n\n### Prefer the same side of the road\n\nYou provide the geographic coordinates of the waypoint, and then set a flag\n[`preferSameSideOfRoad`](/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationWaypoint#prefersamesideofroad)\nthat indicates that you prefer to arrive on the same side of the road as the\nwaypoint---snapped to the nearest sidewalk. \n\n (nullable instancetype)initWithLocation:(CLLocationCoordinate2D)location\n title:(NSString *)title\n preferSameSideOfRoad:(BOOL)preferSameSideOfRoad;\n\n| **Key Point:** In some situations, when the waypoint is snapped to the side of the nearest road, the nearest road might not be the right one. For example, it might be a road around the corner from a waiting rideshare customer. You can prevent this from occurring by using `preferredSegmentHeading` instead of `preferSameSideOfRoad` (see the next section for details).\n\n### Set an arrival heading\n\nYou provide the geographic coordinates of the waypoint, and then provide an\narrival heading\n[`preferredSegmentHeading`](/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationWaypoint#-initwithlocation:title:preferredsegmentheading:)\nthat matches the direction of traffic flow on the same side of the road as the\ndestination. \n\n (nullable instancetype)initWithLocation:(CLLocationCoordinate2D)location\n title:(NSString *)title\n preferredSegmentHeading:(int32_t)preferredSegmentHeading;\n\nThe Navigation SDK chooses the road segment closest to the\nwaypoint---that has a lane direction that aligns (within +/- 55 degrees) with the\nside of the road that the waypoint is on.\n\nSet stopover preference\n-----------------------\n\nIn certain places, it's not possible for users to stop safely (for example,\nelevated areas, ferries, underground locations, and other areas of limited\naccess). The **Stopover** feature relocates the waypoint to a nearby place if\nits location is not suitable for a user to make a stop. When you set\n`vehicleStopover` to `YES`, the waypoint is automatically relocated when\nthe route is calculated, if an alternate location is available.\n\n### How it works\n\nYou set the preference for a stopover when creating the waypoint for that stop.\nTo do this, set the preference for a stopover on a\n`GMSNavigationMutableWaypoint` as shown in the following example: \n\n### Swift\n\n\n```swift\nlet location = CLLocationCoordinate2D(latitude: 47.67, longitude: -122.20)\nlet waypoint = GMSNavigationMutableWaypoint(location: location, title: \"waypoint from location\")!\nwaypoint.vehicleStopover = true\nmapView.navigator?.setDestinations([waypoint], routingOptions: routingOptions, callback: {...})\n```\n\n\u003cbr /\u003e\n\n### Objective-C\n\n\n```objective-c\nCLLocationCoordinate2D location = CLLocationCoordinate2DMake(47.67, -122.20);\nGMSNavigationMutableWaypoint *waypoint =\n [[GMSNavigationMutableWaypoint alloc] initWithLocation:location\n title:@\"waypoint from location\"];\nwaypoint.vehicleStopover = YES;\n[_mapView.navigator setDestinations:@[waypoint1]\n routingOptions:routingOptions\n callback:^(GMSRouteStatus routeStatus){...}];\n```\n\n\u003cbr /\u003e"]]