मेरे ऐप में मैं एमके मैप व्यू का उपयोग करके मानचित्र दृश्य पर कुछ जगह दिखा रहा हूं। यह नक्शा ठीक दिखा रहा था। लेकिन कल से यह केवल ग्रिड दिखा रहा है और नक्शा नहीं दिखा रहा है, जब मैं प्रतिनिधि विधि जोड़ता हूं तो यह मैपव्यूडिडफियाल्टोलोड में कभी-कभी जाता है। (MKMapView *) mapView1 viewForAnnotation: (आईडी) एनोटेशन {एमकेएपी देखें दिखा रहा है केवल ग्रिड नक्शा दिखा रहा है
static NSString *identifier = @"PlaceMark";
if ([annotation isKindOfClass:[PlaceMark class]]) {
MKPinAnnotationView *annotationView = (MKPinAnnotationView *) [mapView1 dequeueReusableAnnotationViewWithIdentifier:identifier];
annotationView.tag=[mapView1.annotations count];
if (annotationView == nil) {
annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier];
} else {
annotationView.annotation = annotation;
}
annotationView.enabled = YES;
annotationView.canShowCallout = YES;
return annotationView;
}
return nil;
(MKAnnotationView *) MapView -
मैं नीचे दिए गए कोड
// MapView
myMapView=[[MKMapView alloc] initWithFrame:CGRectMake(0,gameNameLabel.frame.size.height, 320, 181)];
myMapView.mapType=MKMapTypeStandard;
myMapView.delegate=self;
LocationModel *loc=presentGame.location;
NSArray *cordinates=[loc.geoCordinates componentsSeparatedByString:@","];
CLLocationCoordinate2D zoomLocation;
zoomLocation.latitude = [[cordinates objectAtIndex:0] doubleValue];
zoomLocation.longitude= [[cordinates objectAtIndex:1] doubleValue];
MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 0.5*METERS_PER_MILE, 0.5*METERS_PER_MILE);
// 3
MKCoordinateRegion adjustedRegion = [myMapView regionThatFits:viewRegion];
// 4
[myMapView setRegion:adjustedRegion animated:YES]; [scroll addSubview:myMapView];
Place *pin = [[Place alloc] init];
pin.name = loc.gameLocation;
pin.latitude = [[cordinates objectAtIndex:0] doubleValue];
pin.longitude = [[cordinates objectAtIndex:1] doubleValue];
PlaceMark* Place1 = [[PlaceMark alloc] initWithPlace:pin];
Place1.tagg=1;
[myMapView addAnnotation:Place1];
//end of mapview
उपयोग कर रहा हूँ }
METERS_PER_MILE को 160 9.344 और ih के रूप में परिभाषित किया गया है .h फ़ाइल में प्रतिनिधि सेट प्रतिनिधि।
सभी चीज ठीक काम कर रहा था, लेकिन अब यह ग्रिड केवल दिखा रहा है, यह पिन atleaset
आप सतह के बहुत करीब हैं, और इस तरह के संकल्प में पृथ्वी की कोई छवि नहीं है =) कम से कम यह मेरे मामले – Ossir
में कोई मुद्दा नहीं था, इसलिए मैं ऐसा नहीं करता क्योंकि यह कुछ समय मानचित्र प्रदर्शित करता है। कृपया कुछ चीज सुझाएं – user100
अपने इंटरनेट कनेक्शन की जांच करें –