Swift Error - use of unresolved identifier 'kGMSMarkerAnimationPop'
Asked Answered
U

2

7

I am getting this error

use of unresolved identifier 'kGMSMarkerAnimationPop'

when I use the following code in Swift 3:

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()

How can I fix it?

Unsocial answered 28/3, 2017 at 6:47 Comment(4)
try kGMSMarkerAnimation.PopGyneco
@Anbu when I tried that I am getting error as use of unresolved identifier 'kGMSMarkerAnimation'Unsocial
check this question #34656975Revamp
Possible duplicate of Ambiguous use of 'kGMSMarkerAnimationPop' Error in Swift 2Pyrogallol
D
10

In Swift 3/4 and GoogleMaps 2.3.0. The new syntax is :

marker.appearAnimation = GMSMarkerAnimation.pop

Ambiguous use of 'kGMSMarkerAnimationPop' Error in Swift 2

Dipteran answered 14/12, 2017 at 9:49 Comment(0)
I
0

try marker.appearAnimation = .pop

Illative answered 1/8, 2017 at 4:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.