FUIEsriMapFloorplanViewController
A subclass of FUIMapFloorplanViewController
designed to be used with ArcGIS framework. You can use it to display business objects(points, polylines, polygons) on the map view and view details by selecting a business object. It also supports clustering of point geometries.
Usage
The map view consists of mutiple FUIGeometryLayer
s. By assigning geometries onto different layers, you can show/hide all geometries on a specified layer using setLayerHidden(_:hidden:) api.
- Implement
FUIEsriMapViewDataSource
methods.
In the floorplan controller viewDidLoad() set the datasource.
self.dataSource = dataSource
func numberOfLayers(in mapView: AGSMapView) -> Int {
return 1
}
func mapView(_ mapView: AGSMapView, layerAtIndex index: Int) -> FUIGeometryLayer {
return FUIGeometryLayer("Functional Location")
}
func mapView(_ mapView: AGSMapView, geometriesForLayer layer: FUIGeometryLayer) -> [AGSGeometry] {
return geometries
}
You can also use native ArcGIS api to add graphics to map view. But the
FUIEsriMapViewDelegate
object is not able to manage these graphics.
- Implement
FUIEsriMapViewDelegate
methods as needed.
Determine the visual presentation of the geometry. (color, size, etc)
func mapView(_ mapView: AGSMapView, willRender graphic: AGSGraphic, forGeometryAtIndex index: Int, in layer: FUIGeometryLayer, in state: FUIMapFloorplan.State) {
graphic.symbol = customizedSymbol
}
func mapView(_ mapView: AGSMapView, willRender clusterGraphic: AGSGraphic, for geometryIndexesInLayers: [FUIGeometryLayer : [Int]], in state: FUIMapFloorplan.State) {
clusterGraphic.symbol = customizedSymbol
}
Respond to select/deselect action
func mapView(_ mapView: AGSMapView, didSelect geometry: AGSGeometry, at index: Int, in layer: FUIGeometryLayer) {}
func mapView(_ mapView: AGSMapView, didSelect geometries: [AGSGeometry], at geometryIndexesInLayers: [FUIGeometryLayer: [Int]]) {}
func mapView(_ mapView: AGSMapView, didDeselect geometry: AGSGeometry, at index: Int, in layer: FUIGeometryLayer) {}
func mapView(_ mapView: AGSMapView, didDeselect geometries: [AGSGeometry], at geometryIndexesInLayers: [FUIGeometryLayer: [Int]]) {}
Theming
-
Hide/show graphics on a specific layer.
-
Select a geometry at the specified index in a layer.
-
Deselect the geometry which is currently selected.