mapkit

iOS6 Simulator MKMapKit “Couldn't find default.styleproto in framework”

荒凉一梦 提交于 2019-11-28 06:48:32
Running my app with the iOS6 simulator I am getting the following printed in the XCode console prior to viewDidLoad getting called: Couldn't find default.styleproto in framework Has anyone else encountered this, and if so have you found a reason why? My guess is that it has to do with the iOS6 Apple Maps, but who knows! EDIT I should add that I don't get this warning in the iOS 5.1 simulator. I found a way to consistently reproduce this. First, the culprit is a set of files in the Cache folder for your simulator. Go to your Application Support folder for the iPhone Simulator: ~/Library

How to disable user interaction on MKMapView?

旧城冷巷雨未停 提交于 2019-11-28 06:46:38
How do you disable user interaction to an entire Map (MKMapView) in iOS? I just want to disable zooming, tapping, etc and show a static map. [self.mapView setUserInteractionEnabled:NO] didn't work. Found no working solutions via Google or other answers here on Stack (pls link if you find a working answer..) . Targeting iOS 5. There should be an easier way to do this. Rob The key is to disable zooms and scrolls, such as: self.mapView.zoomEnabled = false; self.mapView.scrollEnabled = false; self.mapView.userInteractionEnabled = false; You can do this in Interface Builder like this: How about

Annotation along route in MapKit

我的未来我决定 提交于 2019-11-28 06:02:39
I'm using MapKit to display directions between locations, and I'm looking for a way to add an annotation that works similarly to the route annotation in the Apple Maps app, where annotations are showing each route's travel time (as shown in the image below). I am already drawing the directions correctly, the problem at hand is how to calculate a pair of coordinates along the route. That is, where to drop the annotation. I thought about somehow using the MKDirection (which contains complete directions, step by step) but I am not sure how I would generate a pair of coordinates that are somewhere

Is the Current Location/Compass heading button available in the iOS sdk?

拟墨画扇 提交于 2019-11-28 05:59:27
I am working on a sample map kit app for iOS. I have everything working and a toolbar button to toggle the MKUserTrackingMode. This may seem like a silly question but I have searched all the options in the IB and looked in the documentation, and I can't find any button options like the one for the current location/compass heading used in the iOS Maps app. Is that particular button available to developers? You need to create a MKUserTrackingBarButtonItem and pass it the MKMapview in the constructor, then add that button item to the navigation menu (or where ever it is your button should be). -

How to draw a route between two locations using MapKit in Swift?

故事扮演 提交于 2019-11-28 05:53:27
How can I draw a route between user's current location to a specific location using MapKit in Swift? I searched a lot, but didn't find any helpful Swift-specific links or tutorials. class MapController: UIViewController, MKMapViewDelegate { func showRouteOnMap() { let request = MKDirectionsRequest() request.source = MKMapItem(placemark: MKPlacemark(coordinate: annotation1.coordinate, addressDictionary: nil)) request.destination = MKMapItem(placemark: MKPlacemark(coordinate: annotation2.coordinate, addressDictionary: nil)) request.requestsAlternateRoutes = true request.transportType =

iOS MapKit connect multiple points on map over roads

老子叫甜甜 提交于 2019-11-28 05:50:20
问题 I'm using this code to connect pins(points on map) with polyline: CLLocationCoordinate2D coordinates[allLocations.count]; int i = 0; for (locHolder *location in allLocations) { coordinates[i] = CLLocationCoordinate2DMake([location.lat floatValue], [location floatValue]); i++; } MKPolyline *polyline = [MKPolyline polylineWithCoordinates:coordinates count:[allLocations count]]; self->polyline = polyline; [self.mapView addOverlay:self->polyline level:MKOverlayLevelAboveRoads]; But this code

How can I group MKAnnotations automatically regarding zoom level?

青春壹個敷衍的年華 提交于 2019-11-28 05:06:10
if the user zooms out on a MKMapView, i want MKAnnotations which are near to each other automatically grouped into one "group" annotation. if the user zooms back in, the "group" annotation should be split again to the unique/original annotations. apple does this already in the iOS 4 Photos.app is there a common, "predefined" way to do this? ninjaproger Its normal working with more than 1500 annotations on the map: -(void)mapView:(MKMapView *)mapView_ regionDidChangeAnimated:(BOOL)animated { NSMutableSet * coordSet = [[NSMutableSet alloc] init]; for(id<MKAnnotation> an in mapView_.annotations)

How to open call out MKAnnotationView programmatically? (iPhone, MapKit)

不羁岁月 提交于 2019-11-28 04:42:52
I want to open up the callout for an MKPinAnnotationView programmatically. Eg I drop 10 pins on the map, and want to open up the one closest to me. How would I go about doing this? Apple has specified the 'selected' parameter for MKAnnotationView's , but discourages setting it directly (this doesn't work, tried it). For the rest MKAnnotationView only has a setHighlighted ( same story ), and can ShowCallout method.. Any hints if this is possible at all? Chip Coons In your mapViewController create an action method: - (void)openAnnotation:(id)annotation { //mv is the mapView [mv selectAnnotation

MKPolylineRenderer produces jagged, unequal paths

折月煮酒 提交于 2019-11-28 03:19:29
问题 I am using the iOS 7 MapKit APIs to produce 3D camera movements on a map that displays an MKDirectionsRequest-produced path. The path is rendered by MKOverlayRenderer like so: -(void)showRoute:(MKDirectionsResponse *)response { for (MKRoute *route in response.routes) { [self.map addOverlay:route.polyline level:MKOverlayLevelAboveRoads]; } } - (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id < MKOverlay >)overlay { MKPolylineRenderer *renderer = [[MKPolylineRenderer

CLLocation returning negative speed

ぐ巨炮叔叔 提交于 2019-11-28 03:03:57
问题 I'm starting a new app which uses the coreLocation and the mapkit frameworks. My problem is trying to get the current speed always returns me a negative value, i have take my iPhone with me to places with a good 3g signal and it doesn't matter, location.speed value is always -1. here is the code which matters: #define kRequiredAccuracy 1500.0 //meters #define kMaxAge 60.0 //seconds in the init method: self.locationManager=[[CLLocationManager alloc] init]; self.locationManager.delegate=self;