mkmapview

didAddAnnotationViews not working on MKMapView

旧城冷巷雨未停 提交于 2019-12-22 05:38:12
问题 I've been playing around with the MKMapView and trying get my head around how the MKMapViewDelegate system works. So far I have no luck in getting the didAddAnnotationViews to get called when the current location marker is added. I have set my app delegate to implement MKMapViewDelegate, I have an Outlet to the MapView in my xib and have set the delegate property of the MapView to be self, as in the app delegate instance. I have implemented didAddAnnotationViews in the app delegate which I

mapViewDidFinishLoadingMap: called too early

偶尔善良 提交于 2019-12-22 05:21:59
问题 My problem is simple: I'm waiting to take a screenshot of an MKMapView, and I want to do it only once the map is loaded. Unfortunately, this delegate method is almost always called before the map is actually loaded. I just get a grid, or a few loaded tiles if I'm lucky. Is there a good way to do what I need to do? Or am I missing something in the MKMapViewDelegate protocol? Thanks! 回答1: Perhaps you could try adding a timer and then take the screenshot in the completion block of the timer. Or

mapViewDidFinishLoadingMap: called too early

白昼怎懂夜的黑 提交于 2019-12-22 05:21:19
问题 My problem is simple: I'm waiting to take a screenshot of an MKMapView, and I want to do it only once the map is loaded. Unfortunately, this delegate method is almost always called before the map is actually loaded. I just get a grid, or a few loaded tiles if I'm lucky. Is there a good way to do what I need to do? Or am I missing something in the MKMapViewDelegate protocol? Thanks! 回答1: Perhaps you could try adding a timer and then take the screenshot in the completion block of the timer. Or

Can't render polygon (can't reserve indicies: XX): featureID: X key: XXXX

本小妞迷上赌 提交于 2019-12-22 05:20:06
问题 I have use Mac OS X 10.9.3 and Xcode 5.1.1 In my app I have to use MKMapView , It's all are working fine but in iOS 6.1, I have stranger error display in console, such like, Can't render polygon (can't reserve indicies: 1482): featureID: 0 key: 0.0.1 (512) Can't render polygon (can't reserve indicies: 570): featureID: 0 key: 0.0.1 (512) Can't render polygon (can't reserve indicies: 30): featureID: 0 key: 0.0.1 (512) Can't render polygon (can't reserve indicies: 390): featureID: 0 key: 0.0.1

how to add custom callout view in mapview

女生的网名这么多〃 提交于 2019-12-22 04:09:49
问题 I am new to mapkit in objective-c. I am able to add custom annotation in mapview. i need to place custom callout view like below image . But i didn't get how can i design callout view like this. i know i need to add callout in view for annotation method. - (MKAnnotationView *)mapView:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>)annotation { static NSString *AnnotationViewID = @"annotationViewID"; MKAnnotationView *annotationView = (MKAnnotationView *)[mapview

Reposition legal label ( MKAttributionLabel )

爷,独闯天下 提交于 2019-12-22 02:00:42
问题 I'd want to move the Legal label to the right side. On iOS 6 and 7 the below solution was working fine, however on iOS 8.3 it seems to not work. I get the label, then with a timer (0.1 sec) in viewDidLayoutSubviews I call this method : -(void)moveLegalLabel { UIView * legalLink = [self attributionView]; legalLink.frame = CGRectMake(self.mapView.frame.size.width - legalLink.frame.size.width - 10, self.mapView.frame.size.height - legalLink.frame.size.height - 10 , legalLink.frame.size.width,

Change color of pin on map after pressing button on another screen

你。 提交于 2019-12-22 00:56:04
问题 I need to find a way to change the pin color when the map is loaded by pushing a button from another screen. For example, the original pins are all red, but when I go to a page and push the map button, it has to lead me to the map view and the coordinates of that location have to be marked with a green pin. I already have the map set up and the setup of making the pins all red. Any help is appreciated. So, just a recap: Page with map with red pin --> click pin, click annotation (another view

Add Custom Property to MKAnnotation

廉价感情. 提交于 2019-12-21 23:54:17
问题 I am trying to add a custom value to my MKAnnotation. I would like to have it store the unique ID of the location. My code for setting up the annotation with a title and subtitle works like this: location.latitude = [dictionary[@"placeLatitude"] doubleValue]; location.longitude = [dictionary[@"placeLongitude"] doubleValue]; newAnnotation = [[MapViewAnnotation alloc] initWithTitle:dictionary[@"placeName"] andCoordinate:location]; newAnnotation.subtitle = dictionary[@"placeCity"]; How would I

How to add Streetview function in my MKMapView?

為{幸葍}努か 提交于 2019-12-21 23:20:17
问题 I'm looking to add Streetview function to my current iphone app maps I made with MKMapView. Any idea how to do this? Thx for helping, Stephane 回答1: Unless you want to spend a long time mapping tiles onto a 3D world, you can give a link to the maps app, which lets the user choose Street View. If you want an easy way to embed Street View, use the (fairly new) Street View Image API, which returns static images for a location and heading (relative to the road): http://maps.googleapis.com/maps/api

Making map pins spread out from a cluster

偶尔善良 提交于 2019-12-21 20:39:17
问题 I've got two custom annotation classes for my map: one for a single post tied to a location, and one for a cluster of those posts. The cluster stores pointers to all of the posts it contains, as well as a central lat/long location (calculated using the locations of the posts it contains). I have the behaviour that when I click on a cluster annotation it removes the cluster and adds its posts to the map. What I want is to change the pin-drop annotation when expanding the clusters to an