mkmapview

Swift 2 MKMapViewDelegate rendererForOverlay compiler warning

余生颓废 提交于 2019-12-23 09:32:48
问题 I am trying to draw a polyline on a map in Swift 2. It all works well, but I get a compiler warning for this code: func mapView(mapView: MKMapView!, rendererForOverlay overlay: MKOverlay!) -> MKOverlayRenderer! { if overlay is MKPolyline { let polylineRenderer = MKPolylineRenderer(overlay: overlay) polylineRenderer.strokeColor = UIColor.redColor() polylineRenderer.lineWidth = 5 return polylineRenderer } return nil } This will give me a warning says that ' Result and parameters in mapView

MKMapView crashing with EXC_BAD_ACCESS

不羁的心 提交于 2019-12-23 09:19:46
问题 I have the following line of code which activates the breakpoint [mapView addAnnotations:grabinstance.itemArray]; This crashing randomly. grabinstance.itemArray is fully populated always and is never changing at the time due to this bit of code only being called once the array is full. This particular time this was confirmed as 323 items in the array. NSZombieEnabled doesn't find anything at all either. The backtrace is below and line 1154 is the line above. #0 0x0126a372 in _insert () #1

MKAnnotationView viewForAnnotation never called

橙三吉。 提交于 2019-12-23 08:57:41
问题 after i spend 2 days of searching the bug i have to ask for help here. i do have MapViewController and place some pins on the map. i´ve copied most of the code from MapCallouts and WeatherMap of the apple code samples. anyhow it seems that i´ve deleted or missed essential parts. it seems there is no connection between the MapViewController and the following code - (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation { NSLog(@"MKAnnotationView");

Loading Annotations to Map View From Plist Not Working

浪子不回头ぞ 提交于 2019-12-23 05:11:40
问题 Hey fellas, so I am able to display annotations (2) from the source code found at this link (and within the commented-out code post below). However, I load annotation information from a plist and load it correctly (confirmed via debugger) into mapView but for some reason the annotations refuse to show when I run the app in the simulator. Here is the relevant code: Annotation header: #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface ArboretumAnnotation : NSObject

Loading Annotations to Map View From Plist Not Working

六眼飞鱼酱① 提交于 2019-12-23 05:10:33
问题 Hey fellas, so I am able to display annotations (2) from the source code found at this link (and within the commented-out code post below). However, I load annotation information from a plist and load it correctly (confirmed via debugger) into mapView but for some reason the annotations refuse to show when I run the app in the simulator. Here is the relevant code: Annotation header: #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface ArboretumAnnotation : NSObject

How to slow MKMapCamera movement?

南楼画角 提交于 2019-12-23 05:07:39
问题 I am coding in iOS. I have an NSArray, which contains a few MKMapCameras. I want to display MKMapCameras from the array one after another. I put a while loop and used [self.mapView setCamera:nextCamera animated:YES]; However, this is only showing the first and the last views. Everything in between is going too fast. I want to slow down the movement of each camera. Is there a way to achieve it using CATransaction or using any other animation tricks. If so, could you please show me an example

iPhone: mapView.showUserLocation. VS locationUpdate function

↘锁芯ラ 提交于 2019-12-23 05:07:12
问题 I'm developing on an app that is location-based, I have a mapView set to show the user location (mapView.showUserLocation); I also have a locationUpdate function to retrieve lat/long of current position: (void)locationUpdate:(CLLocation *)location{} After I call the function stopUpdatingLocation to stop the update location, the mapview (blue ball) continues to update my location... In other word: is there another locationUpdate function is called automatically from the mapview? 回答1: I think

How do I set distance to annotation in tableview?

柔情痞子 提交于 2019-12-23 04:47:20
问题 I have an app that fetches web data and stores it in CD-db. So far, FirstViewController (MKMapView) fetches CD-db into NSMutableArray and uses its values to plot locations by getting the array of custom objects from the db. I cycle thru a for loop while creating the annotation (pin). Each pin gets its distance property set from a calculation I use for the distance from userLocation to each pin. This app runs in a tabbarcontroller and the other tab is a tableview listing of these locations. I

MKPolygon performance problem

限于喜欢 提交于 2019-12-23 04:35:09
问题 I have created a whole heap of overlays using MKPolygon and created into a MKPolygonView. This works fine but one of the overlays has a butt load of points (about 800 points) and this causes memory and performance issues. I tried shouldRasterize on the MKPolygonView but this had the opposite affect which I am not surprised. Is there any other thing I can do to increase the performance of it besides lowing the amount of points (which I am in the process of doing)? 回答1: This is an issue that is

Adding multiple polylines to an MKMapView (Xamarin)

半世苍凉 提交于 2019-12-23 04:27:00
问题 I'm extending the example provided @ https://developer.xamarin.com/recipes/cross-platform/xamarin-forms/maps/map-overlay/polyline/ to add multiple polylines to my map. Everything works fine with a single polyline, but when I add the second, or add a polyline alongside an annotation, GetOverlayRenderer errors out with the error "Value cannot be null.Parameter name: polyline" It's erring out on line: polylineRenderer = new MKPolylineRenderer (overlay as MKPolyline); And when I look at the