开发者

show view location at current location + map view

开发者 https://www.devze.com 2023-02-03 09:11 出处:网络
i have web view in that i am loading list of data i maslo showing my current location . now i want to zoom my view in at my current location.

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

精彩评论

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

关注公众号