Help with Maps please

Discussion in 'iOS Programming' started by kally1369, Apr 29, 2010.

  1. kally1369 macrumors newbie

    Joined:
    Apr 29, 2010
    #1
    Hi,

    I'm trying to do application that launches google maps. I'm using MKMapView and CLLocationManager to receive events.
    My objective is to display the initial map in a smaller region. Now I'm displaying all the continents in the world:) but I want to display just a small region in radius 10 meters to the user location.

    So my code is running, no errors, but I obtain an initial map with all the continents. All I want is displaying smaller region within a certain radius.

    Here is my code and thank you for the help:


    Code:
    - (void)viewDidLoad {
    [super viewDidLoad];
    map = [[MKMapView alloc]initWithFrame:self.view.bounds];
    map.delegate = self;
    [self.view insertSubview:map atIndex:0];
     
    CLLocationManager *locationManager = [[CLLocationManager alloc]init];
    locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;//setting the desired accuracy
    locationManager.distanceFilter = 100.0f;
    locationManager.delegate = self; // Set the delegate to handle the messages from the location manager
    //verifying if gps supported
    if (locationManager.headingAvailable) {
    [locationManager startUpdatingLocation];
    }
     
    }
     
     
    - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{
     
     
    MKCoordinateRegion coordinateRegion;
    coordinateRegion.center = newLocation.coordinate;
    coordinateRegion.span.latitudeDelta = 0.005; //set zoom level
    coordinateRegion.span.longitudeDelta = 0.005;
     
    [map setRegion:region animated:TRUE];
     
    }
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Hmm, 10 meters (~33ft for you imperialists) is an awfully small radius. Google Maps probably won't provide any map image data at that scale.
     

Share This Page