ios - CLLocationCoordinate2D distance between two points considering zoom level -


i'm trying create solid clustering mechanism using subclass of mkmapview. came across task have i've been banging head against wall quite time - grouping annotations single cluster when they're overlapping 1 another. can distance in meters between 2 annotations, how can distance relative zoom level (latitudedelta)? ideally know when 2 annotations overlap each other considering width , height example 40x40.

you can use convertcoordinate:topointtoview: location of actual screen point annotation:

cgpoint annotationpoint = [self.mapview convertcoordinate:annotation.coordinate                                              topointtoview:self.mapview]; 

after that, use trigonometry skills find distance between 2 points.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -