يمكنك تحديد ميزات المسار التي تفضّل تجنّبها، مثل تجنّب الطرق السريعة أو رسوم العبور، من خلال إضافة مُعدِّلات المسار إلى طلب. تحاول واجهة برمجة التطبيقات بعد ذلك
توفير مسار لا يتطلّب هذه الميزات.
استخدِم السمة routeModifiers في طلب من النوع
RouteModifiers. يمكنك تحديد avoidTollsavoidHighways وavoidFerries وavoidIndoor.
لا يؤدي تحديد مُعدِّل مسار إلى إزالة المسارات التي تتضمّن
الميزة المحظورة بالضرورة. تستخدِم واجهة برمجة التطبيقات المُعدِّل لتوجيه النتيجة إلى مسارات أكثر
ملاءمةً. قد يكون هناك بعض الأسباب التي تؤدي إلى عدم تغيير المسار عند طلب خيار تجنُّب الازدحام. على سبيل المثال، المسار الوحيد من نقطة الانطلاق إلى
الوجهة يجعل من المستحيل تجنُّب استخدام طريق سريع أو عبارة. أو قد يؤدي المسار البديل
إلى إطالة مدة الرحلة بشكل كبير.
يوضّح المثال التالي كيفية ضبط معدّلات المسار في أسلوب
computeRoutes (REST) في محتوى طلب. يمكنك أيضًا تحديد هذا الخيار لطريقة
ComputeRoutes (gRPC). في هذا المثال، يمكنك تحديد تجنُّب رسوم العبور والطرق السريعة:
تاريخ التعديل الأخير: 2025-02-06 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-02-06 (حسب التوقيت العالمي المتفَّق عليه)"],[[["The Routes API's Compute Route Matrix feature does not support avoiding route features."],["You can request routes that avoid tolls, highways, ferries, and indoor travel using the `routeModifiers` property."],["While route modifiers bias the results, they may not eliminate the specified features if alternatives are unavailable or significantly increase travel time."],["You can specify route modifiers in both REST and gRPC requests, using the `avoidTolls`, `avoidHighways`, `avoidFerries`, and `avoidIndoor` fields within the `routeModifiers` property."]]],["Route modifiers, set in the `routeModifiers` property of a request, allow users to express preferences for avoiding tolls, highways, ferries, or indoor routes. The `Compute Route Matrix` feature does not support avoiding route features. Modifiers bias the route calculation, but do not guarantee avoidance. `routeModifiers` also supports `vehicleInfo` and `tollPasses`. The API might include the feature to be avoided if no practical alternative exists. An example in a `computeRoutes` request demonstrates setting `avoidTolls` and `avoidHighways` to `true`.\n"]]