mapkit

How to: Display MKOverlay on MKMapView

为君一笑 提交于 2019-12-05 07:00:40
I need to display an MKOverlay on a map, but can't get it to actually appear. I'm following the example from Apple's Location Awareness Programming Guide and the overlay wont display. Any help would be greatly appreciated, this is the first iPhone app I've made, so I might be missing something simple. NavViewController.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface NavViewController : UIViewController <MKMapViewDelegate> { } @property (weak, nonatomic) IBOutlet MKMapView *mapView; @end NavViewController.m #import "MSUNavViewController.h" #import <CoreLocation/CoreLocation.h> -

iOS 7 MapKit Crash: EXC_BAD_ACCESS in [VKRasterOverlayTileSource invalidateRect:level:]

心已入冬 提交于 2019-12-05 06:26:42
I have an unreproducible crash on iOS 7 only. I'm making heavy use of MKOverlayRenderer to draw shapes on the map. This crash does not happen on iOS 6. Any ideas of what this might be related to will be useful. Exception Type: EXC_BAD_ACCESS Code: KERN_INVALID_ADDRESS at 0x291707628 Stack: 0 libobjc.A.dylib objc_msgSend + 5 1 VectorKit __50-[VKRasterOverlayTileSource invalidateRect:level:]_block_invoke_2 + 38 2 VectorKit -[VKTileKeyMap enumerateKeysAndObjectsUsingBlock:] + 58 3 VectorKit -[VKTilePool enumerateKeysAndObjectsUsingBlock:] + 76 4 VectorKit __50-[VKRasterOverlayTileSource

show multiple annotation in map view

僤鯓⒐⒋嵵緔 提交于 2019-12-05 06:22:48
问题 i am new to map view in ios sdk. i want to show multiple annotation in map view using lat and long.basically all lat and long are coming from server side in json format. i am parsing all lat and long and saving it in different array. but how to show all annotation at single time. i am able to show only one annotation at a time.Below is code for single annotation i am using, zoomLocation.latitude = latmpa.doubleValue; zoomLocation.longitude = logmpa.doubleValue; annotationPoint = [

MKUserLocation is selectable, falsely intercepting touches from custom MKAnnotationViews

落爺英雄遲暮 提交于 2019-12-05 04:34:06
I have a normal map in my iOS app where "Shows Users Location" is enabled - meaning I have my normal blue dot on the map, showing my position and accuracy info. The callout is disabled in code. But I also have custom MKAnnotationViews that are plotted around the map which all have custom callouts. This is working fine, but the problem is that when my location is on the location of a MKAnnotationView, the blue dot (MKUserLocation) intercepts the touch, so the MKAnnotationView doesn't get touched. How can I disable the user interaction on the blue dot so that the touches are intercepted by the

What is the difference between MKCoordinateSpan and CLLocationCoordinate2D

风格不统一 提交于 2019-12-05 04:32:32
I was going through the sample example of MapKit and CoreLocation framework. I found these two structs ( MKCoordinateSpan and CLLocationCoordinate2D ) which are similar in declaration. How are these different in functionality, can someone please site an example (using both) to clear their meanings. Thanks! MKCoordinateSpan defines a span , i.e. a delta, in the latitude and longitude directions to show on a map. Along with a point you can then define a region to display on a map. CLLocationCoordinate2D defines a single point in the latitude and longitude coordinate system. For example: |<----

iPhone SDK: Track users location using GPS

人盡茶涼 提交于 2019-12-05 04:21:24
问题 I have a few questions about CoreLocation and GPS. First, what method in core location is used to continually get the users current coordinates? And at what interval should these be retrieved? Second, should these coordinates be pushed into a NSMutableArray each time they are received, so that the array of coordinates will represent the users path? Thanks, just wanting to get started getting me mind around this. 回答1: A very abbreviated version: First, adopt the <CLLocationManagerDelegate>

Location permission check and authorization

怎甘沉沦 提交于 2019-12-05 04:18:38
I want my program to display the users location on the map. It was working at first then randomly stopped so i added the code below to try to fix it but I'm having problems. Thanks in advance! override func viewDidLoad() { super.viewDidLoad() self.locationManager.delegate = self self.locationManager.desiredAccuracy = kCLLocationAccuracyBest if CLLocationManager.locationServicesEnabled() { let status: CLAuthorizationStatus = CLLocationManager.authorizationStatus() if status == CLAuthorizationStatus.NotDetermined { locationManager.requestAlwaysAuthorization() } } else { print("locationServices

Compiler error: Invalid library file - CoreLocation

谁都会走 提交于 2019-12-05 03:34:41
I have one of my application, that is created in Xcode 8. I have used CoreLocation and MapKit in that app. I have update app with latest iOS till now. and it was working fine. Now I am updating application with iOS 1 . So I hvae opened app with Xcode 11.0 and updated all the required code. Also updated setting that is suggested by Xcode "Perform Changes" and all that. Now I run application, but I am getting error like : Compiler error: Invalid library file . I have searched lot, but can't find any solution. Is this a bug in new Xcode or new iOS ? Is there anything I have to do extra changes or

Find nearest location from existing coordinates mapkit

喜欢而已 提交于 2019-12-05 03:11:32
问题 I am in the process of developing an iphone app (objective C) for a client who has multiple stores. I have the coordinates (latitude,long) of all the stores (20) in an array. At the moment I am thinking of looping through the array of stores' coordinates and get the distance from the user's current location to the store's location and then add them into array and does sorting on the lowest distance. Is this a correct approach or very resource hungry? The nearest question of SOF was this one

Getting routes and turn-by-turn navigation in an iPhone app

烈酒焚心 提交于 2019-12-05 02:40:30
I'm developing an app that will focus heavily on giving users routes and turn-by-turn directions while driving. It is important that they stay within the app during their drive, so I really don't want to make them leave the app and go to the built-in Maps app. I have been doing a lot of research lately on how to include this functionality, and it is widely known that it is not easy, since Apple doesn't include this functionality in the SDK out of the box. It looks like my options are: For providing routes (and directions) from one place to another Use a UIWebView and load some web-based maps