Skip to content

Commit fa94e6f

Browse files
authored
Merge pull request #172 from Esri/v.next
V.next
2 parents b47ca46 + a65ad9e commit fa94e6f

30 files changed

+1485
-32
lines changed

Documentation/AR/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ NSLayoutConstraint.activate([
3535

3636

3737
// Create a simple scene.
38-
arView.sceneView.scene = AGSScene(basemapType: .imagery)
38+
arView.sceneView.scene = AGSScene(basemapStyle: .arcGISImagery)
3939

4040
// Set a AGSCLLocationDataSource, used to get our initial real-world location.
4141
arView.locationDataSource = AGSCLLocationDataSource()

Documentation/Bookmarks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The Bookmarks component will display a list of bookmarks in a table view and allows the user to select a bookmark and perform some action.
44

5-
## Bookmarks Behavior:
5+
## Bookmarks Behavior
66

77
The `BookmarksTableViewController` can be created using either an `AGSGeoView` or an array of `AGSBookmark`s.
88

Documentation/Compass/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The Compass (alias North arrow) shows where north is in the MapView. The Compass
44

55
The ArcGIS Runtime SDK currently supports rotating the map with 2-finger gesture on MapView and SceneView interactively by default and while the map will snap to north when rotating using gestures, the compass provides an easier way. The Compass Toolkit component will appear when the map is rotated and, when tapped, re-orientates the map back to north and hides the compass icon (note that the MapView auto-snaps back to north when it's within a threshold of north, and in that case the compass also auto hides).
66

7-
### Compass Behavior:
7+
### Compass Behavior
88

99
Whenever the map is not orientated North (non-zero bearing) the compass appears. When reset to north, it disappears. A property allows you to disable the auto-hide feature so that it always shows.
1010

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# FloorFilter
2+
3+
The `FloorFilter` component simplifies visualization of GIS data for a specific floor of a building in your application. It allows you to filter down the floor plan data displayed in your geo view to a site, a building in the site, or a floor in the building.
4+
5+
The ArcGIS Runtime SDK currently supports filtering a 2D floor aware map based on the sites, buildings, or levels in the map.
6+
7+
<img src="https://user-images.githubusercontent.com/3998072/163230061-6578a899-2167-4bb1-b6a5-65651931f2c7.png" width="512" height="384">
8+
9+
### Behavior
10+
11+
When the Site button is tapped, a prompt opens so the user can select a site and then a facility. After selecting a site and facility, a list of levels is displayed either above or below the site button.
12+
13+
### Usage
14+
15+
```swift
16+
17+
addChild(floorFilterViewController)
18+
view.addSubview(floorFilterViewController.view)
19+
floorFilterViewController.didMove(toParent: self)
20+
21+
```
22+
23+
To see it in action, try out the [Examples](../../Examples) and refer to [FloorFilterExample.swift](../../Examples/ArcGISToolkitExamples/FloorFilterExample.swift) in the project.

Documentation/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* [Augmented reality (AR)](AR) - Integrates the scene view with ARKit to enable augmented reality (AR).
44
* [Bookmarks](Bookmarks) - Shows bookmarks, from a map, scene, or a list.
55
* [Compass](Compass) - Shows a compass direction when the map is rotated. Auto-hides when the map points north up.
6+
* [FloorFilter](FloorFilter) - Allows to filter floor plan data in a geo view by a site, a building in the site, or a floor in the building.
67
* [JobManager](JobManager) - Suspends and resumes ArcGIS Runtime tasks when the app is background, terminated, and relaunched.
78
* [LegendViewController](LegendViewController) - Displays a legend for all the layers in a map or scene contained in an `AGSGeoView`.
89
* [MeasureToolbar](MeasureToolbar) - Allows measurement of distances and areas on the map view.

Examples/ArcGISToolkitExamples.xcodeproj/project.pbxproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
2140781E209B629000FBFDCC /* TimeSliderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2140781D209B629000FBFDCC /* TimeSliderExample.swift */; };
1111
79CA564425F1952D00E9FE3D /* ArcGISToolkit in Frameworks */ = {isa = PBXBuildFile; productRef = 79CA564325F1952D00E9FE3D /* ArcGISToolkit */; };
12+
82EACDA9270CE8BA00A40C11 /* FloorFilterExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82EACDA8270CE8BA00A40C11 /* FloorFilterExample.swift */; };
1213
8800656E2228577A00F76945 /* TemplatePickerExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8800656D2228577A00F76945 /* TemplatePickerExample.swift */; };
1314
883904441DF6022A001F3188 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 883904421DF6022A001F3188 /* Main.storyboard */; };
1415
883904461DF6022A001F3188 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 883904451DF6022A001F3188 /* Assets.xcassets */; };
@@ -34,6 +35,7 @@
3435
/* Begin PBXFileReference section */
3536
2140781D209B629000FBFDCC /* TimeSliderExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TimeSliderExample.swift; sourceTree = "<group>"; };
3637
79CA564025F1942200E9FE3D /* arcgis-runtime-toolkit-ios */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "arcgis-runtime-toolkit-ios"; path = ..; sourceTree = "<group>"; };
38+
82EACDA8270CE8BA00A40C11 /* FloorFilterExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloorFilterExample.swift; sourceTree = "<group>"; };
3739
8800656D2228577A00F76945 /* TemplatePickerExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TemplatePickerExample.swift; sourceTree = "<group>"; };
3840
8839043B1DF6022A001F3188 /* ArcGISToolkitExamples.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ArcGISToolkitExamples.app; sourceTree = BUILT_PRODUCTS_DIR; };
3941
883904431DF6022A001F3188 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
@@ -116,6 +118,7 @@
116118
8800656D2228577A00F76945 /* TemplatePickerExample.swift */,
117119
E447A12A2267BB9500578C0B /* ARExample.swift */,
118120
E48ADDB923563E17005A53AF /* BookmarksExample.swift */,
121+
82EACDA8270CE8BA00A40C11 /* FloorFilterExample.swift */,
119122
);
120123
name = Examples;
121124
sourceTree = "<group>";
@@ -253,6 +256,7 @@
253256
E447A12B2267BB9500578C0B /* ARExample.swift in Sources */,
254257
E48405751E9BE7E600927208 /* LegendExample.swift in Sources */,
255258
E46893271FEDAE29008ADA79 /* CompassExample.swift in Sources */,
259+
82EACDA9270CE8BA00A40C11 /* FloorFilterExample.swift in Sources */,
256260
);
257261
runOnlyForDeploymentPostprocessing = 0;
258262
};
@@ -406,7 +410,7 @@
406410
"$(inherited)",
407411
"@executable_path/Frameworks",
408412
);
409-
MARKETING_VERSION = 100.13;
413+
MARKETING_VERSION = 100.14;
410414
PRODUCT_BUNDLE_IDENTIFIER = "com.esri.${PRODUCT_NAME}";
411415
PRODUCT_NAME = "$(TARGET_NAME)";
412416
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -420,13 +424,14 @@
420424
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
421425
CLANG_ENABLE_MODULES = YES;
422426
DEVELOPMENT_TEAM = "";
427+
ENABLE_TESTABILITY = YES;
423428
INFOPLIST_FILE = ArcGISToolkitExamples/Info.plist;
424429
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
425430
LD_RUNPATH_SEARCH_PATHS = (
426431
"$(inherited)",
427432
"@executable_path/Frameworks",
428433
);
429-
MARKETING_VERSION = 100.13;
434+
MARKETING_VERSION = 100.14;
430435
PRODUCT_BUNDLE_IDENTIFIER = "com.esri.${PRODUCT_NAME}";
431436
PRODUCT_NAME = "$(TARGET_NAME)";
432437
SWIFT_VERSION = 5.0;

Examples/ArcGISToolkitExamples/ARExample.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ARExample: UIViewController {
3535
private let arView = ArcGISARView(renderVideoFeed: true)
3636

3737
/// Denotes whether we've placed the scene in table top experiences.
38-
private var didPlaceScene: Bool = false
38+
private var didPlaceScene = false
3939

4040
// View controller displaying current status of `ARExample`.
4141
private let statusViewController: ARStatusViewController? = {
@@ -67,10 +67,10 @@ class ARExample: UIViewController {
6767
private var toolbar = UIToolbar(frame: .zero)
6868

6969
/// Button used to display the `CalibrationView`.
70-
private let calibrationItem = UIBarButtonItem(title: "Calibration", style: .plain, target: self, action: #selector(displayCalibration(_:)))
70+
private let calibrationItem = UIBarButtonItem(title: "Calibration", style: .plain, target: ARExample.self, action: #selector(displayCalibration(_:)))
7171

7272
/// Button used to change the current scene.
73-
private let sceneItem = UIBarButtonItem(title: "Change Scene", style: .plain, target: self, action: #selector(changeScene(_:)))
73+
private let sceneItem = UIBarButtonItem(title: "Change Scene", style: .plain, target: ARExample.self, action: #selector(changeScene(_:)))
7474

7575
// MARK: Initialization
7676

@@ -506,7 +506,7 @@ extension ARExample {
506506
/// - Returns: The new scene.
507507
private func streetsScene() -> AGSScene {
508508
// Create scene with the streets basemap.
509-
let scene = AGSScene(basemapType: .streets)
509+
let scene = AGSScene(basemapStyle: .arcGISStreets)
510510
scene.addElevationSource()
511511

512512
// Set the location data source so we use our GPS location as the originCamera.
@@ -521,7 +521,7 @@ extension ARExample {
521521
/// - Returns: The new scene.
522522
private func imageryScene() -> AGSScene {
523523
// Create scene with the streets basemap.
524-
let scene = AGSScene(basemapType: .imageryWithLabels)
524+
let scene = AGSScene(basemapStyle: .arcGISImagery)
525525
scene.addElevationSource()
526526

527527
// Set the location data source so we use our GPS location as the originCamera.

Examples/ArcGISToolkitExamples/ExamplesViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class ExamplesViewController: VCListViewController {
3030
("Popup Controller", PopupExample.self, nil),
3131
("Template Picker", TemplatePickerExample.self, nil),
3232
("AR", ARExample.self, nil),
33-
("Bookmarks", BookmarksExample.self, nil)
33+
("Bookmarks", BookmarksExample.self, nil),
34+
("Floor Filter", FloorFilterExample.self, nil)
3435
]
3536
}
3637
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
//
2+
// Copyright 2022 Esri.
3+
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://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 Foundation
16+
import UIKit
17+
import ArcGIS
18+
import ArcGISToolkit
19+
20+
class FloorFilterExample: MapViewController {
21+
var floorFilterVC: FloorFilterViewController?
22+
23+
override func viewDidLoad() {
24+
super.viewDidLoad()
25+
26+
// Create the map from a portal item and assign to the mapView.
27+
let portal = AGSPortal(url: URL(string: "https://indoors.maps.arcgis.com/")!, loginRequired: false)
28+
let portalItem = AGSPortalItem(portal: portal, itemID: "f133a698536f44c8884ad81f80b6cfc7")
29+
let map = AGSMap(item: portalItem)
30+
mapView.map = map
31+
32+
// The expansion direction of the floor filter determines which way it will open.
33+
// If the floor filter is placed on the top of the screen, it is recommended to use the style 'down'.
34+
// If floor filter placed on the bottom of the screen, then use 'up'.
35+
let floorFilterVC = FloorFilterViewController.makeFloorFilterView(
36+
geoView: mapView,
37+
expansionDirection: .up
38+
)
39+
self.floorFilterVC = floorFilterVC
40+
floorFilterVC.onSelectedLevelChangedListener = {
41+
print("Level was changed.")
42+
}
43+
44+
// Add floor filter to the current view.
45+
floorFilterVC.view.translatesAutoresizingMaskIntoConstraints = false
46+
addChild(floorFilterVC)
47+
view.addSubview(floorFilterVC.view)
48+
floorFilterVC.didMove(toParent: self)
49+
50+
let leadingConstraint = CGFloat(40)
51+
floorFilterVC.view.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: leadingConstraint).isActive = true
52+
53+
// This places the floor filter at the bottom of the view,
54+
// anchored to the top of the map view's attribution bar.
55+
floorFilterVC.view.bottomAnchor.constraint(equalTo: mapView.attributionTopAnchor, constant: -leadingConstraint).isActive = true
56+
57+
// This places the floor filter at the top of the view,
58+
// just below the top anchor of the safe area layout guide.
59+
// Set the constraint to true and set the bottom constraint to false
60+
floorFilterVC.view.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: leadingConstraint).isActive = false
61+
}
62+
}

Examples/ArcGISToolkitExamples/JobManagerExample.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,8 @@ extension AGSJobStatus {
405405
return "Succeeded"
406406
case .started:
407407
return "Started"
408+
case .canceling:
409+
return "Canceling"
408410
@unknown default:
409411
fatalError("Unknown AGSJobStatus")
410412
}

0 commit comments

Comments
 (0)