I request from my server a list of places that are closest to the user, based on his observed part of the map.
I'm not quite sure how to do this, but should I send the center of lat and long to the map's scope and then search for results based on the nearest radius?
I know that it MKMapView
has two properties called region
and visibleMapRect
. Should I use one of them, and if so, which one is more suitable for my question?
EDIT
I'm looking to implement functionality that is identical to Apple maps and the Yelp app when you search for nearby locations, and shows what is important based on the visible part of the map view.
EDIT 2
I saw how many people split their visible part mapview
into quadrants, most often into NW, NE, SW, and SE. However, I'm still not quite sure why they are doing this. I would like to know how best to request a back end that contains lat and long for each location to find the locations that exist in mapview
.
I looked everywhere on stackoverflow, and I found a similar question here . However, he does not answer my question and is not mentioned visibleMapRect
, because he is more than 5 years old.
Any help is greatly appreciated.
source
share