swift - MapKit IOS Not Centering on Pin -


i'm having issue mapkit not centering on pin have set. instead loading this.

i've tried multiple different things, example issue related mapkit properties in storyboard? maybe don't think so. can't seem find on web relating issue? here code believe might relevant:

import uikit import mapkit import foundation class first: uiviewcontroller {       @iboutlet var map: mkmapview!      override func viewdidload() {          var location = cllocationcoordinate2dmake(-37.81411, 144.96328)          var span = mkcoordinatespanmake(0.1, 0.1)          var region = mkcoordinateregion(center: location, span: span)           map.setregion(region, animated: true)           var annotation = mkpointannotation()         annotation.coordinate = location         annotation.title = "pizza pistorante"         annotation.subtitle = "luna rossa"          // add annotation scene          map.addannotation(annotation)        } } 

add constraint mapview way:

select mapview storyboard go pin menu , add 4 constraint shown in below image:

enter image description here

and map annotation display @ center.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -