0

I'm hoping for a straightforward way to display up to 200 points in a Map at once without degrading performance when the user is zoomed out and all of them are on the screen.

We have a draw order of priority and the most important ones are above the others. How can I hide the ones underneath until the user zooms into a specific area?

Ben Guild
  • 4,881
  • 7
  • 34
  • 60

1 Answers1

1

you can use these delegate methods to determine which region and the zoom level is being shown and show the points accordingly...

– mapView:regionWillChangeAnimated:
– mapView:regionDidChangeAnimated:

refer apple docs for more info..

Ankit Srivastava
  • 12,347
  • 11
  • 63
  • 115
  • So, how would you calculate something like the size of the marker in pixels in relation to the zoom level and spacing between markers to show or hide the additional points? – Ben Guild Jun 17 '12 at 13:32
  • So, basically, divide the amount of distance between the minimums and maximums by the Map's physical pixel dimensions to get the distance per pixel, and calculate whether or not the size of the markers itself are colliding with another nearby based on the markers' latitude and longitude? – Ben Guild Jun 17 '12 at 22:24
  • your exact requirements are not clear to me.. I just gave you an idea how something like this can be done. – Ankit Srivastava Jun 18 '12 at 04:36
  • Basically, let's say I have 100 points for a map, and 80 are very close to each other. If I zoom out to show all points ... it'll stack 80 and show the other 20. I'm trying to get it so that at a lesser zoom, it will only show 21 points... only showing 1 of the 80 that are close to each other. – Ben Guild Jun 18 '12 at 09:17