Zoom on userLocation

Posted by Marco on Stack Overflow See other posts from Stack Overflow or by Marco
Published on 2010-03-11T07:22:22Z Indexed on 2010/04/16 11:03 UTC
Read the original article Hit count: 416

Filed under:
|

Hello,

how can I zoom the map on my userLocation automatically in my app? I have the following code to zomm in the map but i must zoom on the userLocation and the following code zooms always to africa?

MKCoordinateRegion zoomIn = mapView.region;
    zoomIn.span.latitudeDelta *= 0.2;
    zoomIn.span.longitudeDelta *= 0.2;
    zoomIn.center.latitude = mapView.userLocation.location.coordinate.latitude;
    zoomIn.center.longitude = mapView.userLocation.location.coordinate.longitude;
    [mapView setRegion:zoomIn animated:YES];

© Stack Overflow or respective owner

Related posts about mkmapview

Related posts about iphone-sdk