ui.Map.onIdle
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ลงทะเบียนการเรียกกลับที่จะเริ่มทำงานเมื่อแผนที่หยุดเคลื่อนที่
แสดงผลรหัสที่ส่งไปยัง unlisten() เพื่อยกเลิกการลงทะเบียนแฮนเดิลการเรียกกลับ
การใช้งาน | การคืนสินค้า |
---|
Map.onIdle(callback) | สตริง |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ ui.map | ui.Map | อินสแตนซ์ ui.Map |
callback | ฟังก์ชัน | การเรียกกลับที่จะเริ่มทำงานเมื่อแผนที่ไม่มีการใช้งาน ระบบจะส่งพารามิเตอร์ 2 รายการไปยังฟังก์ชันเรียกกลับ ได้แก่ ออบเจ็กต์ที่มีพิกัดของจุดกึ่งกลางแผนที่ (มีคีย์ lon, lat และ zoom) และวิดเจ็ตแผนที่เอง |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eRegisters a function to be executed when the map stops moving.\u003c/p\u003e\n"],["\u003cp\u003eProvides an ID to remove the registered function later using \u003ccode\u003eunlisten()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe registered function receives the map's center coordinates and the map object itself.\u003c/p\u003e\n"],["\u003cp\u003eThis functionality is accessed through the \u003ccode\u003eonIdle()\u003c/code\u003e method of the \u003ccode\u003eui.Map\u003c/code\u003e instance.\u003c/p\u003e\n"]]],[],null,["# ui.Map.onIdle\n\n\u003cbr /\u003e\n\nRegisters a callback that's fired when the map stops moving.\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.onIdle`(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 becomes idle. The callback is passed two parameters: an object containing the coordinates of the map center (with keys lon, lat, and zoom) and the map widget itself. |"]]