mkmapview

Ignore mapView:didSelectAnnotationView when long press is occuring

蓝咒 提交于 2019-12-13 13:49:54
问题 I am struggling with this one. I have a mapview with many pins in a small area. I want to ignore the mapview's selecting of an annotation when I am long pressing on the map, regardless if i am longpressing on an annotation view. It seems as though the annotation is getting selected on a touchDown, rather than touch up inside on the annotation view, which is annoying. I have added a longpress gesture to the mapview: UILongPressGestureRecognizer *longRec = [[UILongPressGestureRecognizer alloc]

Zoom issue in MKMapView when it is fully zoomed out

天大地大妈咪最大 提交于 2019-12-13 12:09:44
问题 I am zooming out the map on the click of the button. So when the map is fully zoomed out and if I try to again zoom out it then it crashes while setting the region. Not sure but, Is there any way out to detect if the map has reached it maximum zoom limit? Here is my code to zoom out the map -(void)setZoomLevelForNoPicksCurrentLocationAt:(CLLocationCoordinate2D)currentCoordinate{ MKCoordinateSpan span; MKCoordinateRegion region; region.center = currentCoordinate; span.latitudeDelta =self

How to add Action selector to the popup bubble on Annotation view [duplicate]

霸气de小男生 提交于 2019-12-13 08:06:54
问题 This question already has an answer here : CalloutAccessoryView view for MKPinAnnotationView (1 answer) Closed 6 years ago . I have very new to MapKit Implementation In my app one page is to be map View in that I have displayed bulk amount of pins and their Annotation actions. I have added a Discloser button on the popup bubble and set action for these discloser buttons as shown bellow. i Want to Same action When tap on that gray bubble //To add a discloser button to show route map UIButton

Xcode Annotation from Property List

跟風遠走 提交于 2019-12-13 07:37:08
问题 i know that similar questions have been already asked, but i just could find the answer. So, I'm building an app that has over 100 Pins, writing it into the implementation would be just to much. Does anybody know from your previous experience how can i use the property list file to store coordinates and then read them and place Pins on my map ? What is the best way to do this because i did work with plist files(except editing them). Any tutorials ? 回答1: This is from one of my apps: This is in

PopOver frame issue in iPhone SDK

江枫思渺然 提交于 2019-12-13 06:59:17
问题 I display a popover in map view as follows: But when i rotate the device, It shows Like: as you see it covers the annotation instead of showing just beside the annotation. My code is as as shown below: CGPoint annotationPoint = [mapView convertCoordinate:aView.annotation.coordinate toPointToView:mapView]; float boxDY=annotationPoint.y; float boxDX=annotationPoint.x; CGRect box = CGRectMake(boxDX,boxDY,5,5); UILabel *displayLabel = [[UILabel alloc] initWithFrame:box]; [popView

Moving annotation from one coordinate point to another in Swift

◇◆丶佛笑我妖孽 提交于 2019-12-13 06:59:17
问题 This is a repost. I tried all I could do to get this thing done but wasn't successful. I have two coordinate points and all I'm trying to do is moving an annotation from one point to another. As an alternative solution, I found an Obj-C project in github which is very similar to this and I made a bridged connection between Swift and Obj-C to get this done. But for just moving annotation I had to use this whole project which I found is not a good solution. Anyone who was successful in

Draw on UIImageView over MKMapView

时光总嘲笑我的痴心妄想 提交于 2019-12-13 06:01:43
问题 I have searched a lot an answer for this question, but none of them seem to do exactly what I want. A lot of tutorials show me how to add lines and polygons in code, but not with freehand drawing. I got a MKMapView with a UIImageView over the map. And I can draw a little on my UIImageView but right after that, the MKMapView is draged and the draw doesn't continue. I would like to know what have I done wrong ? Here is my code for the touches events : - (void)touchesBegan:(NSSet *)touches

How to setup a MapViewController as Datasource to a TableViewController for displaying distance in cells

别来无恙 提交于 2019-12-13 05:59:55
问题 My app has a tabbarcontroller with a UIViewController (FirstViewController-calling it mapVC) with a mapview and a UITableViewController (SecondViewController-calling it tableVC). The app fetches data from web and puts it into CD-db and each VC executes a fetch to the db. Each entity is named Holiday (dont ask) and it has a lat and long property. Here is the UITabBarController subclass which attempts to set the mapVC as datasource to tableVC: - (void)viewDidLoad{ [super viewDidLoad]; // Do any

Show Annotation Title and SubTitle in Custom MKPinAnnotationView

☆樱花仙子☆ 提交于 2019-12-13 05:52:19
问题 I am using MKPinAnnotationView inside my App. I am setting MapView object as delegate, and using this code for customising my AnnotationView func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? { if annotation is MKUserLocation { //return nil so map view draws "blue dot" for standard user location return nil } let reuseId = "pin" var pinView = mapView.dequeueReusableAnnotationViewWithIdentifier(reuseId) as? MKPinAnnotationView if pinView == nil {

MKMapView causes EXC_BAD_ACCESS when testing only

瘦欲@ 提交于 2019-12-13 05:23:38
问题 when testing on device only, i am getting EXC_BAD_ACCESS. This does not happen when i just run the app. I am concerned my users will experience the crash even though i am not when not testing. Anyone have any ideas why? It does not seem related to my annotations, as i comment out the adding of annotations and it still crashes. Also, it loads on first view of the map, but when i navigate back to my collection view , then back to this view is when it crashes. My coordinates also seem valid