ui.Map.Layer.setShown
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ตั้งค่าระดับการเข้าถึงของเลเยอร์
แสดงผลเลเยอร์แผนที่นี้
การใช้งาน | การคืนสินค้า |
---|
Layer.setShown(shown) | ui.Map.AbstractLayer |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ ui.map.abstractlayer | ui.Map.AbstractLayer | อินสแตนซ์ ui.Map.AbstractLayer |
shown | บูลีน ไม่บังคับ | แสดงเลเยอร์หรือไม่ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eThe \u003ccode\u003eLayer.setShown()\u003c/code\u003e method controls the visibility of a map layer, allowing you to show or hide it.\u003c/p\u003e\n"],["\u003cp\u003eThis method, when called on a \u003ccode\u003eui.Map.AbstractLayer\u003c/code\u003e instance with an optional boolean argument \u003ccode\u003eshown\u003c/code\u003e, returns the \u003ccode\u003eui.Map.AbstractLayer\u003c/code\u003e itself, enabling method chaining.\u003c/p\u003e\n"],["\u003cp\u003eBy default, if the \u003ccode\u003eshown\u003c/code\u003e argument is not provided, the layer's visibility is toggled to its opposite state.\u003c/p\u003e\n"]]],["The `Layer.setShown()` method controls a map layer's visibility. It accepts an optional boolean argument, `shown`, to determine if the layer is displayed (true) or hidden (false). The method is applied to a `ui.Map.AbstractLayer` instance. Invoking this method modifies the layer's visibility and returns the modified `ui.Map.AbstractLayer` instance itself. The layer defaults to being shown if the `shown` argument is not set.\n"],null,["# ui.Map.Layer.setShown\n\n\u003cbr /\u003e\n\nSets the visibility of the layer.\n\n\u003cbr /\u003e\n\nReturns this map layer.\n\n| Usage | Returns |\n|-----------------------------|----------------------|\n| Layer.setShown`(`*shown*`)` | ui.Map.AbstractLayer |\n\n| Argument | Type | Details |\n|------------------------------|----------------------|------------------------------------|\n| this: `ui.map.abstractlayer` | ui.Map.AbstractLayer | The ui.Map.AbstractLayer instance. |\n| `shown` | Boolean, optional | Whether the layer is shown. |"]]