Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSMutableArray *profilesArr = [[[NSMutableArray alloc] initWithContentsOfFile:path]autorelease];
- NSMutableDictionary *tempDict = [[[NSMutableDictionary alloc] initWithDictionary:[profilesArr objectAtIndex:0]]autorelease];
- NSString *dynamicURL = [tempDict objectForKey:@"dynamicLayer"];
- NSString *user = [tempDict objectForKey:@"user"];
- NSString *pass = [tempDict objectForKey:@"pass"];
- NSString *backgroundURL = [tempDict objectForKey:@"backgroundLayer"];
- NSMutableArray *tempVisible = [tempDict objectForKey:@"visibleLegend"];
- [self.mapView removeMapLayerWithName:@"Tiled Layer"];
- [self.mapView removeMapLayerWithName:@"Dynamic Layer"];
- [self.mapView removeMapLayerWithName:@"Graphics Layer"];
- [self.mapView removeMapLayerWithName:@"Graphics Layer 2"];
- [self.mapView removeMapLayerWithName:@"Sketch Layer"];
- [self.mapView removeMapLayerWithName:@"Sketch Layer2"];
- NSLog(@"load temp %@", tempVisible);
- self.visibleLegend = tempVisible;
- self.dynamicLayer.layerDefinitions = visibleLegend;
- cred = [[AGSCredential alloc] initWithUser:user password:pass];
- tiledLayer = [[AGSTiledMapServiceLayer alloc] initWithURL:[NSURL URLWithString:backgroundURL]];
- self.backgroundLayerView =[self.mapView addMapLayer:tiledLayer withName:@"Tiled Layer"];
- self.dynamicLayer = [[[AGSDynamicMapServiceLayer alloc] initWithURL:[NSURL URLWithString: dynamicURL] credential:cred]autorelease];
- self.dynamicLayerView =[self.mapView addMapLayer:self.dynamicLayer withName:@"Dynamic Layer"];
- [self loadMap];
- NSString *pName = profileName;
- [self dismissModalViewControllerAnimated:YES];
- NSMutableArray *profilesArr = [[NSMutableArray alloc] initWithContentsOfFile:path];
- NSMutableDictionary *tempDict = [[NSMutableDictionary alloc] init ] ;
- NSMutableArray *tempArr = [[[NSMutableArray alloc] initWithArray:[tempDict objectForKey:@"visibleLegend"]]autorelease];
- NSMutableArray *tester = [[[NSMutableArray alloc] initWithArray:self.visibleLegend] autorelease];
- NSString *dynamicURL = [self.dynamicLayer.URL absoluteString];
- NSString *tiledURL = [self.tiledLayer.URL absoluteString];
- AGSCredential *currentCred= self.dynamicLayer.credential;
- NSString *user = currentCred.username;
- NSString *pass = currentCred.password;
- tester = self.visibleLegend;
- [tempDict setObject:pName forKey:@"profileName"];
- [tempDict setObject:user forKey:@"user"];
- [tempDict setObject:pass forKey:@"pass"];
- [tempDict setObject:dynamicURL forKey:@"dynamicLayer"];
- [tempDict setObject:tiledURL forKey:@"backgroundLayer"];
- [tempDict setObject:tester forKey:@"visibleLegend"];
- NSLog(@"legend %@", self.visibleLegend);
- NSLog(@"tester %@", tester);
- [profilesArr addObject:tempDict];
- if ([profilesArr containsObject:tempDict])
- NSLog(@"added");
- if ([profilesArr writeToFile:path atomically:NO])
- NSLog(@"new saved");
Add Comment
Please, Sign In to add comment