mapkit

How to call pin annotation on button click in iPhone

我只是一个虾纸丫 提交于 2019-12-02 10:30:04
问题 I dont want pin to be call directly on map, I want this on button action to call pin annotation. When I call this method on button click event my app was crash. I want to call annotation on button click. Can I call this all method on button? - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { MKPinAnnotationView *pin = (MKPinAnnotationView *) [self.map dequeueReusableAnnotationViewWithIdentifier: @"restMap"]; if (pin == nil) { pin = [[

Custom annotation move animation IOS Swift Like Ola Uber App MapKit Swift [duplicate]

守給你的承諾、 提交于 2019-12-02 10:21:21
This question already has an answer here: move animation with custom annotation IOS Swift Like Ola Uber App MapKit 1 answer Move the annotation on Map like Uber iOS application 1 answer This is repost. I want to move custom annotation with animation like Ola uber car with rotation. Please only provide solution in SWIFT Here is que link move animation with custom annotation IOS Swift Like Ola Uber App MapKit I only know swift 来源: https://stackoverflow.com/questions/48394319/custom-annotation-move-animation-ios-swift-like-ola-uber-app-mapkit-swift

Adding a custom annotation to a MKMapview

喜你入骨 提交于 2019-12-02 09:14:55
I am trying to add annotations to a MKMapView I have created a class CustomMapPin which conforms to the MKAnnotation protocol #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface CustomMapPin : NSObject <MKAnnotation> { CLLocationCoordinate2D coordinate; NSString *title; NSString *subtitle; } @property(nonatomic, assign) CLLocationCoordinate2D coordinate; @property(nonatomic, copy) NSString *title; @property(nonatomic, copy) NSString *subtitle; @property(nonatomic, strong) NSString *type; // this is to differentiate between the different annotations on the map @end I have

Displaying custom multiple pins shows wrong pins for locations

假装没事ソ 提交于 2019-12-02 08:47:19
问题 This problem has been bugging me for a couple of weeks already! I have a tab bar application. On one tab I am entering points, and on another tab, the points are displayed on a map. Pins should be different dependent on the types of points. The problem that I face is that every time I switch from one tab to another, the pin images change from what they should be to other images. For example, if I have four points on the map, three displayed as a circle and one as a triangle, the triangle will

Why MKCoordinateSpan changes?

心不动则不痛 提交于 2019-12-02 08:32:06
When I debug code below, I see that span is changed by mapkit from what I have provided. span2 contains different numbers from what was provided. Why is this happening? - (void) viewDidLoad { [super viewDidLoad]; CLLocationCoordinate2D loc; loc.latitude = self.atm.lat; loc.longitude = self.atm.lon; MKCoordinateSpan span1 = MKCoordinateSpanMake(0.05f, 0.05f); self.mapView.region = MKCoordinateRegionMake(loc, span1); // at this point numbers are not 0.05 anymore MKCoordinateSpan span2 = self.mapView.region.span; // ... more code } Note that latitude and longitude change differently so square

Getting the title to show up when map loads with mkmap

若如初见. 提交于 2019-12-02 08:23:55
问题 I am able to get a map to show up and a pin to drop where I want in my iphone app project, but I want the title and subtitle to appear when the view loads. Here is the code I'm using. I thought putting in [mapView selectAnnotation:annotation animated:YES]; would work, but it doesn't. Does anyone know how to do this? Thanks CLLocationCoordinate2D coord = {latitude: 32.02008, longitude: -108.479707}; [self.view addSubview:mapView]; MapController *annotation = [[MapController alloc]

How to get Apple Maps App (not MapKit) to add an annotation?

旧时模样 提交于 2019-12-02 06:17:15
It's quite easy to add an annotation to a MapKit view which is inside your app . theMap: MKMapView! let pa = MKPointAnnotation() pa.title = "title!!" etc theMap.addAnnotation(pa) But how the heck do you make the Maps App add an annotation?? Here's exactly how to open the Maps App to a certain address.. func appleMapApp() { quickAddressText = "123 Smith St 90210" let bottomText = "This shows at BOTTOM Of Maps App screen." let g = CLGeocoder() g.geocodeAddressString(quickAddressText) { placemarks, error in if let found = placemarks?.first, let lok = found.location { let p = MKPlacemark

How to call pin annotation on button click in iPhone

旧巷老猫 提交于 2019-12-02 06:15:49
I dont want pin to be call directly on map, I want this on button action to call pin annotation. When I call this method on button click event my app was crash. I want to call annotation on button click. Can I call this all method on button? - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { MKPinAnnotationView *pin = (MKPinAnnotationView *) [self.map dequeueReusableAnnotationViewWithIdentifier: @"restMap"]; if (pin == nil) { pin = [[[MKPinAnnotationView alloc] initWithAnnotation: annotation reuseIdentifier: @"restMap"] autorelease]; } else {

Displaying custom multiple pins shows wrong pins for locations

自作多情 提交于 2019-12-02 05:31:36
This problem has been bugging me for a couple of weeks already! I have a tab bar application. On one tab I am entering points, and on another tab, the points are displayed on a map. Pins should be different dependent on the types of points. The problem that I face is that every time I switch from one tab to another, the pin images change from what they should be to other images. For example, if I have four points on the map, three displayed as a circle and one as a triangle, the triangle will be moving around from one point to another. Images seem to change quite randomly. So, this is the code

How to call a segue from a disclosure button on a map pin?

杀马特。学长 韩版系。学妹 提交于 2019-12-02 05:20:44
I have an app that plots pins on a mapview. Each pin uses this code to display a detail disclosure button, which when tapped calls a showDetail method which then calls the prepareForSegue method. Im thinking there is a lot of extra work here. Should I eliminate the showDetail and just call the prepareForSegue method? but how would I pass in the MyLocation object? Here is the code: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { static NSString *identifier = @"MyLocation"; if ([annotation isKindOfClass:[MyLocation class]]) { //test if