Mitesh Khatri
Mitesh Khatri

Reputation: 3955

show zoomed location in mkmapview google map, iphone

Right now i am working on Google 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.

Upvotes: 0

Views: 605

Answers (1)

Jason Cragun
Jason Cragun

Reputation: 3233

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) {

    }

}

Upvotes: 1

Related Questions