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
0
votes
0 answers

swift 5 - func mapView(_ mapView: MKMapView, didSelect annotation: MKAnnotation) not executing

I created an app which displays an MKMapView and displays 6 annotations in the Greenwood Indiana area. I tested it on my phone. When I selected one of the annotations, I was expecting the "didSelect annotation" and the "did Select annotation view"…
0
votes
1 answer

How to draw MKPolyline with moving points?

So I have an app which is receiving every second some latitude and longitude data from a websocket. What I'm trying to do is draw a path on my map (MKMapView) every time I receive a new position. The code is working so far, but after approximately…
Fred Novack
  • 727
  • 9
  • 27
0
votes
1 answer

viewForOverlay was never called

I have view with segment's buttons. on clicking on button with index "1", it should show mapview with some overlays. For this reason, I have the following code: { [_routeMap setHidden:NO]; [self drawTheMap]; [_routeMap…
Vov4yk
  • 1,080
  • 1
  • 9
  • 13
0
votes
1 answer

iOS MKMapViewDelegate - Getting UserLocation the second time

I create a MKMapView and associate a MKMapViewDelegate with it. The MKMapViewDelegate gets notified correctly that DidUpdateUserLocation and other life cycle events occurred. When I create another MKMapView later on in the app, the MKMapViewDelegate…
Ian Vink
  • 66,960
  • 104
  • 341
  • 555
0
votes
1 answer

How to detect taps on MKMapView but ignore taps on MKAnnotationViews

I'm writing an iOS app where the user taps on an MKMapView to drop a pin (MKAnnotationView subclass), and taps an existing pin to delete it. Adding new pins and deleting old ones is working, but the tap to delete an existing pin is also resulting in…
0
votes
0 answers

Detect when all the annotations have been successfully been drawn or added to MKMapView

I posted another question about MKMapView today. The code is actually the same one, so if you need to see it, it's here: How to get the MKMapView instance from my UIViewRepresentable view?. In the updateUIView, I am adding annotations when there is…
TigrouMeow
  • 3,669
  • 3
  • 27
  • 31
0
votes
1 answer

Overriding MKMapView scroll/pan has very poor performance

I want to restrict the panning of an MKMapView to horizontal/longitude scrolling only. I set the latitude I want to keep in a var: var currentLatitude: CLLocationDegrees? Then I override the mapViewDidChangeVisibleRegion delegate method to reset…
Darren
  • 10,182
  • 20
  • 95
  • 162
0
votes
1 answer

mapview blue dot not coming for second time

I'm developing an app to show the stores available in a particular zipcode. I start with the current location. I'm getting a blue pulsating dot for my current location. when I enter a zipcode I'm able to show the annotations in the mapview. I have a…
cancerian
  • 942
  • 1
  • 10
  • 18
0
votes
0 answers

How to get mapViewDidFailLoadingMap(_:withError) called when mapType is set to satelliteFlyover?

I'm using a MapView and want to display a static image when the map could not be loaded because the device is offline (or tiles could not be loaded for any other reason). Actually this works when using the MKMapViewDelegate and implementing…
ricobeck
  • 172
  • 1
  • 11
0
votes
1 answer

Displaying TableView when MKAnnotation(Pin) in MKMapView touched/pressed/clicked

I want to display quite a bit of demographic data for a certain pin when someone touches on it, so providing a pop-up isn't going to cut it. I figured once the pin is touched I will just stick a tableviewController onto the NavigationController and…
Justin
  • 859
  • 4
  • 15
  • 30
0
votes
1 answer

Delaying Add Annotation Until Search Has Finished

so i've searched and found multiple articles regarding creation of unique annotations and pins but I think i'm missing something more fundamental, possibly using the annotationView function under the MKMapViewDelegate. First off i'm very new to…
0
votes
1 answer

mapType SwiftUI Button/SegmentedControl

Looking for the best option to change mapType on button/segmented control selection. Currently I have the below code which is working to a degree, however the picker options always rotate. How can I keep it consistent as Standard, Satellite, Hybrid…
0
votes
0 answers

Overlapping annotations in MKMapView swift 4

I have a MKMapview view where there are no of annotations. A location entered by the user is considered as current location. I want this current location to be on top of all other annotations. Right now, the current location is getting ovwerlapped…
Roshni
  • 153
  • 2
  • 14
0
votes
1 answer

Clustering doesn't work properly in iOS 13

I am doing clustering of Annotations. The below code works fine and clusters the points correctly in iOS 11 & iOS 12. This fails to cluster the points decluster the points in iOS 13. I am not using any beta versions. The TTMapView class is wrapper…
0
votes
0 answers

Resizing MKAnnotationView as user zooms in and out

I am trying to resize my custom MKAnnotationView as the user scrolls in and out of the map similar to how the MKMarkerAnnotationView behaves. Currently when the user scrolls in and out of the map my custom annotation stays the same size instead of…