mkannotationview

How to resize callout bubble after resetting title/subtitle

a 夏天 提交于 2019-12-07 12:27:12
问题 I created an MKAnnotation name PushPin which has a title and subtitle. I want to be able to dynamically change the title at a later time. I'm close so I'd rather not have to make a whole new AnnotationView, but if I have to I guess that's ok too. My problem is that, once I change the text for the title, the window does not resize and some text might get cut off depending on how big the title originally was. 1) Is there an event I can trigger to resize the callout bubble window again? 2) Also,

mapView: didSelectAnnotationView: not functioning properly.

谁说我不能喝 提交于 2019-12-07 03:27:18
问题 I'm building an IOS app that uses the built in map view. Im successfully placing custom annotations, etc. However, I'm having a problem with the delegate function that is called when an annotation is pressed (mapView:didSelectAnnotationView). The first time I press an annotation, the function is called properly. However, if I proceed to click the same annotation again, the function does not fire. If I click on a different annotation at this point, the function WILL fire but then if I click on

MKUserLocation is selectable, falsely intercepting touches from custom MKAnnotationViews

风格不统一 提交于 2019-12-07 00:28:31
问题 I have a normal map in my iOS app where "Shows Users Location" is enabled - meaning I have my normal blue dot on the map, showing my position and accuracy info. The callout is disabled in code. But I also have custom MKAnnotationViews that are plotted around the map which all have custom callouts. This is working fine, but the problem is that when my location is on the location of a MKAnnotationView, the blue dot (MKUserLocation) intercepts the touch, so the MKAnnotationView doesn't get

Change MKAnnotationView programmatically

烈酒焚心 提交于 2019-12-06 15:37:00
问题 Is there a way to change MKAnnotationView style (like from red label with number to green colored label with number). I want to change this style according to distance from target. My annotation is moving, with user. I dont want to use remove / add annotation, because it causes "blinking". Can it be done someway? UPDATE : I am adding code, how I am doing it right now MKAnnotationView *av = [mapView viewForAnnotation:an]; if ([data->type isMemberOfClass:[UserAnnotationImage class]]) { UIImage

UILongPressGestureRecognizer on MKAnnotationView not working for single touch

给你一囗甜甜゛ 提交于 2019-12-06 12:15:59
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; pressRecognizer.numberOfTouchesRequired = 1; The same implementation in a normal UIView shows the expected

Draw MKPointAnnotation with title in MKSnapshot image

六眼飞鱼酱① 提交于 2019-12-06 11:55:09
I'm trying to draw an annotation exactly as in a 'live' MapView, but then in a MKSnapshot. Why an MKSnapshot > because I want to have non-interactive MapViews in a UITableView and using images is more efficient. I can get a pin to be drawn (though not a point as in iOS 11, the pin looks old) using MKPinAnnotationView, but also then there is no title of the annotation on the image. Using almost exactly this code: Snapshot of MKMapView in iOS7 . You can use the following steps: with MKMapSnapshotter you will get an image of the map without annotations you can retrieve the annotations from your

MapKit update annotation image

对着背影说爱祢 提交于 2019-12-06 09:47:36
问题 I'm having a problem finding out the way to update a custom MKAnnotationView image after a asynchronous request completes with information about the status of the annotation. So far, I have this: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { static NSString *identifier = @"EstacionEB"; if ([annotation isKindOfClass:[EstacionEB class]]) { EstacionEB *location = (EstacionEB *) annotation; CustomPin *annotationView = (CustomPin *) [_mapita

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

馋奶兔 提交于 2019-12-06 07:06:46
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 is just one so it's not exactly useful. So I'm wondering, is it possible to display multiple

Swift - setting rounded corners to annotation view image

不想你离开。 提交于 2019-12-06 07:01:38
问题 Here is my previous thread, where I set image to annotation view pins Swift - setting different images from array to annotation pins Right now I encountered a problem with setting rounded corners on annotation view image. cannot show callout with clipsToBounds enabled swift appears that I have to choose between rounded corners or showing callout, I don't really get why these two can't come along. Is there any way to do that? Here is my viewForAnnotation function: func mapView(mapView:

iOS MapKit Annotation, not showing correct location

拜拜、爱过 提交于 2019-12-06 06:56:58
问题 I using a custom image for my mapkit annotation. But the main problem it seems that I am running into in using a custom image, is that when zoomed out, the annotation is not in the correct point on the map, and ONLY until I zoom in all the way down, will it show the annotation point in the correct place. It seems that when I use a regular pin MKPinAnnotationView , it works normally, as with the pin being in the correct place zoomed in or out, thanks in advance for anyone that can help. The