I have a coordinate region that I have determined contains the limits of what I want to show for my app. I have set this up as an MKCoordinateRegion with center point lat, longitude and a span. How do I determine if the current userLocation is inside of my coordinate region?
相关问题
- I want to read exif info in image in android. I ca
- what is the difference between bounded and unbound
- Stop location updates when app terminate
- didSelectViewController method not being called (w
- Can Google Maps plot points based on Hours Minutes
相关文章
- Popover segue to static cell UITableView causes co
- Creating UIImage from CIImage
- Zoom to fit current location and annotation on map
- UIAlertViewStylePlainTextInput return key delegate
- AVCaptureDeviceOutput not calling delegate method
- How to call an action when UISwitch changes state?
- Is there way to programmatically enable GPS on And
- Making any tweet favourite through iOS 5 twitter A
Swift 3 version of firstresponder's answer:
Pretty much the same. This API has not been Swift-ified (i.e., updated to conform to the Swift API design guidelines) yet. It really should be...
There is a simple solution to decide if a point is inside your area if the area is given by a polygon using the ray casting algorithm: See here http://en.wikipedia.org/wiki/Point_in_polygon
As a starting point use a location guaranteed to be outside your region, e.g. (geographic) north pole.
Use map rects. Here's an example using the map's current visible rect. With regards to your question, you could use
convertRegion:toRectToView:
to first convert your region to aMKMapRect
beforehand.