با مجموعهها، منظم بمانید ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این سند توضیح میدهد که چگونه میتوانید با استفاده از دو ویژگی، تنظیمات برگزیده نقطه بین برنامه خود را مدیریت کنید:
ترجیحات مسیریابی کنار جاده
توقف
سمت ترجیح مسیریابی جاده را تنظیم کنید
بهطور پیشفرض، Navigation SDK برای iOS سریعترین مسیر را برای رسیدن به یک ایستگاه بینالمللی پیدا میکند، اما این تضمین نمیکند که کاربر به سمت دلخواه جاده برسد، بهعنوان مثال، کنار جادهای که مشتری رانندهای به اشتراک گذاشته شده در آن منتظر است. ویژگی ترجیحی مسیریابی کنار جاده به شما امکان می دهد اطمینان حاصل کنید که وسیله نقلیه به سمت درست جاده می رسد.
چگونه کار می کند
هنگام ایجاد نقطه بین راه برای آن توقف، اولویت را برای رسیدن به سمت خاصی از جاده تنظیم می کنید. شما می توانید اولویت را به یکی از دو روش مشخص کنید.
همان سمت جاده را ترجیح دهید
مختصات جغرافیایی ایستگاه بین راه را ارائه می دهید و سپس یک پرچم preferSameSideOfRoad تعیین می کنید که نشان می دهد ترجیح می دهید به همان سمت جاده برسید که در نزدیک ترین پیاده رو قرار دارد.
شما مختصات جغرافیایی نقطه بین راه را ارائه می دهید و سپس یک عنوان ورودی preferredSegmentHeading ارائه می دهید که جهت جریان ترافیک در همان سمت جاده با مقصد مطابقت دارد.
Navigation SDK نزدیکترین بخش جاده به نقطه بین راه را انتخاب میکند - که جهت خطی دارد که (در 55+/- درجه) با سمت جادهای که ایستگاه بین راه در آن قرار دارد، همسو میشود.
اولویت توقف را تنظیم کنید
در مکانهای خاص، توقف ایمن برای کاربران امکانپذیر نیست (به عنوان مثال، مناطق مرتفع، کشتیها، مکانهای زیرزمینی و سایر مناطق با دسترسی محدود). ویژگی Stopover اگر موقعیت مکانی آن برای توقف کاربر مناسب نباشد، نقطه بین راه را به مکان نزدیک منتقل می کند. هنگامی که vehicleStopover روی YES تنظیم می کنید، در صورت وجود مکان جایگزین، هنگام محاسبه مسیر، نقطه بین به طور خودکار تغییر مکان می دهد.
چگونه کار می کند
هنگام ایجاد ایستگاه بین راهی برای آن توقف، اولویت را برای توقف تعیین می کنید. برای انجام این کار، اولویت را برای توقف در یک GMSNavigationMutableWaypoint همانطور که در مثال زیر نشان داده شده است، تنظیم کنید:
سویفت
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:{...})
هدف-C
CLLocationCoordinate2Dlocation=CLLocationCoordinate2DMake(47.67,-122.20);GMSNavigationMutableWaypoint*waypoint=[[GMSNavigationMutableWaypointalloc]initWithLocation:locationtitle:@"waypoint from location"];waypoint.vehicleStopover=YES;[_mapView.navigatorsetDestinations:@[waypoint1]routingOptions:routingOptionscallback:^(GMSRouteStatusrouteStatus){...}];
تاریخ آخرین بهروزرسانی 2025-08-15 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-15 بهوقت ساعت هماهنگ جهانی."],[[["\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,["This 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\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\nHow 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\nPrefer 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\nSet 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\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\nHow 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\nSwift\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\nObjective-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"]]