公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
Map.setCenter
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
以指定縮放等級將地圖檢視畫面置中於指定座標。
傳回地圖。
用量 | 傳回 |
---|
Map.setCenter(lon, lat, zoom) | ui.Map |
引數 | 類型 | 詳細資料 |
---|
lon | 數字 | 中心經度 (以度為單位)。 |
lat | 數字 | 中心緯度,以度為單位。 |
zoom | 號碼 (選填) | 縮放等級,範圍為 0 到 24。 |
範例
程式碼編輯器 (JavaScript)
// Set the position and optional zoom level of the map. Latitude must be
// within [-85, 85].
Map.setCenter(-123.6, 47.7, 9);
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eCenters the map view to specified coordinates and an optional zoom level.\u003c/p\u003e\n"],["\u003cp\u003eTakes longitude, latitude, and an optional zoom level (0-24) as input.\u003c/p\u003e\n"],["\u003cp\u003eReturns the \u003ccode\u003eui.Map\u003c/code\u003e object for method chaining.\u003c/p\u003e\n"],["\u003cp\u003eLatitude values must be within the range of -85 to 85.\u003c/p\u003e\n"]]],[],null,["# Map.setCenter\n\n\u003cbr /\u003e\n\nCenters the map view at a given coordinates with the given zoom level.\n\n\u003cbr /\u003e\n\nReturns the map.\n\n| Usage | Returns |\n|-------------------------------------|---------|\n| `Map.setCenter(lon, lat, `*zoom*`)` | ui.Map |\n\n| Argument | Type | Details |\n|----------|------------------|------------------------------------------|\n| `lon` | Number | The longitude of the center, in degrees. |\n| `lat` | Number | The latitude of the center, in degrees. |\n| `zoom` | Number, optional | The zoom level, from 0 to 24. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Set the position and optional zoom level of the map. Latitude must be\n// within [-85, 85].\nMap.setCenter(-123.6, 47.7, 9);\n```"]]