mkannotationview

Selecting a MapView Annotation Twice

风格不统一 提交于 2019-12-12 10:58:58
问题 My iPhone app has a mapview with a large number of locations that the user can select from. I would like him to be able to tap on one of the annotations to display its callout view, and then again to actually select it. The problem is that the didSelectAnnotationView only gets called once. So how can I detect the selection an already selected annotation? Alternatively, how can I deselect an annotation without hiding the callout view? The user can work round this by deselecting the annotation

Prevent touch events on MKMapView being detected when a MKAnnotation is tapped

荒凉一梦 提交于 2019-12-12 09:43:18
问题 I have a UITapGestureRecognizer that will hide and show a toolbar over my MKMap when the user taps the Map - simple. However, when the user taps on an MKMapAnnotation, I do not want the map to respond to a tap in the normal way (above). Additionally, when the user taps elsewhere on the map to de-select an MKAnnotation callout, I also don't want the toolbar to respond. So, the toolbar should only respond when there are no MKAnnotations currently in selected state. Nor should it respond when

How to Hide MKAnnotationView Callout?

假如想象 提交于 2019-12-12 07:45:09
问题 i'm trying to hide an AnnotationView without touching the pin, is the possible? Thanks! for (id currentAnnotation in self.mapView.annotations) { if ([currentAnnotation isKindOfClass:[MyAnnotation class]]) { } } 回答1: Do you just want to make the callout bubble go away but keep the pin? If yes, then do this: for (id currentAnnotation in self.mapView.annotations) { if ([currentAnnotation isKindOfClass:[MyAnnotation class]]) { [self.mapView deselectAnnotation:currentAnnotation animated:YES]; } }

didSelectAnnotationView called automatically when custom annotations are added to mapView

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 03:17:24
问题 Am trying to add custom annotations on MKMapView and implement custom callOut view on tap of annotation. Am following this link for the same. The issue is when I add the custom annotation didSelectAnnotationView is called on its own and the popOver callout is shown, even when the user has not clicked the annotation Here is my code: -(void)callAddAnnotationsLocal{ [_mapView removeAnnotations:[_mapView annotations]]; CLLocationCoordinate2D coord = {.latitude = 43.3998170679, .longitude = -95

iOS Swift MapKit why MKPointAnnotation is draggable while a class that conforms MKAnnotation is not

霸气de小男生 提交于 2019-12-12 02:13:37
问题 i have a class that is a subclass of NSManagedObject that conform to MKAnnotation and then i use that in a MapView that dequeues some locations from CoreData class Location: NSManagedObject , MKAnnotation { var coordinate : CLLocationCoordinate2D { return CLLocationCoordinate2D(latitude: Double(self.latitude), longitude: Double(self.longitude)) } var title: String? { return self.name } var subtitle: String? { return self.category } } i then add the fetched objects to the MapView as

Several and different custom Pins in the same mapView

半腔热情 提交于 2019-12-12 01:12:25
问题 This is my question.... I have a mapView and i fill the view with several custom pins. I would different custom pins in my mapView. I have tried with an IF condition but don't work. I don't understand how the called to method works. Follow the code. Vi allego il codice. //Customization of my pins - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation(id<MKAnnotation>)annotation{ static NSString *identifier = @""; MKAnnotationView *pin = [ mappa

Why are my annotations not appearing in my map view?

南笙酒味 提交于 2019-12-11 18:08:54
问题 I have created a set of "IssueLocation"'s, a class which conforms to the MKAnnotation protocol. Why are my annotations (built from API JSON data) not appearing in my map view ? Here is the code behind it all: Class code: class IssueLocation: NSObject, MKAnnotation { var locationName: String var campusName: String var latitude: Double var longitude: Double var coordinate: CLLocationCoordinate2D init(locationName: String, campusName: String, latitude: Double, longitude: Double, coordinate:

MKAnnotationView image changing issue

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 12:30:05
问题 I've got an MKMapView loaded with plenty of custom annotation (800 circa). When I drag on the map and I return to an annotation, it's image has changed with another one. For me it's seems like a cache issue. Pin before dragging Pin after dragging SuperClass header #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface MapAnnotation : NSObject <MKAnnotation> @property (nonatomic, copy) NSString *title; @property NSString * pinImageName; @property (nonatomic)

Swift - adding a button to my MKPointAnnotation

不想你离开。 提交于 2019-12-11 12:00:00
问题 On Swift 1.2 : I'd like to add a button to my annotations on the map. First tap on pin shows user's id, and this is working, but then, by pressing the button, I want to send the user to a detail view controller. you can have an idea of what I'm looking for here and here tried to apply those solutions, but I think I'm missing something. This is another example of what I'm seeking this is my class declaration: import UIKit import MapKit import CoreLocation import Parse class MapViewController:

Why is double tap still being picked up in this IOS code?

此生再无相见时 提交于 2019-12-11 11:37:42
问题 Background - I have a map (MapKit) with a callout (custom view added to an annotation view) - I have managed to ensure that the "long press" gesture made over the callout view does not get picked up (see below, using "shouldReceiveTouch") Issue What I can't do is do the same thing (i.e. ignore) a double-click over the callout view, in that the MapKit map still somehow picks this up and zooms in. I've tried putting the Double Tap gesture in to trap it however it doesn't seem to be working.