मैं MapKit ढांचे का उपयोग कर रहा मेरे आवेदन पर गूगल मैप्स लोड करने के लिए और मैं नक्शा 4 पर जगह "नकली" इस जैसी जगहों:मैपकिट फ्रेमवर्क के साथ कस्टम आइकन का उपयोग कैसे करें?
- (void)viewDidLoad {
[super viewDidLoad];
mapView.delegate = self;
mapView.showsUserLocation = YES;
MKUserLocation *userLocation = mapView.userLocation;
MKCoordinateRegion region =
MKCoordinateRegionMakeWithDistance (userLocation.location.coordinate,500,500);
[mapView setRegion:region animated:NO];
//Simulated annotations on the map
CLLocationCoordinate2D poi1Coord , poi2Coord , poi3Coord , poi4Coord;
//poi1 coordinates
poi1Coord.latitude = 37.78754;
poi1Coord.longitude = -122.40718;
//poi2 coordinates
poi2Coord.latitude = 37.78615;
poi2Coord.longitude = -122.41040;
//poi3 coordinates
poi3Coord.latitude = 37.78472;
poi3Coord.longitude = -122.40516;
//poi4 coordinates
poi4Coord.latitude = 37.78866;
poi4Coord.longitude = -122.40623;
MKPointAnnotation *poi1 = [[MKPointAnnotation alloc] init];
MKPointAnnotation *poi2 = [[MKPointAnnotation alloc] init];
MKPointAnnotation *poi3 = [[MKPointAnnotation alloc] init];
MKPointAnnotation *poi4 = [[MKPointAnnotation alloc] init];
poi1.coordinate = poi1Coord;
poi2.coordinate = poi2Coord;
poi3.coordinate = poi3Coord;
poi4.coordinate = poi4Coord;
poi1.title = @"McDonald's";
poi1.subtitle = @"Best burgers in town";
poi2.title = @"Apple store";
poi2.subtitle = @"Iphone on sales..";
poi3.title = @"Microsoft";
poi3.subtitle = @"Microsoft's headquarters";
poi4.title = @"Post office";
poi4.subtitle = @"You got mail!";
[mapView addAnnotation:poi1];
[mapView addAnnotation:poi2];
[mapView addAnnotation:poi3];
[mapView addAnnotation:poi4];
}
कोड काफी सरल है। मैं अपने Google मानचित्र पर सामान्य लाल पिन का उपयोग करने के बजाय, अलग-अलग स्थानों को दिखाने के लिए अपनी खुद की छवियों का उपयोग करना चाहता हूं। क्या ऐसा करने के लिए एक सरल/सीधा तरीका है, क्योंकि मुझे पहले से मिले नमूने से बहुत उलझन में आया है।
सटीक भ्रम क्या है? आपने क्या प्रयास किया है – Anna