تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوضّح هذا المستند كيف يمكنك إدارة إعداداتك المفضّلة لنقاط الطريق في تطبيقك باستخدام ميزتَين:
الإعدادات المفضّلة لتحديد المسار على جانب الطريق
توقف مؤقت
ضبط الإعدادات المفضّلة للتوجيه على جانب الطريق
تجد Navigation SDK لنظام التشغيل iOS تلقائيًا أسرع طريق إلى نقطة طريق، ولكن هذا لا يضمن وصول المستخدم إلى الجانب المطلوب من الطريق، مثلاً، الجانب الذي ينتظره فيه العميل الذي طلب خدمة مشاركة الركوب. تتيح لك ميزة تفضيل التوجيه إلى الجانب الصحيح من الطريق التأكّد من وصول المركبة إلى الجانب الصحيح من الطريق.
آلية العمل
يمكنك ضبط الإعدادات المفضّلة للوصول إلى جهة معيّنة من الطريق عند إنشاء نقطة الطريق الخاصة بتلك المحطة. يمكنك تحديد الخيار المفضّل بإحدى طريقتين.
تفضيل الجانب نفسه من الطريق
عليك تقديم الإحداثيات الجغرافية لنقطة الطريق، ثم ضبط علامة
preferSameSideOfRoad
تشير إلى أنّك تفضّل الوصول إلى نقطة الطريق على الجانب نفسه من الطريق، مع محاذاتها لأقرب رصيف.
يجب تقديم الإحداثيات الجغرافية لنقطة الطريق، ثم تقديم
عنوان الوصول
preferredSegmentHeading
الذي يتطابق مع اتجاه حركة المرور على الجانب نفسه من الطريق الذي يقع فيه
الموقع الجغرافي للوجهة.
تختار حزمة تطوير البرامج (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){...}];
تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\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"]]