Max Zoom
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Classe google.maps.MaxZoomService
Service permettant d'obtenir le niveau de zoom le plus élevé auquel des images satellite sont disponibles pour un lieu donné.
Accédez-y en appelant const {MaxZoomService} = await google.maps.importLibrary("maps")
. Consultez la section Bibliothèques de l'API Maps JavaScript.
Constructeur |
MaxZoomService |
MaxZoomService()
Paramètres:aucun
Crée une instance d'un MaxZoomService pouvant être utilisée pour envoyer des requêtes sur le niveau de zoom maximal disponible pour les images satellite. |
Méthodes |
getMaxZoomAtLatLng |
getMaxZoomAtLatLng(latlng[, callback])
Affiche le niveau de zoom maximal pour lequel des images détaillées sont disponibles à un LatLng donné pour le type de carte satellite . Étant donné que cette requête est asynchrone, vous devez transmettre une fonction callback qui sera exécutée à la fin de la requête, en lui transmettant un MaxZoomResult . |
Interface google.maps.MaxZoomResult
Résultat MaxZoom au format JSON récupéré à partir de MaxZoomService.
Propriétés |
zoom |
Type:number
Niveau de zoom maximal trouvé pour l'LatLng donnée. |
status optional |
État de la demande. Cette propriété n'est définie que lorsque vous utilisez des rappels avec MaxZoomService.getMaxZoomAtLatLng (elle n'est pas définie lorsque vous utilisez des promesses). |
Constantes google.maps.MaxZoomStatus
État renvoyé par MaxZoomService
à la fin d'un appel à getMaxZoomAtLatLng()
. Spécifiez-les par valeur ou en utilisant le nom de la constante. Par exemple : 'OK'
ou google.maps.MaxZoomStatus.OK
.
Accédez-y en appelant const {MaxZoomStatus} = await google.maps.importLibrary("maps")
. Consultez la section Bibliothèques de l'API Maps JavaScript.
Constantes |
ERROR |
Une erreur inconnue s'est produite. |
OK |
La réponse contient un MaxZoomResult valide. |
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2024/12/22 (UTC).
[null,null,["Dernière mise à jour le 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`. |"]]