gpt4 book ai didi

ios - GoogleMaps cocoapod 中缺少 GMSPlace viewport 成员

转载 作者:搜寻专家 更新时间:2023-11-01 05:37:49 30 4
gpt4 key购买 nike

我正在实现 iOS map View 。我设置了 Google Search Api 来实现地点搜索。

我是这样用cocoapods的

pod 'Google' , '~> 1.2.1'
pod 'GoogleMaps', '~> 1.11.0'

当用户搜索一些关键字时,我得到一个 GMSPlace 列表。当用户选择 GMSPlace 对象时,我运行此代码以获取坐标。

placesClient?.lookUpPlaceID(placeID, callback: { (place: GMSPlace?, error: NSError?) -> Void in                       
if let place = place {
print("Place name \(place.name)")
print("Place coordinate \(place.coordinate)")
// how to find the viewport?
} else {
print("No place details for \(placeID)")
}
})

如果你看这里https://developers.google.com/maps/documentation/ios-sdk/reference/interface_g_m_s_place GMSPlace 有成员 viewport - 这个地方的推荐视口(viewport)。

但是如果我在 Xcode 中使用 CMD 并单击 GMSPlace,我就会来到这门课。它没有视口(viewport)成员。

    /**
* Represents a particular physical place. A GMSPlace encapsulates information about a physical
* location, including its name, location, and any other information we might have about it. This
* class is immutable.
*/
public class GMSPlace : NSObject {

/** Name of the place. */
public var name: String! { get }

/** Place ID of this place. */
public var placeID: String! { get }

/**
* 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.
*/
public var coordinate: CLLocationCoordinate2D { get }

/**
* Represents the open now status of the place at the time that the place was created.
*/
public var openNowStatus: GMSPlacesOpenNowStatus { get }

/**
* 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".
*/
public var phoneNumber: String! { get }

/**
* Address of the place as a simple string.
*/
public var formattedAddress: String! { get }

/**
* 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).
*/
public var rating: Float { get }

/**
* 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).
*/
public var priceLevel: GMSPlacesPriceLevel { get }

/**
* The types of this place. Types are NSStrings, valid values are any types documented at
* <https://developers.google.com/places/supported_types>.
*/
public var types: [AnyObject]! { get }

/** Website for this place. */
@NSCopying public var website: NSURL! { get }

/**
* 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 this GMSPlace is shown, as described in
* the Places API Terms of Service.
*/
@NSCopying public var attributions: NSAttributedString! { get }
}

我需要做什么才能获得所需的类(class)?

最良好的祝愿。

最佳答案

最新的cocoapod有它!我只需要更新。

关于ios - GoogleMaps cocoapod 中缺少 GMSPlace viewport 成员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34790121/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com