|
POST
|
Hi, Try: currentQuery.spatialRelationship = AGSSpatialRelationTouch; currentQuery.geometry=[mappoint geometry]; Regards, Shimin
... View more
04-07-2016
03:45 PM
|
0
|
0
|
1628
|
|
POST
|
Hi, Based on the error infos, it looks to me that creating offline replica from versioned data works like sde database replication that requires data being registered as versioned without the option to move edits to base table. I think, in order to create a replica from versioned data, you would have to register your data as versioned without ticking that option box. However, to achieve your goal of showing data edits immediately after sync, would you consider setting up desktop processes of reconcile and post to run in a timely manner to move edits from delta to base and refresh the services? Just a thought. Shimin
... View more
04-05-2016
03:50 PM
|
0
|
0
|
813
|
|
POST
|
Not sure if an instance of AGSFeatureTableLayer can be retrieved but it can certainly be created based on a gdb feature's table: AGSGDBFeature* gdbFeature = (AGSGDBFeature*)feature; AGSFeatureTable *featureTable = gdbFeature.table; AGSFeatureTableLayer *featureTableLayer = [[AGSFeatureTableLayer alloc]initWithFeatureTable:featureTable]; To get the service url from a gdb feature: AGSGDBFeatureTable *gdbFeatureTable = (AGSGDBFeatureTable *)featureTable; AGSGDBGeodatabase *gdb = gdbFeatureTable.geodatabase; NSURL *url = gdb.serviceURL; NSString *urlString = [url absoluteString]; Based on the difference of the URLs, I think you can tell which layer or featureTable you need to update upon...
... View more
02-17-2016
04:22 AM
|
1
|
0
|
1217
|
|
POST
|
Hi, - (void) mapView:(AGSMapView *)mapView didClickAtPoint:(CGPoint)screen mapPoint:(AGSPoint *)mappoint features:(NSDictionary *)features { NSMutableArray *tappedFeatures = [[NSMutableArray alloc]init]; NSEnumerator* keys = [features keyEnumerator]; for (NSString* key in keys) { [tappedFeatures addObjectsFromArray:[features objectForKey:key]]; } NSString* layerName; for (id<AGSFeature> feature in tappedFeatures) { if ([feature isKindOfClass:[AGSGraphic class]]) { AGSGraphic* graphic = (AGSGraphic*)feature; AGSFeatureLayer *featureLayer = (AGSFeatureLayer *)graphic.layer; layerName = graphic.layer.name; } else if ([feature isKindOfClass:[AGSGDBFeature class]]) { AGSGDBFeature* gdbFeature = (AGSGDBFeature*)feature; AGSFeatureTable *featureTable = gdbFeature.table; layerName = gdbFeature.table.tableName; } } } The layerName should tell which layer a feature belongs to... Hope it helps. Regards, Shimin
... View more
02-16-2016
02:19 PM
|
0
|
5
|
1217
|
|
POST
|
Hi Kristoffer, I'm lucky that our TrackPoints layer and other uploading-only layers are in separate feature services and so I can control the sync operation that way. In your case, would you also be able to try excluding the uploading layer from the layerSyncInfos array when it does not have any edits? Regards, Shimin
... View more
12-03-2015
04:34 PM
|
1
|
1
|
1055
|
|
POST
|
Hi Kristofer, This happened to our TrackPoints sync, too, which has been configured to one way upload-only. Our workaround is to check the gdb/layer for edits before sync and if there is no edit do not allow to sync. However, I think no-edits should not be treated as an error... Regards, Shimin
... View more
12-03-2015
01:00 PM
|
1
|
3
|
1055
|
|
POST
|
Hi All, The line json constructed from points worked. It only took 3 seconds to draw lines for 22000 points. Here is the function in case anybody else needs it: @IBAction func convertTrackPointToLine(sender: UIBarButtonItem) { if self.trackPointLineOn { self.trackPointLineOn = false self.trackPointToLineButton.tintColor = nil self.mapView.removeMapLayerWithName(TRACKPOINTLINELAYERNAME) self.trackPointLineGraphicLayer = nil } else { let query = AGSQuery() query.outFields = ["TrackID", "TrackPointNo", "Description", "Contractor", "Operation", "OperationDetail"] query.orderByFields = ["TrackID ASC", "TrackPointNo ASC"] query.geometry = self.mapView.visibleArea() query.spatialRelationship = AGSSpatialRelationship.Intersects query.returnGeometry = true let trackPointsFeatureTable = self.trackPointsLayer.table trackPointsFeatureTable.queryResultsWithParameters(query) { (features: [AnyObject]!, error: NSError!) -> Void in if error != nil { logAppStatus("Error querying the TrackPoints layer: " + "\(error)", newLine: "\n") FCNSWUtils.showAlertWithTitle("Query Error", andMessage: "Error querying the TrackPoints layer: " + "\(error).") } else { let featureSet = AGSFeatureSet(features: features) let lineJsonPart1 = "{\"paths\":[[" var lineJsonPart2 = "" let lineJsonPart3 = "]],\"spatialReference\":{\"wkid\":3308}}" var count = 0 for feature: AGSGDBFeature in featureSet.features as! [AGSGDBFeature] { let point : AGSPoint = feature.geometry as! AGSPoint let pointJsonValue = point.encodeToJSON() as NSDictionary let x: Double = pointJsonValue.valueForKey("x") as! Double let y: Double = pointJsonValue.valueForKey("y") as! Double let pointXY = "[\(x),\(y)]" if count == 0 { lineJsonPart2 += pointXY } else { lineJsonPart2 += "," + pointXY } count++ } let lineJson = lineJsonPart1 + lineJsonPart2 + lineJsonPart3 let lineJsonValue = (lineJson as NSString).ags_JSONValue() as! NSDictionary let lineGeometry = AGSPolyline(JSON: lineJsonValue as [NSObject : AnyObject], spatialReference: self.mapView.spatialReference) self.trackPointLineGraphicLayer = AGSGraphicsLayer.graphicsLayer() as! AGSGraphicsLayer self.mapView.addMapLayer(self.trackPointLineGraphicLayer, withName: TRACKPOINTLINELAYERNAME) let blueSimpleLineSymbol = AGSSimpleLineSymbol.init(color: UIColor.blueColor()) let blueSimpleLineGraphic = AGSGraphic.graphicWithGeometry(lineGeometry, symbol: blueSimpleLineSymbol, attributes: nil) as! AGSGraphic self.trackPointLineGraphicLayer.addGraphic(blueSimpleLineGraphic) self.trackPointLineOn = true self.trackPointToLineButton.tintColor = UIColor.cyanColor() } } } } Cheers, Shimin
... View more
12-02-2015
04:33 PM
|
0
|
0
|
826
|
|
POST
|
Hi Gagandeep, Thanks for your reply. We are Forestry Corporation of New South Wales in Australia. We have a tracking app that records a dozer's locations as points in the background, let's say, in a site preparation operation as an example. The image below shows two recorded operation type points Stacking (green) and Ripping (purple) Now the operators/contractors are asking converting points to line on the fly. "It's looking like lines from track points from within the app is an important thing. Not so much for harvester tracking but for site prep and roads it seems to be essential. I was thinking that the simplest solution would be to allow the user to build lines from the points within his view extent and delete/rebuild them as required." I have already tried inserting the points into an AGSSketchGraphicLayer and then grabbing it's resulted line geometry to create a line graphic feature and display the feature on top of the points. The code is working fine if the number of points is less than 1000 roughly. However, more than 1000 points crash the simulator due to running out of allowed memory. There are totally about 22000 points in the above case. I think constructing line json from point jsons should be much more efficient and wouldn't require that much memory... Thanks a lot for your help. Shimin
... View more
12-01-2015
06:00 PM
|
0
|
0
|
826
|
|
POST
|
Hi, Does anybody get any idea of converting points to line please? I'm thinking to construct a line json from point jsons and then create a line geometry with the method initWithJSON of AGSPolyline... If this is correct, what would be the best way of constructing the line json from the points jsons? Thanks in Advance. Shimin
... View more
11-29-2015
07:13 PM
|
0
|
3
|
3672
|
|
POST
|
Hi, This problem has been already answered in this thread: Xcode 7 Building for iOS 9 . Sorry I overlooked it. Cheers, Shimin
... View more
09-22-2015
11:55 PM
|
0
|
0
|
905
|
|
POST
|
Hi, I'm migrating my project from Xcode 6.4 to Xcode 7.0 and encountered this error... Ld /Users/shiminc/Library/Developer/Xcode/DerivedData/FCMapApp-fipyenqiqxbltkgzayearhnydoga/Build/Products/Debug-iphoneos/FCMapApp.app/FCMapApp normal armv7 cd /Users/shiminc/Projects/FCNSWGIS export IPHONEOS_DEPLOYMENT_TARGET=6.1 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -L/Users/shiminc/Library/Developer/Xcode/DerivedData/FCMapApp-fipyenqiqxbltkgzayearhnydoga/Build/Products/Debug-iphoneos -F/Users/shiminc/Library/Developer/Xcode/DerivedData/FCMapApp-fipyenqiqxbltkgzayearhnydoga/Build/Products/Debug-iphoneos -F/Users/shiminc/Library/SDKs/ArcGIS/iOS -F/Users/shiminc/Library/SDKs/ArcGIS/iOS/Samples -F/Users/shiminc/Library/SDKs/ArcGIS/iOS/Samples/MapViewDemo -F/Users/shiminc/Library/SDKs/ArcGIS/iOS/Samples/MapViewDemo-Swift -F/Users/shiminc/Library/SDKs/ArcGIS/iOS/Samples/MapViewDemo/MapViewDemo -F/Users/shiminc/Library/SDKs/ArcGIS/iOS/Samples/MapViewDemo-Swift/MapViewDemo-Swift -F/Users/shiminc/Library/SDKs/ArcGIS -F/Users/shiminc/Library/SDKs/ArcGIS/iOS -filelist /Users/shiminc/Library/Developer/Xcode/DerivedData/FCMapApp-fipyenqiqxbltkgzayearhnydoga/Build/Intermediates/FCMapApp.build/Debug-iphoneos/FCMapApp.build/Objects-normal/armv7/FCMapApp.LinkFileList -miphoneos-version-min=6.1 -dead_strip -fembed-bitcode-marker -ObjC -framework ArcGIS -l c++ -fobjc-arc -fobjc-link-runtime -framework ArcGIS -lc++ -lz -lsqlite3.0 -framework MessageUI -framework SystemConfiguration -framework Security -framework MobileCoreServices -framework MediaPlayer -framework OpenGLES -framework QuartzCore -framework CoreText -framework CoreLocation -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/shiminc/Library/Developer/Xcode/DerivedData/FCMapApp-fipyenqiqxbltkgzayearhnydoga/Build/Intermediates/FCMapApp.build/Debug-iphoneos/FCMapApp.build/Objects-normal/armv7/FCMapApp_dependency_info.dat -o /Users/shiminc/Library/Developer/Xcode/DerivedData/FCMapApp-fipyenqiqxbltkgzayearhnydoga/Build/Products/Debug-iphoneos/FCMapApp.app/FCMapApp ld: '/Users/shiminc/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(libArcGISRT.a-armv7-master.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) Looks like something to do withe the SDK... I'm using SDK 10.2.4. However, It builds ok with the simulators and only happens with my iPad mini. Any ideas? Thanks, Shimin
... View more
09-22-2015
10:57 PM
|
0
|
1
|
10503
|
|
POST
|
Hi Akhil, I was also looking for a scalebar solution in the forum but couldn't find any. So I did a very simple scalebar (see the attached image). The idea is to use a fixed-width image view to show a scalebar image. Then calculate the width of the image view in map unit which is map scale dependent. In another word the width of the image view represents different map distances at different map scales. override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. // set up and load your map here //Register map pan and zoom notifications for scale bar NSNotificationCenter.defaultCenter().addObserver(self, selector: "mapViewDidEndPanningZooming", name: AGSMapViewDidEndZoomingNotification, object: nil) NSNotificationCenter.defaultCenter().addObserver(self, selector: "mapViewDidEndPanningZooming", name: AGSMapViewDidEndPanningNotification, object: nil) // the reason to register the AGSMapViewDidEndPanningNotification is to account for the device rotations. } func mapViewDidEndPanningZooming() { //Scale var formatter = NSNumberFormatter() formatter.numberStyle = NSNumberFormatterStyle.DecimalStyle let groupingSeparator: String! = NSLocale.currentLocale().objectForKey(NSLocaleGroupingSeparator) as! String formatter.groupingSeparator = groupingSeparator formatter.groupingSize = 3 formatter.alwaysShowsDecimalSeparator = false formatter.usesGroupingSeparator = true var scale: Double = round(self.mapView.mapScale) self.scaleLabel.text = "1 : " + formatter.stringFromNumber(NSNumber(double: scale))! //Scale bar let screenPointStart = CGPoint(x: self.scalebar.frame.origin.x, y: self.scalebar.frame.origin.y) let mapPointStart = self.mapView.toMapPoint(screenPointStart) let screenPointEnd = CGPoint(x: self.scalebar.frame.origin.x + self.scalebar.frame.size.width, y: self.scalebar.frame.origin.y) let mapPointEnd = self.mapView.toMapPoint(screenPointEnd) let ge = AGSGeometryEngine.defaultGeometryEngine() var distance = ge.distanceFromGeometry(mapPointStart, toGeometry: mapPointEnd) //the distance calculated here is in metres with the spatial reference GDA 1994 New South Wales Lambert if(distance > 10000) //10km { //show the labels in km self.scalebarMiddleLabel.text = String(format:"%0.0f", distance/2000) self.scalebarEndLabel.text = String(format:"%0.0f km", distance/1000) } else { //show the labels in m self.scalebarMiddleLabel.text = String(format:"%0.0f", distance/2) self.scalebarEndLabel.text = String(format:"%0.0f m", distance) } } Hope it helps. Shimin
... View more
09-16-2015
05:26 PM
|
0
|
1
|
1135
|
|
POST
|
Hi All, The OfflineFeatureEditingSample automatically handles subtype editing via AGSPopupsContainreViewController. I'm not using AGSPopupsContainerViewController because I need more editing controls over the fields. I'd like to implement the subtype editing behaviours of AGSPopupsContainerViewController that are when the value of the subtype field changes the values of the associated description fields automatically change to their default domain values. How do I do this not using AGSPopupsContainerViewController? I think first of all I need to know which field is the subtype field and which fields are the description fields? I've gone through the SDK documentation and couldn't figure out how to determine these. The typeIdField and types are always populated as long as a layer is symbolised based on a domain field or a subtype field and it does not matter if a layer has a subtype field or not. Can anyone please shed any light? Thanks, Shimin
... View more
11-18-2014
05:12 PM
|
0
|
0
|
2550
|
|
POST
|
Thanks Divesh. It worked after adding the key 'NSLocationWhenInUseUsageDescription' in the info.plist. Tried the 'NSLocationUsageDescription' before posting the question but it didn't work. Didn't know you have to manually add the key 'NSLocationWhenInUseUsageDescription'. Cheers, Shimin
... View more
10-31-2014
05:12 PM
|
0
|
0
|
640
|
|
POST
|
Hi Divesh, I'm having the same location service issue after migrating to Xcode 6.1 iOS 8.1. I'm using ArcGIS Runtime SDK for iOS 10.2.4. Any suggestions please? Thanks, Shimin
... View more
10-30-2014
07:18 PM
|
0
|
2
|
1564
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-08-2022 01:10 PM | |
| 1 | 09-19-2022 09:21 PM | |
| 1 | 05-23-2022 06:49 PM | |
| 1 | 03-24-2022 05:49 PM | |
| 1 | 10-31-2021 03:16 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-29-2025
01:58 AM
|