-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from Esri/v.next
V.next
- Loading branch information
Showing
30 changed files
with
1,485 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# FloorFilter | ||
|
||
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. | ||
|
||
The ArcGIS Runtime SDK currently supports filtering a 2D floor aware map based on the sites, buildings, or levels in the map. | ||
|
||
<img src="https://user-images.githubusercontent.com/3998072/163230061-6578a899-2167-4bb1-b6a5-65651931f2c7.png" width="512" height="384"> | ||
|
||
### Behavior | ||
|
||
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. | ||
|
||
### Usage | ||
|
||
```swift | ||
|
||
addChild(floorFilterViewController) | ||
view.addSubview(floorFilterViewController.view) | ||
floorFilterViewController.didMove(toParent: self) | ||
|
||
``` | ||
|
||
To see it in action, try out the [Examples](../../Examples) and refer to [FloorFilterExample.swift](../../Examples/ArcGISToolkitExamples/FloorFilterExample.swift) in the project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// Copyright 2022 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 Foundation | ||
import UIKit | ||
import ArcGIS | ||
import ArcGISToolkit | ||
|
||
class FloorFilterExample: MapViewController { | ||
var floorFilterVC: FloorFilterViewController? | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
// Create the map from a portal item and assign to the mapView. | ||
let portal = AGSPortal(url: URL(string: "https://indoors.maps.arcgis.com/")!, loginRequired: false) | ||
let portalItem = AGSPortalItem(portal: portal, itemID: "f133a698536f44c8884ad81f80b6cfc7") | ||
let map = AGSMap(item: portalItem) | ||
mapView.map = map | ||
|
||
// The expansion direction of the floor filter determines which way it will open. | ||
// If the floor filter is placed on the top of the screen, it is recommended to use the style 'down'. | ||
// If floor filter placed on the bottom of the screen, then use 'up'. | ||
let floorFilterVC = FloorFilterViewController.makeFloorFilterView( | ||
geoView: mapView, | ||
expansionDirection: .up | ||
) | ||
self.floorFilterVC = floorFilterVC | ||
floorFilterVC.onSelectedLevelChangedListener = { | ||
print("Level was changed.") | ||
} | ||
|
||
// Add floor filter to the current view. | ||
floorFilterVC.view.translatesAutoresizingMaskIntoConstraints = false | ||
addChild(floorFilterVC) | ||
view.addSubview(floorFilterVC.view) | ||
floorFilterVC.didMove(toParent: self) | ||
|
||
let leadingConstraint = CGFloat(40) | ||
floorFilterVC.view.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: leadingConstraint).isActive = true | ||
|
||
// This places the floor filter at the bottom of the view, | ||
// anchored to the top of the map view's attribution bar. | ||
floorFilterVC.view.bottomAnchor.constraint(equalTo: mapView.attributionTopAnchor, constant: -leadingConstraint).isActive = true | ||
|
||
// This places the floor filter at the top of the view, | ||
// just below the top anchor of the safe area layout guide. | ||
// Set the constraint to true and set the bottom constraint to false | ||
floorFilterVC.view.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: leadingConstraint).isActive = false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.