Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mildocjr

macrumors 65816
Original poster
I have a list of locations (1900+) that are stored in Core Data. Each location has 14 properties and several of these will be used to fill out a custom annotation view.

What is the most efficient way to display these on a map?
My constraints are low memory and battery usage, and fastest processing time, with the understanding that these are oppositional.

getlocations {
get the locations from core data
Calculate the distance of all objects and store in a dictionary of [CLLocationCoordinate2D: Int] ([Location: DistanceFromUserInMeters])
}

If the user moved > 1610 M (1 mile) { get the users new location }

if the map moved {
get the maps center location
get the dictionary
get the current zoom level (default is 80,000 M: 50 mile diameter)
adjust distance for each item in dictionary
update locations
update the map
}

update locations {
if location ~= range of 40,000 M (25 miles radius) { append location to array of locations for map }
if locationsArray.isempty { zoom level *= 2 }
}

update map {
add locationsArray to map
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.