mkannotationview

multiple annotation have issue to get selected index annotation

拜拜、爱过 提交于 2020-01-05 04:40:32
问题 I have displayed multiple annotation successfully in mapView in my iphone application, but I have problem too .. In top of the screen I have two Tab Map and List . map display all annotation in map and list display those data in Tableview which is display in map. when I click on particular cell i get all the particular detail of that cell.but when I try to get id from Tap annotation my array getting lots of id after comparison of name because we have same name in my array list so how can I

How to set the rotation center of an MKAnnotationView

白昼怎懂夜的黑 提交于 2020-01-03 07:33:49
问题 I've got a problem with my MKAnnotationView s when MKUserTrackingModeFollowWithHeading is enabled on the MKMapView. I positioned my images using the centerOffset property of the MKAnnotationView. Specifying the coordinates of the pin's tip relative to the coordinate system at the center of the image is somewhat counter-intutive, but I came up with the following formula: annotationView.centerOffset = CGPointMake(imageWidth/2.0 - tipXCoordinate, imageHeight/2.0 - tipYCordinate); This works fine

UILongPressGestureRecognizer on MKAnnotationView not working for single touch

懵懂的女人 提交于 2020-01-02 10:23:15
问题 I've been trying to use a UILongPressGestureRecognizer in a MKAnnotationView subclass. Interestingly the gesture recognizer only triggers when using two ore fingers/touches. What prevents the gesture recognizer to get triggered with only one touch? Implementation UILongPressGestureRecognizer *pressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]; pressRecognizer.minimumPressDuration = 0.25; pressRecognizer.numberOfTapsRequired = 0;

MapView with clusters: how to display multiple annotations on same view

北城余情 提交于 2020-01-02 09:55:32
问题 I have integrated FBAnnotationClustering on mkmapview which works perfectly, but when there is more than one annotation at exactly the same place I cannot display the annotationView with the correct informations. I'm trying to loop through the annotations and display them in the same view (each with a callout button to display more info). So far I managed to make one callout work to display the details at the bottom, but in the annotationView it displays it without the right title, and there

MKAnnotationView setImage() on iOS 11 has an animation

蹲街弑〆低调 提交于 2020-01-01 10:09:10
问题 Since iOS 11, when I use setImage in my custom MKAnnotationView , the image is displayed with an animation. The problem is when I select and deselect the MKAnnotationView and the image has a different size. It results in a weird animation. No problem until iOS 11, can we stop this behaviour? 回答1: Seeing that this is the only mention of this issue (feature?) that I've found anywhere over the past year and a half, let me first thank you for being my only source of sanity. With that, I've

Dragging the map after dragging my MKAnnotationView does not move the MKAnnotationView with it

两盒软妹~` 提交于 2020-01-01 09:02:50
问题 MKPinAnnotationView does not allow you to use a custom image as 'pin' and enable dragging at the same time, because the image will change back to the default pin as soon as you start dragging. Therefore I use an MKAnnotationView instead of an MKPinAnnotationView. While using MKAnnotationView instead of MKPinAnnotationView does keep your custom image shown as your 'pin' it doesn't support the drag & drop animation that you get with the default pin. Anyway, my issue is that after I drag my

MKMapView Off Screen Annotation Image Incorrect

让人想犯罪 __ 提交于 2019-12-31 04:14:05
问题 I have a map to which I add several annotations, like so: for (Users *user in mapUsers){ double userlat = [user.llat doubleValue]; double userLong = [user.llong doubleValue]; CLLocationCoordinate2D userCoord = {.latitude = userlat, .longitude = userLong}; MapAnnotationViewController *addAnnotation = [[MapAnnotationViewController alloc] initWithCoordinate:userCoord]; NSString *userName = user.username; NSString *relationship = user.relationship; [addAnnotation setTitle:userName];

Hiding and disabling user interaction on a MapKit pin?

蹲街弑〆低调 提交于 2019-12-31 03:16:06
问题 I'm trying to hide a pin on a MapKit view, and while setting the hidden property to YES works, I can still tap on it and get didSelectAnnotationView messages!. Naturally, I tried setting userInteractionEnabled to NO , but I'm still receiving the messages. This is what I've tried. a is my annotation view. a.hidden = YES; a.layer.hidden = YES; a.userInteractionEnabled = NO; There's something that I'm missing here, and I've Googled everywhere and can't find anything that works. Any clues? 回答1:

Why is my map view callout translucent/transparent and how do I change it's color?

 ̄綄美尐妖づ 提交于 2019-12-30 08:13:47
问题 I'm on iOS 7 and I have the following problem. I can't find a clue after some research curiously... I have a map view annotation with left and right accessories but transparent in the middle (default iOS 7 behavior I think). How to change the default translucent/transparent background to any other color I want? 回答1: Is your MKMapView inside a UITableViewCell ? I had a similar issue, where the UITableViewCellSelectionStyle of the cell caused this visual glitch. Setting it to

Customise iOS8 Callout bubble (Swift)

こ雲淡風輕ζ 提交于 2019-12-28 08:40:14
问题 I want to customise the iOS8 MapView Callout bubble which get visualised when clicking on a MKAnnotationView. The Default bubble is a bit limiting (having only Title,Subtitle and 2 accessory view) so I'm struggling to find an alternative solution. Here two possible ways and the relative problems I'm facing: PROBLEM 1) CREATING A CUSTOM CALLOUT BUBBLE Digging the Apple documentation I have found this: When you use a custom view instead of a standard callout, you need to do extra work to make