Skip to content

Conversation

@robertibiris
Copy link

-Before, the minimum Zoom level to perform clustering was defined by the property 'minLongitudeDeltaToCluster'. The problem With this approach is that the equivalent value for 1 degree of Longitude values vary (according to latitude values) from 0 meters in the poles, to 111319.46 meters in the equator. This means that if we set:

minLongitudeDeltaToCluster = 1.0

If the latitude is 90 or -90, it will ALWAYS perform clustering, and if the latitude is 0, it will perform clustering when we zoom out the equivalent to 111 Kilometers.

On the other hand, Latitude distances does not vary in such a big way, and are therefore a better way to reference the current level of zoom.

-Based on this principle, I've added the property

@property(nonatomic, assign) CLLocationDegrees minLatitudeDeltaToCluster;

The ideal thing would be to completely remove the minLongitudeDeltaToCluster property, but considering compatibility issues, it's been Deprecated:

@property(nonatomic, assign) CLLocationDegrees minLongitudeDeltaToCluster DEPRECATED_MSG_ATTRIBUTE("Use minLatitudeDeltaToCluster instead.");

Right Now the algorithm considers BOTH parameters when evaluating the zoom level, but on the next release it should only use the minLatitudeDeltaToCluster value.

I hope it was helpful =)

Roberto Arreaza added 2 commits September 9, 2014 15:17
…t a zoom level to perform clustering. the reason behind this is because Longitude distances vary too much depending on the latitude value, but latitude does not, thus making it a more suitable value to use for the task.

-deprecated the previous  minLongitudeDeltaToCluster so that in the next version it will be completely removed (for now it takes both latitude and longitude values into account, to keep version compatibility).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant