stevensj2

Cannot initiate GPS/Location Services

Discussion created by stevensj2 on Mar 5, 2012
Latest reply on Mar 6, 2012 by njarecha-esristaff
I've been following the reference guide for getting started w/ the ArcGIS SDK and adding a map to the view. That's working just fine and was quite easy to do.

When following the steps to display the user's location, nothing occurs. Starting the app does not initiate the 'This app would like use your location..." dialog nor does the blue locator dot appear on the map.

Below is the code I'm working with:

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSString* bingMapsKey = @"-- my actual key --";
    AGSBingMapLayer* layer = [[AGSBingMapLayer alloc] initWithAppID:bingMapsKey style:AGSBingMapLayerStyleRoad];
    
    if(layer.loaded){
        NSLog(@"Spatial Reference : %@", layer.spatialReference);
    }
    
    [self.mapView addMapLayer:layer withName:@"Tiled Layer"];
    
    self.mapView.gps.autoPanMode = AGSGPSAutoPanModeDefault;
}

- (void)viewDidUnload
{
    [self setMapView:nil];
    [self setMapView:nil];
    [super viewDidUnload];
    [self.mapView.gps stop];
    // Release any retained subviews of the main view.
}

-(void) mapViewDidLoad:(AGSMapView*)mapView {
  [self.mapView.gps start];
}


I've compared this to the included map view sample, though I can't identify the difference with the [self.mapView.gps start]; option.

It appears the mapViewDidLoad is never happening (if I put in an NSLOG() it never gets output).

Any clues on what I'm missing?

Thanks in advance for taking a look!

Outcomes