mkmapview

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

荒凉一梦 提交于 2019-12-12 09:43:18
问题 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

Looking for an MKOverlayPathRenderer example

半腔热情 提交于 2019-12-12 08:46:41
问题 I am trying to figure out how to use a new MKOverlayPathRenderer class. In my app I previously used MKOverlayPathView when building with iOS 6 SDK, but it does not seem to work with iOS 7 SDK unfortunately. So I am trying to move my app from MKOverlayPathView to MKOverlayPathRenderer , but have no success so far. MKPolylineRenderer works OK, but MKOverlayPathRenderer does not. The code gets called, but no overlay is drawn on a map. Does anybody have a working example for MKOverlayPathRenderer

How to get radius from visible area of MKmapview?

一个人想着一个人 提交于 2019-12-12 07:37:58
问题 I am able to get visible rectangle of map view and also centre point of map view and span deltas are also get from mkmaap view methods: To get visible are : mapView.visibleMapRect is used . To get centre point: map view.centerCoordinate is used and to get span: mapView.region.span is used. Now I have all the information, how can i calculate radius of visible are using calculation? Can anyone explain me in detail? I have seen this question but the answer is giving me span not radius of visible

Using IBAction Buttons to Zoom MapView

∥☆過路亽.° 提交于 2019-12-12 07:15:04
问题 I have an issue. My current location is displayed and centered in a map view however the map region doesn't get zoomed in to. I tried taking Rob's advice by taking span and region out of the didUpdateToLocation method but I must not have implemented it right. I don't think it's recognizing my call to setRegion in viewDidLoad and my buttons aren't being recognized. Please check my code below and point out the mistake(s). My goal is to be able to zoom in and out of my location using the

Call another view when user taps on pin in mapview

£可爱£侵袭症+ 提交于 2019-12-12 05:48:30
问题 I have Map with multiply annotations and I want hen user taps on pin to call another view. I'm using storyboard. With .xib this would be like this. ... - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { ... [rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside]; } -(void)showDetails:(UIButton*)sender { OfferDetailViewController *detail = [[OfferDetailViewController alloc] init]; detail.context

Swift 3.0 Get User Location Coordinates from Different View Controller

99封情书 提交于 2019-12-12 05:26:20
问题 I have two view controllers - one with the mapView that is able to obtain user location coordinations through locationManager, and a second VC that I wish to be able to pull these user coordinates. First VC: MapView func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { var coordinatesOfUser = locations.last?.coordinate print("The value of usercoordinates are \(coordinatesOfUser)") // here I want to be able to pull this variable, coordinatesOfUser if

Unable to change MKMapView region(location)

拈花ヽ惹草 提交于 2019-12-12 04:56:15
问题 I am using split view controller in my application. Left panel(Master View Controller) holds table view with list of hotels and on right, the Detail View Controller contains MapView for displaying the location. Initially I am displaying the current location upon application launch. Then after selecting a value from table view, I am trying to show the hotel location in the map. Unfortunately even upon passing proper latitude & longitude values, I am still not able to change the region and I

Swift zoom in on location

Deadly 提交于 2019-12-12 04:54:34
问题 I have an address and I'm trying to use that address to show up on a mapview with the pin instead of having the actual coordinates. I can get it the map to show up with the pin but it is not zooming close enough on my location. Is there anyway I can zoom in on the location? Thanks in advance @IBOutlet weak var mapView: MKMapView! override func viewDidLoad() { super.viewDidLoad() let address = (community!["address"] as AnyObject) let location : String = address as! String let geocoder =

iOS MkMapView blank after moving to Xcode 6

眉间皱痕 提交于 2019-12-12 04:52:14
问题 I have apps created in Xcode 5 with mkMapView working well. Recently created a new app in Xcode 6.1 and dragged old storyboard scenes and view controllers to the new app. The map view now shows a blank screen and no annotations on IOS 7 but worked on IOS 8. I added a button and now the map view is blank on IOS 8 as well. I deleted and recreated the view in storyboard with a map view inside a view inside a view controller by dragging from object templates. The map was still blank. After