POST
|
Thanks Nicholas. That helps and the problem is I need to import certificate to bundle. Then need to add the followings: // 1. import certificate
[AGSCredential importCertificateData:cerData password:nil overwrite:NO error:&error];
// 2. trust base map url connection
[[NSURLConnection ags_trustedHosts] addObject:[mapURL host]]; Now everything works fine.
... View more
01-20-2016
08:02 PM
|
2
|
1
|
797
|
POST
|
I successfully opened base map link with user name and password from safari, but this sample app does not work after connect to VPN. The VPN I am using is Cisco AnyConnect. I cannot test without VPN otherwise I am not able to access the server. iOS9.2, server url is a https. The code is simple: - (void)viewDidLoad {
AGSCredential* cred = [[AGSCredential alloc] initWithUser:MAP_UNAME password:MAP_PWD];
_baseMapLayer = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL:[NSURL URLWithString:BASE_MAP_URL_STRING] credential:cred];
[self.mapView insertMapLayer:_baseMapLayer withName:@"Base" atIndex:0];
self.mapView.layerDelegate = self;
}
- (void)mapViewDidLoad:(AGSMapView *)mapView
{
if (mapView.loaded)
NSLog(@"map loaded");
else
NSLog(@"map not loaded");
} None of the log from mapViewDidLoad get called.. I also have problem to debug because it's a enterprise provision file. Is there any place for me to log something to check? Any help..
... View more
01-20-2016
12:31 AM
|
0
|
3
|
2854
|
POST
|
In my case, I need to query from 3 map layers and get non-graphic information data and display them in 3 table lists. I tried to use NSOperationQueue to manage - (NSOperation *)executeWithQuery:(AGSQuery *)query; But this returned NSOperation is already running, thus cannot be added to NSOperationQueue. Below is how I roughly achieved but I really think it's a bad practice, because for this case I created 3 booleans and 3 AGSQueryTasks for 3 queries, and more variables will be needed if need to query from more layers. I hope you guys can have a better way to introduce. @interface MultipleQueryTest () <AGSQueryTaskDelegate>
{
BOOL _multipleQueryStart;
BOOL _flagQueryOperationAComplete;
BOOL _flagQueryOperationBComplete;
BOOL _flagQueryOperationCComplete;
AGSQueryTask *_queryTaskA;
AGSQueryTask *_queryTaskB;
AGSQueryTask *_queryTaskC;
NSArray *_resultA;
NSArray *_resultB;
NSArray *_resultC;
}
@end
@implementation MultipleQueryTest
- (IBAction)btnGoTapped:(id)sender
{
_multipleQueryStart = YES;
// query A
NSURL *layerAURL = [self getURLForLayer: eLayerA];
NSArray *outFieldsA = [NSArray arrayWithObjects:@"field1", @"field2", ... nil];
NSOperation *queryOpA = [self startQuyerOperationWithURL:layerAURL outFields:outFieldsA operationType:eOperationTypeA];
quryOpA.name = @"operationA";
_flagQueryOperationACompleted = NO;
// query B
NSURL *layerBURL = [self getURLForLayer: eLayerB];
NSArray *outFieldsB = [NSArray arrayWithObjects:@"field1", @"field2", ... nil];
NSOperation *queryOpB = [self startQuyerOperationWithURL:layerBURL outFields:outFieldsB operationType:eOperationTypeB];
quryOpB.name = @"operationB";
_flagQueryOperationBCompleted = NO;
// query C
NSURL *layerCURL = [self getURLForLayer: eLayerC];
NSArray *outFieldsC = [NSArray arrayWithObjects:@"field1", @"field2", ... nil];
NSOperation *queryOpC = [self startQuyerOperationWithURL:layerCURL outFields:outFieldsC operationType:eOperationTypeC];
quryOpC.name = @"operationC";
_flagQueryOperationCCompleted = NO;
}
- (NSOperation *)startQuyerOperationWithURL:(NSURL *)layerURL outFields:(NSArray *)outFields operationType:(eOperationType)opType
{
AGSQuery *query = [AGSQuery query];
query.outSpatialReference = self.mapView.spatialReference;
query.outFields = outFields;
query.returnGeometry = NO;
AGSQueryTask queryTaskObj = [[AGSQueryTask alloc] initWithURL: layerURL];
queryTaskObj.delegate = self;
if (opType == eOperationTypeA)
{
_queryTaskA = queryTaskObj;
return [_queryTaskA executeWithQuery:query];
}
else if (opType == eOperationTypeB)
{
_queryTaskB = queryTaskObj;
return [_queryTaskB executeWithQuery:query];
}
else if (opType == eOperationTypeC)
{
_queryTaskC = queryTaskObj;
return [_queryTaskC executeWithQuery:query];
}
else
return nil;
}
#pragma mark - AGSQueryTaskDelegate
- (void)queryTask:(AGSQueryTask *)queryTask operation:(NSOperation *)op didExecuteWithFeatureSetResult:(AGSFeatureSet *)featureSet
{
if (_multipleQueryStart)
{
if ([op.name isEqualToString:@"operationA"]) {
_resultA = featureSet.features;
_flagQueryOperationACompleted = YES;
_queryTaskA = nil;
}
else if ([op.name isEqualToString:@"operationB"]) {
_resultB = featureSet.features;
_flagQueryOperationBCompleted = YES;
_queryTaskB = nil;
}
else if ([op.name isEqualToString:@"operationC"]) {
_resultC = featureSet.features;
_flagQueryOperationCCompleted = YES;
_queryTaskC = nil;
}
if (_flagQueryOperationACompleted && _flagQueryOperationBCompleted && _flagQueryOperationCCompleted)
{
NSLog(@"All list received.......");
_multipleQueryStart = NO;
}
return;
}
}
@end
... View more
09-22-2015
07:36 PM
|
0
|
1
|
3280
|
POST
|
Thank you so much Nicholas. I use the AGSLayerDelegate::layerDidLoad to dismiss my loading screen after loading and then it's able to commit the new created graphic.It works fine now.
... View more
09-04-2015
02:30 AM
|
0
|
0
|
440
|
POST
|
My testing server has the following functions: I want to draw a polygon and add the new polygon to this layer, but all the property canCreate/canDelete/canUpdate/canUpdateGeometry return NO, and of course, I failed to add graphic to this layer. Is anything I missing? AGSGraphic *newGraphic = [AGSGraphic graphicWithGeometry:self.sketchLayer.geometry symbol:[self getMapSymbolByType:eIfosMapSymbolTypePolygon] attributes:@{@"attire":@"testttt", @"attr2":@"test22"}];
AGSFeatureLayer *inspectionLayer = [AGSFeatureLayer featureServiceLayerWithURL:[NSURL URLWithString:LAYER_URL_STR] mode:AGSFeatureLayerModeSnapshot];
inspectionLayer.editingDelegate = self;
// return NO
if (inspectionLayer.canCreate) {
NSLog(@"can create");
}
// return NO
if (inspectionLayer.canDelete) {
NSLog(@"can delete");
}
// return NO
if (inspectionLayer.canUpdate) {
NSLog(@"can update");
}
// return NO
if (inspectionLayer.canUpdateGeometry) {
NSLog(@"can update geometry");
}
[inspectionLayer applyEditsWithFeaturesToAdd:[NSArray arrayWithObject:newGraphic] toUpdate:nil toDelete:nil];
... View more
09-02-2015
08:39 PM
|
0
|
2
|
3143
|
POST
|
What I am trying to do is, when you press a button, the app auto pan and zoom to current location. Then I can pan the map to other place, and when I press that button again, it will still bring me to my current location (auto pan and zoom). My problem is, when I first press the button, it works as i expected. Then I move to other place on the map, and when i press the button again, it does not auto pan and zoom to my current location. Code is below: - (void)viewDidLoad {
[super viewDidLoad];
// add map layers
... ...
self.mapView.locationDisplay.autoPanMode = AGSLocationDisplayAutoPanModeCompassNavigation;
self.mapView.locationDisplay.navigationPointHeightFactor = 0.5;
[self.mapView.locationDisplay addObserver:self forKeyPath:@"location" options:NSKeyValueObservingOptionNew context:NULL];
}
- (IBAction)showCurrentLocation:(id)sender {
[self.mapView.locationDisplay startDataSource];
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if ([keyPath isEqual:@"location"]) {
// creating graphics on current location
... ...
[self.mapView.locationDisplay stopDataSource];
}
}
... View more
05-20-2015
09:10 PM
|
0
|
2
|
4281
|
POST
|
I know that only ArcGis 10.2 server or later can provide feature services to download .tpk files for offline use. My problem is, my customer only has ArcGis 10.0 server and I need to be able to show offline map in iOS devices. in theory, .tpk files are just map tiles for different zoom levels and indexing file to know where to put map tiles. It should able to download ties from ArcGis10.0, but what about the indexing files? Anyone tried this before? Any advice?
... View more
05-04-2015
07:32 AM
|
1
|
1
|
2851
|
POST
|
Hi Gagandeep Singh, Thank you so much. My problem was I implement AGSCalloutDelegate, and this protocol and AGSLayerCalloutDelegate has the same method: - (BOOL)callout:(AGSCallout *)callout willShowForFeature:(id<AGSFeature>)feature layer:(AGSLayer<AGSHitTestable> *)layer mapPoint:(AGSPoint *)mapPoint; In my implementation, I made it aways return YES, which is the cause of my problem. I fixed it by checking the layer type and return NO if user tap on other layer, and it works fine now.
... View more
04-27-2015
06:19 PM
|
0
|
0
|
469
|
POST
|
I am adding callout to my Map and it works fine. I create a pushpin: AGSPictureMarkerSymbol *pushpin = [AGSPictureMarkerSymbol pictureMarkerSymbolWithImageNamed:@"BluePushpin.png"];
pushpin.offset = CGPointMake(9, 16);
pushpin.leaderPoint = CGPointMake(-9, 11); Then I add the callout pushpin to may callout layer AGSPoint *theTask = [AGSPoint pointWithX:latitude y:longitude doubleValue]
spatialReference:self.mapView.spatialReference];
AGSGraphic graphic = [AGSGraphic graphicWithGeometry:theTask symbol:pushpin attributes:singleDataDic];
[self.taskInfoLayer addGraphic:graphic]; Everything works fine, when I tap on a pin point, it actually shows something. The problem happened after I added some other layer: NSURL *featureBldgURL = [NSURL URLWithString:LAYER_BLDG_URL];
AGSFeatureLayer *bldgLayer = [AGSFeatureLayer featureServiceLayerWithURL:featureBldgURL mode:AGSFeatureLayerModeOnDemand];
[self.mapView addMapLayer:bldgLayer withName:LAYER_BLDG_NAME]; Even when I tap on a place where I did not put a pushpin, it still shows up an empty callout dialog: I found that the AGSFeatureLayer has implement AGSLayerCalloutDelegate, maybe it's the reason to show an empty callout when user tap on that AGSFeatureLayer? How can I disable the callout for AGSFeatureLayer? Or, any other solution for this problem?
... View more
04-27-2015
04:54 AM
|
0
|
2
|
2982
|
Title | Kudos | Posted |
---|---|---|
2 | 01-20-2016 08:02 PM | |
1 | 05-04-2015 07:32 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|