POST
|
I have a strange issue. I am using SDK 7.0 and 10.1.1 Update 2. This same issue was present before I moved to 7.0, back on 6 as well however. I have code that does an identify on a dynamic service layer. When the results are returned, if they are empty, then it automatically does a new identify on another dynamic service layer. This workflow is so that if there is something turned on in the top layer, the Identify will return from that layer, but if there wasn't something in that service where the user picked, then it will move down to the next layer and return results from there. This is working just fine, but only if I'm zoomed all the way in to the map. The original identify works no matter what my zoom level is, but the second identify only seems to work if I'm zoomed in all the way. Also, if I pick while zoomed out, and the second identify fires, then I zoom in, the popup will show up once I zoom all the way in, and it will stay if I zoom back out. Here's the code (I left out parts that don't seem important): @synthesize identifyTask = _identifyTask,identifyParams=_identifyParams; @synthesize identifyTaskBase = _identifyTaskBase,identifyParamsBase=_identifyParamsBase; - (void)viewDidLoad { [super viewDidLoad]; self.mapView.touchDelegate = self; self.mapView.calloutDelegate = self; self.mapView.callout.delegate = self; ... self.identifyTask = [AGSIdentifyTask identifyTaskWithURL:[NSURL URLWithString:@"http://****/ArcGIS/rest/services/CityMap/MapServer"]]; self.identifyTask.delegate = self; self.identifyParams = [[AGSIdentifyParameters alloc] init]; self.identifyTaskBase = [AGSIdentifyTask identifyTaskWithURL:[NSURL URLWithString:@"http://****/arcgis/rest/services/BaseMap/GJMAP/MapServer"]]; self.identifyTaskBase.delegate = self; self.identifyParamsBase = [[AGSIdentifyParameters alloc] init]; ... } - (void)mapView:(AGSMapView *)mapView didClickAtPoint:(CGPoint)screen mapPoint:(AGSPoint *)mappoint graphics:(NSDictionary *)graphics { self.mappoint = mappoint; NSMutableArray *layerIDs = [NSMutableArray array]; for (AGSLayer *layer in self.mapView.mapLayers) { if([layer isKindOfClass:[AGSDynamicMapServiceLayer class]]) { AGSDynamicMapServiceLayer *tempLayer = (AGSDynamicMapServiceLayer *)layer; layerIDs = [tempLayer.visibleLayers mutableCopy]; } } self.identifyParams.layerIds = layerIDs; self.identifyParams.tolerance = 8; self.identifyParams.geometry = self.mappoint; self.identifyParams.size = self.mapView.bounds.size; self.identifyParams.mapEnvelope = self.mapView.visibleArea.envelope; self.identifyParams.returnGeometry = YES; self.identifyParams.layerOption = AGSIdentifyParametersLayerOptionTop; self.identifyParams.spatialReference = self.mapView.spatialReference; [self.identifyTask executeWithParameters:self.identifyParams]; } - (void)identifyTask:(AGSIdentifyTask *)identifyTask operation:(NSOperation *)op didExecuteWithIdentifyResults:(NSArray *)results { [self.graphicsLayer removeAllGraphics]; if ([results count] > 0) { AGSSymbol* symbol = [AGSSimpleFillSymbol simpleFillSymbol]; symbol.color = [UIColor colorWithRed:0 green:0 blue:1 alpha:0.5]; for (AGSIdentifyResult* result in results) { result.feature.symbol = symbol; [self.graphicsLayer addGraphic:result.feature]; } NSString *layerName = [((AGSIdentifyResult*)[results objectAtIndex:0]) layerName]; self.mapView.callout.title = layerName; self.mapView.callout.detail = @"Click for more detail.."; [self.mapView.callout showCalloutAtPoint:self.mappoint forGraphic:((AGSIdentifyResult*)[results objectAtIndex:0]).feature animated:YES]; } else { //do another identify on base layer (parcels etc) self.identifyParamsBase.layerIds = @[@36,@37,@38,@39]; self.identifyParamsBase.tolerance = 8; self.identifyParamsBase.geometry = self.mappoint; self.identifyParamsBase.size = self.mapView.bounds.size; self.identifyParamsBase.mapEnvelope = self.mapView.visibleArea.envelope; self.identifyParamsBase.returnGeometry = YES; self.identifyParamsBase.layerOption = AGSIdentifyParametersLayerOptionTop; self.identifyParamsBase.spatialReference = self.mapView.spatialReference; //execute the task [self.identifyTaskBase executeWithParameters:self.identifyParamsBase]; } } - (void)identifyTaskBase:(AGSIdentifyTask *)identifyTaskBase operation:(NSOperation *)op didExecuteWithIdentifyResults:(NSArray *)results { [self.graphicsLayer removeAllGraphics]; if ([results count] > 0) { AGSSymbol* symbol = [AGSSimpleFillSymbol simpleFillSymbol]; symbol.color = [UIColor colorWithRed:0 green:0 blue:1 alpha:0.5]; for (AGSIdentifyResult* result in results) { result.feature.symbol = symbol; [self.graphicsLayer addGraphic:result.feature]; } NSString *layerName = [((AGSIdentifyResult*)[results objectAtIndex:0]) layerName]; self.mapView.callout.title = layerName; self.mapView.callout.detail = @"Click for more detail.."; [self.mapView.callout showCalloutAtPoint:self.mappoint forGraphic:((AGSIdentifyResult*)[results objectAtIndex:0]).feature animated:YES]; } } Does anyone see anything directly wrong with this code? What is baffling me is that it works fine if I am zoomed all the way in, but doesn't display properly otherwise. Also the fact that if there is a layer turned on for the first identify to hit, that works at any zoom level, and it is set up the exact same way. Thanks for any tips or help! Jackson
... View more
10-14-2013
02:54 PM
|
0
|
3
|
2541
|
POST
|
Hi - I downloaded the new version of the identify task demo for 10.1.1 from the samples, but the new one doesn't want to compile. I am getting two errors: Semantic Issue - Property 'attributes' not found on object of type 'AGSGraphic *' and two warnings: Semantic Issue - 'AGSMapView' may not respond to 'showCalloutAtPointforGraphic:animated:' Is this a problem with the sample itself, or a problem with my machine? I have 10.1.1 SDK installed and I can compile some of the other samples just fine. Thanks for any help!
... View more
02-21-2013
11:51 AM
|
0
|
0
|
397
|
POST
|
Thanks for the links, those are perfect. (I was looking under the Find and Identify samples).
... View more
09-28-2012
09:35 AM
|
0
|
0
|
385
|
POST
|
Excellent, thanks for the quick answer! I'm kind of wondering, why isn't there a sample in the samples gallery showing this functionality and how to use it?
... View more
09-28-2012
08:19 AM
|
0
|
0
|
385
|
POST
|
I am wondering if anyone has made or seen a bit of code out there to do a multipage infoPopup in Flex. For an example of what I'm talking about, take a look at this link (click on one of the building footprints and you will get results for the footprint and the parcel both): http://help.arcgis.com/en/webapi/javascript/arcgis/samples/find_popup/index.html The javascript API has a popup, where when you do an identifyTask on multiple features, you get the little back and forward arrows at the top of the window. Then you can use these to cycle through all of the features underneath where you clicked. I like this much better than the flex examples I've seen where you get a list of features that you have to scroll through. Has anyone done something like this in flex? Figured I'd ask before I started building my own. Thanks! Jackson
... View more
09-28-2012
08:01 AM
|
0
|
4
|
811
|
POST
|
SDE 10.0 SP2: We have one-way replication set up between two SDE 10.0 SP2 geodatabases, and it is working fine, no errors. All of the spatial tables replicate correctly. We have one non-spatial table, that also replicates, but on the child database, it is always blank, even though the parent has rows. Has anyone else seen this, or know how to fix it? The non-spatial table is versioned and has global IDs on the parent side.
... View more
12-28-2011
02:05 PM
|
0
|
6
|
1068
|
POST
|
Awesome, thanks for the instant reply! I'm glad this is coming soon!
... View more
11-15-2011
01:48 PM
|
0
|
0
|
473
|
POST
|
All I'd like to see, is an update for the progress bar to make the text scroll slower, or stop scrolling so I can actually read the % number on the front. It goes by so fast I can never read it. The green "clock" that khibma mentioned does not seem to match up with the % in the progress bar, although I never really can tell since I can't read the progress bar at all. I've even tried taking screen shots right as it resets but I can't even press the button fast enough to catch the % showing. From what I can tell it never actually fully displays on the screen at all. It seems to start with the first half already scrolled off the screen, so I can only catch the right half of the 2nd number. I went and promoted the "Idea" in ideas.arcgis.com, but I noticed that even though it has 3880 points, and has been around for a year is isn't even under consideration yet.
... View more
11-15-2011
01:28 PM
|
0
|
0
|
794
|
POST
|
In the query feature endpoint, I need to be able to search for records which contain an apostrophe in the data, for example: Johnston's Subdivision If I submit a query like this: SUBDIVISION like '%johnston's%' The apostrophe in the middle ends up causing an error. I have tried escaping it these two ways but neither worked: \'
' I also tried submitting double quotes like this: SUBDIVISION like "%johnston's%" No luck with that either. Does anyone know what the correct way to do this is?
... View more
09-26-2011
07:08 AM
|
0
|
3
|
2739
|
POST
|
Hi YungKai Chin, thanks for the reply, but that doesn't quite answer what I was asking. I'm just talking about the right click copy that is on the default menu in flex when you select text. For some reason it isn't working inside my infowindow, although it works in other text areas.
... View more
09-13-2011
02:29 PM
|
0
|
0
|
194
|
POST
|
This is an odd one and I'm hoping someone out there has an answer. I'm using a popUpRenderer in the map.infoWindow to display a tooltip on the map. In the old 1.x flex version of our map, the users could highlight text in the popup, right click, copy and then paste. In the 2.4 version, they can still highlight, right click and copy, but nothing ever goes to the clipboard. If they hit ctrl+c to copy, it still works. I've tried disabling everything else in my program that has to do with right click menus and that didn't help so I'm thinking it has to do with the infoWindow itself. Anyone else had this issue or know of a way to fix it or work around it (aside from just telling users to hit ctrl+c). Thanks, Jackson
... View more
09-13-2011
09:25 AM
|
0
|
3
|
450
|
POST
|
Looks like I'm going to be the only one posting in my thread, but I'll keep it up in case anyone has my same issues down the road. I solved my problem of no media section by configuring the popup renderer first and then adding it to the map.infoWindow. I still don't 100% understand why/how this works, but it does. Here's the code: var infoData:Object =
{
title: title,
content: content,
link: link,
point: point,
geometry: resultGraphic.geometry
};
identGfxLayer.add(lastIdentifyResultGraphic);
popUpRenderer.popUpInfo = configurePopUpInfo(infoData);
popUpRenderer.graphic = lastIdentifyResultGraphic;
map.infoWindow.content = popUpRenderer;
map.infoWindow.contentOwner = popUpRenderer;
map.infoWindow.show(infoData.point);
... View more
09-02-2011
07:07 AM
|
0
|
0
|
320
|
POST
|
This popup has been a lot of trouble for me. After finally getting everything I was asking about above working, I found out today that the media portion of the popup is now not displaying. If I'm using a map.InfoWindow, is there still a media section available? I am still setting it the way I was before but now it just isn't there. Here's the code including the function that sets the popup media: var infoData:Object =
{
title: title,
content: content,
link: link,
point: point,
geometry: resultGraphic.geometry
};
identGfxLayer.add(lastIdentifyResultGraphic);
var popUpInfo:PopUpInfo = new PopUpInfo;
popUpInfo = configurePopUpInfo(infoData);
var myInfoPopup:PopUpRenderer = new PopUpRenderer;
myInfoPopup.popUpInfo = popUpInfo;
map.infoWindow.content = myInfoPopup;
map.infoWindow.show(infoData.point);
private function configurePopUpInfo(popUpData:Object):PopUpInfo
{
var popUpInfo:PopUpInfo = new PopUpInfo;
popUpInfo.title = popUpData.title;
popUpInfo.description = popUpData.content;
if (popUpData.link)
{
var pos:Number = popUpData.link.length - 4;
var sfx:String = popUpData.link.substr(pos, 4).toLowerCase();
if ((sfx == ".jpg") || (sfx == ".png") || (sfx == ".gif")) // use PopUpMediaInfo if it is an image
{
var popUpMediaInfo:PopUpMediaInfo = new PopUpMediaInfo;
popUpMediaInfo.type = PopUpMediaInfo.IMAGE;
popUpMediaInfo.imageLinkURL = popUpData.link;
popUpMediaInfo.imageSourceURL = popUpData.link;
popUpInfo.popUpMediaInfos = [ popUpMediaInfo ];
}
else
{
popUpInfo.description += "<br/><a href='" + popUpData.link + "'>Click here for more info</a>"
}
}
return popUpInfo;
} Any insight would be a relief! Thanks.
... View more
08-31-2011
02:51 PM
|
0
|
0
|
320
|
Title | Kudos | Posted |
---|---|---|
1 | 05-17-2024 01:25 PM | |
2 | 07-25-2019 03:22 PM | |
1 | 09-15-2023 03:06 PM | |
1 | 09-05-2017 10:36 AM | |
2 | 08-08-2018 01:38 PM |
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|