mapkit

how to get visible overlays in MapKit? (i.e. MKOverlay/MKOverlayRender from a Mapkit Ivew)

十年热恋 提交于 2019-12-08 12:15:33
问题 How does one get a list (array) of currently visible overlay from a MapkitView? Background - for example I want to show direction arrows to the center of certain Overlay types on my mapkitview, however how do I get the visible ones? There seems to be no way to do this I can see? So do I need to got through all overlays (actually ~8000) and do my own check to see what would be showing on the screen? Seems a waste if MapKit would have already effectively done this as part of deciding what

Find index of annotation MapKit

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 10:28:10
问题 I have been trying to performSegue for annotation, but this code generates different indexes and wrong places are shown in detailsView. Would be great to find out how it is possible to fix this. Thanks var detailsDict = [NSDictionary]() var selectedPlace: NSDictionary! func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control: UIControl) { if (view.annotation?.isKind(of: PlaceAnnotation.self))! { let annotation = view.annotation let index

Application crashes when asking if user wants to use Location Services

二次信任 提交于 2019-12-08 10:05:04
问题 I have an iPhone app that is using CoreLocation. Upon first installing the app, the iPhone system message is displayed asking whether or not the user wants to allow location services, if they click yes, my app suddenly displays the first screen of my app (I'm using a navigation controller), and crashes. This is what I see in the log - warning: UUID mismatch detected with the loaded library - on disk is: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library

MapKit: coordinates from Sqlite database

為{幸葍}努か 提交于 2019-12-08 09:38:19
问题 I have a sqlite database with about 100 000 rows containing longitudes and latitudes of ATMs. I want to display this ATMs by pins on MKMapView. But I think that it is not good for memory and not o fast if I will load all coordinates from DB at once. What is the best way to do it? 回答1: You're absolutely right, don't load them all at once! Use a bounding box to only get coordinates that are within the map your want to display. Check out the answer to this question : Core Data and Core Location

Is it possible to set a fixed on-screen position for the User Location Pin on MKMapView?

旧城冷巷雨未停 提交于 2019-12-08 08:54:09
问题 I'm trying to set up a MKMapView in a way that the user's location would always be offset in the top right corner of the view controller, and I would build the rest of my UI around that "block". Is there a way to set a fixed/offset center point for the MKMapView for example in a way that the pin is always at an x, y position on the screen? I can provide a sketched example if you are having trouble understanding my goal. 回答1: I figured it out just now, func mapView(mapView: MKMapView!,

Custom curent location Annotation pin not updating with core location

丶灬走出姿态 提交于 2019-12-08 08:41:29
问题 Trying to add a custom pin for current location, However the location does not update. Even after setting setShowsUserLocation = YES; - (id)initWithAnnotation:(id <MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier]; if ([[annotation title] isEqualToString:@"Current Location"]) { self.image = [UIImage imageNamed:[NSString stringWithFormat:@"cursor_%i.png", [[Session instance].current_option

Create multiple MKOverlays of polyline from locations coming via web-service

点点圈 提交于 2019-12-08 08:32:34
问题 My app is real-time tracker, where multiple users are logged in and updating their location by sending their co-ordinates to our web service which is then called back let's after every 2 minutes to show all the users on my MapView . Every time I get the locations of users from web service in connectionDidFinishLoading method, I am parsing, creating polyline through pointsArray and adding them to overlay : -(void) connectionDidFinishLoading: (NSURLConnection *) connection { userLatitudeArray =

MapView with local search

南笙酒味 提交于 2019-12-08 08:24:33
问题 I've a question about doing a local search in Apple maps which I have already implemented into my app. The app should show the user where are "supermarkets" around him. My mapView also shows the user's current location but I don't really know how I should do this with the results of the market-locations. Maybe Apple provides a solution/advice for this. Thanks in advance. The results (supermarkets) should be displayed as in this picture. UPDATE: The function works perfectly but is it also

device not working with mapkit

不羁的心 提交于 2019-12-08 07:52:19
问题 my device doenst work at all when i load an project that contains any mapkit framework files it says ld: warning: in /APP/MapKit.framework/MapKit, file was built for i386 which is not the architecture being linked (armv6) and it doesnt let me test it on the device, however when i load this on my simulator it works. Any help? 回答1: Maybe this post help you : Error building my app to my ipod touch:building with 'Targeted Device Family' set to iPhone only ('1') not supported with SDK 'Device -

CLLocationManager in background thread

萝らか妹 提交于 2019-12-08 07:39:24
问题 I am doing one application.In that i am using the CLLocationManager Class for getting the updated location latitude and longitude details.But i need to use this CLLocationManager in sepaate thread .I written my code like below. - (void)viewDidLoad { [NSThread detachNewThreadSelector:@selector(fetch) toTarget:self withObject:nil]; } -(void)fetch { manager=[[CLLocationManager alloc]init]; manager.delegate=self; manager.distanceFilter=kCLDistanceFilterNone; manager.desiredAccuracy =