mkmapview

mapview autozoom on current location automatic

落花浮王杯 提交于 2019-12-12 04:37:54
问题 I have one problem. I've been looking at the other answers here on stack overflow about the same question and I can't get them to work for me. So I'm going to try asking here. What I want to do is when I'm on map view and have got the user location I want to automatically zoom into the location. the h-file #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import <CoreLocation/CoreLocation.h> @interface WalkingTableViewController: UIViewController <MKMapViewDelegate> @property (weak,

Implementing MKPinAnnotationView drag feature?

半城伤御伤魂 提交于 2019-12-12 03:35:19
问题 Can anyone suggest a good tutorial for implementing dragging feature for MKPinAnnotationView in iPhone MKMapView ? 回答1: you can find source code demo for MKPinAnnotationView Drag & drop feature from this link. Update: The Github project link given in above site url is not working. But I found new project example for that from this url. 回答2: To make an annotation draggable, set the annotation view's draggable property to YES. This is normally done in the viewForAnnotation delegate method so

didSelectAnnotationView called automatically when custom annotations are added to mapView

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 03:17:24
问题 Am trying to add custom annotations on MKMapView and implement custom callOut view on tap of annotation. Am following this link for the same. The issue is when I add the custom annotation didSelectAnnotationView is called on its own and the popOver callout is shown, even when the user has not clicked the annotation Here is my code: -(void)callAddAnnotationsLocal{ [_mapView removeAnnotations:[_mapView annotations]]; CLLocationCoordinate2D coord = {.latitude = 43.3998170679, .longitude = -95

Multiple map views in same app

拥有回忆 提交于 2019-12-12 03:08:34
问题 I wrote this code to add a map view in a single page for my app. I want to add one more page with a different map view. How can I do this? controller.h # import < UIKit/UIKit.h > # import < MapKit/MapKit.h > @interface __3_ProductionsViewController : UIViewController { MKMapView *mapview; } @property (nonatomic, retain) IBOutlet MKMapView *mapview; -(IBAction)setMap:(id)sender; -(IBAction)getlocation; @end controller.m # import "__3_ProductionsViewController.h" # import " NewClass.h " #

Adding mapview annotations within parse query returns null randomly

旧街凉风 提交于 2019-12-12 02:47:19
问题 I am creating an iOS app using Parse database(asynchronously) to store information that will be used when populating a mapview. I have been trying to figure out what is wrong for a long time and have done plenty of research without any luck. I have, however, found the source of the issue. In my code, I am querying the parse database in hopes of getting the information I want and then storing the information in a custom pointAnnotation class, which is of type MkPointAnnotation. Each item is

IOS - Mapkit crash - Is it a bug in xcode 4.2 and Automatic Reference Counting (ARC)?

戏子无情 提交于 2019-12-12 02:40:00
问题 I have found a very wierd problem in MKMapView that i think might be a bug in the new xcode 4.2 and ARC (Automatic Reference Count). I created a very basic UIViewController class: MapViewController, that implements the protocol : #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import <CoreLocation/CoreLocation.h> @interface MapViewController : UIViewController <MKMapViewDelegate> @property (strong, nonatomic) IBOutlet MKMapView *mapView; I use a xib file to instantiate the mapview and link

Get address from latitude and longitude in ios

邮差的信 提交于 2019-12-12 02:23:43
问题 I have been programming for ios and I need to get address. How can I get full address from latitude and longitude in json or other format? Can I get it without internet connection? Thank you for your attention. 回答1: What you need is the CLGeocoder (on iOS 5) and MKReverseGeocoder (on older iOS versions). Both use Google Maps to get address data so you need an internet connection to get data. You'll get address as NSDictionary , but you can easily convert it to a JSON string with JSONKit or

Detect Callout overlap other UIViews in MKMapView

女生的网名这么多〃 提交于 2019-12-12 01:53:41
问题 I have Some UIViews that are displayed over an MKMapView to serve as controls to filter the content of the map and my mapView have annotations that can show callout.I want to create an effect where my overlays will fade away if my callout appears or gets scrolled under the overlays and become visible again after the callout does not takes its place. Is there a way to find out if the Callout of an MKMapView is overlapping a UIView ? I have tried: Accessing frame of Callout to check if it

Drop Pin on current location

馋奶兔 提交于 2019-12-12 01:32:03
问题 I am building an iOS app and need to be able to place a pin where the user currently is! For some reason I have been having an awful time getting it to work! I tried the following code but was faced with an error. - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{ if (annotation == mapView.userLocation) { MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil]; annView.pinColor =

Several and different custom Pins in the same mapView

半腔热情 提交于 2019-12-12 01:12:25
问题 This is my question.... I have a mapView and i fill the view with several custom pins. I would different custom pins in my mapView. I have tried with an IF condition but don't work. I don't understand how the called to method works. Follow the code. Vi allego il codice. //Customization of my pins - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation(id<MKAnnotation>)annotation{ static NSString *identifier = @""; MKAnnotationView *pin = [ mappa