mkmapview

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

邮差的信 提交于 2019-12-07 02:26:48
问题 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 -

How to add annotation on center of map view in iPhone?

风流意气都作罢 提交于 2019-12-07 01:37:01
问题 I have MAP view in my app and i want to add Annotation pin (Red pin) on center of map view. Now when user scroll map view pin should adjust with center according to that. How to do that? Thank 回答1: If you want to use an actual annotation instead of just a regular view positioned above the center of the map view, you can: use an annotation class with a settable coordinate property (pre-defined MKPointAnnotation class eg). This avoids having to remove and add the annotation when the center

custom MKAnnotation not moving when coordinate set

空扰寡人 提交于 2019-12-07 01:34:05
问题 I've got a custom MKAnnotation set up class Location: NSObject, MKAnnotation { var id: Int var title: String? var name: String var coordinate: CLLocationCoordinate2D { didSet{ didChangeValueForKey("coordinate") } } when i set the coordinate it does not move the pin on the map. I added the 'didSet' with the key word coordinate as i found people saying that would force it to update. but nothing, it doesn't move. i have verified the lat / long have changed and are correct, the pin just isn't

iOS driving directions in iOS6

岁酱吖の 提交于 2019-12-06 21:35:30
I have been searching all around about how to integrate driving directions into MKMapView within my application. Is the only way to open the Apple Maps program and go from there, or is their a way of integrating within your own app. If not, I will probably go with google maps as soon as I can get an API key. Paul Peelen If you mean getting the same views for driving direction (a.k.a. turn-by-turn navigation) as the Apple Maps application, then no... as far as I know, there is no library for that (if not 3rd party). However, as you mentioned, you can open apple maps or google maps giving the

How to clear MKMapView cache?

大憨熊 提交于 2019-12-06 20:11:33
问题 I am trying load map region and MKMapView delegate methods are not being called on second or subsequent load. None of the delegate methods viz - (void)mapViewWillStartLoadingMap:(MKMapView *)mapView; - (void)mapViewDidFinishLoadingMap:(MKMapView *)mapView; - (void)mapViewDidFailLoadingMap:(MKMapView *)mapView withError:(NSError *)error; are ever called. The Only methods called are - (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)animated; - (void)mapView:(MKMapView *

Recognising a circle gesture to drop an annotation, how to detect circle?

佐手、 提交于 2019-12-06 17:17:41
问题 I've found some code which detects a circle gesture anywhere in a view: http://iphonedevelopment.blogspot.com/2009/04/detecting-circle-gesture.html It works fine. Now I want to incorporate it into a map view, so that the user can draw a circle, and a map pin gets dropped in the the middle of the drawn circle. The above code doesn't work if I subclass a UIView, with the code above, and stick a map on it. (unless I hide the map). Neither does it work if I put the code in a subclassed MKMapView.

Show custom contact information

帅比萌擦擦* 提交于 2019-12-06 16:05:57
So I have an MKMapView and I have a pin on it with a disclosure button. I want the user to be able to tap the disclosure button and the navigation controller to push a new view controller. But I want that new view controller to look like the contacts viewController that comes standard in the contacts app. I need it to display custom contact information because the contact will not be in the users contacts. I have been playing around with ABPerson, but I can't figure it out. I want that contact page to look exactly like the standard page. This is what I've been playing with:

MapView with local search

ぃ、小莉子 提交于 2019-12-06 15:51:33
I've a question about doing a local search in Apple maps which I have already implemented into my app. The app should show the user where are "supermarkets" around him. My mapView also shows the user's current location but I don't really know how I should do this with the results of the market-locations. Maybe Apple provides a solution/advice for this. Thanks in advance. The results (supermarkets) should be displayed as in this picture. UPDATE: The function works perfectly but is it also possible to make these pins clickable to show an info-sheet about this location as in the pictures below?

Mapkit is using too much CPU in IOS 13

折月煮酒 提交于 2019-12-06 15:24:34
Recently my iOS app starting crashing frequently after some users updated to iOS 13.x (it doesn't exhibit the problem in iOS 12.x) I am using Mapkit to render some MKPolygons and MKPolylines. The MKPolylines get removed and re-added to the MKMapView around 10 times per second (that's because my GPS is giving me new lat/longs at 10Hz). I profiled my app in iOS 12.x and it is using around 15% to 30% of CPU resources (iPad Mini 4). I did the same profiling in iOS 13.1.2 and 13.1.3, and the CPU consumption went up to around 150% (there are 2 CPU cores). If I remove the code that renders the 2

Create a title for annotation from MKLocalSearch

三世轮回 提交于 2019-12-06 15:13:43
I have added an MKLocalSearch and the pins are displaying correctly. The only problem is that the pins titles have both the name and address, were I only want the name. How would I change this. Here is the code I am using - - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated { MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init]; request.naturalLanguageQuery = @"School"; request.region = mapView.region; MKLocalSearch *localSearch = [[MKLocalSearch alloc] initWithRequest:request]; [localSearch startWithCompletionHandler:^(MKLocalSearchResponse *response,