GooglePlacesSwift Framework Reference

  • FetchPhotoRequest is a struct used to request a photo for a specific place, along with its properties.

  • It initializes with a Photo object and a maxSize of type CGSize to define the desired photo dimensions.

  • The returned photo will either be the original if smaller than maxSize or scaled down while maintaining aspect ratio.

  • maxSize height and width must be within the range of 1 to 4800, otherwise, the request will result in an error.

FetchPhotoRequest

struct FetchPhotoRequest
extension FetchPhotoRequest : Sendable

The request for a specific placeID and place properties to include in the Place response.

  • Request object to use with PlacesClient to fetch a photo.

    If the image is smaller than the values specified, the original image will be returned. If the image is larger in either dimension, it will be scaled to match the smaller of the two dimensions, restricted to its original aspect ratio. CGSize height and width should be set to an integer between 1 and 4800. If not, the PlacesClient request callback will return an error.

    Declaration

    Swift

    init(photo: Photo, maxSize: CGSize)

    Parameters

    photo

    The Photo to request.

    maxSize

    The maximum desired size in pixels of the image returned by the Place Photos service.