|
POST
|
Try changing your code like this and see if it works.. parcelsQuery = [AGSQuery query]; NSString *start = searchBar.text; //int startValue = [start integerValue]; //parcelsQuery.where = @"Title_Lookup = '" +startValue+ "'"; parcelsQuery.where = [@"Title_Lookup=" stringByAppendingString:start]; parcelsQuery.outFields = [NSArray arrayWithObject:@"*"]; [parcelsQueryTask executeWithQueryarcelsQuery]; Regards, Nimesh
... View more
07-15-2010
10:11 AM
|
0
|
0
|
572
|
|
POST
|
Akhlaq, Apologies, error in my test scenario. The autoPan property only turns OFF on pan actions and not zoom actions. It is been documented in the blog as following, ***autoPan: property now defaults to NO. You need to enable it if you want the map to keep centering at the reported GPS location. Also, the autoPan property is automatically disabled when the user pans the map.*** http://blogs.esri.com/Dev/blogs/mobilecentral/archive/2010/07/01/ArcGIS-API-for-iOS-_2800_Update-1_2900_.aspx Regards, Nimesh
... View more
07-12-2010
04:33 PM
|
0
|
0
|
1181
|
|
POST
|
Akhlaq, Is it possible for you to attach your project so I can have a look? Regards, Nimesh
... View more
07-12-2010
01:08 PM
|
0
|
0
|
1181
|
|
POST
|
I double checked, zoom and pan actions turn OFF autoPan property but you have to make sure your GPS is on. Here is the code I've used. // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; //create an instance of a tiled map service layer //Add it to the map view //release to avoid memory leaks AGSTiledMapServiceLayer *tiledLayer = [[AGSTiledMapServiceLayer alloc] initWithURL:[NSURL URLWithString:kTiledMapServiceURL]]; [self.mapView addMapLayer:tiledLayer withName:@"Tiled Layer"]; [tiledLayer release]; //create an instance of a dynmaic map layer //set visible layers //name the layer. This is the name that is displayed if there was a property page, tocs, etc... //set transparency self.dynamicLayer = [[[AGSDynamicMapServiceLayer alloc] initWithURL:[NSURL URLWithString:kDynamicMapServiceURL]] autorelease]; self.dynamicLayer.visibleLayers = [NSArray arrayWithObjects:[NSNumber numberWithInt:2], nil]; self.dynamicLayerView = [self.mapView addMapLayer:self.dynamicLayer withName:@"Dynamic Layer"]; self.dynamicLayerView.alpha = 0.5; self.mapView.gps.autoPan = YES; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(respondTo:)name:@"MapDidEndPanning" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(respondToZooming:)name:@"MapDidEndZooming" object:nil]; } - (void)respondTo:(NSNotification *)notification { NSLog(@"MapDidEndPanning"); NSLog(@"autoPan = %@\n", (self.mapView.gps.autoPan ? @"YES" : @"NO")); } - (void)respondToZooming:(NSNotification *)notification { NSLog(@"MapDidEndZooming"); NSLog(@"autoPan = %@\n", (self.mapView.gps.autoPan ? @"YES" : @"NO")); } Regards, Nimesh
... View more
07-12-2010
10:59 AM
|
0
|
0
|
1181
|
|
POST
|
Here is the code to add bing map... AGSLayer *roadLayer = [[AGSBingMapLayer alloc] initWithAppID:@"*****" style:kAGSBingMapLayerStyleRoad]; [self.mapView addMapLayer:roadLayer withName:@"Road Bing Maps Layer"]; [roadLayer release]; Regards, Nimesh
... View more
07-09-2010
08:34 AM
|
0
|
0
|
1400
|
|
POST
|
Here is the code to listen to notifications... // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; //create an instance of a tiled map service layer //Add it to the map view //release to avoid memory leaks AGSTiledMapServiceLayer *tiledLayer = [[AGSTiledMapServiceLayer alloc] initWithURL:[NSURL URLWithString:kTiledMapServiceURL]]; [self.mapView addMapLayer:tiledLayer withName:@"Tiled Layer"]; [tiledLayer release]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(respondTo:)name:@"MapDidEndPanning" object:nil]; } - (void)respondTo:(NSNotification *)notification { //do something with the notification here NSLog(@"MapDidEndPanning"); } Hope this helps! Regards, Nimesh
... View more
07-09-2010
08:10 AM
|
0
|
0
|
1181
|
|
POST
|
Thanks for posting your code. I've created a demo application (see attached) and here is the code. *****code from .h file***** #import <UIKit/UIKit.h> #import "ArcGIS.h" @interface IdentifyTaskDemoViewController : UIViewController <AGSMapViewDelegate, AGSIdentifyTaskDelegate> { AGSMapView *_mapView; AGSGraphicsLayer *_graphicsLayer; AGSIdentifyTask *_identifyTask; AGSIdentifyParameters *_identifyParams; } @property (nonatomic, retain) IBOutlet AGSMapView *mapView; @property (nonatomic, retain) IBOutlet AGSGraphicsLayer *graphicsLayer; @property (nonatomic, retain) IBOutlet AGSIdentifyTask *identifyTask; @property (nonatomic, retain) IBOutlet AGSIdentifyParameters *identifyParams; @end ************************* *****code from .m file***** #import "IdentifyTaskDemoViewController.h" #define kDynamicMapServiceURL @"http://*****/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer" @implementation IdentifyTaskDemoViewController @synthesize mapView=_mapView; @synthesize graphicsLayer=_graphicsLayer; @synthesize identifyTask=_identifyTask,identifyParams=_identifyParams; // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { self.mapView.mapViewDelegate = self; AGSDynamicMapServiceLayer *dynamicLayer = [[AGSDynamicMapServiceLayer alloc] initWithURL:[NSURL URLWithString:kDynamicMapServiceURL]]; dynamicLayer.visibleLayers = [NSArray arrayWithObjects:[NSNumber numberWithInt:5], nil]; [self.mapView addMapLayer:dynamicLayer withName:@"Dynamic Layer"]; [dynamicLayer release]; self.graphicsLayer = [AGSGraphicsLayer graphicsLayer]; [self.mapView addMapLayer:self.graphicsLayer withName:@"Graphics Layer"]; //Create Identify Task self.identifyTask = [AGSIdentifyTask identifyTaskWithURL:[NSURL URLWithString:kDynamicMapServiceURL]]; self.identifyTask.delegate = self; self.identifyParams = [[AGSIdentifyParameters alloc] init]; [super viewDidLoad]; } - (void)mapView:(AGSMapView *)mapView didClickAtPoint:(CGPoint)screen mapPoint:(AGSPoint *)mappoint graphics:(NSDictionary *)graphics { //the layer we want is layer �??5�?? (from the map service doc) self.identifyParams.layerIds = [NSArray arrayWithObjects:[NSNumber numberWithInt:5], nil]; self.identifyParams.tolerance = 10; self.identifyParams.geometry = mappoint; self.identifyParams.size = self.mapView.bounds.size; self.identifyParams.mapEnvelope = self.mapView.envelope; self.identifyParams.returnGeometry = YES; self.identifyParams.layerOption = AGSIdentifyParametersLayerOptionAll; self.identifyParams.spatialReference = self.mapView.spatialReference; //Turn on network activity indicator using the AGSMapView class method [AGSMapView showNetworkActivityIndicator:TRUE]; //execute the task [self.identifyTask executeWithParameters:self.identifyParams]; } - (void)identifyTask:(AGSIdentifyTask *)identifyTask operation:(NSOperation *)op didExecuteWithIdentifyResults:(NSArray *)results { //Turn off network activity indicator [AGSMapView showNetworkActivityIndicator:FALSE]; //clear previous results [self.graphicsLayer removeAllGraphics]; //add new results 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]; } //call dataChanged on the graphics layer to redraw the graphics [self.graphicsLayer dataChanged]; } ************************* Hope this helps! Please feel free to contact if you need any further help. Regards, Nimesh
... View more
07-08-2010
12:09 PM
|
0
|
0
|
1599
|
|
POST
|
You can download ArcGIS API for iOS now. 🙂 ArcGIS API for iOS (Update 1) is now available: http://blogs.esri.com/Dev/blogs/mobilecentral/archive/2010/07/01/ArcGIS-API-for-iOS-_2800_Update-1_2900_.aspx Regards, Nimesh
... View more
07-07-2010
10:14 AM
|
0
|
0
|
716
|
|
POST
|
Why are you confused? What do you feel is missing? Can you please upload your attempted project so I can have a look and help you with? Regards, Nimesh
... View more
07-07-2010
08:11 AM
|
0
|
0
|
1599
|
|
POST
|
Please make sure build configuration settings are as following, Library Search Paths: $(HOME)/Library/SDKs/AGSiPhone/${PLATFORM_NAME}.sdk/usr/local/lib $(HOME)/Library/SDKs/AGSCore/${PLATFORM_NAME}.sdk/usr/local/lib User Header Search Paths: $(HOME)/Library/SDKs/AGSCore/${PLATFORM_NAME}.sdk/usr/local/include $(HOME)/Library/SDKs/AGSiPhone/${PLATFORM_NAME}.sdk/usr/local/include Note: Make sure that the recursive check box is checked! Regards, Nimesh
... View more
07-06-2010
07:50 AM
|
0
|
0
|
1175
|
|
POST
|
I would suggest you to look into the GeometryServiceTaskDemo sample app which has a code to buffer the geometries. It will give you an idea to work with geometry service task and similarly you can use projectGeometries:toSpatialReference: method to project the geometry. It get installed with SDK at ~/Library/SDKs/Samples. Please feel free to let me know if you need any further help! Regards, Nimesh
... View more
06-22-2010
03:08 PM
|
0
|
0
|
1247
|
|
POST
|
Jeff, Just before adding a layer to map view, add following line to set the visible layer. dynamicLayer.visibleLayers = [NSArray arrayWithObjects:[NSNumber numberWithInt:0], nil]; Nimesh
... View more
06-18-2010
07:57 AM
|
0
|
0
|
1565
|
|
POST
|
The spatialReference parameter in your JSON is outSR parameter and not the address candidates spatial reference value. ===For REST help doc=== outSR - The well-known ID of the spatial reference or a spatial reference json object for the returned address candidates. For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems. This parameter was added at 10. ===For REST help doc=== Change your code lines as following and you'll see location's spatial reference in the output. //NSDictionary *sRJSON=[NSDictionary dictionaryWithObjectsAndKeys:@"4326", @"wkid", nil]; //NSDictionary *locationJSON=[NSDictionary dictionaryWithObjectsAndKeys:@"-122.408951", @"x", @"37.783206", @"y", nil]; NSString *locationJSON = @"{\"x\":-122.408951,\"y\":37.783206,\"spatialReference\":{\"wkid\":4326}}"; NSDictionary *attributesJSON=[NSDictionary dictionaryWithObjectsAndKeys:@"MASON", @"StreetName", @"ST", @"StreetType", nil]; NSDictionary *json=[NSDictionary dictionaryWithObjectsAndKeys:@"1 MASON ST", @"address", [locationJSON JSONValue], @"location", @"75", @"score", attributesJSON, @"attributes", nil]; AGSAddressCandidate *candidateTest =[[AGSAddressCandidate alloc ]initWithJSON:json]; Hope this helps! Please let me know if you have any further queries. Regards, Nimesh
... View more
06-15-2010
10:16 AM
|
0
|
0
|
769
|
|
POST
|
The 1st layer (base layer) should be a tiled layer and then you�??ll be able to add your map service layers on top of it. Regards, Nimesh
... View more
06-15-2010
07:35 AM
|
0
|
0
|
1565
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-18-2024 12:33 PM | |
| 1 | 03-12-2024 08:54 AM | |
| 1 | 09-28-2023 08:19 AM | |
| 2 | 07-28-2023 08:07 AM | |
| 1 | 06-27-2013 10:42 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-26-2025
07:28 AM
|