reviewsהשקת Places UI Kit: ספריית רכיבים מוכנה לשימוש בעלות נמוכה, שמאפשרת לכם להוסיף לכל מפה שתבחרו את ממשק המשתמש המוכר של 'מקומות' במפות Google. כדאי לנסות אותו ולשלוח לנו משוב כדי לעזור לנו לעצב את העתיד של GMP.
אינטראקציה עם המפה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בדף הזה מתוארים האירועים בממשק המשתמש ואירועי השגיאה שתוכלו להאזין להם ולטפל בהם באופן פרוגרמטי.
אירועים בממשק המשתמש
בקטע הזה מפורטים האירועים האינטראקטיביים וההתראות על שינוי המצבים שתוכלו להאזין להם ולטפל בהם באופן פרוגרמטי כשעובדים עם מפות תלת-ממדיות. JavaScript בדפדפן מבוסס על אירועים, כלומר הוא מגיב לאינטראקציות של משתמשים על ידי יצירת אירועים שהתוכנה יכולה להאזין להם ולהריץ קוד בהתאם.
יש שני סוגים עיקריים של אירועים:
- אירועי אינטראקציה של משתמשים (כמו קליקים על העכבר) מופצים מאזור התצוגה של המפה בתלת-ממד אל הקוד שלכם. האירועים האלה מאפשרים להגיב לפעולות ישירות של משתמשים בסביבת המפה התלת-ממדית. לצפייה בדוגמה
- ההתראות על שינוי מצבים משקפות עדכונים במודלים של נתוני המפות בתלת-ממד ובמצב הרינדור, באמצעות סכימה רגילה של
gmp-propertychange
למתן שמות.
כל אובייקט של API למיפוי תלת-ממדי חושף קבוצה של אירועים בעלי שם, שהתוכנה יכולה לרשום עבורם לוגיקה ולהפעיל אותם כשהאירועים האלה מתרחשים באמצעות הפונקציה addEventListener()
המובנית.
הדוגמה הבאה מראה אילו אירועים מופעלים כשמשתמש מבצע אינטראקציה עם המפה:
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-04-29 (שעון UTC).
[null,null,["עדכון אחרון: 2025-04-29 (שעון UTC)."],[],[],null,["\u003cbr /\u003e\n\n| This product or feature is in Preview (pre-GA). Pre-GA products and features might have limited support, and changes to pre-GA products and features might not be compatible with other pre-GA versions. Pre-GA Offerings are covered by the [Google\n| Maps Platform Service Specific Terms](https://cloud.google.com/maps-platform/terms/maps-service-terms). For more information, see the [launch stage\n| descriptions](/maps/launch-stages).\n\n\u003cbr /\u003e\n\nThis page describes the user interface events and error events that you can\nlisten for and handle programmatically.\n\nUser Interface Events\n\nThis section outlines the interactive events and state change notifications you\ncan listen for and handle programmatically when working with 3D maps. JavaScript\nwithin the browser is event-driven, meaning it responds to user interactions by\ngenerating events that your program can listen to and execute code accordingly.\n\nThere are two main types of events:\n\n- User interaction events (such as mouse clicks) are propagated from the 3D map viewport to your code. These events allow you to respond to direct user actions within the 3D map environment. [View\n sample](/maps/documentation/javascript/examples/3d/polygon-click-event).\n- State change notifications reflect updates to the underlying 3D map data models and rendering state, using a conventional `gmp-propertychange` naming scheme.\n\nEach 3D mapping API object exposes a set of named events that your program can\nregister event listeners for and execute logic when those events occur using the\nbuilt-in `addEventListener()` function.\n\nThe following sample shows which events are triggered as a user interacts with\nthe map:"]]