mkmapview

How to put a button on a Map in Iphone

百般思念 提交于 2019-12-24 20:16:02
问题 i am trying to pull a map in my applcation with interface builder using MKMapView but for some reason its not showing up. Also i want to add some button to this view by clicking which i can browse a file existing in my iphone. Please provide me with the detial description as i am new to this. Thanks, 回答1: You'll want to add an annotation to the map, then provide a custom view for it. To add an annotation to the map, adopt the MKAnnotation protocol in one of your objects and set its coordinate

Can't be changed pin color when I change segement in mkMapView

不问归期 提交于 2019-12-24 20:14:44
问题 I have some problem regarding Annotations in mapView. Lets have one glance on my requirement. I want to give choice to user to choose location for meeting. There are two options. 1) I should give list of near by data Or 2) He can drag and drop pin anywhere he wants ! For that I have created one segment. First index for near by data and Second index for dropping a pin. For First option ( "near by" ) I need to fetch near by data from location of Seller, location of Buyer and midpoint between

MKMapView show DetailView - How to make a segue

a 夏天 提交于 2019-12-24 19:25:28
问题 I have a MapView, the annotations comes from a property list. Now I would like to see more data in the detail view. Unfortunately I do not how to program the Segue, so that data can be displayed. I hope you understand what I mean. My english is not so good ... I know that there is missing some in the method prepareforSegue. I am using storyboard. In advance thank you for your help ... regards #import "MapViewNewController.h" #import "MapViewAnnotation.h" #import "SetCardController.h"

MKMapView custom callOutView with auto layout iOS 6 vs. iOS7

≡放荡痞女 提交于 2019-12-24 18:09:39
问题 Hej Folks, my apps crashes on a MKMapView under iOS 6 if I use auto layout for the callout view. With iOS 7 this works fine. - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view { CustomMapAnnotation *annotation = (CustomMapAnnotation *)view.annotation; if([annotation isKindOfClass:[CustomMapAnnotation class]]) { CustomMapCalloutView *calloutView = [CustomMapCalloutView new]; calloutView.translatesAutoresizingMaskIntoConstraints = NO; calloutView.titleLabel

Rotate MKAnnotationPinView according to the device heading

笑着哭i 提交于 2019-12-24 13:26:14
问题 In my app I'm rotating the MapView according to the device heading, I have only one annotation and i'm rotating it's pin and it's pinView too. My rotation method is inside the next function - (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { if (newHeading.headingAccuracy < 0) return; CLLocationDirection theHeading = ((newHeading.trueHeading > 0) ? newHeading.trueHeading : newHeading.magneticHeading); lastHeading = theHeading; [self rotateImage:self

How add pin on map?

旧城冷巷雨未停 提交于 2019-12-24 12:05:06
问题 I have a view in which i have a map. On that view i have a tool bar. In tool bar i have a button for drop pin on map. Now i want to get methods for detecting pin drop and latitude and longitude of that point. For example when user click on button then a pin drop on center of map view. And when user click on pin then show title as the address of that point where that pin drop. What function i use for that so that i can set that event on my map view? How do that? Thanks in advance... 回答1: this

How to add colored border bubble callout in swift?

流过昼夜 提交于 2019-12-24 11:54:06
问题 I added a right button to callout, but now I'd like add a colored border to the whole bubble/callout. let's say I want the whole bubble with a colored border. I thought to implement something as view?.detailCalloutAccessoryView?.layer.borderWidth = 5.0 view?.detailCalloutAccessoryView?.layer.borderColor = UIColor(red:51/255.0, green:153/255.0, blue:255/255.0, alpha: 1.0).CGColor but it doesn't work something similar to this (I know that here they only aded a red view) but white inside, but

Custom annotations with same image

醉酒当歌 提交于 2019-12-24 11:44:38
问题 As you can see in the image below that all annotations have same image and discount which is not correct, they should have different image and discount . How can I fix this? I am using a custom annotation class with discountStr and 'imgPathStr' property and the following code. -(void) connectionDidFinishLoading: (NSURLConnection *) connection { [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; _adResultDict = [NSJSONSerialization JSONObjectWithData:_adResultData options

DetailDisclosure button not showing in annotation view

旧城冷巷雨未停 提交于 2019-12-24 10:58:08
问题 For some odd reason the detail button somehow stopped appearing: - (MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>)annotation { MKPinAnnotationView *pinAnnotation = nil; if(annotation != mapView.userLocation) { MKPinAnnotationView *pinAnnotation = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"sadasdasd"]; if ( pinAnnotation == nil ){ pinAnnotation = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@

For Loop with Google Geocoding - High Error Rate - iPhone

久未见 提交于 2019-12-24 10:13:02
问题 I am using the below code to fetch location information via Geocoding and then add a map pin to a Google Map View. The code uses a For loop to cycle through each place in my database. The problem is that the code fails to return location info for about 50% of the places when run. These failed items are saved in the failedLoad array as per the code below. Can anyone suggest why this is ? Also since these failed items are saved in the "failedLoad" array, is there a way I could use this array to