开发者

show zoomed location in mkmapview google map, iphone

开发者 https://www.devze.com 2023-03-02 13:18 出处:网络
Right now i am working on Go开发者_开发问答ogle map. and for show pins on Google map i am using the area name and using Geo coder. so now i want to so zoomed Google map. so now how i set span using ge

Right now i am working on Go开发者_开发问答ogle map. and for show pins on Google map i am using the area name and using Geo coder. so now i want to so zoomed Google map. so now how i set span using geo coder. please suggest.

Mike.


Mike, not exactly sure what you are asking... but I think you are asking how to zoom the map into a certain location. if that is the case.. here is some code to demo that by zooming into the good ol USA.

-(void) showUS 
{

    MKMapView *mapView = (MKMapView *)self.view;


    MKCoordinateRegion region;
    MKCoordinateSpan span;
    span.longitudeDelta= 56.250000;

    CLLocationCoordinate2D center;

    center.latitude=38.959409;
    center.longitude=-97.734375;

    region.span=span;
    region.center=center;

    @try {
        [mapView setRegion:region animated:YES];
    }
    @catch (NSException * e) {

    }

}
0

精彩评论

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