Utilise un nouveau modèle de tarification. Pour obtenir des informations sur les tarifs de toutes les API, consultez
SDK Places pour Android (nouveau).
Place Photo (ancienne version) renvoie une image bitmap.
Place Photo (New) renvoie un URI vers l'image.
L'ancienne fonctionnalité Photo de lieu acceptait une taille maximale de 1 600 x 1 600 pixels. Place Photo (New)
accepte les tailles jusqu'à 4 800 x 4 800 pixels.
Vous ne pouvez appeler la méthode PlacesClient.fetchPhoto() que si vous activez l'API Places. Cette méthode n'est pas disponible lorsque vous n'activez que l'API Places (nouvelle).
Si l'objet PhotoMetadata renvoyé inclut des attributions ou des attributions d'auteur, vous devez les inclure dans votre application partout où vous affichez l'image. Consultez la documentation sur les attributions.
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 2025/08/30 (UTC).
[null,null,["Dernière mise à jour le 2025/08/30 (UTC)."],[],[],null,["# Migrate to Place Photo (New)\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\n\u003cbr /\u003e\n\n| This feature requires that you enable Places API (New), the next generation of the Places API. For more information, see [Enable APIs](/maps/documentation/places/android-sdk/legacy/cloud-setup#enabling-apis).\n\n\u003cbr /\u003e\n\nPlaces SDK for Android supports\n[Place Photo (Legacy)](/maps/documentation/places/android-sdk/photos).\nIf you are familiar with Place Photo (Legacy),\n[Place Photo (New)](/maps/documentation/places/android-sdk/place-photos)\nmakes the following changes:\n\n- Uses a new pricing model. For pricing information for all APIs, see [Places SDK for Android\n (New)](/maps/documentation/places/android-sdk/usage-and-billing#pricing-new).\n\n- Place Photo (Legacy) returns a bitmap image.\n Place Photo (New) returns a URI to the image.\n\n- Place Photo (Legacy) supported a maximum photo\n size of 1600 by 1600 pixels. Place Photo (New)\n supports sizes up to 4800 by 4800 pixels.\n\n- To make a request, call the new\n [`PlacesClient.fetchResolvedPhotoUri()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/net/PlacesClient#fetchResolvedPhotoUri(com.google.android.libraries.places.api.net.FetchResolvedPhotoUriRequest))\n method.\n\n- You can only call the\n [`PlacesClient.fetchPhoto()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/net/PlacesClient#fetchPhoto(com.google.android.libraries.places.api.net.FetchPhotoRequest))\n method if you enable **Places API** . That method is\n not available when you only enable\n **Places API (New)**.\n\n For more information, see\n [Use API Keys](/maps/documentation/places/android-sdk/get-api-key).\n- Pass to the request an object of the new\n [`FetchResolvedPhotoUriRequest`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/net/FetchResolvedPhotoUriRequest.Builder)\n class.\n\n- Each photo in the response is represented by a\n [`PhotoMetadata`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/PhotoMetadata)\n object. For Places SDK for Android (New) the `PhotoMetadata`\n object contains a new\n [`PhotoMetadata.getAuthorAttributions()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/PhotoMetadata#public-abstract-authorattributions-getauthorattributions)\n method that returns an object of type [`AuthorAttributions`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/AuthorAttributions).\n\n If the returned `PhotoMetadata` object includes any attributions or author\n attribution, you must include these attributions in your\n application wherever you display the image. See the documentation on\n [attributions](/maps/documentation/places/android-sdk/policies#other_attribution_requirements).\n- To access the new author attributions in `PhotoMetadata` you must initialize\n your app by calling the\n [`Places.initializeWithNewPlacesApiEnabled()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/Places#initializeWithNewPlacesApiEnabled(android.content.Context,%20java.lang.String))\n method. For more information on selecting the Places API service, see\n [Set up your Google Cloud project](/maps/documentation/places/android-sdk/legacy/cloud-setup).\n\nExample request\n---------------\n\nFor a complete example, see\n[Place Photos (New)](/maps/documentation/places/android-sdk/place-photos)."]]