GMSPlace Class Reference

GMSPlace Class Reference

Overview

Represents a particular physical place.

AGMSPlaceencapsulates information about a physical location, including its name, location, and any other information we might have about it. This class is immutable.

Public Member Functions

(GMSPlaceOpenStatus)-isOpenAtDate:
Default init is not available.
(GMSPlaceOpenStatus)-isOpen
Calculates if a place is open based onopeningHours,UTCOffsetMinutes,and current date and time obtained from[NSDate date].

Properties

NSString *name
Name of the place.
NSString *placeID
Place ID of this place.
CLLocationCoordinate2Dcoordinate
Location of the place.
NSString *phoneNumber
Phone number of this place, in international format, i.e.
NSString *formattedAddress
Address of the place as a simple string.
floatrating
Five-star rating for this place based on user reviews.
NSArray<GMSPlaceReview* > *reviews
An array ofGMSPlaceReviewobjects representing the user reviews of the place.
GMSPlacesPriceLevelpriceLevel
Price level for this place, as integers from 0 to 4.
NSArray< NSString * > *types
The types of this place.
NSURL *website
Website for this place.
NSAttributedString *attributions
The data provider attribution string for this place.
GMSPlaceViewportInfo*viewportInfo
The recommended viewport for this place.
NSArray<GMSAddressComponent* > *addressComponents
An array ofGMSAddressComponentobjects representing the components in the place's address.
GMSPlusCode*plusCode
The Plus code representation of location for this place.
GMSOpeningHours*openingHours
The normal business Opening Hours information for this place.
GMSOpeningHours*currentOpeningHours
Returns this place's hours of operation over the next seven days.
NSArray<GMSOpeningHours* > *secondaryOpeningHours
Returns an array of this place's secondary hour(s) of operation over the next seven days.
NSUIntegeruserRatingsTotal
Represents how many reviews make up this place's rating.
NSArray<GMSPlacePhotoMetadata* > *photos
An array ofGMSPlacePhotoMetadataobjects representing the photos of the place.
NSNumber *UTCOffsetMinutes
The timezone UTC offset of the place in minutes.
GMSPlacesBusinessStatusbusinessStatus
TheGMSPlaceBusinessStatusof the place.
NSString *editorialSummary
Returns this place's editorial summary.
UIColor *iconBackgroundColor
Background color of the icon according to Place type, to color the view behind the icon.
NSURL *iconImageURL
The URL according to Place type, which you can use to retrieve the NSData of the Place icon.
GMSBooleanPlaceAttributetakeout
Place Attribute for takeout experience.
GMSBooleanPlaceAttributedelivery
Place Attribute for delivery services.
GMSBooleanPlaceAttributedineIn
Place Attribute for dine in experience.
GMSBooleanPlaceAttributecurbsidePickup
Place Attribute for curbside pickup services.
GMSBooleanPlaceAttributereservable
Place Attribute indicating place is popular with tourists.
GMSBooleanPlaceAttributeservesBreakfast
Place Attribute indicating place serves breakfast.
GMSBooleanPlaceAttributeservesLunch
Place Attribute indicating place serves lunch.
GMSBooleanPlaceAttributeservesDinner
Place Attribute indicating place serves dinner.
GMSBooleanPlaceAttributeservesBeer
Place Attribute indicating place serves beer.
GMSBooleanPlaceAttributeservesWine
Place Attribute indicating place serves wine.
GMSBooleanPlaceAttributeservesBrunch
Place Attribute indicating place serves brunch.
GMSBooleanPlaceAttributeservesVegetarianFood
Place Attribute indicating place serves vegetarian food.
GMSBooleanPlaceAttributewheelchairAccessibleEntrance
Place Attribute indicating place is wheelchair accessible at the entrance.

Member Function Documentation

- (GMSPlaceOpenStatus)isOpenAtDate: (NSDate *) date

Default init is not available.

Calculates if a place is open based onopeningHours,UTCOffsetMinutes,anddate.

Parameters:
dateA reference point in time used to determine if the place is open.
Returns:
GMSPlaceOpenStatusOpen if the place is open, GMSPlaceOpenStatusClosed if the place is closed, and GMSPlaceOpenStatusUnknown if the open status is unknown.
Note:
This is deprecated. This method is deprecated in favor ofGMSPlacesClient::isOpenAtDate:place:date:callback</ code> and will be removed in a future release.

Calculates if a place is open based onopeningHours,UTCOffsetMinutes,and current date and time obtained from[NSDate date].

Returns:
GMSPlaceOpenStatusOpen if the place is open, GMSPlaceOpenStatusClosed if the place is closed, and GMSPlaceOpenStatusUnknown if the open status is unknown.
Note:
This is deprecated. This method is deprecated in favor ofGMSPlacesClient::isOpen:place:callbackand will be removed in a future release.

