ui.Map.DrawingTools.onLayerConfig
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ลงทะเบียนการเรียกกลับที่จะเริ่มทำงานหลังจากเปลี่ยนชื่อหรือสีของเลเยอร์
แสดงผลรหัสที่ส่งไปยัง unlisten() เพื่อยกเลิกการลงทะเบียนแฮนเดิลการเรียกกลับ
การใช้งาน | การคืนสินค้า |
---|
DrawingTools.onLayerConfig(callback) | สตริง |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ ui.map.drawingtools | ui.Map.DrawingTools | อินสแตนซ์ ui.Map.DrawingTools |
callback | ฟังก์ชัน | การเรียกกลับที่จะเริ่มทำงานหลังจากกำหนดค่าเลเยอร์แล้ว โดยจะมีการส่งพารามิเตอร์ 2 รายการไปยังฟังก์ชันเรียกกลับ ได้แก่ GeometryLayer ที่กำหนดค่าไว้และวิดเจ็ต ui.Map.DrawingTools ที่เชื่อมโยงเครื่องมือฟังเหตุการณ์ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eRegisters a callback function that is triggered when a layer's name or color is modified.\u003c/p\u003e\n"],["\u003cp\u003eProvides a unique ID that can be used to unregister the callback using the \u003ccode\u003eunlisten()\u003c/code\u003e function.\u003c/p\u003e\n"],["\u003cp\u003eThe callback receives the modified \u003ccode\u003eGeometryLayer\u003c/code\u003e and the \u003ccode\u003eui.Map.DrawingTools\u003c/code\u003e widget as parameters.\u003c/p\u003e\n"]]],["The function `DrawingTools.onLayerConfig` registers a callback that triggers when a layer's name or color changes. This callback receives the modified `GeometryLayer` and the `ui.Map.DrawingTools` instance. The function returns a unique ID string, which can be used with `unlisten()` to remove the callback. This function allows user to be notified when a layer's configuration has changed.\n"],null,["# ui.Map.DrawingTools.onLayerConfig\n\n\u003cbr /\u003e\n\nRegisters a callback that's fired after a layer's name or color is changed.\n\n\u003cbr /\u003e\n\nReturns an ID which can be passed to unlisten() to unregister the callback.\n\n| Usage | Returns |\n|----------------------------------------|---------|\n| DrawingTools.onLayerConfig`(callback)` | String |\n\n| Argument | Type | Details |\n|-----------------------------|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `ui.map.drawingtools` | ui.Map.DrawingTools | The ui.Map.DrawingTools instance. |\n| `callback` | Function | The callback to fire after a layer is configured. The callback is passed two parameters: the configured GeometryLayer and the ui.Map.DrawingTools widget that the event listener is bound to. |"]]