ui.Map.onClick
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
تماس برگشتی را ثبت می کند که با کلیک روی نقشه اجرا می شود.
شناسهای را برمیگرداند که میتوان آن را به unlisten() برای لغو ثبت تماس برگشت داد.
استفاده | برمی گرداند | Map. onClick (callback) | رشته |
استدلال | تایپ کنید | جزئیات | این: ui.map | ui.Map | نمونه ui.Map. |
callback | تابع | وقتی روی نقشه کلیک میشود، تماس برگشتی فعال میشود. پاسخ تماس به یک شی ارسال می شود که حاوی مختصات نقطه کلیک روی نقشه (با کلیدهای lon و lat) و خود ویجت نقشه است. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eRegisters a callback function that is triggered when the map is clicked, providing the coordinates of the clicked point.\u003c/p\u003e\n"],["\u003cp\u003eReturns a unique ID that can be used to unregister the callback function using the \u003ccode\u003eunlisten()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe callback function receives an object containing the longitude (\u003ccode\u003elon\u003c/code\u003e), latitude (\u003ccode\u003elat\u003c/code\u003e) of the clicked point, and the map widget instance.\u003c/p\u003e\n"]]],[],null,["# ui.Map.onClick\n\n\u003cbr /\u003e\n\nRegisters a callback that's fired when the map is clicked.\n\n\u003cbr /\u003e\n\nReturns an ID which can be passed to unlisten() to unregister the callback.\n\n| Usage | Returns |\n|-------------------------|---------|\n| Map.onClick`(callback)` | String |\n\n| Argument | Type | Details |\n|----------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `ui.map` | ui.Map | The ui.Map instance. |\n| `callback` | Function | The callback to fire when the map is clicked. The callback is passed an object containing the coordinates of the clicked point on the map (with keys lon and lat) and the map widget itself. |"]]