我在尝试为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'的模糊使用
任何帮助都会得到满足!
升级谷歌地图pod将无法正常工作,至少在1.12.3之前.
从这个改变GMSMarker.h中的GMSMarkerAnimation:
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