Property Documentation

- (NSString*)name[read, copy]

Name of the place.

- (NSString*)placeID[read, copy]

Place ID of this place.

- (CLLocationCoordinate2D)coordinate[read, assign]

Location of the place.

The location is not necessarily the center of the Place, or any particular entry or exit point, but some arbitrarily chosen point within the geographic extent of the Place.

- (NSString*)phoneNumber[read, copy]

Phone number of this place, in international format, i.e.

including the country code prefixed with "+". For example, Google Sydney's phone number is "+61 2 9374 4000".

- (NSString*)formattedAddress[read, copy]

Address of the place as a simple string.

- (float)rating[read, assign]

Five-star rating for this place based on user reviews.

Ratings range from 1.0 to 5.0. 0.0 means we have no rating for this place (e.g. because not enough users have reviewed this place).

- (NSArray<GMSPlaceReview*>*)reviews[read, copy]

An array ofGMSPlaceReviewobjects representing the user reviews of the place.

- (GMSPlacesPriceLevel)priceLevel[read, assign]

Price level for this place, as integers from 0 to 4.

e.g. A value of 4 means this place is "$$$$" (expensive). A value of 0 means free (such as a museum with free admission).

- (NSArray<NSString *>*)types[read, copy]

The types of this place.

Types are NSStrings, valid values are any types documented at <https://developers.google.com/places/ios-sdk/supported_types>.

- (NSURL*)website[read, copy]

Website for this place.

- (NSAttributedString*)attributions[read, copy]

The data provider attribution string for this place.

These are provided as a NSAttributedString, which may contain hyperlinks to the website of each provider.

In general, these must be shown to the user if data from thisGMSPlaceis shown, as described in the Places SDK Terms of Service.

The recommended viewport for this place.

May be nil if the size of the place is not known.

This returns a viewport of a size that is suitable for displaying this place. For example, aGMSPlaceobject representing a store may have a relatively small viewport, while aGMSPlaceobject representing a country may have a very large viewport.

- (NSArray<GMSAddressComponent*>*)addressComponents[read, copy]

An array ofGMSAddressComponentobjects representing the components in the place's address.

These components are provided for the purpose of extracting structured information about the place's address: for example, finding the city that a place is in.

These components should not be used for address formatting. If a formatted address is required, use theformattedAddressproperty, which provides a localized formatted address.

- (GMSPlusCode*)plusCode[read, assign]

The Plus code representation of location for this place.

- (GMSOpeningHours*)openingHours[read, assign]

The normal business Opening Hours information for this place.

Includes open status, periods and weekday text when available.

Returns this place's hours of operation over the next seven days.

The time period starts at midnight on the date of the request and ends at 11:59 pm six days later.

GMSPlaceSpecialDayentries onGMSOpeningHourswill only be present forGMSPlacecurrentOpeningHoursandGMSPlacesecondaryOpeningHours.

- (NSArray<GMSOpeningHours*>*)secondaryOpeningHours[read, copy]

Returns an array of this place's secondary hour(s) of operation over the next seven days.

Secondary hours are different from a business's main hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. SeeGMSPlaceHoursTypefor the different types of secondary hours.

GMSPlaceSpecialDayentries onGMSOpeningHourswill only be present forGMSPlacecurrentOpeningHoursandGMSPlacesecondaryOpeningHours.

- (NSUInteger)userRatingsTotal[read, assign]

Represents how many reviews make up this place's rating.

- (NSArray<GMSPlacePhotoMetadata*>*)photos[read, copy]

An array ofGMSPlacePhotoMetadataobjects representing the photos of the place.

- (NSNumber*)UTCOffsetMinutes[read, assign]

The timezone UTC offset of the place in minutes.

TheGMSPlaceBusinessStatusof the place.

- (NSString*)editorialSummary[read, copy]

Returns this place's editorial summary.

- (UIColor*)iconBackgroundColor[read, assign]

Background color of the icon according to Place type, to color the view behind the icon.

- (NSURL*)iconImageURL[read, assign]

The URL according to Place type, which you can use to retrieve the NSData of the Place icon.

NOTES: URL link does not expire and the image size aspect ratio may be different depending on type.

Place Attribute for takeout experience.

Place Attribute for delivery services.

- (GMSBooleanPlaceAttribute)dineIn[read, assign]

Place Attribute for dine in experience.

Place Attribute for curbside pickup services.

Place Attribute indicating place is popular with tourists.

Place Attribute indicating place serves breakfast.

Place Attribute indicating place serves lunch.

Place Attribute indicating place serves dinner.

Place Attribute indicating place serves beer.

Place Attribute indicating place serves wine.

Place Attribute indicating place serves brunch.

Place Attribute indicating place serves vegetarian food.

Place Attribute indicating place is wheelchair accessible at the entrance.