mkmapview

How to know annotation index MKMapview ios

删除回忆录丶 提交于 2020-01-17 06:20:52
问题 Hi i have 100 annotations in mapview ontap of one of its annotations i should get annotation index related to that. Does anyone have idea about getting tag number for that? Looking for any delegate method does. 回答1: Found an answer this will return annotation tapped number: - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view { NSUInteger index = [mapView.annotations indexOfObject:view.annotation]; NSLog(@"index no %d",index); } The above code will generate

MKDirections calculateETAWithCompletionHandler executing with delay Swift 2.0

孤街醉人 提交于 2020-01-16 03:57:27
问题 I'm trying to calculate the ETA between two coordinates in Swift using calculateETAWithCompletionHandler from the MKDirections class. I have the following code in my program, MapViewController.swift print("A") calculateETAofClosestBus(closestBusStop) print("B") func calculateETAofClosestBus(destination: BusStop) { var shortestETA = 0 print("C") var request = MKDirectionsRequest() var sourceItem = MKMapItem(placemark: MKPlacemark(coordinate: listBuses[0].pin.coordinate, addressDictionary: nil)

Why is drawRect on MKOverlayRenderer slow

落花浮王杯 提交于 2020-01-15 04:50:10
问题 For an app, I have to place a MKCircle annotation on a MKMapView. However, the circle needs to be moved/resized. I know this has been asked, e.g. Moving MKCircle in MKMapView where removing/adding the annotation is suggested to get that behavior. However, I consider the drawing being very slow, like the user in this post: Smooth resizing of MKCircle. Since there are now answers to this question, the question seemed to use YHAnimatedCircleView . By slow I mean, when I use a UISlider to change

Memory usage of MKMapView is very high

依然范特西╮ 提交于 2020-01-13 19:43:51
问题 So i have a UIScrollView with UIPageControl which has a bunch of MKMapViews (mostly 15 different maps). The app is really sluggish once this view loads and after a few minutes of usage i get a memory warning. I looked at it in Instruments and the maps take an insanely high chunk of memory. Even upto ~200mb sometimes. One thing i can think of is to reuse the mapViews. But because of how the views are structured the coding complexity increases. Any suggestions how i can improve performance?

How to use delegates in Google map API for IOS 6 [closed]

筅森魡賤 提交于 2020-01-13 06:50:09
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . In my iphone app I am using google map SDK for showing nearby restaurants.I am able to show the places. I have some doubts.. 1. How can I find out the center coordinates of the map ?? 2. How to revert back to

General-Block 56, 1024, 8, 244, 24 Memory Leaks using UIWebView loadRequest

♀尐吖头ヾ 提交于 2020-01-13 03:17:46
问题 I'm getting memory leaks that i can't figure out through leaks, build/analyze or overall inspection how to repair. I have a very strong notion that it's due to the loadRequest command from my UIWebview loading javascript, but I can't figure out what's wrong. Here's my setup: I have a tabbarcontroller that i programatically create with 4 view controllers: a table view, a mapview, another table view and a webview, respectively. the 1st tableview shows static data. the mapview shows annotations

iOS 6 Map problems with MKUserTrackingModeFollowWithHeading

时间秒杀一切 提交于 2020-01-12 08:47:26
问题 I'm trying to solve two problems with MKUserTrackingModeFollowWithHeading in iOS 6: MKUserTrackingModeFollowWithHeading works briefly, but it's jittery and returns to MKUserTrackingModeFollow almost immediately, especially at high zoom levels. The app occasionally crashes when repeatedly changing the MKUserTrackingMode : I get EXC_BAD_ACCESS on the main thread, without further information. This is hard to reproduce, but it has happened repeatedly. Any thoughts on what might be causing this?

Clean solution to know which MKAnnotation has been tapped?

对着背影说爱祢 提交于 2020-01-12 05:28:26
问题 Ok, so you typically have some object X you want to be annotated inside a MKMapView. You do this way: DDAnnotation *annotation = [[DDAnnotation alloc] initWithCoordinate: poi.geoLocation.coordinate title: @"My Annotation"]; [_mapView addAnnotation: annotation]; Then you create the annotation view inside - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation; And when some callout gets tapped, you handle the event inside: - (void)mapView:(MKMapView *

I need help with a MKMapView crash

◇◆丶佛笑我妖孽 提交于 2020-01-12 05:25:11
问题 One of the most frequent crashes of my live app is a crash at MKMapView. It crash at the internal method -[MKMapView mapTileViewDidFinishLoading:] . During my test I could not retrace the crash but is very frequent in the crash reports on iTunes Connect. Has anyboday some experience with this crash? It is only a very simple map showing exactly one annotation. Here is the complete stacktrace of this crash: Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at

iphone: ubercab aka (uber) map coordinate

▼魔方 西西 提交于 2020-01-12 03:42:08
问题 Can anyone describe how to get the map coordinate of a MKMapView by its position on center of screen? Check out Uber app (its free). They have a pin statically located in the middle of the screen and you drag the map but the pin stays there. The middle of the screen is they find your location (very very quickly) showing you the address you are close to. 回答1: Heyo! I'm the mobile Engineer at Uber (you asked for some Uber help I assume :)) The trick is to place the pin, which is actually a