AnsweredAssumed Answered

Zooming not working on World Imagery Map

Question asked by golden_gate on Feb 2, 2014
Latest reply on Feb 4, 2014 by golden_gate
[ATTACH=CONFIG]31055[/ATTACH]

I tried to modify the WebmapSample to display the following image from the World Imagery gallery:

http://www.arcgis.com/home/webmap/viewer.html?webmap=d802f08316e84c6592ef681c50178f17&extent=-122.578926,37.720084,-122.258263,37.927545

Based on my inspection of the URL I needed to create an AGSEnvelope object  which contains the extent parameters displayed
in the URL.

Extent Parameters:
Xmin:-122.578926
ymin:37.720084
xmax:-122.258263
ymax:37.927545

My modification of the application involved:

1. Added a string constant for the id of map of interest
2. Added AGSMapViewLayerDelegate protocol to WebmapSampleViewController.h
3. Set the WebmapSampleView controller to be the delegate object for the protocol mentioned.
3. Added the function -(void)mapViewDidLoad: (AGSMapView*)mapView in WebmapSampleViewController.m (code snippet below)

- (void)mapViewDidLoad:(AGSMapView *)mapView {               NSURL * goldengateURL = [NSURL URLWithString:@"http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"];     AGSTiledMapServiceLayer * tiledLayer = [[AGSTiledMapServiceLayer alloc] initWithURL:goldengateURL];     [self.mapView addMapLayer:tiledLayer withName:@"Tiled Layer"];          AGSSpatialReference *sr = [AGSSpatialReference spatialReferenceWithWKID:102100];     AGSEnvelope * env = [AGSEnvelope envelopeWithXmin:-122.578926 ymin:37.720084 xmax:-122.258263 ymax:37.927545 spatialReference:sr];     [self.mapView zoomToEnvelope:env animated:YES];           }


When the program is invoked the contents of the display turn black and purple. This issue was also highlighted
in the following forum post:

http://forums.arcgis.com/threads/75752-world-imagery-service-canadian-imagery-weirdly-purple

I need to know if I have modified the code correctly. I did not want to assume that it was directly related to the previous post.
Notice that I set the infrastructure for the zoom in the delegate method. I have seen other posts on resource examples that do this in the view controllers - (void)viewDidLoad method.

I am hoping there is a work around for this. I need to zoom. It would be a waste if all of this high resolution imagery could not be processed.

Outcomes