mkannotationview

MapKit Display Annotation Clusters and Along With Non-Clustered Annotations

。_饼干妹妹 提交于 2019-12-06 05:27:37
I am new to iOS development and currently using the FBAnnotationClusteringSwift to cluster makers. My app needs to have two annotations which will not be clustered, as they indicate the source and destination addresses. The remaining annotations must be clustered as they represent stations . What I want to achieve is something like the image bellow, where "A" is my source address, and the clusters represent stations: However what is happening is, as the clusters are created , the Annotation that represents a non-clustered annotation (the source address) disappears as following: If the library

How to change default background color of callout bubble with detailCalloutAccessoryView

佐手、 提交于 2019-12-06 04:43:30
问题 In my app I have the following sutuation. I've implemented a custom callout bubble with custom detailCalloutAccessoryView with two labels inside. I know how to change the color of detailCalloutAccessoryView with this line. view.detailCalloutAccessoryView?.backgroundColor = UIColor.red But I can't figure out how to change background color of the main bubble (it is transparent grey/white now). With view.detailCalloutAccessoryView?.backgroundColor = UIColor.red line my calloutbubble looks like

Annotation Image is replaced by RedPushPin when long press on annotation

你说的曾经没有我的故事 提交于 2019-12-05 21:38:05
问题 I have created Custom Annotation with following: -(MKAnnotationView*)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation { MKPinAnnotationView *view = nil; if (annotation != mapView.userLocation) { view = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"myAnnotationIdentifier"]; if (!view) view = [[MKPinAnnotationView alloc]initWithAnnotation:annotation reuseIdentifier:@"myAnnotationIdentifier"]; if (((CustomAnnotation *)annotation)

How to resize callout bubble after resetting title/subtitle

早过忘川 提交于 2019-12-05 21:18:02
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, I check to make sure that the annotation actually has a title first before I go resetting the title,

Custom MKAnnotationView - How to capture touches and NOT dismiss the callout?

ぃ、小莉子 提交于 2019-12-05 20:59:28
I have a custom MKAnnotationView subclass. It is showing the view exactly as I want it to. In that view, I have a button. I want to capture events on the button to perform an action. This works just fine. However, I do NOT want the callout to be dismissed or disappear. Basically, touching the button in the callout will start playing a sound, but I want to leave the annotation up so the user can press stop if they want to, without having to touch the map pin again to bring the annotation back up. In another instance, I want the button touch to animate more details in the callout, so I

MKAnnotationView custom image is not shown

前提是你 提交于 2019-12-05 18:30:24
I am trying to add a custom image instead of the regular pin on the map. But it remains a red pin... What am I missing? - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{ static NSString* AnnotationIdentifier = @"AnnotationIdentifier"; MKPinAnnotationView *annView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier]; annView.animatesDrop = TRUE; annView.image = [UIImage imageNamed:@"CustomPin.png"]; return annView; } DJPlayer MKMapView: Instead of Annotation Pin, a custom view -(MKAnnotationView *

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

感情迁移 提交于 2019-12-05 13:23:41
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 the user clicks on an annotation directly. So far, I have being trying the following action that reacts

show multiple annotation in map view

僤鯓⒐⒋嵵緔 提交于 2019-12-05 06:22:48
问题 i am new to map view in ios sdk. i want to show multiple annotation in map view using lat and long.basically all lat and long are coming from server side in json format. i am parsing all lat and long and saving it in different array. but how to show all annotation at single time. i am able to show only one annotation at a time.Below is code for single annotation i am using, zoomLocation.latitude = latmpa.doubleValue; zoomLocation.longitude = logmpa.doubleValue; annotationPoint = [

MKUserLocation is selectable, falsely intercepting touches from custom MKAnnotationViews

落爺英雄遲暮 提交于 2019-12-05 04:34:06
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 touched. How can I disable the user interaction on the blue dot so that the touches are intercepted by the

Show address in annotation when pin is dropped on map

▼魔方 西西 提交于 2019-12-05 02:32:57
问题 Currently I can drop pins around the map. Now I want the annotation title to display the address of where the pin is dropped. I've had a look at this but cant get mine to work: Set annotation's title as current address Code in my ViewController.m Updated. - (void)addPinToMap:(UIGestureRecognizer *)gestureRecognizer { if (gestureRecognizer.state != UIGestureRecognizerStateBegan) return; CGPoint touchPoint = [gestureRecognizer locationInView:self.map]; CLLocationCoordinate2D touchMapCoordinate