GMS Marker fixed to center of map in Swift -


how 1 ensure gms marker remains fixed on centre of map allowing map dragged not marker?

thanks

you can add vertical , horizontal constraints align marker view.

let xconstraint = nslayoutconstraint(item: yourmarkerview, attribute: .centerx, relatedby: .equal, toitem: self.yourmapview, attribute: .centerx, multiplier: 1, constant: 0)  let yconstraint = nslayoutconstraint(item: yourmarkerview, attribute: .centery, relatedby: .equal, toitem: self.yourmapview, attribute: .centery, multiplier: 1, constant: 0)  self.yourmapview.addconstraint(xconstraint) self.yourmapview.addconstraint(yconstraint) 

also make sure have constraints added yourmapview. (you can add them in storyboard.)


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

authentication - Mongodb revoke acccess to connect test database -

python - Scipy.Odr multiple variable regression -