我在尝试为GMSMarker设置动画时出现错误,我遵循了Google文档和各种指南,但始终返回错误,以下是我的代码:
func placeMarker(coordinate: CLLocationCoordinate2D) {
if locationMarker != nil {
locationMarker.map = nil
}
locationMarker = GMSMarker(position: coordinate)
locationMarker.icon = GMSMarker.markerImageWithColor(purple)
locationMarker.appearAnimation = kGMSMarkerAnimationPop
locationMarker.snippet = "The best place on earth."
locationMarker.map = mapView
}
该错误返回错误使用'kGMSMarkerAnimationPop'
任何帮助都将被申请!
最佳答案
至少在1.12.3之前,升级Google Map Pod无效。
typedef enum {
/** No animation (default). */
kGMSMarkerAnimationNone = 0,
/** The marker will pop from its groundAnchor when added. */
kGMSMarkerAnimationPop,
} GMSMarkerAnimation;
对此:
typedef NS_ENUM(NSInteger, GMSMarkerAnimation){
/** No animation (default). */
kGMSMarkerAnimationNone = 0,
/** The marker will pop from its groundAnchor when added. */
kGMSMarkerAnimationPop,
} ;
locationMarker.appearAnimation = kGMSMarkerAnimationPop
至
locationMarker.appearAnimation = GMSMarkerAnimation.Pop