FUIMapFloorplanViewController
open class FUIMapFloorplanViewController<InnerView, EditingGeometryWrapper, EditingTypes> : FUIBaseDrawingViewController<InnerView>, FUIMapFloorplanComponent, SharedModelObserver where InnerView : FUIMapFloorplanContentView, EditingGeometryWrapper : FUIManageRepresentation, EditingTypes : FUIGeometryTypeWrapper
A generic map floorplan view controller that supports creating new geometry, editing geometry and save geometry. In general, you do not subclass this class directly. Use FUIMKMapFloorplanViewController
(MapKit) or FUIEsriMapFloorplanViewController
(ArcGIS) instead.
[Summary Header]
[Image]
Views Available in FUIMapFloorplanViewController:
detailPanel
: Displays a resizing panel that holds the search controller, content controller, and edit controller. The panel resizes based on the presented controllerpreferredContentSize
.toolbar
: A view that contains toolbar buttons for easy access to common map functionalities. Default toolbar buttons are provided.legend
: A view that shows mapAnnotations and their title.settingsController
: A controller presented as aformSheet
over the map allowing for customization of the map.createGeometryResultsController
: A controller presented when a geometry is saved. Allows for additional configuration before commiting the geometry.
Variables Available in FUIMapFloorplanViewController:
isEditable
: ABool
that prepares the floorplan for editing.createGeometryItems
: An array that displays workorders to create in editing mode. The contents are displayed in a table and on cell selection displays the editing panel.isCreatePointEnabled
: ABool
that enables editing of point geometries.isCreatePolylineEnabled
: ABool
that enables editing of polyline geometries.isCreatePolygonEnabled
: ABool
that enables editing of polygon geometries.
Usage
override func viewDidLoad() {
detailPanel.search.tableView.dataSource = dataSource
detailPanel.content.tableView.dataSource = dataSource
legend.items = items
settingsController = controller
createGeometryResultsController = controller
}
Editing Interaction:
The floorplan supports editing to allow users to add geometries (points, polylines, and polygons) by drawing directly on the map.
A floorplan subclass can become editable by setting isEditable
. The view controller will transition to an editing state by setting all other annotations to disabled, showing editing toolbar buttons, and presenting the editing panel. The +
right bar button presents a popover allowing the user to select a geometry.
Once the panel is presented, a user can toggle between geometry types (points, polylines, and polygons) to edit. The user can draw directly on the map by tapping on screen. The editing tool bar buttons show how the user can interact with the map. When the add Button is selected, the user can tap to add points. When the delete button is selected, a user can tap a point to delete. Actions can be undone and redone with the undo and redo buttons. Lastly the branch button can extend a polyline or polygon. To edit existing points the user can use the long press gesture to drag points to new locations.
Alternatively, A user can edit existing points using the panel. The user can input directly an address and a list of suggestions will be presented. Tapping on a suggestion will add the point to the map. To delete, tap the red circle to show the red delete button. Tap delete to remove the point. Reordering points is done by dragging cells amongst each other.
To save, tap the save button. This will launch the developer’s createGeometryResultsController
where the user can make additional changes to the workorder. Tapping the save right bar button dismisses the controller and exits the editing state. It is up to the developer to update his model with the saved geometry.
-
Bool
property that prepares the floorplan for editing. When editable, floorplan displays a+
to begin creating a geometry.Declaration
Swift
open var isEditable: Bool { get set }
-
Reload all geometries from the data source.
Those geometries added using
MKMapView
‘s api(i.e.addAnnotation(_:)
andaddOverlay(_:)
) will not be affected.Declaration
Swift
open func reloadData()
-
A view controller contained in a formSheet. Provides interface to update settings on the map floorplan.
Declaration
Swift
public var settingsController: UIViewController?
-
A dynamic UI control constrained to the top left corner of the map. The
detailPanel
displays thesearchResults
andcontent
. Its size is determined by the presented controller’spreferredContentSize
.Declaration
Swift
public var detailPanel: FUIMapDetailPanel! { get }
-
A view that displays an array of
FUIMapToolbarButton
. Thetoolbar
provides easy access to common map functionalities. The view is constrained to the top right corner of the map and resizes to fit the number ofFUIMapToolbarButton
items.Declaration
Swift
public var toolbar: FUIMapToolbar! { get }
-
A view controller that displays map annotation information. It displays an array of
FUIMapLegendItem
and is presented in aUIPopoverPresentationController
Declaration
Swift
public var legend: FUIMapLegend
-
Called before the editing panel is pushed.
Declaration
Swift
open func editingPanelWillAppear(createItem: FUIMapLegendItem)
Parameters
createItem
The item that is currently being edited.