Skip to content

Commit

Permalink
Merge pull request #554 from Esri/destiny/geotracking-refactor
Browse files Browse the repository at this point in the history
AR: Refactor world scale
  • Loading branch information
des12437 authored Jan 8, 2024
2 parents 99e952f + 56114d1 commit dc1347f
Show file tree
Hide file tree
Showing 5 changed files with 316 additions and 221 deletions.
12 changes: 6 additions & 6 deletions Examples/Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
1C40F3322B46118800C00ED5 /* WorldScaleGeoTrackingExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C40F3312B46118800C00ED5 /* WorldScaleGeoTrackingExampleView.swift */; };
1CC376D42ABA0B3700A83300 /* TableTopExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CC376D32ABA0B3700A83300 /* TableTopExampleView.swift */; };
4D19FCB52881C8F3002601E8 /* PopupExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D19FCB42881C8F3002601E8 /* PopupExampleView.swift */; };
75230DAE28614369009AF501 /* UtilityNetworkTraceExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75230DAD28614369009AF501 /* UtilityNetworkTraceExampleView.swift */; };
Expand All @@ -16,7 +17,6 @@
75C37C9227BEDBD800FC9DCE /* BookmarksExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75C37C9127BEDBD800FC9DCE /* BookmarksExampleView.swift */; };
75D41B2B27C6F21400624D7C /* ScalebarExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75D41B2A27C6F21400624D7C /* ScalebarExampleView.swift */; };
882899FD2AB5099300A0BDC1 /* FlyoverExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882899FC2AB5099300A0BDC1 /* FlyoverExampleView.swift */; };
885554952ACB4D9600ECBB4A /* WorldScaleExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 885554942ACB4D9600ECBB4A /* WorldScaleExampleView.swift */; };
E42BFBE92672BF9500159107 /* SearchExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E42BFBE82672BF9500159107 /* SearchExampleView.swift */; };
E4624A25278CE815000D2A38 /* FloorFilterExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4624A24278CE815000D2A38 /* FloorFilterExampleView.swift */; };
E47ABE442652FE0900FD2FE3 /* ExamplesApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = E47ABE432652FE0900FD2FE3 /* ExamplesApp.swift */; };
Expand Down Expand Up @@ -47,6 +47,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
1C40F3312B46118800C00ED5 /* WorldScaleGeoTrackingExampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorldScaleGeoTrackingExampleView.swift; sourceTree = "<group>"; };
1CC376D32ABA0B3700A83300 /* TableTopExampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableTopExampleView.swift; sourceTree = "<group>"; };
4D19FCB42881C8F3002601E8 /* PopupExampleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopupExampleView.swift; sourceTree = "<group>"; };
75230DAD28614369009AF501 /* UtilityNetworkTraceExampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UtilityNetworkTraceExampleView.swift; sourceTree = "<group>"; };
Expand All @@ -56,7 +57,6 @@
75C37C9127BEDBD800FC9DCE /* BookmarksExampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksExampleView.swift; sourceTree = "<group>"; };
75D41B2A27C6F21400624D7C /* ScalebarExampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScalebarExampleView.swift; sourceTree = "<group>"; };
882899FC2AB5099300A0BDC1 /* FlyoverExampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlyoverExampleView.swift; sourceTree = "<group>"; };
885554942ACB4D9600ECBB4A /* WorldScaleExampleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WorldScaleExampleView.swift; sourceTree = "<group>"; };
E42BFBE82672BF9500159107 /* SearchExampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchExampleView.swift; sourceTree = "<group>"; };
E4624A24278CE815000D2A38 /* FloorFilterExampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloorFilterExampleView.swift; sourceTree = "<group>"; };
E47ABE402652FE0900FD2FE3 /* Toolkit Examples.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Toolkit Examples.app"; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -105,14 +105,14 @@
75657E4727ABAC8400EE865B /* CompassExampleView.swift */,
E4AA9315276BF5ED000E6289 /* FloatingPanelExampleView.swift */,
E4624A24278CE815000D2A38 /* FloorFilterExampleView.swift */,
882899FC2AB5099300A0BDC1 /* FlyoverExampleView.swift */,
E4F9BC98265EFCAF001280FF /* OverviewMapExampleView.swift */,
4D19FCB42881C8F3002601E8 /* PopupExampleView.swift */,
75D41B2A27C6F21400624D7C /* ScalebarExampleView.swift */,
E42BFBE82672BF9500159107 /* SearchExampleView.swift */,
75230DAD28614369009AF501 /* UtilityNetworkTraceExampleView.swift */,
882899FC2AB5099300A0BDC1 /* FlyoverExampleView.swift */,
1CC376D32ABA0B3700A83300 /* TableTopExampleView.swift */,
885554942ACB4D9600ECBB4A /* WorldScaleExampleView.swift */,
75230DAD28614369009AF501 /* UtilityNetworkTraceExampleView.swift */,
1C40F3312B46118800C00ED5 /* WorldScaleGeoTrackingExampleView.swift */,
);
name = Examples;
sourceTree = "<group>";
Expand Down Expand Up @@ -273,6 +273,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1C40F3322B46118800C00ED5 /* WorldScaleGeoTrackingExampleView.swift in Sources */,
1CC376D42ABA0B3700A83300 /* TableTopExampleView.swift in Sources */,
752A4FC4294D268000A49479 /* MapDataModel.swift in Sources */,
752A4FC5294D268000A49479 /* SceneDataModel.swift in Sources */,
Expand All @@ -290,7 +291,6 @@
4D19FCB52881C8F3002601E8 /* PopupExampleView.swift in Sources */,
882899FD2AB5099300A0BDC1 /* FlyoverExampleView.swift in Sources */,
E48A73462658227100F5C118 /* ExampleView.swift in Sources */,
885554952ACB4D9600ECBB4A /* WorldScaleExampleView.swift in Sources */,
E42BFBE92672BF9500159107 /* SearchExampleView.swift in Sources */,
E4C389D526B8A12C002BC255 /* BasemapGalleryExampleView.swift in Sources */,
75D41B2B27C6F21400624D7C /* ScalebarExampleView.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import ArcGIS
import ArcGISToolkit
import CoreLocation

/// An example that utilizes the `WorldScaleSceneView` to show an augmented reality view
/// An example that utilizes the `WorldScaleGeoTrackingSceneView` to show an augmented reality view
/// of your current location. Because this is an example that can be run from anywhere,
/// it places a red circle around your initial location which can be explored.
struct WorldScaleExampleView: View {
struct WorldScaleGeoTrackingExampleView: View {
@State private var scene: ArcGIS.Scene = {
// Creates an elevation source from Terrain3D REST service.
let elevationServiceURL = URL(string: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer")!
Expand All @@ -32,6 +32,7 @@ struct WorldScaleExampleView: View {
scene.baseSurface.backgroundGrid.isVisible = false
scene.baseSurface.navigationConstraint = .unconstrained
scene.basemap = Basemap(style: .arcGISImagery)
scene.addOperationalLayer(parcelsLayer)
return scene
}()

Expand All @@ -42,9 +43,16 @@ struct WorldScaleExampleView: View {
/// The location datasource that is used to access the device location.
@State private var locationDatasSource = SystemLocationDataSource()

static var parcelsLayer: FeatureLayer {
let parcelsTable = ServiceFeatureTable(url: URL(string: "https://services.arcgis.com/aA3snZwJfFkVyDuP/ArcGIS/rest/services/Parcels_for_San_Bernardino_County/FeatureServer/0")!)
let featureLayer = FeatureLayer(featureTable: parcelsTable)
featureLayer.renderer = SimpleRenderer(symbol: SimpleLineSymbol(color: .cyan, width: 3))
return featureLayer
}

var body: some View {
VStack {
WorldScaleSceneView { proxy in
WorldScaleGeoTrackingSceneView { proxy in
SceneView(scene: scene, graphicsOverlays: [graphicsOverlay])
.onSingleTapGesture { screen, _ in
print("Identifying...")
Expand Down
2 changes: 1 addition & 1 deletion Examples/ExamplesApp/Examples.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension ExampleList {
examples: [
AnyExample("Flyover", content: FlyoverExampleView()),
AnyExample("Tabletop", content: TableTopExampleView()),
AnyExample("World Scale", content: WorldScaleExampleView())
AnyExample("World Scale", content: WorldScaleGeoTrackingExampleView())
]
)

Expand Down
Loading

0 comments on commit dc1347f

Please sign in to comment.