mkmapview

Two coloured/custom line on MKPolylineRenderer

可紊 提交于 2019-12-21 20:38:00
问题 I am drawing x amount of lines on an MKMapView . The data is being downloaded from a webservice and for each line that needs drawing I am creating a MKPolyline , adding it to an overlayArray (some overlays have more than one polyline) and finally adding that overlay to the map via: [self.mapView addOverlays:overlayArray];` The next function is therefore called which works wonderfully: - (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id<MKOverlay>)overlay { if (![overlay

Rotate only view and not its subviews

柔情痞子 提交于 2019-12-21 18:30:05
问题 Is there any way by which transform of a view for rotation wont be passed to its subviews? I have a custom MKAnnotationView which I am rotating according to the heading values of the user. In below method in the custom Annotation view class , i am adding a subview to the annotation view. - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; if(selected) { [self addSubview:self.myCallOutView]; return; } [self.myCallOutView

Load MKMapView in background and create UIImage from it (iPhone & iPad)

杀马特。学长 韩版系。学妹 提交于 2019-12-21 17:28:59
问题 I have a situation whereby I need a way of loading an MKMapView with several overlays. This map view shouldn't be shown onscreen, the only reason I require it to load is in order to create an image from the map for use elsewhere. I have had a look around online but I haven't had any luck with finding a solution to the problem. Please can someone help me out? Here is what I've tried so far (with no success) // Load the map view Logs_Map_ViewController *mapViewController = [[Map_ViewController

Show MKMapView in UITableViewCell without slow down UI

蹲街弑〆低调 提交于 2019-12-21 15:03:15
问题 i'm trying to put a MKMapView in some UiTableViewCell but (on iPhone 5, so even in other devices), when the app load the cell with the map, the scroll become not too smooth. There is some method, with GCD or something, to do this in better way? Here is a screenshot of the result: I load the Cell from Nib, here is the code where i set the coordinate and the annotation (with custom view, but this is not the problem.) // Delegate cell.objectMap.delegate = self; // Coordinate MKCoordinateRegion

MKMapView showsUserLocation Crash

℡╲_俬逩灬. 提交于 2019-12-21 12:31:29
问题 I'm setting showsUserLocation = NO on an MKMapView object via the applicationDidEnterBackground method of the app delegate. This is to stop it from updating the user's location whilst in the background to save on battery. However, I seem to be receiving a small number of crash logs like this: 0 MapKit 0x3174c5f6 <redacted> + 9 1 MapKit 0x3174c5e9 -[MKQuadTrie contains:] + 24 2 MapKit 0x3176eaa7 -[MKAnnotationManager _removeAnnotation:updateVisible:removeFromContainer:] + 50 3 MapKit

MKMapView center and zoom in

馋奶兔 提交于 2019-12-21 10:05:22
问题 I am using MKMapView on a project and would like to center the map on a coordinate and zoom in. Just like Google maps has: GMSCameraPosition.camera(withLatitude: -33.8683, longitude: 151.2086, zoom: 6) Is there any Mapkit method for this? 回答1: You'd create a MKCoordinateRegion object and set that as the region on your MKMapView object. MKCoordinateRegion mapRegion; CLLocationCoordinate2D coordinate; coordinate.latitude = 0; coordinate.longitude = 0; mapRegion.center = coordinate; mapRegion

iOS MKDirections for multiple destinations and a single source

别说谁变了你拦得住时间么 提交于 2019-12-21 06:45:30
问题 My application needs to get the "closest" walking point to the user from a set of 10. I have seen that MKDirections does this with "calculateDirectionsWithCompletionHandler" for a single source, destination locations. My question is, do I have do make 10 requests and then check which one is the closest one in distance or there is a way of sending multiple destinations and the response would be the closest one walking? Thank you 回答1: As far as I'm aware there is no way to specify more than two

How to accurately make a map for a map-overlay

不羁岁月 提交于 2019-12-21 05:41:23
问题 I have images covering the whole of South Africa. These are in Tiff format and have coordinates embedded into them. I am trying to take these images (about 20 images) and use them as an map overlay in my iPhone app. My problem lies with cutting the maps up into tiles (accurately). MapTiler is the application which I plan on using to cut these massive images up into the tiles, but it askes me for several details. I have to choose from: Custom definition of the system (WKT, Proj. 4, ...) WGS84

Preventing overlays from disappearing when zoomed - MKMapView & MKOverlay

女生的网名这么多〃 提交于 2019-12-21 04:56:07
问题 I am working on an iPhone / iPad app that is using semi-transparant tiled map overlays via MKMapView and MKOverlay. I want users to be able to zoom in deeply into the maps, but the resolution of my map overlays only goes to level 6. I do not want to limit zooming. But... If a user zooms "too far" and then scrolls to a new tile, if they are zoomed deeper than the tree of overlay tiles, my overlay is not drawn. I want the overlay to draw even when the user is zoomed in deep. Are there any best

Change coordinate of MKOverlay for an MKOverlayView

心已入冬 提交于 2019-12-21 04:35:07
问题 I have an overlay on the map, and I would like to change its coordinates. To do this seamlessly I'm going to call the setNeedsDisplayInMapRect: method after the change has been made to the view. I've tested this out by just changing the fillColor and it works fine: overlayView.fillColor = [[UIColor greenColor] colorWithAlphaComponent:0.3]; [overlayView setNeedsDisplayInMapRect:mapView.visibleMapRect]; However I've seemingly hit a brick wall trying to also change the center coordinates of my