mkoverlay

Performance issues with MapKit on iOS6

送分小仙女□ 提交于 2019-12-09 18:40:29
问题 After updating to iOS 6 I have noticed sever performance decreases when panning or zooming a MKMapView with multiple overlays. An app I created has approximately 600 polygon overlays of various colours, and ran lag-free (even on older iOS devices) on iOS 5, now runs extremely laggily (when zooming & panning) on iOS 6, even on the latest devices. My hunch is that this is due to the fact the device has to actually dynamically create the map (since its vector based) rather than just display

how to get visible overlays in MapKit? (i.e. MKOverlay/MKOverlayRender from a Mapkit Ivew)

十年热恋 提交于 2019-12-08 12:15:33
问题 How does one get a list (array) of currently visible overlay from a MapkitView? Background - for example I want to show direction arrows to the center of certain Overlay types on my mapkitview, however how do I get the visible ones? There seems to be no way to do this I can see? So do I need to got through all overlays (actually ~8000) and do my own check to see what would be showing on the screen? Seems a waste if MapKit would have already effectively done this as part of deciding what

Check if MKPolyline intersects MKPolygon

て烟熏妆下的殇ゞ 提交于 2019-12-08 11:24:27
问题 I'm trying to figure out if a MKPolyline intersects an MKPolygon on map. Currently the only idea I have about this is to go through the line and test on every point if it is located in polygon. More exactly, I'm trying to test if there aren't any MKPolygon between MKUserLocation and an objective on map (so MKUserLocation can see that objective). Any more practical idea about how to do this? If not, how to transform the MKPolyLine into a lot of points? 回答1: They both conform to the MKOverlay

Create multiple MKOverlays of polyline from locations coming via web-service

点点圈 提交于 2019-12-08 08:32:34
问题 My app is real-time tracker, where multiple users are logged in and updating their location by sending their co-ordinates to our web service which is then called back let's after every 2 minutes to show all the users on my MapView . Every time I get the locations of users from web service in connectionDidFinishLoading method, I am parsing, creating polyline through pointsArray and adding them to overlay : -(void) connectionDidFinishLoading: (NSURLConnection *) connection { userLatitudeArray =

Create multiple MKOverlays of polyline from locations coming via web-service

落花浮王杯 提交于 2019-12-08 06:35:27
My app is real-time tracker, where multiple users are logged in and updating their location by sending their co-ordinates to our web service which is then called back let's after every 2 minutes to show all the users on my MapView . Every time I get the locations of users from web service in connectionDidFinishLoading method, I am parsing, creating polyline through pointsArray and adding them to overlay : -(void) connectionDidFinishLoading: (NSURLConnection *) connection { userLatitudeArray = [[NSMutableArray alloc]init]; userLongitudeArray = [[NSMutableArray alloc]init]; userIdArray = [

Adding MKOverlayPathRenderer as overlay to MKMapView gets exception

╄→尐↘猪︶ㄣ 提交于 2019-12-08 05:57:53
问题 Everything said in topic, so here is the code - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. _pathRenderer = [[MKOverlayPathRenderer alloc] init]; _pathRenderer.lineWidth = 8.0f; _pathRenderer.strokeColor = [UIColor redColor]; _pathRenderer.path = CGPathCreateMutable(); [_mapView addOverlay:_pathRenderer]; } At the last line it drops with exception: Terminating app due to uncaught exception 'NSInvalidArgumentException',

Adding MKOverlayPathRenderer as overlay to MKMapView gets exception

吃可爱长大的小学妹 提交于 2019-12-07 08:35:27
Everything said in topic, so here is the code - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. _pathRenderer = [[MKOverlayPathRenderer alloc] init]; _pathRenderer.lineWidth = 8.0f; _pathRenderer.strokeColor = [UIColor redColor]; _pathRenderer.path = CGPathCreateMutable(); [_mapView addOverlay:_pathRenderer]; } At the last line it drops with exception: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MKOverlayPathRenderer boundingMapRect]: unrecognized selector It means that i'm using wrong

App crashing when I add overlay to mkmapview

孤街浪徒 提交于 2019-12-07 04:34:57
问题 I am trying to add annotations and overlays to a mapview but it crashes randomly. It is an EXC_BAD_ACCESS error, but zombies doesn't tell me anything. It says it is crashing on CG::Path::apply_transform(CGAffineTransform const&). I have looked everywhere for why this is happening but can't pinpoint it. I am creating the mapview in ib and have the delegates and everything set up right. It will work sometimes and then crash randomly. I am using a gesture recognizer to add the annotations and

How to: Display MKOverlay on MKMapView

大兔子大兔子 提交于 2019-12-07 03:09:37
问题 I need to display an MKOverlay on a map, but can't get it to actually appear. I'm following the example from Apple's Location Awareness Programming Guide and the overlay wont display. Any help would be greatly appreciated, this is the first iPhone app I've made, so I might be missing something simple. NavViewController.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface NavViewController : UIViewController <MKMapViewDelegate> { } @property (weak, nonatomic) IBOutlet MKMapView

Convert MKCircle Radius to CoreGraphics Arc Radius

人盡茶涼 提交于 2019-12-06 12:39:59
问题 How can I convert an MKCircle's radius (in meters) into a value I can use to draw a circle using core graphics in an MKOverlayPathView subclass? In the following code the radius is hardcoded to 50 but I need it to reflect the radius of the MKCircle. For the position I use MKMapPointForCoordinate() to convert the MKCircle's coordinate to an MKMapPoint, then convert the MKMapPoint to a point using MKOverlayPathView's pointForMapPoint:. But how can I convert the MKCircle's radius into a relative