تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تصف هذه الصفحة أحداث واجهة المستخدم وأحداث الأخطاء التي يمكنك
الاستماع إليها والتعامل معها آليًا.
أحداث واجهة المستخدم
يوضّح هذا القسم الأحداث التفاعلية وإشعارات تغيير الحالة التي يمكنك الاستماع إليها ومعالجتها آليًا عند العمل على الخرائط الثلاثية الأبعاد. تعتمد لغة JavaScript
في المتصفّح على الأحداث، ما يعني أنّها تستجيب لتفاعلات المستخدمين من خلال إنشاء أحداث يمكن لبرنامجك الاستماع إليها وتنفيذ الرمز وفقًا لذلك.
هناك نوعان رئيسيان من الأحداث:
يتم نشر أحداث تفاعل المستخدم (مثل نقرات الماوس) من إطار عرض الخريطة الثلاثية الأبعاد إلى الرمز البرمجي الخاص بك. تسمح لك هذه الأحداث بالاستجابة إلى إجراءات
المستخدم المباشرة داخل بيئة الخريطة ثلاثية الأبعاد. عرض
النموذج.
تعكس إشعارات تغيير الحالة التعديلات التي يتم إجراؤها على نماذج بيانات الخرائط الثلاثية الأبعاد الأساسية وحالة العرض، وذلك باستخدام نظام تسمية gmp-propertychange تقليدي.
يعرض كل عنصر من عناصر واجهة برمجة التطبيقات للتعيين الثلاثي الأبعاد مجموعة من الأحداث المُسمّاة التي يمكن لبرنامجك
تسجيل أدوات معالجة الأحداث لها وتنفيذ منطق عند وقوع هذه الأحداث باستخدام
دالة addEventListener() المُدمَجة.
يوضّح النموذج التالي الأحداث التي يتم تشغيلها عندما يتفاعل المستخدِم مع الخريطة:
تاريخ التعديل الأخير: 2025-04-29 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-04-29 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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:"]]