mkmapview

IOS: Adding image to custom MKAnnotationview

风格不统一 提交于 2019-12-18 16:54:27
问题 I want to add a custom image to my annotations in the map. And i have made the following custom MapAnnotationView: #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> #import <CoreLocation/CoreLocation.h> @class POI; @interface MapAnnotation : MKAnnotationView <MKAnnotation > @property (nonatomic) CGFloat lat; @property (nonatomic) CGFloat lon; @property (nonatomic) CGFloat altitude; @property (nonatomic, copy) NSString * title; @property (nonatomic, copy)

How to move MKMapView based on selected annotation

元气小坏坏 提交于 2019-12-18 15:07:09
问题 I have an MKMapView which populates the entirety of my view, but when a pin is selected, I am sliding up another view on top of the map. I want to move the map so the pin will appear in the centre of the visible area of the map. Difficult to explain but hopefully it makes sense! Thanks in advance. 回答1: You could try getting the MKMapRect from visibleMapRect for the map view, converting the annotation's coordinate to an MKMapPoint, resetting the MKMapRect's origin so the MKMapPoint is in the

How to show blue pin with dot (circle) in MKMapView in IPhone

有些话、适合烂在心里 提交于 2019-12-18 13:37:08
问题 my question may seem a bit complicated but let me clarify. i am using mkmapview , in this i want to show current user location with blue dot and circle , but this isn't really exactly what I wanted. As I am making an iPhone application,SInce I am new to map integration its getting difficult for me to do the same.IF any one can provide me a link for its demo or can explain me how to show user location with blue dot with circle on map then it would be of great help to me . Thanks in advance 回答1

How to bring UIBezierPath to the back of a MKAnnotation object?

雨燕双飞 提交于 2019-12-18 12:37:43
问题 In my app, user draws a shape on map and using UIBeizerPath i am drawing that path. Then based on the coordinates of the path i am displaying the results which are only in that area. Everything works great except that now when Annotations drops on the Map view the pins looks like they are behind the path which means path looks in the front. I am using this code to display the Annotation and path : -(void)clearAnnotationAndPath:(id)sender { [_mapView removeAnnotations:_mapView.annotations];

How to select a map pin programmatically

*爱你&永不变心* 提交于 2019-12-18 11:45:02
问题 I am new to Maps Concept. Please find the attached image once. when i click the "pin" i am getting message says "Admire your smile" or any text..... Now i want like... when we select the table view, i need to raise that message for that pin(with out user interaction for that pin)... I am using below code for This maps and pins. -(void) viewWillAppear:(BOOL)animated { [super viewWillAppear:YES]; customLocation.latitude=[casesobjc.latitude_string doubleValue]; customLocation.longitude=

Allow tapping anywhere on an annotation callout without a callout accessory view

安稳与你 提交于 2019-12-18 11:23:49
问题 I have a map view that adds annotations more or less like this: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation { MKAnnotationView *annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"MKPinAnnotationView"]; annotationView.canShowCallout = YES; UIButton *detailButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; [detailButton addTarget:self action:@selector(handleButtonAction)

Optimizing Code for MKMapView - Large Number of Annotations

為{幸葍}努か 提交于 2019-12-18 10:56:45
问题 I have a modal view in my app which displays a UIMapView. I then add a large number of annotations (over 800) to this map view (code below). The problem is that the user is forced to wait a minute or so while all the pins load. Also the app becomes sluggish once all 800 pins are on the map. Can anyone suggest how I can improve my code below ? Thank you. #import "MapView.h" #import "MapPlaceObject.h" @implementation MapView @synthesize mapViewLink, mapLocations, detail, failedLoad; - (id

iPhone: Detecting Tap in MKMapView

我只是一个虾纸丫 提交于 2019-12-18 10:35:31
问题 How do I detect a single tap on an instance of MKMapView ? Do I have to subclass MKMapView and then override the touchesEnded method? Thanks, -Chris 回答1: Hope this will help : How to intercept touches events on a MKMapView or UIWebView objects? 回答2: If you're just looking to get notified of tap gestures without affecting any of the other touch behavior of the map, you'll want to use a UITapGestureRecognizer . It's super simple, just put in some code like this. UITapGestureRecognizer* tapRec =

Car (Annotation) animation (like uber app) not working

最后都变了- 提交于 2019-12-18 10:03:16
问题 I made one demo project (from Moving-MKAnnotationView demo on github) for moving car on map following is its link https://github.com/pratikbhiyani/Moving-MKAnnotationView I edit my code on the basis of given answer by vinaut but still problem is that when we zoom or scroll the map animation get distract in ios 7 and in ios 6 when we zoom or scroll the map annotation set to its original angle for a while. Below is a screen shot of my Demo Project Here is some code i change - (void) setPosition

Issue with Map Annotation and MKMapView in iOS 4.2?

99封情书 提交于 2019-12-18 08:58:18
问题 I have a map view with pins that when the user selects a pin it goes to a detail screen for that pin. I also have a table view that when the user selects an item it goes to the same type detail view. Here's the problem ... It seems to work fine in everything from 3.1.3 to 4.1. That is the detail view matches with the pin. But I have a user who just upgraded to iOS 4.2 and says that under 4.1 it worked fine, but in 4.2 the pin selection takes him to the detail for a different pin. But in the