- (void) webMapDidLoad:(AGSWebMap*) webMap { //webmap data was retrieved successfully NSLog(@load successfully); [self.webmap openIntoMapView:self.mapView]; [self.mapView setNeedsDisplay]; } - (void) webMap:(AGSWebMap *)webMap didFailToLoadWithError:(NSError *)error { //webmap data was not retrieved //alert the user NSLog(@Error while loading webmap: %@",[error localizedDescription]); } -(void)didOpenWebMap:(AGSWebMap*)webMap intoMapView:(AGSMapView*)mapView{ //web map finished opening NSLog(@delegate method: didOpenWebMap:(AGSWebMap*)webMap intoMapView:(AGSMapView*)mapView); } -(void)didLoadLayer:(AGSLayer*)layer{ //layer in web map loaded properly } - (void)viewDidLoad { [super viewDidLoad]; NSString *mapId = @49c555e22cdf480181153f35d18f8863;//1d105a71e3eb499383e4b7556f0bbc34 self.webmap = [[AGSWebMap alloc] initWithItemId:mapId credential:nil]; self.webmap.delegate = self; } -(void)didFailToLoadLayer:(NSString*)layerTitle url:(NSURL*)url baseLayer:(BOOL)baseLayer withError:(NSError*)error { NSLog(@Error while loading layer: %@",[error localizedDescription]); } - (void)viewDidUnload { [self setMapView:nil]; self.webmap = nil; [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; }
@property (retain, nonatomic) IBOutlet AGSMapView *mapView; @property (retain, nonatomic) AGSWebMap *webmap;
-(NSString*)bingAppId{ return @YOUR BING MAPS KEY; }
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.