רשימת המיקומים הנתמכים לתשלום אגרה מופיעה במאמר בנושא TollPass.
דוגמה למטריצת מסלולים עם נתוני אגרה
בדוגמה הבאה נעשה שימוש בשיטה computeRouteMatrix כדי להחזיר מידע על כבישי אגרה במסלול עם מחיר משוער, כשמשתמשים בכרטיס מעבר בכבישי אגרה:
מגדירים את שדה המערך extraComputations לערך TOLLS כדי להפעיל את החישוב של פרטי האגרה.
מציינים את סוג הרכב ואת סוג כרטיס המעבר באמצעות השדה routeModifiers של נקודות הדרך origin בבקשה. מחיר האגרה שמוחזר מבוסס על התמחור שמשמש את סוג הרכב והמינוי שצוינו. אם מציינים יותר מכרטיס אחד, המערכת מחזירה את המחיר הכי זול.
משתמשים במסכת שדות התגובה כדי להגדיר את השיטה להחזרת פרטי האגרה בתגובה. מציינים
routes.travelAdvisory.tollInfo כדי להחזיר מידע על המסלול כולו.
[[["התוכן קל להבנה","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-04 (שעון UTC)."],[[["\u003cp\u003eThe Routes API's \u003ccode\u003ecomputeRouteMatrix\u003c/code\u003e method allows you to calculate estimated toll fees for routes in supported cities, providing cost insights for route planning.\u003c/p\u003e\n"],["\u003cp\u003eTo enable toll calculations, specify \u003ccode\u003eTOLLS\u003c/code\u003e in the \u003ccode\u003eextraComputations\u003c/code\u003e field and provide vehicle and toll pass details in the \u003ccode\u003erouteModifiers\u003c/code\u003e field within the request.\u003c/p\u003e\n"],["\u003cp\u003eToll prices are estimates and are influenced by factors like vehicle type and toll pass used, with the response including the estimated price in the specified currency.\u003c/p\u003e\n"],["\u003cp\u003eWhile the Route Matrix provides toll information, detailed route specifics are not included; for that, use the \u003ccode\u003eCompute Routes\u003c/code\u003e functionality with single origin and destination points.\u003c/p\u003e\n"],["\u003cp\u003eBe aware that requests including toll fee calculations are billed at a higher rate than standard route matrix requests.\u003c/p\u003e\n"]]],["To calculate toll fees for a route matrix, set the `extraComputations` field to `TOLLS`. Specify the vehicle type and toll pass using the `routeModifiers` field within the origin waypoints; the lowest-cost toll pass pricing will be applied if multiple passes are set. Use the response field mask with `routes.travelAdvisory.tollInfo` to include toll information, and note that toll fee requests have a higher billing rate. The response then contains `estimatedPrice`.\n"],null,[]]