Skip to content

Commit 896565b

Browse files
authored
Merge branch 'v.next' into Caleb/New-FindAddressWithReverseGeocode
2 parents 395443d + fc11595 commit 896565b

File tree

5 files changed

+117
-0
lines changed

5 files changed

+117
-0
lines changed

Samples.xcodeproj/project.pbxproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@
200200
D73FCFFA2B02A3C50006360D /* FindAddressWithReverseGeocodeView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D73FCFF42B02A3AA0006360D /* FindAddressWithReverseGeocodeView.swift */; };
201201
D73FCFFF2B02C7630006360D /* FindRouteAroundBarriersView.Views.swift in Sources */ = {isa = PBXBuildFile; fileRef = D73FCFFE2B02C7630006360D /* FindRouteAroundBarriersView.Views.swift */; };
202202
D73FD0002B02C9610006360D /* FindRouteAroundBarriersView.Views.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D73FCFFE2B02C7630006360D /* FindRouteAroundBarriersView.Views.swift */; };
203+
D742E4922B04132B00690098 /* DisplayWebSceneFromPortalItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D742E48F2B04132B00690098 /* DisplayWebSceneFromPortalItemView.swift */; };
204+
D742E4952B04134C00690098 /* DisplayWebSceneFromPortalItemView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D742E48F2B04132B00690098 /* DisplayWebSceneFromPortalItemView.swift */; };
203205
D744FD172A2112D90084A66C /* CreateConvexHullAroundPointsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D744FD162A2112D90084A66C /* CreateConvexHullAroundPointsView.swift */; };
204206
D744FD182A2113C70084A66C /* CreateConvexHullAroundPointsView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D744FD162A2112D90084A66C /* CreateConvexHullAroundPointsView.swift */; };
205207
D7464F1E2ACE04B3007FEE88 /* IdentifyRasterCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7464F1D2ACE04B3007FEE88 /* IdentifyRasterCellView.swift */; };
@@ -379,6 +381,7 @@
379381
dstSubfolderSpec = 7;
380382
files = (
381383
D73FCFFA2B02A3C50006360D /* FindAddressWithReverseGeocodeView.swift in Copy Source Code Files */,
384+
D742E4952B04134C00690098 /* DisplayWebSceneFromPortalItemView.swift in Copy Source Code Files */,
382385
D7010EC12B05618400D43F55 /* DisplaySceneFromMobileScenePackageView.swift in Copy Source Code Files */,
383386
D737237B2AF5AE1A00846884 /* FindRouteInMobileMapPackageView.Models.swift in Copy Source Code Files */,
384387
D737237A2AF5AE1600846884 /* FindRouteInMobileMapPackageView.MobileMapView.swift in Copy Source Code Files */,
@@ -627,6 +630,7 @@
627630
D73FC0FC2AD4A18D0067A19B /* CreateMobileGeodatabaseView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreateMobileGeodatabaseView.swift; sourceTree = "<group>"; };
628631
D73FCFF42B02A3AA0006360D /* FindAddressWithReverseGeocodeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FindAddressWithReverseGeocodeView.swift; sourceTree = "<group>"; };
629632
D73FCFFE2B02C7630006360D /* FindRouteAroundBarriersView.Views.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FindRouteAroundBarriersView.Views.swift; sourceTree = "<group>"; };
633+
D742E48F2B04132B00690098 /* DisplayWebSceneFromPortalItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DisplayWebSceneFromPortalItemView.swift; sourceTree = "<group>"; };
630634
D744FD162A2112D90084A66C /* CreateConvexHullAroundPointsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreateConvexHullAroundPointsView.swift; sourceTree = "<group>"; };
631635
D7464F1D2ACE04B3007FEE88 /* IdentifyRasterCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IdentifyRasterCellView.swift; sourceTree = "<group>"; };
632636
D7464F2A2ACE0964007FEE88 /* SA_EVI_8Day_03May20 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = SA_EVI_8Day_03May20; sourceTree = "<group>"; };
@@ -834,6 +838,7 @@
834838
1C56B5DE2A82C02D000381DA /* Display points using clustering feature reduction */,
835839
E004A6D528465C70002A1FE6 /* Display scene */,
836840
D7010EBA2B05616900D43F55 /* Display scene from mobile scene package */,
841+
D742E48E2B04132B00690098 /* Display web scene from portal item */,
837842
E070A0A1286F3B3400F2B606 /* Download preplanned map area */,
838843
E004A6EE284E4B7A002A1FE6 /* Download vector tiles to local cache */,
839844
1C26ED122A859525009B7721 /* Filter features in scene */,
@@ -1420,6 +1425,14 @@
14201425
path = "Find address with reverse geocode";
14211426
sourceTree = "<group>";
14221427
};
1428+
D742E48E2B04132B00690098 /* Display web scene from portal item */ = {
1429+
isa = PBXGroup;
1430+
children = (
1431+
D742E48F2B04132B00690098 /* DisplayWebSceneFromPortalItemView.swift */,
1432+
);
1433+
path = "Display web scene from portal item";
1434+
sourceTree = "<group>";
1435+
};
14231436
D744FD132A2112360084A66C /* Create convex hull around points */ = {
14241437
isa = PBXGroup;
14251438
children = (
@@ -2248,6 +2261,7 @@
22482261
E0EA0B772866390E00C9621D /* ProjectGeometryView.swift in Sources */,
22492262
D74C8BFE2ABA5605007C76B8 /* StyleSymbolsFromMobileStyleFileView.swift in Sources */,
22502263
D7E7D0812AEB39D5003AAD02 /* FindRouteInTransportNetworkView.swift in Sources */,
2264+
D742E4922B04132B00690098 /* DisplayWebSceneFromPortalItemView.swift in Sources */,
22512265
0042E24328E4BF8F001F33D6 /* ShowViewshedFromPointInSceneView.Model.swift in Sources */,
22522266
D7E557682A1D768800B9FB09 /* AddWMSLayerView.swift in Sources */,
22532267
D7497F3C2AC4B4C100167AD2 /* DisplayDimensionsView.swift in Sources */,
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright 2023 Esri
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import ArcGIS
16+
import SwiftUI
17+
18+
struct DisplayWebSceneFromPortalItemView: View {
19+
/// A scene of Geneva, Switzerland created from a portal item.
20+
@State private var scene = {
21+
// Create a portal item using a portal and an ID.
22+
let portalItem = PortalItem(
23+
portal: .arcGISOnline(connection: .anonymous),
24+
id: .genevaSwitzerlandScene
25+
)
26+
27+
// Create a scene using the portal item.
28+
return Scene(item: portalItem)
29+
}()
30+
31+
var body: some View {
32+
// Create a scene view with the scene.
33+
SceneView(scene: scene)
34+
}
35+
}
36+
37+
private extension PortalItem.ID {
38+
/// The ID for the "Geneva, Switzerland Scene" portal item on ArcGIS Online.
39+
static var genevaSwitzerlandScene: PortalItem.ID {
40+
.init("c6f90b19164c4283884361005faea852")!
41+
}
42+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Display web scene from portal item
2+
3+
Open a web scene from a portal item.
4+
5+
![Image of display web scene from portal item](display-web-scene-from-portal-item.png)
6+
7+
## Use case
8+
9+
A scene is symbolized geospatial content that allows you to visualize and analyze geographic information in an intuitive and interactive 3D environment. Web scenes are an ArcGIS format for storing scenes in ArcGIS Online or portal. Scenes can be used to visualize a complex 3D environment like a city.
10+
11+
## How to use the sample
12+
13+
When the sample opens, it will automatically display the scene from ArcGIS Online. Pan and zoom to explore the scene.
14+
15+
## How it works
16+
17+
To open a web scene from a portal item:
18+
19+
1. Create a `PortalItem` with an item ID pointing to a web scene.
20+
2. Create a `Scene` passing in the portal item.
21+
3. Pass the scene to a `SceneView` to display it.
22+
23+
## Relevant API
24+
25+
* PortalItem
26+
* Scene
27+
* SceneView
28+
29+
## About the data
30+
31+
This sample uses a [Geneva, Switzerland Scene](https://www.arcgis.com/home/item.html?id=c6f90b19164c4283884361005faea852) hosted on ArcGIS Online.
32+
33+
## Tags
34+
35+
portal, scene, web scene
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"category": "Scenes",
3+
"description": "Open a web scene from a portal item.",
4+
"ignore": false,
5+
"images": [
6+
"display-web-scene-from-portal-item.png"
7+
],
8+
"keywords": [
9+
"portal",
10+
"scene",
11+
"web scene",
12+
"PortalItem",
13+
"Scene",
14+
"SceneView"
15+
],
16+
"redirect_from": [],
17+
"relevant_apis": [
18+
"PortalItem",
19+
"Scene",
20+
"SceneView"
21+
],
22+
"snippets": [
23+
"DisplayWebSceneFromPortalItemView.swift"
24+
],
25+
"title": "Display web scene from portal item"
26+
}
187 KB
Loading

0 commit comments

Comments
 (0)