// // ----- OpenStreetMap base layer // AGSOpenStreetMapLayer *baseLayer = [[AGSOpenStreetMapLayer alloc] init]; [self.mapView addMapLayer:baseLayer withName:@"OpenStreetMap"]; [baseLayer release]; // // ----- US highways from ESRI // NSURL* url = [NSURL URLWithString: @"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer"]; AGSDynamicMapServiceLayer* highwayLayer = [AGSDynamicMapServiceLayer dynamicMapServiceLayerWithURL: url]; [self.mapView addMapLayer:highwayLayer withName:@"US Highways"]; // // ----- zoom to approximately Colorado // AGSSpatialReference *sr = [AGSSpatialReference spatialReferenceWithWKID:4326]; AGSEnvelope *env = [AGSEnvelope envelopeWithXmin:-110.0 ymin:35.0 xmax:-100.0 ymax:40.0 spatialReference:sr]; [self.mapView zoomToEnvelope:env animated:YES];
AGSSpatialReference *sr = [AGSSpatialReference spatialReferenceWithWKID:102100]; AGSEnvelope *env = [AGSEnvelope envelopeWithXmin:-12158332 ymin:4392194 xmax:-11341332 ymax:5006778 spatialReference:sr]; [self.mapView zoomToEnvelope:env animated:YES];