Swift 错误 - 使用了无法解析的标识符 'kGMSMarkerAnimationPop'

Swift Error - use of unresolved identifier 'kGMSMarkerAnimationPop'

我遇到了这个错误

use of unresolved identifier 'kGMSMarkerAnimationPop'

当我在Swift3中使用下面的代码时:

let camera = GMSCameraPosition.camera(withLatitude: location.coordinate.latitude, longitude: location.coordinate.longitude, zoom: 14)
mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
mapView?.isMyLocationEnabled = true
mapView?.settings.myLocationButton = true
view = mapView
let marker = GMSMarker()
marker.position = CLLocationCoordinate2D(latitude: location.coordinate.latitude, longitude: location.coordinate.longitude)
marker.title = "Sydney"
marker.snippet = "Australia"
marker.appearAnimation = kGMSMarkerAnimationPop // the error is occurring in this line
marker.map = mapView
locationManager.stopUpdatingLocation()

我该如何解决?

尝试 marker.appearAnimation = .pop

在 Swift 3/4 和 GoogleMaps 2.3.0 中。 新语法是:

marker.appearAnimation = GMSMarkerAnimation.pop

Ambiguous use of 'kGMSMarkerAnimationPop' Error in Swift 2