Solved! Go to Solution.
Hi,
I'm doing exact the same thing in my project and it works for me.
Have you tried to first remove the previous maplayer?[mapView removeMapLayerWithName:@"blub"];
The second thing is this line:sgViewController *sVC = [self.storyboard instantiateViewControllerWithIdentifier:@"sgViewController"];
I think this gives you a new instance of the sgViewController and not the one which is already initialized. I'm fairly new to objective-c so that could me wrong.
But if thats the problem:
Give the ConfigViewController a public sgViewController property and assign your sgViewController to it when you call the ConfigViewController.
Something like:ConfigViewController* configViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"configView"]; [configViewController setSgViewController:self]; [self.navigationController pushViewController:configViewController animated:YES];
[mapView removeMapLayerWithName:@"blub"];
sgViewController *sVC = [self.storyboard instantiateViewControllerWithIdentifier:@"sgViewController"];
ConfigViewController* configViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"configView"]; [configViewController setSgViewController:self]; [self.navigationController pushViewController:configViewController animated:YES];
Hi,
I'm doing exact the same thing in my project and it works for me.
Have you tried to first remove the previous maplayer?[mapView removeMapLayerWithName:@"blub"];
The second thing is this line:sgViewController *sVC = [self.storyboard instantiateViewControllerWithIdentifier:@"sgViewController"];
I think this gives you a new instance of the sgViewController and not the one which is already initialized. I'm fairly new to objective-c so that could me wrong.
But if thats the problem:
Give the ConfigViewController a public sgViewController property and assign your sgViewController to it when you call the ConfigViewController.
Something like:ConfigViewController* configViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"configView"]; [configViewController setSgViewController:self]; [self.navigationController pushViewController:configViewController animated:YES];
Have you ever tried this with an AGSOpenStreetMapLayer?
I'm trying to change between an AGSDynamicMapServiceLayer and the AGSOpenStreetMapLayer but thats not working.
The changing between two different AGSDynamicMapServiceLayers is no problem, but as soon as I'm trying to add a AGSOpenStreetMapLayer after viewDidLoad happens nothing.