Map Show Memory warning

494
0
04-25-2014 01:22 AM
fengli
by
New Contributor
When i Launched my app,taped map , then is very height for CPU and Memory. I don't know why happen this question.I just added AGSTiledMapServiceLayer to my map . There is my code , i hope someone can help me.

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.trackedViewName = @"OneMap View";
   
    //back button
    self.navigationItem.leftBarButtonItem = [[SharedObject sharedClass] navigationBarButtonWithTitle:@" Back" image:@"btn_back.png" selector:@selector(backBtnClicked:) target:self];
   
    //Add help
    UIButton *questionButton = [[UIButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 24.0, 24.0)];
    [questionButton setImage:[UIImage imageNamed:@"icon_help.png"] forState:UIControlStateNormal];
    [questionButton addTarget:self action:@selector(actionQuestionButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem * rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:questionButton];
    self.navigationItem.rightBarButtonItem = rightBarButtonItem;

    // Do any additional setup after loading the view from its nib.
    AGSTiledMapServiceLayer *tiledLayer = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL:[NSURL URLWithString:@"http://XXXXXXX"]];
    [self.OneMapView addMapLayer:tiledLayer withName:@"Tiled Layer 1 "];
 
    //set the mapView's calloutDelegate so we can display callouts
    self.OneMapView.callout.delegate = self;
    self.graphicsLayer = [AGSGraphicsLayer graphicsLayer];
   
    //Update map - show user current location
    [self addCompass];
   
    if (self.categories!=nil) {
        [self addFilter];
    }
   
    //[self addGPS];
   
    //Location manager delegate
    locationManager = [[CLLocationManager alloc] init];
    locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    locationManager.delegate = self;
   
    [locationManager startUpdatingLocation];
    [locationManager startUpdatingHeading];
   
//    [self compassclicked:nil]; //auto show current location
    [self.OneMapView.locationDisplay startDataSource];
0 Kudos
0 Replies