Iphone mapkit drag and get center location

Hi

I have a Mapview with some marker points + a marker for the current location.

Now, what I want to do here, when the user drags or moves through mapview, I want to find the coordinate (latitude and longitude) of the new center location after dragging the map.

I want to clarify again, I'm not talking about dragging a marker / point, I'm talking about dragging a map with a touch.

Thanks in advance.

+4
source share
2 answers

Look for theMapView.region.center or theMapView.centerCoordinate (should be the same) in your delegate deletion -mapView:regionDidChangeAnimated:

+6
source

Judging by this document:

http://developer.apple.com/iphone/library/DOCUMENTATION/MapKit/Reference/MKMapView_Class/MKMapView/MKMapView.html

You can get this using the centerPosition property of your MKMapView . To indicate when the location changes, implement the -mapView:regionDidChangeAnimated: method in MKMapViewDelegate .

+1
source

Source: https://habr.com/ru/post/1303317/


All Articles