קל לארגן דפים בעזרת אוספים אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Navigation SDK מספק דרכים שונות לשילוב חוויית ניווט באפליקציה. בדף הזה מוסבר מהי חוויית ניווט בהתאמה אישית, ומה ההבדל בינה לבין חוויות ניווט אחרות שזמינות ב-Navigation SDK.
מהי חוויית ניווט מותאמת אישית?
הדרך העיקרית להטמיע את Navigation SDK היא באמצעות חוויית הניווט של Google, שמאפשרת לכם להטמיע חוויית ניווט במסלול מפורט שמשתמשת ברכיבי ממשק משתמש ובאלמנטים חזותיים שסופקו על ידי Google – בדומה לחוויית הניווט באפליקציות של מפות Google. אם אתם צריכים גמישות רבה יותר מזו שמוצעת בחוויית הניווט של Google, אתם יכולים להטמיע חוויית ניווט בהתאמה אישית. חוויית ניווט בהתאמה אישית יכולה להיות כל דבר, החל מביטול ההנחיות לפניות לחלוטין והפעלת הניווט רק כתהליך ברקע, ועד להצגת חוויית הנחיה בהתאמה אישית גבוהה על מסך נפרד מהמכשיר שמריץ את הניווט. במסגרת חוויית ניווט מותאמת אישית, האפליקציה קוראת ל-Navigation SDK כדי לבקש פיד של ניווט מפורט, ואז אתם מספקים ומנהלים את רכיבי ממשק המשתמש והרכיבים החזותיים שהמשתמש רואה במהלך חוויית הניווט. בדרך כלל קל יותר להטמיע את חוויית הניווט של Google, אבל בניית חוויית ניווט מותאמת אישית מאפשרת יותר התאמות אישיות.
כשיוצרים חוויית ניווט בהתאמה אישית, האפליקציה שולחת קריאה ל-Navigation SDK כדי להתחיל, להפעיל ולהפסיק את הניווט, באמצעות התהליך הבא:
מתחילים בניווט. בדומה לחוויית הניווט של Google, גם חוויית ניווט בהתאמה אישית כוללת יצירה של מופע ניווט והגדרת היעד. עם זאת, כדי להשיג את זה באמצעות חוויית ניווט מותאמת אישית, צריך קודם ליצור סשן ניווט באמצעות GMSNavigationService.createNavigationSession, שהוא אובייקט ללא ממשק משתמש שכולל מצב, ויכול לפעול עם בקר תצוגה או בלי בקר תצוגה.
לצפייה בהדגמה: ההורדה של Navigation SDK כוללת הדגמה שאפשר להריץ כדי לראות דוגמה של חוויית ניווט שבה יש מעבר בין הנחיות מפורטות בניווט רגיל לבין חוויית ניווט שבה מוצג רק המיקום של המכשיר שנע לאורך קו פוליגון של כביש.
ניווט פעיל. הנה עוד הבדל חשוב בין חוויית ניווט ש-Google מספקת לבין חוויית ניווט בהתאמה אישית. במקום להעביר את ההנחיות למנהל האירועים המובנה ב-Navigation SDK, מפעילים את פיד ההנחיות המפורטות ומטמיעים גורמים שמטפלים באירועים. כך חוויית השימוש יכולה להגיב לאירועים שמתוארים במאמר האזנה לאירועי ניווט.
סיום הניווט בדומה לחוויית הניווט של Google, גם בניווט מותאם אישית צריך להפסיק את הניווט באופן שהכי מתאים לחוויית השימוש באפליקציה.
מתי כדאי להשתמש בחוויית ניווט בהתאמה אישית?
בטבלה הבאה מתוארים כמה תרחישים של ניווט בהתאמה אישית.
תרחיש לדוגמה
שלבים כלליים
צריך לספק הנחיות נהיגה מבוססות-טקסט בלבד למכשירים קטנים, כמו כלי רכב דו-גלגליים.
ליצור את מכשיר הניווט ולהגדיר את ההנחיות המפורטות כפיד נתונים למכשיר עם מסך קטן, בזמן שמכשיר הניווט פועל בטלפון הנייד של הנהג מחוץ לשדה הראייה שלו.
אתם רוצים שהאפליקציה שלכם תהיה זמינה כסוג של שירות לרכב לנהגים שמשתמשים ב-Android Auto.
מגדירים את שירות הרכב.
מגדירים את פרויקט Navigation SDK.
אם עדיין לא עשיתם זאת, צריך להגדיר כלי ניווט.
הפעלת פיד ההנחיות המפורטות.
לצייר את המפה בממשק של אפליקציית Auto ולאכלס את השדות מפיד הנתונים שהגדרתם.
[[["התוכן קל להבנה","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-16 (שעון UTC)."],[[["\u003cp\u003eThe Navigation SDK offers both a pre-built Google navigation experience and the flexibility to create custom navigation experiences.\u003c/p\u003e\n"],["\u003cp\u003eCustom navigation experiences allow developers to manage UI elements, visuals, and event handling for a highly tailored user interface.\u003c/p\u003e\n"],["\u003cp\u003eThis customization ranges from background navigation to projecting guidance onto separate screens, giving developers more control.\u003c/p\u003e\n"],["\u003cp\u003eCustom experiences involve starting navigation, managing active navigation with event handlers, and ending navigation as needed.\u003c/p\u003e\n"],["\u003cp\u003eUse cases for custom navigation include text-only guidance, Android Auto integration, and dynamic switching between map views and turn-by-turn instructions.\u003c/p\u003e\n"]]],[],null,["The Navigation SDK provides different ways to integrate a navigation\nexperience into your app. This page explains what a custom navigation experience\nis and how it differs from other navigation experiences that are available in\nthe Navigation SDK.\n\nWhat is a custom navigation experience?\n\nThe primary way to implement the Navigation SDK is to use the [Google\nnavigation\nexperience](/maps/documentation/navigation/android-sdk/intro-google-nav),\nwhich lets you embed a turn-by-turn navigation experience that uses\nGoogle-provided UI elements and visuals --- similar to the navigation experience\nwithin the Google Maps apps. If you need more flexibility than the Google\nnavigation experience offers, you can implement a custom navigation experience.\nA custom navigation experience refers to anything from eliminating turn guidance\nentirely with and running navigation only as a background process, to projecting\na highly customized guidance experience to a screen separate from the device\nthat runs the navigation. With a custom navigation experience, your app calls\nthe Navigation SDK to request a turn-by-turn navigation feed, and then\nyou provide and manage the UI elements and visuals that the user sees in the\nnavigation experience. While using the Google navigation experience is generally\neasier to implement, building your own custom navigation experience allows for\nmore customization.\n\nWhen you create a custom navigation experience, your app calls the Navigation\nSDK to start, run, and stop navigation, using the following flow:\n\n1. **Start navigation** . As with the Google navigation experience, a custom\n navigation experience still involves creating a navigation instance and\n setting the destination. However, with a customized navigation experience,\n you achieve this by first establishing a navigation session using\n `GMSNavigationService.createNavigationSession`, which is a state-bearing\n non-UI object that can operate either with a view controller, or without\n one.\n\n For more information, see [Enable turn-by-turn data\n feed](/maps/documentation/navigation/android-sdk/tbt-feed).\n\n **See the demo:** The download of the Navigation SDK contains a demo\n you can run to see an example of a navigation experience that switches\n between turn-by-turn guidance through standard navigation to a navigation\n experience that shows only the device location moving along a road\n polyline.\n2. **Active navigation** . Here is another key difference between a\n Google-provided navigation experience and a custom navigation experience.\n Instead of handing off guidance to the built-in event manager of the\n Navigation SDK, you enable the turn-by-turn feed and implement event\n handlers. This allows your experience to respond to the events described in\n [Listen for navigation\n events](/maps/documentation/navigation/android-sdk/events).\n\n3. **End navigation**. As with the Google navigation experience, custom\n navigation also requires you to terminate navigation in the manner best\n suited for the app's experience.\n\nWhen might you use a custom navigation experience?\n\nThe following table describes some custom navigation scenarios.\n\n| **Example scenario** | **High-level steps** |\n|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| You need to provide text-only driver guidance for small devices such as 2-wheeled vehicles. | Create your navigator and set up the turn-by-turn guidance as a data feed to a small screen device while the navigator runs on the driver's mobile phone outside of their immediate view. |\n| You want to make your app available as a car service for drivers who use Android Auto. | 1. Set up the car service. 2. Set up your Navigation SDK project. 3. Establish a navigator if you haven't already. 4. Enable the turn-by-turn guidance feed. 5. Draw the map on the auto app surface and populate the fields from the data feed you configured. For more information, see [Enable Navigation for Android Auto](/maps/documentation/navigation/android-sdk/android-auto) |\n| Drivers using your app want an overview map for most of their journey, with only minimal turn-by-turn guidance for city streets. | Your app should allow drivers to enter and exit the Google navigation experience as they need, without alternating the navigator's settings for destination and trip mode. |"]]