iphone - MapView snaps back to original location - help! -


i have mapview custom annotations , ran problem on beta tester's iphone. mapview won't let user move location.. try move, snaps right original coordinates.

any idea why? doesn't happen in simulator, , notice little bit on own device... consistent problem on device.

thanks much!

static bool havealreadyreceivedcoordinates = no;  - (void)locationmanager:(cllocationmanager *)manager didupdatetolocation:(cllocation *)newlocation fromlocation:(cllocation *)oldlocation  {     if(havealreadyreceivedcoordinates) {     return;     }      havealreadyreceivedcoordinates = yes;      cllocationcoordinate2d loc = [newlocation coordinate];     [mapview setcentercoordinate:loc]; } 

icky put on right track. shouldn't resetting map's center whatever location manager. location manager send sorts of updates.

you may wish use update once , ignore future updates (by setting kind of flag), or may wish center map on user's location when user presses button. in latter case thing need in didupdatetolocation: store new location member variable.

the reason don't see in simulator location hardware simulator isn't updating way real 1 is.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -