self.graphicsLayer = [AGSGraphicsLayer graphicsLayer]; [self.mapView addMapLayer:self.graphicsLayer withName:@"Graphics Layer"];
CLLocation *location = self.locations[0]; NSDictionary *params = @{@"geoFormat": @"esrijson", @"geo": @{@"latitude": @(location.coordinate.latitude), @"longitude": @(location.coordinate.longitude), @"distance": @100}}; [[AGSGTApiClient sharedClient] postPath:@"trigger/list" parameters:params success:^(id responseObject) { if (responseObject != nil) { NSArray *triggers = responseObject[@"triggers"]; for (NSDictionary *trigger in triggers) { NSDictionary *condition = trigger[@"condition"]; NSDictionary *geo = condition[@"geo"]; NSDictionary *esriJson = geo[@"esrijson"]; AGSGeometry *geometry = AGSGeometryWithJSONAndSR(esriJson, [self.mapView spatialReference]); // Do stuff with geometry! AGSFillSymbol* symbol = [AGSSimpleFillSymbol simpleFillSymbol]; symbol.color = [UIColor redColor]; //Create the AGSSimpleLineSymbol used for the outline AGSSimpleLineSymbol* myOutlineSymbol = [AGSSimpleLineSymbol simpleLineSymbol]; myOutlineSymbol.color = [UIColor redColor]; myOutlineSymbol.width = 2; //set the outline property to myOutlineSymbol symbol.outline = myOutlineSymbol; AGSGraphic *LocationDisplay = [[AGSGraphic alloc] initWithGeometry:geometry symbol:symbol attributes:nil]; [self.graphicsLayer addGraphic:LocationDisplay]; [self.graphicsLayer refresh]; [self.mapView zoomToGeometry:[LocationDisplay geometry] withPadding:0 animated:YES]; } } } failure:^(NSError *error) { NSLog(@"Error listing triggers: %@", error); }];
Solved! Go to Solution.
AGSFillSymbol* symbol = [AGSSimpleFillSymbol simpleFillSymbol]; symbol.color = [UIColor redColor]; AGSSimpleRenderer* mySimpleRenderer = [AGSSimpleRenderer simpleRendererWithSymbol:symbol]; self.graphicsLayer.renderer = mySimpleRenderer;
AGSFillSymbol* symbol = [AGSSimpleFillSymbol simpleFillSymbol]; symbol.color = [UIColor redColor]; AGSUniqueValueRenderer *cityRenderer = [[AGSUniqueValueRenderer alloc] init]; cityRenderer.defaultSymbol = symbol; self.graphicsLayer.renderer = cityRenderer;
self.mapView.layerDelegate = self;
Assigning to 'id<AGSMapViewLayerDelegate>' from incompatible type 'ViewController_iPad *const __strong'