mapkit

kCLErrorDomain error 2 after geocoding repeatedly with CLGeocoder

ε祈祈猫儿з 提交于 2019-11-27 03:47:45
问题 I have a search bar in my application that the user can type an address into, and it will come up with the geocoded result. The result updates as the user types, according to the following code: - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { ... if (self.geocoder.geocoding) [self.geocoder cancelGeocode]; [self.geocoder geocodeAddressString:searchText completionHandler:^(NSArray *placemarks, NSError *error) { if (error != nil) { NSLog(@"ERROR during geocode:

why self.locationManager stopUpdatingLocation doesn't stop location update

半腔热情 提交于 2019-11-27 03:46:27
问题 Problem : It seems I can't stop Core Location from sending updates to my app / tracking. What am I doing : In my viewWillAppear I call self.locationManager and pass it to a method to show user's location on the map (an instance of MKMapView ). The getter is overridden to check for availability of the serive, to see whether its authorized. If so, it allocs/inits and startMonitoringSignificantLocationChanges and returns . In viewDidDisappear , I call [self.locationManager stopUpdatingLocation]

Slight zoom on MKCoordinateRegion?

家住魔仙堡 提交于 2019-11-27 03:36:15
问题 I am zooming an MKMapView to fit the bounding region of a collection of pins, however when the pins are displayed I have noticed that the zoom could ideally do with being a little tighter. My proposed solution to this was to make the region deltas slightly smaller: // SMALL ZOOM region.span.latitudeDelta = (upper.latitude - lower.latitude) * 0.9; region.span.longitudeDelta = (upper.longitude - lower.longitude) * 0.9; However I have noticed that fine adjustments don't seem to translate to a

How to make the union between two MKCoordinateRegion

匆匆过客 提交于 2019-11-27 03:35:44
问题 I'm trying to do the union between two MKCoordinateRegion. Does anybody have an idea on how to do this? 回答1: There is a MKMapRectUnion function which accepts two MKMapRects so you could first convert each MKCoordinateRegion to an MKMapRect and then call that function (and convert the result back to an MKCoordinateRegion using the MKCoordinateRegionForMapRect function). The conversion method might look like this: - (MKMapRect)mapRectForCoordinateRegion:(MKCoordinateRegion)coordinateRegion {

Multiple MKOverlays on a MKMapView lead to memory warnings

帅比萌擦擦* 提交于 2019-11-27 03:32:14
问题 I'm working on an iPhone app that shows a map with multiple circle overlays on certain locations. I'm running into serious memory issues and crashes when I add more than 6 circles and I zoom out far enough that they are all visible. When I zoom in such that only 2 circles are visible, all is fine. When I remove the MKOverlays, everything works fine. Anyone who recognizes this behavior? Code that creates the overlays. I store the overlays in a NSMutableDictionary for future reference (to be

iOS - How to limit the MapView to a specific region?

让人想犯罪 __ 提交于 2019-11-27 03:06:37
I have the following problem: I have a "drawn map" (image) which I add to the MapView as an Overlay. No Problem with that.. but I need to limit the MapView to the region of the Overlay, so a user isn't able to scroll/zoom outside of this region.. but it should be possible to scroll/zoom inside the "bounds" of the overlay - means I cannot just disable zoom/scrolling for the MapView. Are there any ideas/solution on this topic? The reason for using the MapView/-Kit is that I need to add various POIs to the custom map. This may become more complex when just using an ImageView+ScrollView for

How to get left-top and right-bottom latitude and longitude of map in MapKit

戏子无情 提交于 2019-11-27 02:47:45
问题 How to get left-top and right-bottom latitude and longitude of map in MapKit? I use this code, but it doesn't work properly. How should I fix it? MKCoordinateRegion region = [map region]; double topL,topG,bottomL,bottomG; //if latitude=55 and latitudeDelta=126 topL is 118 and it will be not at top, it will be at buttom of screen topL = region.center.latitude + region.span.latitudeDelta/2; topG = region.center.longitude - region.span.longitudeDelta/2; CLLocationCoordinate2D lt; lt.latitude

iOS app getting throttled from local searches

我的未来我决定 提交于 2019-11-27 02:42:12
问题 I am implementing autocomplete (one search per new character added) in an app that searches for addresses, and I keep getting MKErrorDomain error 3 , which is MKErrorLoadingThrottled . This error, according to Apple dev, occurs when The data was not loaded because data throttling is in effect. This error can occur if an app makes frequent requests for data over a short period of time. I know exactly how many requests are being made, one for each new charachter in the search query (just like

MKMapView doesn't zoom correctly while user tracking mode is MKUserTrackingModeFollowWithHeading

霸气de小男生 提交于 2019-11-27 02:18:15
问题 I created a test project with few lines of code and with two components: MKMapView and UIButton . I ticked mapView option - Shows user location . Also I defined an action for the button, it zooms the map to user location. Here is code from controller: - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; self.mapView.userTrackingMode = MKUserTrackingModeFollowWithHeading; self.mapView.delegate = self; } - (IBAction)changeRegion:(id)sender { MKCoordinateRegion region =

Animated gif not working in MKMapView overlay using MKOverlayRenderer

允我心安 提交于 2019-11-27 01:46:48
I am trying to display an animated gif in an overlay for MKMapView . The overlay is created using the MKOverlayRenderer . To animate the gif in iOS 7, I'm using the UIImage+animatedGIF category posted here on GitHub. The image of the animated gif displays fine in the overlay using the category; however, the gif does not animate. I have no problem using the category to animate a gif in a UIImageView but it does not seem to work correctly in a map view overlay. How can I use this category to place an animated gif in a map view overlay? or... Is there a way to place a UIImageView in the overlay