با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
بهطور پیشفرض، Navigation SDK برای Android سریعترین مسیر را برای رسیدن به یک نقطه راه پیدا میکند، اما این تضمین نمیکند که وسیله نقلیه در کنار جادهای که مصرفکننده در آن منتظر است میآید یا اینکه محل رسیدن برای راننده امن است که در آن توقف کند. این راهنما دو ویژگی را شرح می دهد که می توانید برای این شرایط استفاده کنید:
ترجیح مسیریابی کنار جاده
ویژگی توقف
ترجیح مسیریابی سمت مسیر
هنگام ایجاد یک ایستگاه برای توقف، میتوانید اولویتی را برای رسیدن به سمت خاصی از جاده تعیین کنید. شما می توانید اولویت را به یکی از دو روش مشخص کنید: ترجیح دادن همان سمت جاده، یا ارائه یک عنوان ورود.
همان سمت جاده را ترجیح دهید
شما مختصات جغرافیایی ایستگاه بین راه را ارائه میکنید و سپس یک پرچم ( setPreferSameSideOfRoad ) تعیین میکنید که نشان میدهد ترجیح میدهید به همان سمت جاده برسید که در نزدیکترین پیادهرو قرار دارد.
شما مختصات جغرافیایی نقطه بین راه را ارائه می دهید و سپس یک عنوان ورود ( setPreferredHeading ) ارائه می دهید که با جهت جریان ترافیک در همان سمت جاده که مصرف کننده منتظر است مطابقت دارد.
Navigation SDK نزدیکترین بخش جاده به نقطه بین راه را انتخاب میکند - که جهت خطی دارد که (در 55+/- درجه) با سمت جادهای که ایستگاه بین راه در آن قرار دارد، همسو میشود.
اولویت توقف را تنظیم کنید
در مکانهای خاص، توقف ایمن برای رانندگان امکانپذیر نیست (مثلاً مناطق مرتفع، کشتیها، مکانهای زیرزمینی و سایر مناطق با دسترسی محدود). ویژگی Stopover اگر موقعیت مکانی آن برای توقف وسیله نقلیه مناسب نباشد، نقطه بین راه را به مکان نزدیک منتقل می کند. وقتی setVehicleStopover روی true تنظیم می کنید، در صورت وجود مکان جایگزین، هنگام محاسبه مسیر، نقطه بین به طور خودکار تغییر مکان می دهد.
چگونه کار می کند
هنگام ایجاد ایستگاه بین راهی برای آن توقف، اولویت را برای توقف تعیین می کنید. برای انجام این کار، ترجیح setVehicleStopover را همانطور که در مثال زیر نشان داده شده است، مشخص کنید:
تاریخ آخرین بهروزرسانی 2025-09-03 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-09-03 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe Navigation SDK for Android now uses \u003ccode\u003eWaypoint.Builder\u003c/code\u003e to create waypoints with options for side-of-road routing and stopover preferences.\u003c/p\u003e\n"],["\u003cp\u003eYou can ensure arrival on the desired side of the road by setting \u003ccode\u003esetPreferSameSideOfRoad\u003c/code\u003e or providing an arrival heading using \u003ccode\u003esetPreferredHeading\u003c/code\u003e when building a waypoint.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esetVehicleStopover\u003c/code\u003e preference within \u003ccode\u003eWaypoint.Builder\u003c/code\u003e relocates waypoints to safer nearby locations if the initial location isn't suitable for stopping.\u003c/p\u003e\n"]]],[],null,["# Manage waypoints\n\n| **Notice:** `fromLatLng()` and `fromPlaceId()`\n| are deprecated, but will remain available with no further updates. We\n| recommend migrating to the new [`Waypoint.Builder`](/maps/documentation/navigation/android-sdk/reference/com/google/android/libraries/navigation/Waypoint.Builder).\n\nBy default, the Navigation SDK for Android finds the quickest route to a\nwaypoint, however this doesn't guarantee that the vehicle will arrive on the\nside of the road that the consumer is waiting on or that the arrival place is\nsafe for the driver to stop at. This guide describes two feature you can use for\nthese situations:\n\n- **Side of the road routing preference**\n- **Stopover feature**\n\nSide of the route routing preference\n------------------------------------\n\nYou can set a preference for arriving on a particular side of the\nroad when you create a waypoint for a stop. You can specify the preference\nin one of two ways: prefer the same side of the road, or provide an arrival\nheading.\n\n### Prefer the same side of the road\n\nYou provide the geographic coordinates of the waypoint, and then set a flag\n(`setPreferSameSideOfRoad`) that indicates that you prefer to arrive on the same\nside of the road as the waypoint---snapped to the nearest sidewalk. \n\n Waypoint waypoint =\n Waypoint.builder()\n .setLatLng(latitude, longitude)\n .setTitle(\"Somewhere in Sydney\")\n .setPreferSameSideOfRoad(true)\n .build()\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 the waiting consumer. You can prevent this from occurring by using `setPreferredHeading` instead of `setPreferSameSideOfRoad` (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 (`setPreferredHeading`) that matches the direction of\ntraffic flow on the same side of the road as the waiting consumer. \n\n Waypoint waypoint =\n Waypoint.builder()\n .setLatLng(latitude, longitude)\n .setTitle(\"Somewhere in Sydney\")\n .setPreferredHeading(preferredHeading)\n .build()\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 drivers 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 vehicle to make a stop. When you set\n`setVehicleStopover` to `true`, 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, specify the `setVehicleStopover` preference as shown in the\nfollowing example: \n\n Waypoint waypoint =\n Waypoint.builder()\n .setLatLng(latitude, longitude)\n .setTitle(\"Somewhere in Sydney\")\n .setVehicleStopover(true)\n .build()"]]