Pengumuman: Semua project nonkomersial yang terdaftar untuk menggunakan Earth Engine sebelum 
15 April 2025 harus 
memverifikasi kelayakan nonkomersial untuk mempertahankan akses. Jika Anda belum melakukan verifikasi hingga 26 September 2025, akses Anda mungkin ditangguhkan.
  
        
 
       
     
  
  
  
    
  
  
  
    
      ui.Map.add
    
    
      
    
    
      
      Tetap teratur dengan koleksi
    
    
      
      Simpan dan kategorikan konten berdasarkan preferensi Anda.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
    
  
  
Menambahkan item ke peta. Dapat juga digunakan untuk menambahkan widget seperti ui.Label serta beberapa objek non-widget seperti ui.Map.Layer.
Menampilkan peta.
| Penggunaan | Hasil | 
|---|
| Map.add(item) | ui.Map | 
| Argumen | Jenis | Detail | 
|---|
| ini: ui.map | ui.Map | Instance ui.Map. | 
| item | Objek | Item yang akan ditambahkan. | 
  
  
  Contoh
  
    
  
  
    
    
  
  
  
  
    
    
    
      Code Editor (JavaScript)
    
    
  // The default map in the Code Editor is a built-in ui.Map object called "Map".
// Let's refer to it as "defaultMap" for clarity.
var defaultMap = Map;
// ui.Map objects can be constructed. Here, a new map is declared.
var newMap = ui.Map({
  center: {lat: 0, lon: 0, zoom: 1},
  style: {position: 'bottom-right', width: '400px'}
});
// Add the newMap to the defaultMap;
defaultMap.add(newMap);
// Other UI widgets can be added to ui.Map objects, for example labels:
defaultMap.add(ui.Label('Default Map', {position: 'bottom-left'}));
newMap.add(ui.Label('New Map', {position: 'bottom-left'}));
// ...selectors:
defaultMap.add(ui.Select(['This', 'That', 'Other']));
// ...or buttons:
defaultMap.add(ui.Button('Click me'));
// You can also add ui.Map.Layer objects. Here, an ee.Geometry object
// is converted to a map layer and added to the default map.
var geom = ee.Geometry.Point(-122.0841, 37.4223);
var geomLayer = ui.Map.Layer(geom, {color: 'orange'}, 'Googleplex');
defaultMap.add(geomLayer);
defaultMap.centerObject(geom, 18);
  
    
  
  
    
  
  
  
  
  
  
  
 
  
    
    
      
       
    
    
  
  
  Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
  Terakhir diperbarui pada 2025-07-26 UTC.
  
  
  
    
      [null,null,["Terakhir diperbarui pada 2025-07-26 UTC."],[],["The `Map.add(item)` function adds an object to a `ui.Map` instance, returning the modified map.  The `item` can be a `ui.Map` itself, UI widgets like `ui.Label`, `ui.Select`, or `ui.Button`, or objects like `ui.Map.Layer`. Examples demonstrate adding a new map, labels, selectors, buttons, and a geometry layer to an existing map. These are done using default and newly created maps. The new elements are added to the map using `defaultMap.add()`.\n"]]