开发者

show view location at current location + map view

i have web view in that i am loading list of data

i m aslo showing my current location . now i want to zoom my view in at my current location.

in map view i开发者_C百科 m showing many data . my view is showing me zooming location at my last data location at my last data .


I created a method to move the map to a location:

-(void)setMapPosition:(CLLocation *)location animated:(BOOL)ani
{
    MKCoordinateRegion region;
    region.center.latitude =  location.coordinate.latitude;
    region.center.longitude = location.coordinate.longitude;
    region.span.latitudeDelta = 0.015;
    region.span.longitudeDelta = 0.015;

    [myMapView setRegion:region animated:ani];

}

Show user location:

[self setMapPosition:myMapView.userLocation.location animated:YES];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