Max Zoom
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Lớp google.maps.MaxZoomService
Dịch vụ cung cấp mức thu phóng cao nhất có hình ảnh vệ tinh cho một vị trí nhất định.
Truy cập bằng cách gọi const {MaxZoomService} = await google.maps.importLibrary("maps")
. Xem phần Thư viện trong API Maps JavaScript.
Hàm dựng |
MaxZoomService |
MaxZoomService()
Thông số: Không có
Tạo một thực thể mới của MaxZoomService có thể dùng để gửi truy vấn về mức thu phóng tối đa có sẵn cho hình ảnh vệ tinh. |
Phương thức |
getMaxZoomAtLatLng |
getMaxZoomAtLatLng(latlng[, callback])
Trả về mức thu phóng tối đa có hình ảnh chi tiết tại một LatLng cụ thể cho loại bản đồ satellite . Vì yêu cầu này không đồng bộ, nên bạn phải truyền một hàm callback sẽ được thực thi sau khi hoàn tất yêu cầu, được truyền một MaxZoomResult . |
Giao diện google.maps.MaxZoomResult
Kết quả MaxZoom ở định dạng JSON được truy xuất từ MaxZoomService.
Thuộc tính |
zoom |
Loại: number
Cấp độ thu phóng tối đa được tìm thấy tại LatLng đã cho. |
status optional |
|
Hằng số google.maps.MaxZoomStatus
Trạng thái do MaxZoomService
trả về khi hoàn tất lệnh gọi đến getMaxZoomAtLatLng()
. Chỉ định các hằng này theo giá trị hoặc bằng cách sử dụng tên của hằng. Ví dụ: 'OK'
hoặc google.maps.MaxZoomStatus.OK
.
Truy cập bằng cách gọi const {MaxZoomStatus} = await google.maps.importLibrary("maps")
. Xem phần Thư viện trong API Maps JavaScript.
Hằng số |
ERROR |
Đã xảy ra lỗi không xác định. |
OK |
Phản hồi chứa MaxZoomResult hợp lệ. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-12-22 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-12-22 UTC."],[],[],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`. |"]]