mapkit

How to get to the max zoomlevel on iOS MKMapView

北城以北 提交于 2019-11-29 06:58:39
One of my apps uses the MKMapView at a very high (max) zoomLevel (high detail map) With the introduction of iOS7, I can't come nearly as close to the map as before. I am using the mapView setRegion: method for this. I have been running tests and these are the results: spans across iOS versions in full screen portrait mode mapview: iOS 5.1: 140 meters iOS 6.1: 70 meters iOS 7.0.3: 281 meters iOS 7.0.3: 160 meters (if pinched manually!!) Is there a way to achieve the 160 meters (the max zoomlevel) programmatically on iOS 7.0.3 (I know the horizontal span depends on the lattitude, so the number

iOS app doesn't ask for location permission

廉价感情. 提交于 2019-11-29 06:39:22
My Swift-iOS app is meant to show the user's location on a map. However, the XCode debug console tells me I need to ask permission to show the user's location. I think, I do that but the dialog never comes up. Here is the error message, and below the ViewController where I call CLLocationManager::requestWhenInUseAuthorization() Error: 2014-06-30 21:25:13.927 RowingTracker2[17642:1608253] Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first.

Determining Midpoint Between 2 Coordinates

折月煮酒 提交于 2019-11-29 06:24:18
问题 I am trying to determine the midpoint between two locations in an MKMapView . I am following the method outlined here (and here) and rewrote it in Objective-C, but the map is being centered somewhere northeast of Baffin Island, which is no where near the two points. My method based on the java method linked above: +(CLLocationCoordinate2D)findCenterPoint:(CLLocationCoordinate2D)_lo1 :(CLLocationCoordinate2D)_loc2 { CLLocationCoordinate2D center; double lon1 = _lo1.longitude * M_PI / 180;

put CLLocationCoordinate2D into CLLocation for Swift

[亡魂溺海] 提交于 2019-11-29 06:16:53
问题 I have a method I want to call however when I get back the center of the map, it is in CLLocationCoordinate2D type. How do I put the results of CLLocationCoordinate2D into CLLocation? 回答1: Figured it out. When mapView changes region, get the Lat and Lon from CLLocationCoordinate2D and create a CLLocation variable with the lat and lon passed in. func mapView(mapView: MKMapView!, regionDidChangeAnimated animated: Bool){ var centre = mapView.centerCoordinate as CLLocationCoordinate2D var getLat:

Should I use MKAnnotation, MKAnnotationView or MKPinAnnotation?

落花浮王杯 提交于 2019-11-29 04:48:58
I'm calling a webservice and plotting some objects on a MapView. What I'm failing to understand is should I use MKAnnotationPoint or MkAnnotationView? I'm not sure. When I use MKAnnotation, the pins show up on the map, if I click on them, they show me the title, and subtitle. If I use MKAnnotationView, the pins show up but when I click on them, nothing happens. I'm also trying to add the right button callout/chevron looking button but haven't been able to figure that out either. Here's an example of my code. MKPointAnnotation mk = new MKPointAnnotation(); MKAnnotationView mkView = new

How to use custom icons with mapKit framework?

丶灬走出姿态 提交于 2019-11-29 04:21:35
I am using the MapKit framework to load google maps on my application and I place on map 4 "simulated" places like this: - (void)viewDidLoad { [super viewDidLoad]; mapView.delegate = self; mapView.showsUserLocation = YES; MKUserLocation *userLocation = mapView.userLocation; MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance (userLocation.location.coordinate,500,500); [mapView setRegion:region animated:NO]; //Simulated annotations on the map CLLocationCoordinate2D poi1Coord , poi2Coord , poi3Coord , poi4Coord; //poi1 coordinates poi1Coord.latitude = 37.78754; poi1Coord.longitude =

how to update MKPolyline / MKPolylineView?

∥☆過路亽.° 提交于 2019-11-29 03:27:16
I am trying to create a polyline (MKPolyline) overlay that updates periodically, to simulate the movement of an object. I can achieve this by removing the old overlay, updating the polyline and adding the overlay again, but this leads to flickering. For a point annotation (MKPointAnnotation) you can simply change its coordinate, and the view will be updated automatically and smoothly without having to remove and re-add the annotation. Is this also possible somehow for an overlay? yea, you would have to add an additional overlay with the point set of from your last point to your next point.

move animation with custom annotation IOS Swift Like Ola Uber App MapKit

六眼飞鱼酱① 提交于 2019-11-29 02:42:33
**Here the car image where I want to only rotate car icon.** In my app I'm receiving location from server in every 10 seconds so I want to animate my custom annotation with animation from one point to another point. I want to move annotation with MapKit in iOS Swift 3 how to give the move animation from one location to another. I sending my viewController class code please read carefully and help me to get out from this thanks Here I am Adding custom annotation var point : MyCustomAnnotation? point = MyCustomAnnotation(coordinate: CLLocationCoordinate2D(latitude: self.latitude , longitude:

How to draw arc/curve line with MKOverlayView on MKMapView

社会主义新天地 提交于 2019-11-29 02:32:41
问题 Help needed now. I can draw lines with MKPolyline and MKPolylineView, but how to draw an arc or curve lines between two coordinates on the MKMapView? Great thanks. The Final Solution Finally I wrote myself these conclusions here to help who want it. If you want to: just draw arc path on map just draw an image on map combine arc path and image as overlay on map So the solutions are: There are MKPolyline and MKPolylineView to draw lines, MKPolygon and MKPolygonView to draw polygons, MKCircle

Number of “region” monitored by RegionMonitoring, based on users current location in iOS7

耗尽温柔 提交于 2019-11-29 02:29:34
I am working on such a project where apps do the following things: User select a radius (10 meter to 1000 meter) and go to next viewController by pressing "Go" button Here apps Grab users current position and start "region monitoring" based on that current position with selected radius If the user cross that certain boundary (10 meter to 1000 meter) then it gives an "ExitRegion" alert message. And start "region monitoring" again based on users new current position. And the apps keep doing this all the time, both foreground and background mode. I manage to do it & it is working perfectly. Now,