UtilsControllerInterface
public protocol UtilsControllerInterface
-
Calculates distance in meters between two mercator points
Declaration
Swift
func getDistance(m1: MNMercator, m2: MNMercator) -> Double
Parameters
m1
The first point (mercator)
m2
The second point (mercator)
Return Value
Distance between m1 and m2
-
Calculates distance in meters between two points each with a latitude/longitude value
Declaration
Swift
func getDistance(l1: MNLatLng, l2: MNLatLng) -> Double
Parameters
l1
The first location (latitude/longitude)
l2
The second location (latitude/longitude)
Return Value
Distance between m1 and m2
-
Calculates distance from a point to a polygon
Declaration
Swift
func getDistFromPointToPolygon(point: MNMercator, polygon: [MNMercator]) -> Double
Parameters
point
A mercator point
polygon
A polygon defined by a list of mercator points
Return Value
Distance between point and polygon
-
Checks whether a point is inside the boundary of a polygon
Declaration
Swift
func isPointInPolygon(point: MNMercator, polygon: [MNMercator]) -> Bool
Parameters
point
A mercator point
polygon
A polygon defined by a list of mercator points
Return Value
true if the point lies inside the boundaries of the polygon
-
Attempts to find a property and building in which the point lies
Declaration
Swift
func findPropertyAndBuilding(point: MNMercator) -> MNZone?
Parameters
point
A mercator point
Return Value
A possible property/building zone in which the point lies
-
Call this function to perform intelligent search on the list of searchables based on a search string.
Declaration
Swift
func filterAndSortSearchables(input: String, listOfSearchables: [ISearchable]) -> [ISearchable]
Parameters
input
The string to search for
listOfSearchables
The string to search for
Return Value
A list of searchables filtered for input and sorted by best match
-
Call this function to perform search of an entity inside a property
Declaration
Swift
func findEntityByName(name: String) -> [ISearchable]
Parameters
name
The name of the entity to search for
propertyId
An identifier for the property
Return Value
A list of searchables matching the name
-
Declaration
Swift
func fetchOnlineSearch(propertyId: Int, text: String, lang: String, page: Int, limit: Int, completion: ((CMSOnlineSearchResultInfo?) -> Void)?)
-
Declaration
Swift
func fetchDestinationInstruction(propertyId: Int, completion: @escaping ((Bool) -> Void))
-
Call this function to get the session Id once the sdk is iniitalized
Declaration
Swift
func getSessionId() -> String?
Return Value
SessionId. It is an optional value.