File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Shared/Samples/Edit features using feature forms Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ struct EditFeaturesUsingFeatureFormsView: View {
5959 }
6060 }
6161
62+ /// The feature layer on the map.
63+ private var featureLayer : FeatureLayer {
64+ map. operationalLayers. first as! FeatureLayer
65+ }
66+
6267 var body : some View {
6368 MapViewReader { mapViewProxy in
6469 MapView ( map: map)
@@ -71,10 +76,7 @@ struct EditFeaturesUsingFeatureFormsView: View {
7176 }
7277 . task ( id: tapPoint) {
7378 // Identifies the feature at the tapped point and creates a feature form from it.
74- guard let tapPoint,
75- let featureLayer = map. operationalLayers. first as? FeatureLayer else {
76- return
77- }
79+ guard let tapPoint else { return }
7880 defer { self . tapPoint = nil }
7981
8082 do {
@@ -166,9 +168,7 @@ struct EditFeaturesUsingFeatureFormsView: View {
166168 /// Closes the feature form panel and resets the feature selection.
167169 private func endEditing( ) {
168170 isShowingFeatureForm = false
169-
170- let featureLayer = map. operationalLayers. first as? FeatureLayer
171- featureLayer? . clearSelection ( )
171+ featureLayer. clearSelection ( )
172172 }
173173
174174 /// Applies the edits made in the feature form to the feature service.
You can’t perform that action at this time.
0 commit comments