问题描述
<$ p
我试图给GMSMarker设置动画时出错,我遵循了Google文档和各种指南,但它一直返回一个错误,下面是我的代码: $ p $ func placeMarker(坐标:CLLocationCoordinate2D){
如果locationMarker!= nil {
locationMarker.map = nil
}
locationMarker = GMSMarker(位置:坐标)
locationMarker.icon = GMSMarker.markerImageWithColor(紫色)
locationMarker.appearAnimation = kGMSMarkerAnimationPop
locationMarker.snippet =地球上最好的地方。
locationMarker.map = mapView
}
返回错误模糊使用'kGMSMarkerAnimationPop'
任何帮助都将被appriciated!
升级谷歌地图pod不会工作,至少直到1.12.3。
-
改变GMSMarker.h中的GMSMarkerAnimation:
typedef枚举{
/ **没有动画(默认)。 * /
kGMSMarkerAnimationNone = 0,
/ **当添加标记时,标记将从它的groundAnchor弹出。 * /
kGMSMarkerAnimationPop,
} GMSMarkerAnimation; b
typedef NS_ENUM(NSInteger,GMSMarkerAnimation){
/ **没有动画(默认)。 * /
kGMSMarkerAnimationNone = 0,
/ **当添加标记时,标记将从它的groundAnchor弹出。 * /
kGMSMarkerAnimationPop,
};
-
更改
locationMarker.appearAnimation = kGMSMarkerAnimationPop
to
locationMarker.appearAnimation = GMSMarkerAnimation.Pop
Im having an error while trying to animate a GMSMarker, I have followed the Google documentation and various guides but it keeps returning an error, below is my code:
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
}
Which returns the error Ambiguous use of 'kGMSMarkerAnimationPop'
Any help would be appriciated!
upgrading google map pod won't work, at least until 1.12.3.
change GMSMarkerAnimation in GMSMarker.h from this:
typedef enum { /** No animation (default). */ kGMSMarkerAnimationNone = 0, /** The marker will pop from its groundAnchor when added. */ kGMSMarkerAnimationPop, } GMSMarkerAnimation;
to this:
typedef NS_ENUM(NSInteger, GMSMarkerAnimation){ /** No animation (default). */ kGMSMarkerAnimationNone = 0, /** The marker will pop from its groundAnchor when added. */ kGMSMarkerAnimationPop, } ;
change
locationMarker.appearAnimation = kGMSMarkerAnimationPop
to
locationMarker.appearAnimation = GMSMarkerAnimation.Pop
这篇关于在Swift 2中对'kGMSMarkerAnimationPop'错误的模糊使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!