mkannotationview

How to Hide MKAnnotationView Callout?

风格不统一 提交于 2019-12-03 10:45:20
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]]) { } } 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]; } } 来源: https://stackoverflow.com/questions/2918154/how-to-hide-mkannotationview-callout

MKMapview place pin at location (long/lat)

萝らか妹 提交于 2019-12-03 05:02:55
问题 I have latitude and long values and I need to be able to drop a pin at this location. Can anybody provide some advice on how to go about this? 回答1: Find the below very simple solution to drop the pin at given location define by CLLocationCoordinate2D Drop Pin on MKMapView Edited: CLLocationCoordinate2D ctrpoint; ctrpoint.latitude = 53.58448; ctrpoint.longitude =-8.93772; AddressAnnotation *addAnnotation = [[AddressAnnotation alloc] initWithCoordinate:ctrpoint]; [mapview addAnnotation

How to check if annotation is clustered (MKMarkerAnnotationView and Cluster)

て烟熏妆下的殇ゞ 提交于 2019-12-03 03:56:05
I'm trying to work with the new features added to the mapview in ios11. I'm clustering all my MKAnnotationView with circle collision but I have to check in real time when the annotation becomes clustered. I have no idea how to do that. EDIT (4/1/2018) : More informations : When I select an annotation I add a custom CallOutView when the didSelect method is called and remove the CallOut when the didDeselect method is called. The issue is when an annotation is selected and becomes clustered, when you zoom in the annotation is still selected but in "normal" state. I want to remove the CallOut of

show users location blue point in iPhone MKMapView

99封情书 提交于 2019-12-03 03:13:26
I am developing a custom pins in a MapView in my iPhone app. Here is the code: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { static NSString *AnnotationViewID = @"annotationViewID"; MKAnnotationView *annotationView = (MKAnnotationView *)[myMapView dequeueReusableAnnotationViewWithIdentifier:AnnotationViewID]; if (annotationView == nil) { annotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationViewID] autorelease]; } if ([[annotation title] isEqualToString:NSLocalizedString(@"Current Location",@""

MKMapview place pin at location (long/lat)

本秂侑毒 提交于 2019-12-02 19:22:29
I have latitude and long values and I need to be able to drop a pin at this location. Can anybody provide some advice on how to go about this? Find the below very simple solution to drop the pin at given location define by CLLocationCoordinate2D Drop Pin on MKMapView Edited: CLLocationCoordinate2D ctrpoint; ctrpoint.latitude = 53.58448; ctrpoint.longitude =-8.93772; AddressAnnotation *addAnnotation = [[AddressAnnotation alloc] initWithCoordinate:ctrpoint]; [mapview addAnnotation:addAnnotation]; [addAnnotation release]; You should: 1. add the MapKit framework to your project. 2. create a class

In IOS MapView, is there an annotation title call back function or a way to set a target?

这一生的挚爱 提交于 2019-12-02 15:55:58
问题 I am displaying a custom MKAnnotationView that when clicked displays a title. I know that I can use: - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view; To detect the click on the annotation view. Once the user clicks on this AnnotationView a title pops up for the annotation. What I want to do is go to a new controller when the title is clicked. So my question is: Is there a way to detect a click on the title? 回答1: In your custom MKAnnotationView simply

Detecting selected annotation to change pin color

淺唱寂寞╮ 提交于 2019-12-02 11:05:58
问题 I am now working on a mapView. This is the scenario: All annotations are coming from JSON objects (MySQL tables). Annotations are grouped by source table: Table 1-> Ofertas, Table 2-> Cursos, Table 3-> Eventos. Initially there is shown a map region which is big enough to show later all annotations. There is a UISegmentedControll to let the user select which annotations group should be shown. At this app state, I will need to make the following updates: Each annotation group should have a

MKMapView MKAnnotationView ISSUE?

不羁岁月 提交于 2019-12-02 09:29:05
I have a map view with pins that when the user selects a pin it goes to a detail screen for that pin. I also have a table view that when the user selects an item it goes to the same type detail view. I am adding the multiple pins in mapview through array. I have added button to the accessory view, Here's the problem ... when I tap the button pin selection takes him to the detail view for a different pin. But in the table view it still works fine..anyone pls help me with this...? -(MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {

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

Detecting selected annotation to change pin color

一世执手 提交于 2019-12-02 06:05:07
I am now working on a mapView. This is the scenario: All annotations are coming from JSON objects (MySQL tables). Annotations are grouped by source table: Table 1-> Ofertas, Table 2-> Cursos, Table 3-> Eventos. Initially there is shown a map region which is big enough to show later all annotations. There is a UISegmentedControll to let the user select which annotations group should be shown. At this app state, I will need to make the following updates: Each annotation group should have a different pin colour. This is the method I am using to draw the annotations to the mapView depending on the