I am using a special Map SDK for iOS and I am adding a custom shape to the map. The shape is always a different size and it could be a circle, square, star etc. the point being it is always dynamic whenever the app is run.
After adding this shape to the map, I can access it's property called overlayBounds
which is described as: This property contains the smallest rectangle that completely encompasses the overlay.
The overlay
is my shape that I'm adding to the map.
Whenever a location update is generated by CLLocationManager
, I want to check and see if the most recent coordinate is inside of that overlayBounds
property of the shape.
When accessing overlayBounds
, it has an ne
property and a sw
property. Both of these are just CLLocationCoordinate2D's
So, if the overlayBounds
is made up of two CLLocationCoordinate2D's
and the CLLocationManager
is always updating the user's location and giving me the most recent coordinate(CLLocationCoordinate2D
), how can I check if that most recent coordinate is within the overlayBounds
?
After doing a lot of research I have only found one potential solution to go off of which is this: https://stackoverflow.com/a/30434618/3344977
But that answer assumes that my overlayBounds
property has 4 coordinates(CLLocationCoordinate2D's
), when I only have 2.