mapkit

get coordinates on tap in iphone application

霸气de小男生 提交于 2019-12-11 01:44:37
问题 I am create a iphone Mapkit application. I want to get the coordinates where the user has tapped on the map screen. Best Regards, Naveed Rafi 回答1: Handle the touch event and then Use convertPoint:toCoordinateFromView: http://developer.apple.com/iphone/library/documentation/MapKit/Reference/MKMapView_Class/MKMapView/MKMapView.html#//apple_ref/occ/instm/MKMapView/convertPoint:toCoordinateFromView: 来源: https://stackoverflow.com/questions/3624117/get-coordinates-on-tap-in-iphone-application

Strange behavior of MKMapView visibleMapRect property

瘦欲@ 提交于 2019-12-11 01:37:16
问题 I tried to set visibleMapRect property of MKMapView object but result map rect is not the exact what I expected. This is my code: NSLog(@"current size %f %f", mapView.visibleMapRect.size.width, mapView.visibleMapRect.size.height); NSLog(@"target size %f %f", newBounds.size.width, newBounds.size.height); mapView.visibleMapRect = newBounds; NSLog(@"new size %f %f", mapView.visibleMapRect.size.width, mapView.visibleMapRect.size.height); And this is the result: 2013-01-15 19:21:25.440 MyApp[4216

Phonegap (Cordova) 2.7.0 + Mapkit Plugin + Getting Started

自作多情 提交于 2019-12-11 01:26:03
问题 I am trying to get the PhoneGap Mapkit Plugin up and running. This is what I did so far: I added the MapKit framework into my xcodeproject: Framework/ MapKit.framework ... Downloaded and added MapKit plugin native files to the plugins folder: Plugins/ AsyncImageView.h AsyncImageView.m CDVAnnotation.h CDVAnnotation.m MapKit.h MapKit.m Downloaded and added JSONKit plugin native files to the plugins folder: Plugins/ ... JSONKit.h JSONKit.m Downloaded and added MapKit.js: www/js/ MapKit.js ...

Update MapKit annotation subtitle and image

本秂侑毒 提交于 2019-12-11 00:52:44
问题 I've searched a bit around the web and found a few ideas on how to do what I want, but I would still like to know what you think I should do. Here is the context : I'm developing an app for iOS 5. I use MapKit to display a map, and I add around 5000 annotations to it - yup, that seems a lot, but don't worry, I use a clustering library :). In order not to load them every time the user opens the map, I create them in my appDelegate (I create an array of annotations, and call [_mapView

how to automatically zoom mapView to show overlay

时光毁灭记忆、已成空白 提交于 2019-12-11 00:25:44
问题 I am able to draw the polygon on mapView however I need to locate the polygon and zoom it manually. Is there a way to do this process automatically like adjust the polygon in centre? I have browsed the internet and read few related articles, most of them are based on polylines and points. Any kind of help will be appreciated, as I am finding for the solution for a while. Thanks in advance. Using the following methods to draw the polygon on mapView : - func drawFence(coordinates: UnsafePointer

When should I stop updating location manager?

坚强是说给别人听的谎言 提交于 2019-12-10 21:08:55
问题 I have an app that makes a call to get the user's location: -(void)getLocation{ locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.distanceFilter = kCLDistanceFilterNone; locationManager.desiredAccuracy = kCLLocationAccuracyBest; [locationManager startUpdatingLocation]; } //SET USER LOCATION -(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { self.userLocation = [locations lastObject]; NSLog(@"location

iOS 8 SDK, Swift, MapKit Drawing a Route

百般思念 提交于 2019-12-10 20:45:09
问题 I need to draw route between two points and I'm using MKDirectionsRequest for my purpose. Getting a route is OK, but I have trouble with drawing it. In iOS 8 SDK there's no function - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay There is only this one: func mapView(mapView: MKMapView!, rendererForOverlay overlay: MKOverlay!) -> MKOverlayRenderer! And for some reason, I can't understand why that method isn't called. Delegate for MapView is set and MapKit

MapKit (Swift 4) Xcode 9.2 - 'Could not inset legal attribution from corner 4'

帅比萌擦擦* 提交于 2019-12-10 20:22:46
问题 I'm doing a project that deals with a MapKit. My issue is when I run the app, I get the 'Could not inset legal attribution from corner 4.' error. What solution can I take to resolve this issue? error: My app screen: 回答1: I had the exact same error as you - the map was not showing up and I was getting the error: 2018-08-25 09:59:17.324966-0400 Parse Foursquare Clone[45537:42276733] Could not inset legal attribution from corner 4 2018-08-25 09:59:17.332612-0400 Parse Foursquare Clone[45537

Swift MKPointAnnotation custom Image

删除回忆录丶 提交于 2019-12-10 19:05:37
问题 I try to create a custom "badget" for my MKPointAnnotation in swift, but it fails as MKPointAnnotation does not have any property like image var information = MKPointAnnotation() information.coordinate = location information.title = "Test Title!" information.subtitle = "Subtitle" information.image = UIImage(named: "dot.png") //this is the line whats wrong Map.addAnnotation(information) Anyone figured out a swift like solution for that? 回答1: func mapView(mapView: MKMapView, viewForAnnotation

How to tell a rightCalloutAccessoryView has been touched for MapKit

二次信任 提交于 2019-12-10 18:35:07
问题 I have a MKAnnotationView being allocated with a DetailDisclosure button being displayed on the right side of the annotation. How would I go about knowing when a user clicked on the annotation button? This is what my code looks like right now - UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; pinView.rightCalloutAccessoryView = rightButton; pinView.animatesDrop = YES; Is there a built in method to detect when a accessory view has been touched? I'm guessing it