में बाएं-शीर्ष और दाएं-नीचे अक्षांश और मानचित्र का देशांतर कैसे प्राप्त करें मैपकिट में बाएं-शीर्ष और दाएं-नीचे अक्षांश और मानचित्र का देशांतर कैसे प्राप्त करें? मैं इस कोड का उपयोग करता हूं, लेकिन यह ठीक से काम नहीं करता है। मुझे इसे कैसे ठीक करना चाहिए?मैपकिट
MKCoordinateRegion region = [map region];
double topL,topG,bottomL,bottomG;
//if latitude=55 and latitudeDelta=126 topL is 118 and it will be not at top, it will be at buttom of screen
topL = region.center.latitude + region.span.latitudeDelta/2;
topG = region.center.longitude - region.span.longitudeDelta/2;
CLLocationCoordinate2D lt;
lt.latitude=topL;
lt.longitude=topG;
annotation = [Annotation new];
annotation.coordinate = lt;
annotation.title = @"Left";
[map addAnnotation:annotation];
[annotation release];
//if latitude=55 and latitudeDelta=126 bottomL is -7.23 and it will be not at bottom, it will be at above bottom of screen
bottomL = region.center.latitude - region.span.latitudeDelta/2;
bottomG = region.center.longitude + region.span.longitudeDelta/2;
CLLocationCoordinate2D rb;
rb.latitude=bottomL;
rb.longitude=bottomG;
annotation = [Annotation new];
annotation.coordinate = rb;
annotation.title = @"Right";
[map addAnnotation:annotation];
[annotation release];
धन्यवाद, यह काम करता है! :) –