Max Zoom
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
google.maps.MaxZoomService
class
這項服務可取得特定地點可用的最高衛星圖像縮放等級。
請呼叫 const {MaxZoomService} = await google.maps.importLibrary("maps")
存取。請參閱「Maps JavaScript API 中的程式庫」。
建構函式 |
MaxZoomService |
MaxZoomService()
參數:無
建立 MaxZoomService 的新例項,可用於傳送有關衛星圖像可用的最大縮放等級查詢。 |
方法 |
getMaxZoomAtLatLng |
getMaxZoomAtLatLng(latlng[, callback])
傳回 satellite 地圖類型的特定 LatLng 可提供詳細圖像的最高縮放等級。由於這項要求是非同步的,您必須傳遞 callback 函式,該函式會在要求完成後執行,並傳遞 MaxZoomResult 。 |
google.maps.MaxZoomResult
介面
使用 JSON 格式 (擷取自 MaxZoomService) 的 MaxZoom 結果。
屬性 |
zoom |
類型: number
在指定 LatLng 中找到的最大縮放等級。 |
status optional |
|
google.maps.MaxZoomStatus
常數
MaxZoomService
在完成對 getMaxZoomAtLatLng()
的呼叫時傳回的狀態。您可以使用值或常數名稱來指定這些值。例如 'OK'
或 google.maps.MaxZoomStatus.OK
。
請呼叫 const {MaxZoomStatus} = await google.maps.importLibrary("maps")
存取。請參閱「Maps JavaScript API 中的程式庫」。
常數 |
ERROR |
發生不明錯誤。 |
OK |
回應包含有效的 MaxZoomResult 。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-22 (世界標準時間)。
[null,null,["上次更新時間:2024-12-22 (世界標準時間)。"],[],[],null,["[MaxZoomService](#MaxZoomService)\nclass\n\n\ngoogle.maps`.`MaxZoomService\nclass\n\nA service for obtaining the highest zoom level at which satellite imagery is available for a given location.\n\nAccess by calling `const {MaxZoomService} = await google.maps.importLibrary(\"maps\")`. \nSee [Libraries in the Maps JavaScript API](/maps/documentation/javascript/libraries).\n\n| Constructor ||\n|-----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [MaxZoomService](#MaxZoomService.constructor) | `MaxZoomService()` **Parameters:** None Creates a new instance of a `MaxZoomService` that can be used to send queries about the maximum zoom level available for satellite imagery. |\n\n| Methods ||\n|----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [getMaxZoomAtLatLng](#MaxZoomService.getMaxZoomAtLatLng) | `getMaxZoomAtLatLng(latlng[, callback])` **Parameters:** - `latlng`: [LatLng](/maps/documentation/javascript/reference/coordinates#LatLng)`|`[LatLngLiteral](/maps/documentation/javascript/reference/coordinates#LatLngLiteral) - `callback`: `function(`[MaxZoomResult](/maps/documentation/javascript/reference/max-zoom#MaxZoomResult)`): void `optional **Return Value:** [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)`\u003c`[MaxZoomResult](/maps/documentation/javascript/reference/max-zoom#MaxZoomResult)`\u003e` Returns the maximum zoom level for which detailed imagery is available at a particular `LatLng` for the `satellite` map type. As this request is asynchronous, you must pass a `callback` function which will be executed upon completion of the request, being passed a `MaxZoomResult`. |\n\n[MaxZoomResult](#MaxZoomResult)\ninterface\n\n\ngoogle.maps`.`MaxZoomResult\ninterface\n\nA MaxZoom result in JSON format retrieved from the MaxZoomService.\n\n| Properties ||\n|--------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [zoom](#MaxZoomResult.zoom) | **Type:** `number` The maximum zoom level found at the given `LatLng`. |\n| [status](#MaxZoomResult.status)` `optional | **Type:** [MaxZoomStatus](/maps/documentation/javascript/reference/max-zoom#MaxZoomStatus)` `optional Status of the request. This property is only defined when using callbacks with [MaxZoomService.getMaxZoomAtLatLng](/maps/documentation/javascript/reference/max-zoom#MaxZoomService.getMaxZoomAtLatLng) (it is not defined when using Promises). |\n\n[MaxZoomStatus](#MaxZoomStatus)\nconstants\n\n\ngoogle.maps`.`MaxZoomStatus\nconstants\n\nThe status returned by the `MaxZoomService` on the completion of a call to `getMaxZoomAtLatLng()`. Specify these by value, or by using the constant's name. For example, `'OK'` or `google.maps.MaxZoomStatus.OK`.\n\nAccess by calling `const {MaxZoomStatus} = await google.maps.importLibrary(\"maps\")`. \nSee [Libraries in the Maps JavaScript API](/maps/documentation/javascript/libraries).\n\n| Constants ||\n|-------------------------------|------------------------------------------------|\n| [ERROR](#MaxZoomStatus.ERROR) | An unknown error occurred. |\n| [OK](#MaxZoomStatus.OK) | The response contains a valid `MaxZoomResult`. |"]]