お知らせ: 
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、アクセスを維持するために
非商用目的での利用資格を確認する必要があります。2025 年 9 月 26 日までに確認が完了していない場合、アクセスが保留されることがあります。
  
        
 
       
     
  
  
  
    
  
  
  
    
      ui.Map.centerObject
    
    
      
    
    
      
      コレクションでコンテンツを整理
    
    
      
      必要に応じて、コンテンツの保存と分類を行います。
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
    
  
  
指定されたオブジェクトを中心に地図ビューを配置します。
この ui.Map を返します。
| 用途 | 戻り値 | 
|---|
| Map.centerObject(object, zoom, onComplete) | ui.Map | 
| 引数 | タイプ | 詳細 | 
|---|
| これ: ui.map | ui.Map | ui.Map インスタンス。 | 
| object | Element|Geometry | 中心に配置するオブジェクト(ジオメトリ、画像、フィーチャー)。 | 
| zoom | 数値、省略可 | ズームレベル(0 ~ 24)。指定しない場合、オブジェクトのバウンディング ボックスに基づいて計算されます。 | 
| onComplete | 関数(省略可) | 再センタリングが正常に完了した後にトリガーされるコールバック。このパラメータを渡すと、`centerObject` オペレーションが非同期で実行されます。 | 
  
  
  例
  
    
  
  
    
    
  
  
  
  
    
    
    
      コードエディタ(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);
// You can set the viewport of a ui.Map to be centered on an object.
// Here, the defaultMap is centered on a point with a selected zoom level.
var geom = ee.Geometry.Point(-122.0841, 37.4223);
defaultMap.centerObject(geom, 18);
defaultMap.addLayer(geom, {color: 'orange'}, 'Googleplex');
// Map extent can be fetched using the ui.Map.getBounds method.
print('defaultMap bounds as a list',
      defaultMap.getBounds());
print('defaultMap bounds as a dictionary',
      ee.Dictionary.fromLists(['w', 's', 'e', 'n'], defaultMap.getBounds()));
print('defaultMap bounds as GeoJSON',
      defaultMap.getBounds({asGeoJSON: true}));
// Map center point can be fetched using the ui.Map.getCenter method.
print('defaultMap center as a Point geometry', defaultMap.getCenter());
// Map zoom level can be fetched using the ui.Map.getZoom method.
print('defaultMap zoom level', defaultMap.getZoom());
// Map scale can be fetched using the ui.Map.getScale method.
print('defaultMap approximate pixel scale', defaultMap.getScale());
  
    
  
  
    
  
  
  
  
  
  
  
 
  
    
    
      
       
    
    
  
  
  特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
  最終更新日 2025-07-26 UTC。
  
  
  
    
      [null,null,["最終更新日 2025-07-26 UTC。"],[],[]]