VMWalkingPathOverlayUtil
@interface VMWalkingPathOverlayUtil : NSObject
This is a utility class that performs various calculations for walking path related objects.
Since
1.1-
Figure out the closest mapped waypoint to a user-tapped location
Declaration
Swift
+ (VMMSWaypoint *)findClosestWaypointAtLocation:(CLLocationCoordinate2D)location onFloor:(NSString *)floorKey inMap:(VMMSMap *)map;Parameters
locationthe location
floorKeythe floor to search on
Return Value
the closest waypoint
-
Determines the geographic boudaries that encapsulates the part of a waypath on a given floor
Declaration
Swift
+ (VMMSCoordinateBounds *)boundsForWaypath:(VMMSWaypath *)waypath onFloor:(NSString *)floorKey;Parameters
waypaththe waypath
floorKeythe floor uid
Return Value
a VMMSCoordinateBounds object
-
Determines the geographic boundaries that encapsulates the given waypath segment
Declaration
Swift
+ (VMMSCoordinateBounds *)boundsForSegment:(VMMSWaypathSegment *)segment;Parameters
segmentthe segment
Return Value
a VMMSCoordinateBounds object
-
Determines the geographic boundaries that encapsulates the given floor
Since
1.2Declaration
Swift
+ (VMMSCoordinateBounds *)boundsForFloor:(VMMSBaseFloor *)floor;Parameters
floorthe floor to calculate the boundary for
-
Determine the geographic boundaries that encapsulates the given building
Since
1.2Declaration
Swift
+ (VMMSCoordinateBounds *)boundsForBuilding:(VMMSBaseBuilding *)building;Parameters
buildingthe building to calculate the boundary for
-
Determine geographic boundaries of a list of coordinates
Since
1.2Declaration
Swift
+ (VMMSCoordinateBounds *)boundsForCoordinates: (NSArray<NSValue *> *)coordinates;Parameters
coordinatesthe list of coordintes to calculate the boundary for
-
Combine multiple coordinate bounds into a single one.
Since
1.2Declaration
Swift
+ (VMMSCoordinateBounds *)unionOfCoordinateBounds: (NSArray<VMMSCoordinateBounds *> *)bounds;Parameters
boundsa list of bounds to merge
-
Calculates the zoom needed to display the entire bounds on google maps.
Declaration
Swift
+ (float)getBoundsZoomLevel:(VMMSCoordinateBounds *)bounds mapWidth:(NSInteger)mapWidthPx mapHeight:(NSInteger)mapHeightPx;Parameters
boundsthe bounds of the area to zoom
mapWidthPxthe width of the map in pixels
mapHeightPxthe height of the map in pixels
Return Value
the zoom level required to fit the specified bounds into specified width/height, limited to the default maximum zoom
-
Calculates the zoom needed to display the entire bounds on a map.
Since
Since 1.2Declaration
Swift
+ (float)getBoundsZoomLevel:(VMMSCoordinateBounds *)bounds mapWidth:(NSInteger)mapWidthPx mapHeight:(NSInteger)mapHeightPx maxZoom:(float)maxZoom;Parameters
boundsthe bounds of the area to zoom
mapWidthPxthe width of the map in pixels
mapHeightPxthe height of the map in pixels
maxZoomthe max allowable zoom level
Return Value
the zoom level required to fit the specified bounds into specified width/height, limited to the specified maximum zoom
-
Rotates a coordinate around a center point
Declaration
Swift
+ (CLLocationCoordinate2D)rotateCoordinate:(CLLocationCoordinate2D)coordinate withCenter:(CLLocationCoordinate2D)center andBearing:(double)bearing;Parameters
coordinatethe coordinate to rotate
centerthe point to rotate around
bearingthe amount to rotate (in DEGREES)
Return Value
a new coordinate that is the result of the rotation
-
Useful for debugging. This method maps a fill color depending on the waypoint’s type, so it is possible to visually inspect that all waypoints were loaded as intended.
Declaration
Swift
+ (id)colorForWaypoint:(VMMSWaypoint *)wp;Parameters
wpthe waypoint
Return Value
the color
-
Useful for debugging. This method maps a stroke color depending on whether the waypoint is classified as indoor or outdoor.
Declaration
Swift
+ (id)strokeColorForWaypoint:(VMMSWaypoint *)wp;Parameters
wpthe waypoint
Return Value
the color
-
Locate the closest waypoint to a target from a list
Declaration
Swift
+ (VMMSWaypoint *) findClosestDestinationWaypointInList:(CLLocationCoordinate2D)location inList:(NSArray<VMMSWaypoint *> *)list;Parameters
locationthe target location
lista list of waypoints (hopefully nearby)
Return Value
the closest waypoint by distances
VMWalkingPathOverlayUtil Class Reference