Skip to content

Commit

Permalink
Merge pull request #532 from Esri/v.next
Browse files Browse the repository at this point in the history
Merge v.next into main for 200.3
  • Loading branch information
des12437 authored Dec 6, 2023
2 parents 5ea1271 + fb8c855 commit 99988c2
Show file tree
Hide file tree
Showing 192 changed files with 18,683 additions and 1,191 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
88AD138E283443F800500B2E /* MapItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88AD138D283443F800500B2E /* MapItemView.swift */; };
88D24DF0288F062D007A539C /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D24DEF288F062D007A539C /* ProfileView.swift */; };
88D24DF2288F2FA1007A539C /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D24DF1288F2FA1007A539C /* HomeView.swift */; };
88D24DF4288F4BEB007A539C /* FeaturedMapsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D24DF3288F4BEB007A539C /* FeaturedMapsView.swift */; };
88D24DF4288F4BEB007A539C /* WebMapsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D24DF3288F4BEB007A539C /* WebMapsView.swift */; };
88D24DF6288F5BAE007A539C /* UserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D24DF5288F5BAE007A539C /* UserView.swift */; };
88D24DF8288F6002007A539C /* LoadableImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D24DF7288F6002007A539C /* LoadableImageView.swift */; };
/* End PBXBuildFile section */
Expand All @@ -32,7 +32,7 @@
88AD138D283443F800500B2E /* MapItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapItemView.swift; sourceTree = "<group>"; };
88D24DEF288F062D007A539C /* ProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = "<group>"; };
88D24DF1288F2FA1007A539C /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
88D24DF3288F4BEB007A539C /* FeaturedMapsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturedMapsView.swift; sourceTree = "<group>"; };
88D24DF3288F4BEB007A539C /* WebMapsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebMapsView.swift; sourceTree = "<group>"; };
88D24DF5288F5BAE007A539C /* UserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserView.swift; sourceTree = "<group>"; };
88D24DF7288F6002007A539C /* LoadableImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadableImageView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -75,7 +75,7 @@
88AD13782834355000500B2E /* AuthenticationApp.swift */,
88D24DF1288F2FA1007A539C /* HomeView.swift */,
88D24DF7288F6002007A539C /* LoadableImageView.swift */,
88D24DF3288F4BEB007A539C /* FeaturedMapsView.swift */,
88D24DF3288F4BEB007A539C /* WebMapsView.swift */,
88AD138D283443F800500B2E /* MapItemView.swift */,
88AD137A2834355000500B2E /* SigninView.swift */,
88D24DEF288F062D007A539C /* ProfileView.swift */,
Expand Down Expand Up @@ -176,7 +176,7 @@
files = (
88AD138E283443F800500B2E /* MapItemView.swift in Sources */,
88AD137B2834355000500B2E /* SigninView.swift in Sources */,
88D24DF4288F4BEB007A539C /* FeaturedMapsView.swift in Sources */,
88D24DF4288F4BEB007A539C /* WebMapsView.swift in Sources */,
88D24DF2288F2FA1007A539C /* HomeView.swift in Sources */,
88D24DF8288F6002007A539C /* LoadableImageView.swift in Sources */,
88D24DF0288F062D007A539C /* ProfileView.swift in Sources */,
Expand Down Expand Up @@ -325,7 +325,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 200.2.0;
MARKETING_VERSION = 200.3.0;
PRODUCT_BUNDLE_IDENTIFIER = com.esri.Authentication;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -358,7 +358,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 200.2.0;
MARKETING_VERSION = 200.3.0;
PRODUCT_BUNDLE_IDENTIFIER = com.esri.Authentication;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>com.apple.token</string>
</array>
</dict>
</plist>
2 changes: 1 addition & 1 deletion AuthenticationExample/AuthenticationExample/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct HomeView: View {
var body: some View {
if let portal = portal {
NavigationView{
FeaturedMapsView(portal: portal)
WebMapsView(portal: portal)
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button {
Expand Down
6 changes: 4 additions & 2 deletions AuthenticationExample/AuthenticationExample/SignInView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ struct SignInView: View {
switch credential {
case .password(let passwordCredential):
return passwordCredential.username
case .certificate:
return ""
case .certificate(let certificateCredential):
return certificateCredential.identityName
case .serverTrust:
return nil
case .smartCard(let smartCardCredential):
return smartCardCredential.identityName
@unknown default:
fatalError("Unknown NetworkCredential")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
import SwiftUI
import ArcGIS

/// A view that displays the featured maps of a portal.
struct FeaturedMapsView: View {
/// The portal from which the featured content can be fetched.
/// A view that displays the web maps of a portal.
struct WebMapsView: View {
/// The portal from which the web maps can be fetched.
var portal: Portal

/// A Boolean value indicating whether the featured content is being loaded.
@State var isLoading = true

/// The featured items.
@State var featuredItems = [PortalItem]()
/// The web map portal items.
@State var webMapItems = [PortalItem]()

var body: some View {
VStack {
if isLoading {
ProgressView()
} else {
List(featuredItems, id: \.id) { item in
List(webMapItems, id: \.id) { item in
NavigationLink {
MapItemView(map: Map(item: item))
} label: {
Expand All @@ -40,15 +40,23 @@ struct FeaturedMapsView: View {
}
}
.task {
guard featuredItems.isEmpty else { return }
guard webMapItems.isEmpty else { return }
do {
featuredItems = try await portal.featuredItems
// Try to fetch the featured items but if none available then find webmap items.
var items = try await portal.featuredItems
.filter { $0.kind == .webMap }
if items.isEmpty {
items = try await portal.findItems(
queryParameters: .items(ofKinds: [.webMap])
)
.results
}
webMapItems = items
} catch {}

isLoading = false
}
.navigationTitle("Featured Maps")
.navigationTitle("Web Maps")
}
}

Expand Down
2 changes: 1 addition & 1 deletion AuthenticationExample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is an application that shows how to use the Authenticator toolkit component to fully support ArcGIS authentication and network authentication in an application.

Documentation for the Authenticator toolkit components is [here](../Documentation/Authenticator/README.md).
Documentation for the Authenticator toolkit component is [here](https://developers.arcgis.com/swift/toolkit-api-reference/documentation/arcgistoolkit/authenticator).

## Instructions

Expand Down
20 changes: 14 additions & 6 deletions Examples/Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
objects = {

/* Begin PBXBuildFile section */
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 */; };
752A4FC4294D268000A49479 /* MapDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752A4FC2294D268000A49479 /* MapDataModel.swift */; };
752A4FC5294D268000A49479 /* SceneDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752A4FC3294D268000A49479 /* SceneDataModel.swift */; };
75657E4827ABAC8400EE865B /* CompassExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75657E4727ABAC8400EE865B /* CompassExampleView.swift */; };
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 */; };
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 @@ -44,13 +46,15 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
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>"; };
752A4FC2294D268000A49479 /* MapDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapDataModel.swift; sourceTree = "<group>"; };
752A4FC3294D268000A49479 /* SceneDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDataModel.swift; sourceTree = "<group>"; };
75657E4727ABAC8400EE865B /* CompassExampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompassExampleView.swift; sourceTree = "<group>"; };
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>"; };
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 @@ -94,16 +98,18 @@
E40F58042656E509006F5CB9 /* Examples */ = {
isa = PBXGroup;
children = (
4D19FCB42881C8F3002601E8 /* PopupExampleView.swift */,
E4C389D426B8A12C002BC255 /* BasemapGalleryExampleView.swift */,
75C37C9127BEDBD800FC9DCE /* BookmarksExampleView.swift */,
75657E4727ABAC8400EE865B /* CompassExampleView.swift */,
E4AA9315276BF5ED000E6289 /* FloatingPanelExampleView.swift */,
E4624A24278CE815000D2A38 /* FloorFilterExampleView.swift */,
E4F9BC98265EFCAF001280FF /* OverviewMapExampleView.swift */,
4D19FCB42881C8F3002601E8 /* PopupExampleView.swift */,
75D41B2A27C6F21400624D7C /* ScalebarExampleView.swift */,
E42BFBE82672BF9500159107 /* SearchExampleView.swift */,
E4AA9315276BF5ED000E6289 /* FloatingPanelExampleView.swift */,
75657E4727ABAC8400EE865B /* CompassExampleView.swift */,
E4624A24278CE815000D2A38 /* FloorFilterExampleView.swift */,
75230DAD28614369009AF501 /* UtilityNetworkTraceExampleView.swift */,
882899FC2AB5099300A0BDC1 /* FlyoverExampleView.swift */,
1CC376D32ABA0B3700A83300 /* TableTopExampleView.swift */,
);
name = Examples;
sourceTree = "<group>";
Expand Down Expand Up @@ -264,6 +270,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1CC376D42ABA0B3700A83300 /* TableTopExampleView.swift in Sources */,
752A4FC4294D268000A49479 /* MapDataModel.swift in Sources */,
752A4FC5294D268000A49479 /* SceneDataModel.swift in Sources */,
75657E4827ABAC8400EE865B /* CompassExampleView.swift in Sources */,
Expand All @@ -278,6 +285,7 @@
E48A73472658227100F5C118 /* ExampleList.swift in Sources */,
E4624A25278CE815000D2A38 /* FloorFilterExampleView.swift in Sources */,
4D19FCB52881C8F3002601E8 /* PopupExampleView.swift in Sources */,
882899FD2AB5099300A0BDC1 /* FlyoverExampleView.swift in Sources */,
E48A73462658227100F5C118 /* ExampleView.swift in Sources */,
E42BFBE92672BF9500159107 /* SearchExampleView.swift in Sources */,
E4C389D526B8A12C002BC255 /* BasemapGalleryExampleView.swift in Sources */,
Expand Down Expand Up @@ -421,7 +429,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 200.2.0;
MARKETING_VERSION = 200.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.esri.arcgis-swift-sdk-toolkit-examples";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -449,7 +457,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 200.2.0;
MARKETING_VERSION = 200.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.esri.arcgis-swift-sdk-toolkit-examples";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down
25 changes: 8 additions & 17 deletions Examples/Examples/BookmarksExampleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,14 @@ struct BookmarksExampleView: View {
/// The `Map` with predefined bookmarks.
@State private var map = Map(url: URL(string: "https://www.arcgis.com/home/item.html?id=16f1b8ba37b44dc3884afc8d5f454dd2")!)!

/// The last selected bookmark.
@State var selectedBookmark: Bookmark?

/// Indicates if the `Bookmarks` component is shown or not.
/// - Remark: This allows a developer to control when the `Bookmarks` component is
/// shown/hidden, whether that be in a group of options or a standalone button.
@State var showingBookmarks = false

/// Allows for communication between the `Bookmarks` component and a `MapView` or
/// `SceneView`.
@State var viewpoint: Viewpoint?

var body: some View {
MapViewReader { mapViewProxy in
MapView(map: map, viewpoint: viewpoint)
.onViewpointChanged(kind: .centerAndScale) {
viewpoint = $0
}
.task(id: selectedBookmark) {
if let selectedBookmark, let viewpoint = selectedBookmark.viewpoint {
await mapViewProxy.setViewpoint(viewpoint)
}
}
MapView(map: map)
.toolbar {
ToolbarItem(placement: .primaryAction) {
Button {
Expand All @@ -58,7 +43,13 @@ struct BookmarksExampleView: View {
isPresented: $showingBookmarks,
geoModel: map
)
.onSelectionChanged { selectedBookmark = $0 }
.onSelectionChanged {
if let viewpoint = $0.viewpoint {
Task {
await mapViewProxy.setViewpoint(viewpoint)
}
}
}
}
}
}
Expand Down
13 changes: 12 additions & 1 deletion Examples/Examples/FloatingPanelExampleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import ArcGISToolkit
import ArcGIS

struct FloatingPanelExampleView: View {
/// The height of the map view's attribution bar.
@State private var attributionBarHeight: CGFloat = 0

/// The data model containing the `Map` displayed in the `MapView`.
@StateObject private var dataModel = MapDataModel(
map: Map(basemapStyle: .arcGISImagery)
Expand All @@ -38,7 +41,15 @@ struct FloatingPanelExampleView: View {
map: dataModel.map,
viewpoint: initialViewpoint
)
.floatingPanel(selectedDetent: $selectedDetent, isPresented: isPresented) {
.onAttributionBarHeightChanged {
attributionBarHeight = $0
}
.ignoresSafeArea(.keyboard, edges: .bottom)
.floatingPanel(
attributionBarHeight: attributionBarHeight,
selectedDetent: $selectedDetent,
isPresented: isPresented
) {
switch demoContent {
case .list:
FloatingPanelListDemoContent(selectedDetent: $selectedDetent)
Expand Down
41 changes: 41 additions & 0 deletions Examples/Examples/FlyoverExampleView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2023 Esri.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import SwiftUI
import ArcGIS
import ArcGISToolkit

struct FlyoverExampleView: View {
@State private var scene = Scene(
item: PortalItem(
portal: .arcGISOnline(connection: .anonymous),
id: PortalItem.ID("7558ee942b2547019f66885c44d4f0b1")!
)
)

var body: some View {
FlyoverSceneView(
initialLocation: Point(x: 4.4777, y: 51.9244, z: 1_000, spatialReference: .wgs84),
translationFactor: 1_000
) { proxy in
SceneView(scene: scene)
.onSingleTapGesture { screen, _ in
print("Identifying...")
Task.detached {
let results = try await proxy.identifyLayers(screenPoint: screen, tolerance: 20)
print("\(results.count) identify result(s).")
}
}
}
}
}
Loading

0 comments on commit 99988c2

Please sign in to comment.