Questions tagged [mkmapviewdelegate]

MKMapViewDelegate is a protocol that describes events originating from an MKMapView.

MKMapViewDelegate is a protocol that describes events originating from an MKMapView. Interested classes can get messages for changes to the map's annotations, overlays, visible region, and user location updates.

For more information, see the Apple Documentation for MKMapViewDelegate.

160 questions
3
votes
5 answers

mapView:didDeselectAnnotationView: delegate method getting called before the annotation view is actually deselected

I am working with a map view populated with custom pins. When the user taps somewhere on the map to deselect a pin, I want to implement the map such that the pin does not become deselected (i.e. users are not able to deselect pins without selecting…
3
votes
0 answers

How to send the latitude and longitude to MapViewController?

I have the DetailView which read from the plist file and show all the value on the View, my code as below, however, I want to pass the latitude and longitude value to MapViewController was not success, please tell me which was miss or…
Gere Tan
  • 43
  • 5
3
votes
1 answer

How to make custom MKMapView delegate actions for SwiftUI ViewRepresentable?

I've wrapped a MKMapView in a ViewRepresentable public struct MapView: UIViewRepresentable { I want to create an action callback that works like this: MapView().onAnnotationTapped { annotation in } In MapView i have defined @inlinable public…
bogen
  • 9,954
  • 9
  • 50
  • 89
3
votes
0 answers

How to fetch an annotation which is have the same co-ordinates from MKClusterAnnotation?

I'm currently developing an app where I load different types of annotations by using MKClusterAnnotations from apple's mapkit. We know MKClusterAnotation is An annotation that groups two or more distinct annotations into a single entity. Is this…
Ram
  • 764
  • 1
  • 7
  • 20
3
votes
0 answers

Perform didSelect before didDeselect

The title might not due the actually question justice since there might be a completely different solution to this problem. What we are trying to do is create a snapchat like map view, where data is displayed on the bottom of the screen in a…
NoSixties
  • 2,443
  • 2
  • 28
  • 65
3
votes
1 answer

Adding cluster annotations to a map view, which has several custom annotation views

I have a map view, which has two types of custom annotation views. I am wondering how to add different types of clusters for these views (depending on the types of annotation views). Currently I've tried to do everything as in the sample project…
Tigran Iskandaryan
  • 1,371
  • 2
  • 14
  • 41
3
votes
3 answers

didSelect for MKAnnotationView not firing

I have troubles to make a custom annotation at a MapView selectable. I was trying several ways, without success: Using didSelect of MKMapViewDelegate Using a UIButton which is added to the AnnotationView Using UITapGestureRecognizer for the…
Jürgen P.
  • 231
  • 3
  • 13
3
votes
0 answers

Transform Annotationview based on user location heading direction

I am trying to transform annotationview based on user location heading direction.Annotation view not changing properly. LocationMapView.userTrackingMode=YES; locationManager.headingFilter =5; [locationManager…
3
votes
2 answers

Custom font for MKAnnotationView Callout

Fortunately, the standard callout view for an MKAnnotationView meets our needs - title, subtitle, leftCalloutAccessoryView, and rightCalloutAccessoryView. Unfortunately, we use custom fonts in our app, and would like to extend those custom fonts to…
djibouti33
  • 12,102
  • 9
  • 83
  • 116
2
votes
0 answers

UImapview: using lat and lon how to calculate speed in obj c

In my application get longitude,latitude and calculate the speed. First get the user current location longitude,latitude. Using this code got it. [[self mapView] setShowsUserLocation:YES]; locationManager = [[CLLocationManager alloc] init]; …
saravanar
  • 639
  • 2
  • 11
  • 25
2
votes
0 answers

Are MKMapView GEOErrorDomain codes documented anywhere?

Apple provides a method in MKMapViewDelegate for handling map view errors. - (void)mapViewDidFailLoadingMap:(MKMapView *)mapView withError:(NSError *)error; A few of our users complained about map tiles not loading, so we added…
goldierox
  • 1,085
  • 1
  • 8
  • 23
2
votes
2 answers

GetViewForAnnotation is never called

I am creating a MapView where I want to display some custom Annotations. So I think usually what you do is add some IMKAnnotation to the MKMapView using the AddAnnotation method. I make sure to invoke that on the main thread like: new…
Cheesebaron
  • 24,131
  • 15
  • 66
  • 118
2
votes
1 answer

I can't seem to set the MKMapView annotation title after the first time it has been set

What happens is I type in an address in the search field and click go. The location is found and the map zooms in. I click on the pin image and the title bubble pops up and shows the title. I created a property "pin" to be a reference to the title…
LondonGuy
  • 10,778
  • 11
  • 79
  • 151
2
votes
1 answer

MKMapView setRegion minimum span

I'm using MKMapView to display some assets on a map. These asset can be clustered. When the user taps on a cluster I calculate a MKCoordinateRegion based on the location of the assets in the cluster then zoom the map in: -…
VaporwareWolf
  • 10,143
  • 10
  • 54
  • 80
2
votes
2 answers

Detect end dragging/zooming MKMapView

Is there a way to determine if a MKMapView drag and zoom stops? Right now I've added an UIPanGestureRecognizer for dragging MKMapView but I'll receive gestureRecognizer.state == UIGestureRecognizerStateEnded immediately when the user lift his finger…
DoK
  • 851
  • 3
  • 15
  • 31
1 2
3
10 11