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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -