ee.Feature.getMapId
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ฟังก์ชันที่จำเป็นซึ่งแสดงผลรหัสแผนที่และโทเค็นที่ไม่บังคับ เหมาะสำหรับการสร้างภาพซ้อนทับแผนที่
แสดงผลออบเจ็กต์ที่อาจส่งไปยัง ee.data.getTileUrl หรือ ui.Map.addLayer ซึ่งรวมถึงฟิลด์ "image" เพิ่มเติมที่มีรูปภาพ Collection.draw ที่ครอบคลุม FeatureCollection ที่มีฟีเจอร์นี้ ไม่ระบุหากมีการระบุการเรียกกลับ
การใช้งาน | การคืนสินค้า |
---|
Feature.getMapId(visParams, callback) | MapId|Object |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ feature | ฟีเจอร์ | อินสแตนซ์ฟีเจอร์ |
visParams | ออบเจ็กต์ (ไม่บังคับ) | พารามิเตอร์การแสดงภาพ ปัจจุบันอนุญาตให้มีพารามิเตอร์ได้เพียง 1 รายการเท่านั้น ซึ่งก็คือ "color" ที่มีสตริงสี RGB หากไม่ได้ระบุ visParams ระบบจะใช้สีดำ ("000000") |
callback | ฟังก์ชัน (ไม่บังคับ) | การเรียกกลับแบบไม่พร้อมกัน |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eGenerates a Map ID and optional token for creating Map overlays using a Feature.\u003c/p\u003e\n"],["\u003cp\u003eReturns an object compatible with \u003ccode\u003eee.data.getTileUrl\u003c/code\u003e or \u003ccode\u003eui.Map.addLayer\u003c/code\u003e for visualization.\u003c/p\u003e\n"],["\u003cp\u003eAccepts optional visualization parameters for customizing the overlay's appearance, defaulting to black if unspecified.\u003c/p\u003e\n"],["\u003cp\u003eCan execute an asynchronous callback function, but in that case, the object is not returned directly.\u003c/p\u003e\n"]]],["The function `Feature.getMapId` generates a map overlay ID and optional token. It returns either a `MapId` or an `Object`, which can be used with `ee.data.getTileUrl` or `ui.Map.addLayer`. The returned object includes an 'image' field with a `Collection.draw` image. The function accepts optional `visParams`, an object with a 'color' parameter (defaulting to black), and an optional asynchronous `callback` function. The input is a `Feature` instance.\n"],null,["# ee.Feature.getMapId\n\n\u003cbr /\u003e\n\nAn imperative function that returns a map ID and optional token, suitable for generating a Map overlay.\n\n\u003cbr /\u003e\n\nReturns an object which may be passed to ee.data.getTileUrl or ui.Map.addLayer, including an additional 'image' field, containing a Collection.draw image wrapping a FeatureCollection containing this feature. Undefined if a callback was specified.\n\n| Usage | Returns |\n|--------------------------------------------------|---------------|\n| Feature.getMapId`(`*visParams* `, `*callback*`)` | MapId\\|Object |\n\n| Argument | Type | Details |\n|-----------------|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `feature` | Feature | The Feature instance. |\n| `visParams` | Object, optional | The visualization parameters. Currently only one parameter, 'color', containing an RGB color string is allowed. If visParams is not specified, black (\"000000\") is used. |\n| `callback` | Function, optional | An async callback. |"]]