Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 19th, 2012  |  syntax: None  |  size: 0.57 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Find nearby locations in a given region
  2. MKCoordinateRegion *mapRegion = myMap.region;
  3.        
  4. maxLatitude = mapRegion.center.latitude + mapRegion.span.latitudeDelta/2;
  5. minLatitude = mapRegion.center.latitude - mapRegion.span.latitudeDelta/2;
  6.  
  7. maxLongitude = mapRegion.center.longitude+ mapRegion.span.longitudeDelta/2;
  8. minLongitude = mapRegion.center.longitude- mapRegion.span.longitudeDelta/2;
  9.        
  10. find all locations where latitude > mapMinLat
  11.                      and latitude < mapMaxLat
  12.                      and longitude > mapMinLon
  13.                      and longitude < mapMaxLon