@Akashdeep ,
You need to decide how many "points" you want to use and wLat1/wLong1 would become wLat2/wLong2 etc etc. You would set a Variable on each
UpdateContext(
{
varDist1:
With(
{
wLat1: YourBoundary1Latitude,
wLat2: Location.Latitude,
wLong1: YourBoundary1Longitude
wLong2: Location.Longitude,
wCalc: 17.4532925199432
},
12742 * Asin(Sqrt(0.5 - Cos((wLat1 - wLat2) * wCalc)/2 +
Cos(wLat1 * wCalc) * Cos(wLat2 * wCalc) *
(1 - Cos((wLong1 - wLong2) * wCalc)) / 2))
)
}
)
so you would have (say) four variables varDist1-4, then test if any of them are bigger than the limit you set, which should be the greatest distance between any two of them.
UpdateContext(
{
varGeoOK:
varDist1 < YourDistance &&
varDist2 < YourDistance &&
varDist3 < YourDistance &&
varDist4 < YourDistance
}
)
This will return true if OK and false if not. NOTE: I have converted it to metres in the above.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.