Basics

Create and add a map

Create an instance of FNOMap and add it to your view controller.

let map = FNOMap(frame: CGRect(x: 0.0, y: 0.0, width: 300.0, height: 300.0)) map.delegate = self self.view.addSubview(map)

FNOMap delegate can be set to know when map has finished loading and is ready.

import FNOSDK -- class ViewController: UIViewController, FNOMapDelegate { ... } -- map.delegate = self -- @objc func mapReady(map: FNOMap) { print("FNOMap is ready !") }

Display map

After creating a FNOMap instance, display content with map id parameter.

public func displayMap(mapId: Int)

Delete map

If you want to change the current map and load a new one, you will need call this event first.

public func destroyMap()

Change container color

This method permits to change the color of a specific container. The color parameter is a hexadecimal value.

public func setContainerColor(color: String, place: Int)

Itinerary

This method is used to set an itinerary from a starting point to a destination point.

public func setItineraryToEntityWithId(id: Int) public func setItineraryToEntityWithId(from: Int, id: Int) public func clearItinerary()

Itinerary Highlight/Unhighlight a specific object on the map

This method is used to highlight or unhighlight a specific object in the map.

@param isOutline: boolean representing if the object needs to be highlighted

@param idContainer: string representing the unique identifier of the map's object

@return void

public func setOutlineContainer(id: Int, active: Bool) public func clearAllOutline() public func setContainerColor(color: String, container: Int)

Zoom

You can get map zoom value with getZoom method. Callback will be made through FNOMap delegate.

public func getZoom() // FNOMapDelegate method @objc optional func getZoom(map: FNOMap, zoom: Float)

Zoom value can be set with these methods (value between 0.0 and 1.0)

public func setZoom(zoom: Float) public func zoomIn() public func zoomOut()

Camera

This method is used to change the camera's perspective of the map.

You can choose between two camera options :

  • TOP : Map camera is placed above the scene without perspective like in 2D

  • FPS : See map or Itinerary at the first person

  • GLOBAL3D : Broad 3D scene view

  • ITINERARY3D : 3D view focus on the itinerary

  • ITINERARY2D : 2D view focus on the itinerary

@param option: .CAMERA_VIEW___OPTIONS representing the camera view option chosen

@return void

// Top = 1 // 2D // FPS = 2 // FPS // Global3D = 3 // Global 3D // Itinerary3D = 4 // 3D Itinerary // Itinerary2D = 5 // 2D Itinerary public func setCameraView(cameraViewOption: CameraViewOption) public func startCameraRotation(speed: Float) public func stopCameraRotation() public func setMoveFpsToTarget(state: Bool)

Waypoints

This method is used to show all the waypoints on the map or hide them. A waypoint is a point of interest where something important is represented. For example, an event or an action to realize.

public func showAllWaypoints() public func hideAllWaypoints()

Datas

This method is used to get all informations about the map, as :

  • ID

  • Rooms name

  • Description

  • Type

  • Asset's information

  • Logos

_ _

public func getAllMetaData()

Floors

public func getFloors() // get all available floors public func setFloors(floor: Int) // set current floor. All other floors are hidden public func resetFloors() // show all floors // FNOMapDelegate @objc optional func floorSelected(data: Any?)


On This Page
Basics