Skip to content

Commit f9d6a8c

Browse files
authored
Merge pull request #165 from Esri/Ting/FixNickUI
[Update] Address UI feedback from Nick
2 parents b987e9a + fa09718 commit f9d6a8c

File tree

10 files changed

+29
-24
lines changed

10 files changed

+29
-24
lines changed

Shared/Samples/Add feature layers/AddFeatureLayersView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private extension AddFeatureLayersView {
190190
switch self {
191191
case .serviceFeatureTable: return "Service Feature Table"
192192
case .portalItem: return "Portal Item"
193-
case .geodatabase: return "Geodatabase"
193+
case .geodatabase: return "Mobile Geodatabase"
194194
case .geoPackage: return "GeoPackage"
195195
case .shapefile: return "Shapefile"
196196
}
200 KB
Loading

Shared/Samples/Change camera controller/ChangeCameraControllerView.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,14 @@ struct ChangeCameraControllerView: View {
9999
.toolbar {
100100
ToolbarItem(placement: .bottomBar) {
101101
Menu("Camera Controllers") {
102-
ForEach(CameraControllerKind.allCases, id: \.self) { kind in
103-
Button(kind.label) {
104-
cameraControllerKind = kind
105-
cameraController = makeCameraController(kind: kind)
102+
Picker("Choose a camera controller for the scene view.", selection: $cameraControllerKind) {
103+
ForEach(CameraControllerKind.allCases, id: \.self) { kind in
104+
Text(kind.label)
106105
}
107106
}
107+
.task(id: cameraControllerKind) {
108+
cameraController = makeCameraController(kind: cameraControllerKind)
109+
}
108110
}
109111
}
110112
}

Shared/Samples/Project geometry/ProjectGeometryView.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,21 @@ struct ProjectGeometryView: View {
2222
/// The point where the map was tapped in its original spatial reference (Web Mercator).
2323
@State private var originalPoint: Point!
2424

25-
/// The tap location.
26-
@State private var tapLocation: Point!
25+
/// The projected location after normalization.
26+
@State private var projectedPoint: Point!
2727

2828
/// The view model for the sample.
2929
@StateObject private var model = Model()
3030

3131
var body: some View {
3232
MapView(map: model.map, graphicsOverlays: [model.graphicsOverlay])
3333
.onSingleTapGesture { _, mapPoint in
34-
tapLocation = mapPoint
3534
if calloutPlacement == nil {
3635
// Sets the original point to where the map was tapped.
3736
originalPoint = GeometryEngine.normalizeCentralMeridian(of: mapPoint) as? Point
3837

3938
// Projects the original point from Web Mercator to WGS 84.
40-
let projectedPoint = GeometryEngine.project(originalPoint!, into: .wgs84)!
39+
projectedPoint = GeometryEngine.project(originalPoint!, into: .wgs84)!
4140

4241
// Updates the geometry of the point graphic.
4342
model.pointGraphic.geometry = projectedPoint
@@ -56,7 +55,7 @@ struct ProjectGeometryView: View {
5655
Text("Coordinates")
5756
.fontWeight(.medium)
5857
Text("Original: \(originalPoint.xyCoordinates)")
59-
Text("Projected: \(tapLocation.xyCoordinates)")
58+
Text("Projected: \(projectedPoint.xyCoordinates)")
6059
}
6160
.font(.callout)
6261
}

Shared/Samples/Set surface placement mode/SetSurfacePlacementModeView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ private extension SetSurfacePlacementModeView {
144144
// Creates symbols for the graphic.
145145
let markerSymbol = SimpleMarkerSymbol(style: .triangle, color: .red, size: 20)
146146
let textSymbol = TextSymbol(text: surfacePlacement.label, color: .blue, size: 20, horizontalAlignment: .left)
147+
textSymbol.haloColor = .cyan
148+
textSymbol.haloWidth = 2
147149

148150
// Adds an offset to avoid overlapping the text and marker symbols.
149151
textSymbol.offsetY = 20
24.4 KB
Loading

Shared/Samples/Show device location/ShowDeviceLocationView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private extension LocationDisplay.AutoPanMode {
133133
/// A human-readable label for each auto-pan mode.
134134
var label: String {
135135
switch self {
136-
case .off: return "Off"
136+
case .off: return "Autopan Off"
137137
case .recenter: return "Recenter"
138138
case .navigation: return "Navigation"
139139
case .compassNavigation: return "Compass Navigation"
13 KB
Loading

Shared/Samples/Show realistic light and shadows/ShowRealisticLightAndShadowsView.swift

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ struct ShowRealisticLightAndShadowsView: View {
1919
/// The view model for this sample.
2020
@StateObject private var model = Model()
2121

22-
/// A Boolean value indicating whether the settings view should be presented.
23-
@State private var isShowingSettings = false
24-
2522
/// The date second value controlled by the slider.
2623
@State private var dateSecond: Float = Model.dateSecondsNoon
2724

@@ -54,25 +51,30 @@ struct ShowRealisticLightAndShadowsView: View {
5451
}
5552
.frame(maxWidth: 540)
5653
.onChange(of: dateSecond, perform: sliderValueChanged(toValue:))
57-
.padding()
54+
.padding(.horizontal)
55+
}
56+
.overlay(alignment: .top) {
57+
dateTimeOverlay
5858
}
5959
.toolbar {
60-
ToolbarItemGroup(placement: .bottomBar) {
61-
Text(dateTimeText)
62-
Button("Mode") {
63-
isShowingSettings = true
64-
}
65-
.confirmationDialog("Choose a lighting mode for the scene view.", isPresented: $isShowingSettings, titleVisibility: .visible) {
60+
ToolbarItem(placement: .bottomBar) {
61+
Picker("Choose a lighting mode for the scene view.", selection: $lightingMode) {
6662
ForEach(SceneView.SunLighting.allCases, id: \.self) { mode in
67-
Button(mode.label) {
68-
lightingMode = mode
69-
}
63+
Text(mode.label)
7064
}
7165
}
7266
}
7367
}
7468
}
7569

70+
/// An overlay showing the date time adjusted by the slider.
71+
var dateTimeOverlay: some View {
72+
Text(dateTimeText)
73+
.frame(maxWidth: .infinity)
74+
.padding(.vertical, 6)
75+
.background(.thinMaterial, ignoresSafeAreaEdges: .horizontal)
76+
}
77+
7678
/// Handles slider value changed event and set the scene view's sun date.
7779
/// - Parameter value: The slider's value.
7880
private func sliderValueChanged(toValue value: Float) {
14 KB
Loading

0 commit comments

Comments
 (0)