Online Maps v3
Loading...
Searching...
No Matches
OnlineMapsPositionRange Class Reference

Class limiting the coordinates of the map. More...

Public Member Functions

 OnlineMapsPositionRange (float minLat, float minLng, float maxLat, float maxLng, OnlineMapsPositionRangeType type=OnlineMapsPositionRangeType.center)
 Constructor.
 
Vector2 CheckAndFix (Vector2 position)
 Checks and limits geographic coordinates.
 
bool CheckAndFix (ref double lng, ref double lat)
 Checks and limits geographic coordinates.
 
bool InRange (Vector2 position)
 Checks whether the specified geographic coordinates in the range.
 

Public Attributes

float minLat = -90
 Minimum latitude value.
 
float minLng = -180
 Minimum longitude value.
 
float maxLat = 90
 Maximum latitude value.
 
float maxLng = 180
 Maximum longitude value.
 
OnlineMapsPositionRangeType type = OnlineMapsPositionRangeType.center
 Type of limitation position map.
 

Properties

Vector2 center [get]
 Center of range.
 

Detailed Description

Class limiting the coordinates of the map.

Constructor & Destructor Documentation

◆ OnlineMapsPositionRange()

OnlineMapsPositionRange.OnlineMapsPositionRange ( float minLat,
float minLng,
float maxLat,
float maxLng,
OnlineMapsPositionRangeType type = OnlineMapsPositionRangeType::center )

Constructor.

Parameters
minLatMinimum latitude value
minLngMinimum longitude value
maxLatMaximum latitude value
maxLngMaximum longitude value
typeType of position lock

Member Function Documentation

◆ CheckAndFix() [1/2]

bool OnlineMapsPositionRange.CheckAndFix ( ref double lng,
ref double lat )

Checks and limits geographic coordinates.

Parameters
lngLongitude
latLatitude
Returns
True - coordinate changed, False - in other cases.

◆ CheckAndFix() [2/2]

Vector2 OnlineMapsPositionRange.CheckAndFix ( Vector2 position)

Checks and limits geographic coordinates.

Parameters
positionGeographic coordinates
Returns
Geographical coordinates corresponding to the specified range.

◆ InRange()

bool OnlineMapsPositionRange.InRange ( Vector2 position)

Checks whether the specified geographic coordinates in the range.

Parameters
positionGeographic coordinates
Returns
True - coordinates are in the range, False - in other cases.