mkmapview

How can i get any information like lat,long when i touch on MKMapView in iPhone/iPad?

自作多情 提交于 2019-12-09 23:52:21
问题 I have a mapView using xib file now when i touch in the mapview i want the latitude and longitude of that particular area so there any whey or any sample code which help me in this task.Thanks in Advance. 回答1: With iOS 3.2 or greater, it's probably better and simpler to use a UIGestureRecognizer with the map view instead of trying to subclass it and intercepting touches manually. First, add the gesture recognizer to the map view: UITapGestureRecognizer *tgr = [[UITapGestureRecognizer alloc]

Draw poly line on the road in mkmap view - iphone

被刻印的时光 ゝ 提交于 2019-12-09 22:00:48
问题 i am making an navigation based application. In this application i am drawing a route from points selected by the user. for Calculating the route i have used Google direction API . and for drawing the route i have used this code - (void) drawRoute:(NSArray *) path { NSInteger numberOfSteps = path.count; [self.objMapView removeOverlays: self.objMapView.overlays]; CLLocationCoordinate2D coordinates[numberOfSteps]; for (NSInteger index = 0; index < numberOfSteps; index++) { CLLocation *location

mkmapview MKUserLocation AnnotationView

不羁岁月 提交于 2019-12-09 19:20:54
问题 I'm trying to create custom annotationviews for the annotations on my map. I'm doing that by adapting the protocol MKMapViewDelegate and overwriting the function mapView:viewForAnnotation: . It all works, the only problem is that I also have showsUserLocation set to TRUE , which means that one "Annotation" I get in my mapView:viewForAnnotation: method is of the class MKUserLocation . I don't want the userlocation annotation to have my custom annotationview, I want that one to show the default

Setting a MapView's center coordinate does not take into account full size of MapView (off-screen portion)

穿精又带淫゛_ 提交于 2019-12-09 18:46:03
问题 The Problem I have a view that includes a full-screen MKMapView. The bottom half of the MapView is covered with a TableView that has translucent cells so that the map shows through. When I center on an annotation coordinate, the current location for example, the annotation view is blocked by the TableView. - (void)centerOnCurrentLocation { MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(self.locationManager.location.coordinate, 50000, 50000); [self.mapView setRegion:[self

Performance issues with MapKit on iOS6

送分小仙女□ 提交于 2019-12-09 18:40:29
问题 After updating to iOS 6 I have noticed sever performance decreases when panning or zooming a MKMapView with multiple overlays. An app I created has approximately 600 polygon overlays of various colours, and ran lag-free (even on older iOS devices) on iOS 5, now runs extremely laggily (when zooming & panning) on iOS 6, even on the latest devices. My hunch is that this is due to the fact the device has to actually dynamically create the map (since its vector based) rather than just display

This IP, site or mobile application is not authorized to use this API key. How to fix this issue for an ios app?

烈酒焚心 提交于 2019-12-09 18:31:33
问题 I'm working on Augmented reality in ios app. I found a nice tutorial and a sample project from this site. While running that app in my device, I received the error in NSLOG console, Response: { "error_message" = "This IP, site or mobile application is not authorized to use this API key."; "html_attributions" = ( ); results = ( ); status = "REQUEST_DENIED"; } I'd created a new project in Google dev site and created Sever Key as iOS Key is not supported for Google places Api. I'd also tried

check if a user allows the app to use their location

拈花ヽ惹草 提交于 2019-12-09 16:43:19
问题 The first time the app tries to get the users location they are prompted with "Would like to use your current location" and they can hit Don't allow or ok. Is there any way to find out if the user has hit ok or don't allow? I'm trying to have the MKMapView show the users current location but I would like to take different actions based on the users selection. Normally you would think there would be a delegate to get this information but there doesn't seem to be. Thanks in advance for your

Putting a CLPlacemark on Map in iOS 5

时间秒杀一切 提交于 2019-12-09 09:51:37
问题 In iOS 5, there is a new way to forward geocode address (converting address like 1 Infinite Loop, CA, USA to lat/lang address). More info on this is here. Has anybody tried to put the forward geocoded CLPlacemark object on a MKMapView? I have a CLPlacemark object after geocoding but have no clue how to put it on a map. I would appreciate any type of help. Google is of no help so far. 回答1: In addition to the selected answer, there is also this way for adding annotations to the mapView for

How to suppress the “Current Location” callout in map view

谁说我不能喝 提交于 2019-12-09 08:25:47
问题 Tapping the pulsating blue circle representing the userLocation brings up a "Current Location" callout. Is there a way to suppress that? 回答1: There's a property on the annotation view you can change, once the user location has been updated: - (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation { MKAnnotationView *userLocationView = [mapView viewForAnnotation:userLocation]; userLocationView.canShowCallout = NO; } 回答2: You can set the title to blank to

Mapkit with multi annotation (callout), mapping the next view

柔情痞子 提交于 2019-12-09 07:18:38
问题 Wanted some help with a problem with mapkit I am facing. Should be a silly problem or I have missed out something while going through the mapkit framework. Here is the senario. I am placing multiple annotation on the map when the user performs some search like pizza. Added button for the right annotation view, on click which opens a next detail view. The problem is how to send some information to the next view, for example I add index to annotations while creating them, now I want to access