POST
|
MapView posts notifications on panning and zooming, you can register for them with this: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(scaleDidChange:) name:@"MapDidEndZooming" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mapDidEndPanning:) name:@"MapDidEndPanning" object:nil]; then implement the callback methods (these are your own custom methods): -(IBAction)scaleDidChange:(NSNotification *)notification {
//do Something here
}
-(IBAction)mapDidEndPanning:(NSNotification *)notification {
//do Something here
} Is this what you were looking for?
... View more
08-29-2012
12:22 PM
|
0
|
0
|
568
|
POST
|
Here is what I got: 2012-05-18 11:08:33.738 WPC_Mobile[7173:707] Key: 6675 Value: AGSFeatureSet: display name: (null)
geometry type: esriGeometryPoint
num features: 1
spatial reference: (null)
2012-05-18 11:08:33.741 WPC_Mobile[7173:707] graphic: geometry: (null), symbol: (null), attributes: {
CompletionRecID = 10214;
}, visible: 1 This is what I was looking for. It looks like I failed to go into the FeatureSet.features and pull out the attributes from the graphic. Thank you very much! Chris
... View more
05-18-2012
09:14 AM
|
0
|
0
|
323
|
POST
|
I have a map service published to ArcGIS Server 10, with a point feature class in SDE that has 2 ole db tables related in the map document. I have successfully queried these tables through the REST interface, and gotten the expected results, but once in a while the relate query stops working but I can still retrieve the features from the point feature class. I have to restart the service in order to get the related tables query working again. The server manager logs do not show anything unusual besides hitting the max record count limit, but this does not seem to correlate with the query breaking. Also, I have seen other threads regarding related records not working if there is a join on any of the tables. I have confirmed that I do not have any joins in the map doc.
... View more
05-17-2012
12:46 PM
|
0
|
0
|
677
|
POST
|
Good thought, but still did not work. I am logging the objectid and it is returning the correct one, and if i compare to a manual rest query, the related records are there.
... View more
05-16-2012
06:13 AM
|
0
|
0
|
323
|
POST
|
I am having trouble implementing AGSRelationshipQuery, I get a successful response, but the data returned id not what I expect and I am not sure if I am setting up my query the correct way. What I am trying to do is query related records from a point feature class (through a map service) that has a relationship set up with a table. Here is code: (the names of the server and services have been changed to protect the innocent, and unfortunately, this server is not public so i can't point anybody to it) - (void)mapView:(AGSMapView *)mapView didClickCalloutAccessoryButtonForGraphic:(AGSGraphic *)graphic {
self.queryTask = [AGSQueryTask queryTaskWithURL:[NSURL URLWithString:@"http://<myServer>/arcgis/rest/services/<myFolder>/<myService>/MapServer/0"]];
self.queryTask.delegate = self;
self.relQuery = [AGSRelationshipQuery relationshipQuery];
self.relQuery.objectIds = [NSArray arrayWithObject:[graphic.attributes objectForKey:@"OBJECTID"]];
self.relQuery.outFields = [NSArray arrayWithObject :@"*"];
self.relQuery.relationshipId = 0;
[self.queryTask executeWithRelationshipQuery:self.relQuery];
{
- (void) queryTask:(AGSQueryTask *)queryTask operation:(NSOperation*)op didExecuteWithRelatedFeatures:(NSDictionary *)relatedFeatures {
NSLog(@"relatedFeatures: %@", relatedFeatures);
} The response I get back from the NSLog on related Features is: relatedFeatures: (
"AGSFeatureSet: display name: (null)
\ngeometry type: esriGeometryPoint
\nnum features: 1
\nspatial reference: (null)"
) I have confirmed the parameters in my query are valid using the rest/services web page, and there I get a json object that has the data I expect. But I am not sure what to make of the response I am getting through the iOS API. I have also tested the a regular http request using the direct URL for the REST query, and I do get back the proper response,
NSString *relatedQueryString = @"http://<myServer>/ArcGIS/rest/services/<myFolder>/<myService>/MapServer/0/queryRelatedRecords?objectIds=1&relationshipId=0&definitionExpression=&returnGeometry=false&maxAllowableOffset=&outSR=&outFields=*&f=pjson";
NSError *theError = nil;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:relatedQueryString]];
NSURLResponse *theResponse = [[NSURLResponse alloc] init];
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&theResponse error:&theError];
NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSDictionary *jsonDict = [string AGSJSONValue];
so I am figuring I am just not setting up the related request correctly. Chris
... View more
05-15-2012
06:52 AM
|
0
|
5
|
3282
|
POST
|
There are also methods of the mapView that you can use, for example, i have a project that has buttons for zoom in and zoom out and i set the actions on those as follows: -(void)didTapZoomInButton:(id)sender {
[self.mapView zoomIn:YES];
}
-(void)didTapZoomOutButton:(id)sender {
[self.mapView zoomOut:YES];
}
... View more
04-17-2012
06:38 AM
|
0
|
0
|
203
|
POST
|
I know you can't set the spatial reference directly for the mapView, but is there something out there that let's me instantiate a mapView with a certain spatial reference and extents with loading a layer first? I am trying to develop an app that can function entirely offline if need be, but so far the only way i can get that to work is by using the cached map way, as illustrated in the CustomTileOverlay sample app. Unfortunately, I don't intend to load my basemaps this way, so i would have to just have dummy tile in order to get the map view to load properly. I have tried loading layers using the decodeFromJSON method and a local file, but it doesn't seem to work unless i also have a local cache as well.
... View more
09-01-2011
05:00 PM
|
0
|
1
|
2777
|
POST
|
That worked very well. Much better on my memory usage as well! Thanks.
... View more
07-28-2011
06:35 AM
|
0
|
0
|
233
|
POST
|
For what it's worth, I was able to find a work around. I just created another instance of my view that contained the graphics and created a new renderer for that view and added it to the mapview. Seems like a hack and extra overhead, but it works for the moment.
... View more
07-25-2011
07:45 PM
|
0
|
0
|
233
|
POST
|
I am trying to label a polygon graphics layer. I am able to either symbolize the graphic or the label through the renderer, but I can't figure out how to do both at the same time. I see that the AGSFeatureLayer has a labeling functionality, but I am using an AGSGraphicsLayer because I am loading data locally.
... View more
07-25-2011
11:10 AM
|
0
|
4
|
1734
|
POST
|
Thanks Nimesh, that is a neat little trick. I am going to try and extend that to export pdf to email. Chris
... View more
07-22-2011
06:27 AM
|
0
|
0
|
529
|
POST
|
Thanks Robert! I have been beating my head against the wall on this one and your suggestion worked.
... View more
06-29-2011
07:22 AM
|
0
|
0
|
724
|
POST
|
I am trying to get a notification message for when the map has zoomed, to then fire off another method to do something. I read in the API docs that there is a notification sent out from AGSMapView for "MapDidEndZooming": "The map component broadcasts four notifications - MapViewDidLoad, MapTimeExtentChanged, MapDidEndPanning and MapDidEndZooming. Observers interested in these notifications can register for them using the default NSNotificationCenter." I have tried this in my viewController implementation: self.mapView.layerDelegate = self; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveZoomMessage: ) name:MapDidEndZooming object:nil]; but I keep getting error stating the "MapDidEndZooming" is undeclared.
... View more
04-23-2011
12:23 PM
|
0
|
3
|
637
|
IDEA
|
The management of annotation has always been a bit frustrating as in order to manage it, you have to go into the data frame properties dialog. I would really like to see the annotation moved into it's own layer in the table of contents, whether that could be a seperate tab in the TOC or if there could be an option to auto create a new feature layer for the annotation without having to associate the annotation with an existing feature layer.
... View more
04-01-2010
09:14 AM
|
25
|
8
|
1282
|
Title | Kudos | Posted |
---|---|---|
25 | 04-01-2010 09:14 AM | |
19 | 04-01-2010 07:27 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|