-
Notifications
You must be signed in to change notification settings - Fork 393
Edit features with feature-linked annotation implementation #928
Edit features with feature-linked annotation implementation #928
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing this sample! There are a few things to fix and to discuss. I can give another review before getting to Phil.
arcgis-ios-sdk-samples/Edit data/Edit features with feature-linked annotation/README.md
Outdated
Show resolved
Hide resolved
arcgis-ios-sdk-samples/Edit data/Edit features with feature-linked annotation/README.md
Outdated
Show resolved
Hide resolved
arcgis-ios-sdk-samples/Edit data/Edit features with feature-linked annotation/README.md
Outdated
Show resolved
Hide resolved
...-ios-sdk-samples/Edit data/Edit features with feature-linked annotation/README.metadata.json
Outdated
Show resolved
Hide resolved
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
private var selectedFeature: AGSFeature? | ||
private var selectedFeatureIsPolyline = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's OK to keep them private, but Phil might ask to remove them. Let's wait for his response.
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
…nked annotation/README.md Co-authored-by: Ting Chen <tchen@esri.com>
…nked annotation/README.md Co-authored-by: Ting Chen <tchen@esri.com>
…nked annotation/README.metadata.json Co-authored-by: Ting Chen <tchen@esri.com>
…nked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift Co-authored-by: Ting Chen <tchen@esri.com>
@yo1995 Thanks for the suggestions! I made some changes and it is ready for another review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the identify workflow, here is my version
mapView.identifyLayers(atScreenPoint: screenPoint, tolerance: 10.0, returnPopupsOnly: false) { (results: [AGSIdentifyLayerResult]?, error: Error?) in
if let error = error {
self.presentAlert(error: error)
return
}
results?.forEach { (result) in
guard let featureLayer = result.layerContent as? AGSFeatureLayer, let featureToSelect = result.geoElements[0] as? AGSFeature else { return }
switch featureToSelect.geometry?.geometryType {
case .point:
self.showEditableAttributes(selectedFeature: featureToSelect)
case .polyline:
let polyline = featureToSelect.geometry as! AGSPolyline
let polylineArray = polyline.parts.array()
for part in polylineArray {
if part.pointCount > 2 {
self.selectedFeature = nil
self.presentAlert(title: "Make a different selection", message: "Select straight (single segment) polylines only.")
return
}
}
self.selectedFeatureIsPolyline = true
default:
return
}
featureLayer.select(featureToSelect)
self.selectedFeature = featureToSelect
}
}
This includes all the suggestion I made in early reviews. Feel free to make some changes.
As the day is coming to an end, I'll leave more comments tomorrow. 👋
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small issues. Ready for Phil's review! 👍
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
arcgis-ios-sdk-samples/Edit data/Edit features with feature-linked annotation/README.md
Outdated
Show resolved
Hide resolved
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
...s with feature-linked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift
Outdated
Show resolved
Hide resolved
…nked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift Co-authored-by: Ting Chen <tchen@esri.com>
Co-authored-by: Philip Ridgeway <pridgeway@esri.com>
…nked annotation/EditFeaturesWithFeatureLinkedAnnotationViewController.swift Co-authored-by: Philip Ridgeway <pridgeway@esri.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vquach2404 Looks good! Thanks for making all those changes. This is now ready for @saratchandrakarumuri to look at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arcgis-ios-sdk-samples/Edit data/Edit features with feature-linked annotation/README.md
Outdated
Show resolved
Hide resolved
arcgis-ios-sdk-samples/Edit data/Edit features with feature-linked annotation/README.md
Outdated
Show resolved
Hide resolved
arcgis-ios-sdk-samples/Edit data/Edit features with feature-linked annotation/README.md
Outdated
Show resolved
Hide resolved
@saratchandrakarumuri Just now I gave it a test and it seems to work fine. Are you using the geodatabase file downloaded by the sample viewer? We are not sure what caused this problem. 🤔 |
@yo1995 I cleared downloaded geodatabase and tried again with fresh install and ran into it again on couple of devices. But the same thing worked on a sim. So looks like the issue is exclusive with physical devices |
@vquach2404 The location of the geodatabase is readonly on device. I didn't think about that. To fix that, you'll need to copy the geodatabase into a temporary directory. Here is how one sample does the same thing with a mobile map package. |
@vquach2404 With this change, the edits are not persisted from session to session as the temp replica is removed after deinit. Should we mention in README? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updates LGTM. Looking forward to Sarat's re-review.
I don't think this is necessary since most samples behave similarly (e.g. a sample refreshing to a default layer after previously selecting different layers) and the geodatabase is not an online source. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I am able to edit features. Sample is working as expected
Implementation of Edit features with feature-linked annotation implementation. Looking forward to feedback!