ประกาศ: โปรเจ็กต์ที่ไม่ใช่เชิงพาณิชย์ทั้งหมดที่ลงทะเบียนเพื่อใช้ Earth Engine ก่อนวันที่
15 เมษายน 2025 ต้อง
ยืนยันการมีสิทธิ์ที่ไม่ใช่เชิงพาณิชย์เพื่อรักษาสิทธิ์เข้าถึง หากคุณไม่ยืนยันภายในวันที่ 26 กันยายน 2025 ระบบอาจระงับสิทธิ์เข้าถึงของคุณ
ee.FeatureCollection.getMap
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ฟังก์ชันที่จำเป็นซึ่งแสดงผลรหัสและโทเค็นแผนที่ เหมาะสำหรับการสร้างการวางซ้อนแผนที่
แสดงผลออบเจ็กต์ที่อาจส่งไปยัง ee.data.getTileUrl หรือ ui.Map.addLayer ซึ่งรวมถึงฟิลด์ "image" เพิ่มเติมที่มีรูปภาพ Collection.draw ที่ครอบคลุม FeatureCollection ที่มีฟีเจอร์นี้ ไม่ระบุหากมีการระบุการเรียกกลับ
| การใช้งาน | การคืนสินค้า |
|---|
FeatureCollection.getMap(visParams, callback) | MapId|Object |
| อาร์กิวเมนต์ | ประเภท | รายละเอียด |
|---|
ดังนี้ featurecollection | FeatureCollection | อินสแตนซ์ FeatureCollection |
visParams | ออบเจ็กต์ (ไม่บังคับ) | พารามิเตอร์การแสดงภาพ ปัจจุบันอนุญาตให้มีพารามิเตอร์ได้เพียง 1 รายการเท่านั้น ซึ่งก็คือ "color" ที่มีสตริงสี RGB หากไม่ได้ระบุ vis_params ระบบจะใช้สี #000000 |
callback | ฟังก์ชัน (ไม่บังคับ) | การเรียกกลับแบบไม่พร้อมกัน หากไม่ได้ระบุไว้ ระบบจะโทรแบบพร้อมกัน |
ตัวอย่าง
โปรแกรมแก้ไขโค้ด (JavaScript)
// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
// Get MapId for styled FeatureCollection.
var mapId = fc.getMap({color: '800080'});
print('mapId for styled FeatureCollection', mapId);
// MapId can be used as an input to Map.addLayer to display the layer.
Map.setCenter(4.56, 50.78, 7);
Map.addLayer(mapId);
// MapId can be used as an input to ee.data.getTileUrl to fetch map tiles.
print('URL for zoom level 6 tile that includes majority of points',
ee.data.getTileUrl(mapId, 32, 21, 6));
การตั้งค่า Python
ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า
สภาพแวดล้อม Python
import ee
import geemap.core as geemap
Colab (Python)
# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
'country_lg == "Belgium"'
)
# Get MapId for styled FeatureCollection.
map_id = fc.getMapId({'color': '800080'})
display('map_id for FeatureCollection', map_id)
# MapId can be used as an input to geemap.Map.add_layer to display the layer.
m = geemap.Map()
m.set_center(4.56, 50.78, 7)
m.add_layer(map_id['image'])
display(m)
# MapId can be used as an input to ee.data.getTileUrl to fetch map tiles.
display(
'URL for zoom level 6 tile that includes majority of points',
ee.data.getTileUrl(map_id, 32, 21, 6),
)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[],[]]