mapkit

MapKit Entitlements Oddity

怎甘沉沦 提交于 2019-11-30 22:52:37
I have a simple Mac app, not intended for distribution of any kind; simply personal use. The app is an NSWindow which contains an MKMapView . As I don't have a Mac dev account, and don't want one (see "personal use only"), I'm not doing any form of code signing or provisioning. However, on launch, I get a blank map and this error: Your Application has attempted to access the Map Kit API. You cannot access this API without an entitlement. You may receive an entitlement from the Mac Developer Program for use by you only with your Mac App Store Apps. For more information about Apple's Mac

MKLocalSearch not finding obvious results

被刻印的时光 ゝ 提交于 2019-11-30 22:51:43
My code is virtually identical to the following example: https://github.com/iamamused/Example-MKLocalSearch.git Here are the important bits: @interface ViewController : UIViewController @property (strong, nonatomic) IBOutlet MKMapView *ibMapView; @end @implementation ViewController { MKLocalSearch *localSearch; MKLocalSearchResponse *results; } - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { [localSearch cancel]; MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init]; request.naturalLanguageQuery = searchBar.text; request.region = self.ibMapView.region; localSearch

iphone mapkit drag and get center location

爷,独闯天下 提交于 2019-11-30 22:48:40
HI, I have a Mapview with some marker points + a marker for current location. Now, what I want to do here is, when user drag or traverse through mapview, I want to find coordinate (latitude, longitude) of the new center location after map has been dragged. I want to clarify once again, I am not talking about dragging the marker/point, I am talking about dragging the map with touch. Thanks in advance. Look for theMapView.region.center or theMapView.centerCoordinate (should be the same) in your MapView's delegate -mapView:regionDidChangeAnimated: method. Judging by this document: http:/

How to check if Apple Maps is installed

北城以北 提交于 2019-11-30 22:11:04
问题 Anyone aware how to check whether Apple Maps is installed or not? I could not find anything in the docs. With iOS10 users can delete the Apple Maps application. While for Google Maps we can use UIApplication.shared.canOpenURL() to check if it's installed. I am not aware of such a thing exists to check for Apple Maps. Of course one can check if opening a MKMapItem with mapItem.openInMaps() fails - but that does not help for checking in advance. 回答1: The simple answer is this is not currently

Find out which type of area you are in from MKMapView

半世苍凉 提交于 2019-11-30 21:48:20
is there any way to determine which type of area you are in from a MKMapView? I.e. if the centre of the map is in the ocean we can tell the user: the centre of the map is above the ocean, or if the map is centred above a green area: the centre of the map is above parkland... The only way I can think of to do this is to create a screenshot of the visible screen and analyse the colour of each bit by using some method such as this: iOS -- detect the color of a pixel? However I would be interested to know if there is an easier way that anyone can think of! EDIT To make it more clear what I'm

MKMapview annotation dynamic pin image changes after zooming

纵然是瞬间 提交于 2019-11-30 21:15:10
I am working on a little project that shows 7 different types of annotations on the map. My annotations are taken from a url result in array and I parse it using JSON. I have lots of annotations and everything seems to look good once the map loads. After zooming in and zooming out, the the pin images changes for some reason to the wrong pin image (a specific image, no clue why). I am sure I am missing something here...may you please help :) ? Here's one part of my code, let me know if you need anymore of it: -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>

Is MKMapView leaky

对着背影说爱祢 提交于 2019-11-30 20:54:23
问题 As well as my question "Removing MKMapView Annotations causes leaks." I have discovered that if you create a view based project, add a UISearchBar and MKMapView into the view's NIB, wire up the delegates (I'm not creating any methods as we don't actually need to do anything to trigger the leaks), link in the MapKit and fire up the project, then simply clicking in the UISearchBar causes a 1k+ leak. This doesn't happen unless you have both UISearchBar and MKMapView in a view. I have the same

Map annotation display all the same image/pins for all points

女生的网名这么多〃 提交于 2019-11-30 20:48:01
问题 I have a conditional statement to add map annotation icons/pins in the method below. The problem I'm having is that the map is being populated with all the same icon. It should detect the cat id and display the icons depending on which cat id is detected. I'm not sure what the problem is because this did work in iOS 6 and now in iOS 7 the map only displays all the same annotation icon images. - (MKAnnotationView *) mapView:(MKMapView *)mapingView viewForAnnotation:(id <MKAnnotation>)

How to add touch gesture to map but ignore touches on pins and annotations?

匆匆过客 提交于 2019-11-30 20:21:42
I have a mapview that uses MKCircle s to display radius information for certain user actions. What I want to do, is allow the user to dismiss the MKCircle when they touch the map. However, I would like the MKCircle to NOT dismiss should the user touch any of the other pins or the MKCircle itself. Any ideas? Here is my current code, which dismisses the MKCircle when any part of the map is touched: UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(deactivateAllRadars)]; [tap setCancelsTouchesInView:NO]; [_mapView addGestureRecognizer:tap]; In the

MapKit Annotations Disappearing

守給你的承諾、 提交于 2019-11-30 20:09:24
I have an array of latitudes and another array of longitudes that I add to an array of type CLLocationCoordinate2D. I then use the new array to annotate multiple points on the map. Some, or most, or maybe even all of the annotations are displaying on the map but as I zoom in (yes, zoom IN), some of the annotations disappear, then come back, or dont. Any ideas on how to keep them all visible? This is behavior I would expect while zooming out, not in. Here is the code i'm using for what i've described above. import UIKit import MapKit import CoreLocation class MultiMapVC: UIViewController,