mkoverlay

Animating an MKOverlayView

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 04:14:17
I have an MKOverlayView that displays animated radar data as a series of images. The issue I have is that the radar images are chopped into tiles by MapKit. To swap images I have a timer that calls an update function which sets the current image in my overlay and then calls the following [myRadarOverlayView setNeedsDisplayInMapRect:self.mapView.visibleMapRect]; The overlay updates, but does so one tile at a time so I get a choppy animation. Any ideas about how make all the tiles animate (i.e. swap images) at the exact same time? I solved this by adding a UIImageView as a subview of the

Need to add a Fixed Overlay like on mapview in IOS

耗尽温柔 提交于 2019-11-29 12:35:45
I need to create a map view interface, which is something similar to the OLA Cabs Application in iOS. What I exactly wanna do is to fix an overlay on mapView and allow the user to scroll the map view across it. So that the overlay can be fixed at any location the User wants it to, I searched a lot about overlays, in iOS and MapKit, but couldn't make it possible. If some one can give me tips for achieving this I would be really grateful. Here is a snapshot of the screen Here the annotation remains fixed and you can move the map view across it, So that when you stop the mapview, the overlay will

MKMapView with multiple overlays memory-issue

这一生的挚爱 提交于 2019-11-29 03:54:48
问题 There seems to be an "issue" with overlays and the MapKit . Unlike annotations, overlays aren't reused and therefore when adding multiple overlays would cause memory-problems on a real device. I've had this problem multiple times. So my question is, how can I reuse the MKOverlay and so improve the performance of overlays on MapKit ? 回答1: The Answer to this is not "reusing" but to draw them all in to one MKOverlayView and then draw that on the map. Multiple MKPolygons , MKOverlays etc. cause

draw line on MKMapView with pattern image

安稳与你 提交于 2019-11-28 22:09:00
I try to draw a line on a MKMapView with a pattern image. The drawing is done by adding a custom MKMapOverlay view. I'm able to get the line drawn, but it seems that the drawing is done using only the left, topmost pixel of the pattern image, instead of the whole image. Here is my drawing routine: void drawPatternCellCallback(void *info, CGContextRef cgContext) { UIImage *patternImage = [UIImage imageNamed:@"tmpLine"]; CGContextDrawImage(cgContext, CGRectMake(0, 0, patternImage.size.width, patternImage.size.height), patternImage.CGImage); } - (void)drawMapRect:(MKMapRect)mapRect zoomScale:

Add inverted circle overlay to map view

陌路散爱 提交于 2019-11-28 20:50:47
(Using iOS 5 and Xcode 4.2.) I've followed the instructions here: http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/LocationAwarenessPG/AnnotatingMaps/AnnotatingMaps.html#//apple_ref/doc/uid/TP40009497-CH6-SW15 and used the MKCircle and MKCircleView classes to add a circle overlay on my MKMapView . However what I actually want is an inverted circle overlay, like the left map in the sketch below (currently I have a circle overlay like the one on the right): For the inverted circle, the overlay should cover the entire map - apart from the visible circle. Is there an

How to detect taps on MKPolylines/Overlays like Maps.app?

吃可爱长大的小学妹 提交于 2019-11-28 15:50:12
问题 When displaying directions on the built-in Maps.app on the iPhone you can "select" one of the usually 3 route alternatives that are displayed by tapping on it. I wan't to replicate this functionality and check if a tap lies within a given MKPolyline. Currently I detect taps on the MapView like this: // Add Gesture Recognizer to MapView to detect taps UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleMapTap:)]; // we require all gesture

Need to add a Fixed Overlay like on mapview in IOS

拜拜、爱过 提交于 2019-11-28 06:49:36
问题 I need to create a map view interface, which is something similar to the OLA Cabs Application in iOS. What I exactly wanna do is to fix an overlay on mapView and allow the user to scroll the map view across it. So that the overlay can be fixed at any location the User wants it to, I searched a lot about overlays, in iOS and MapKit, but couldn't make it possible. If some one can give me tips for achieving this I would be really grateful. Here is a snapshot of the screen Here the annotation

MKPolylineRenderer produces jagged, unequal paths

折月煮酒 提交于 2019-11-28 03:19:29
问题 I am using the iOS 7 MapKit APIs to produce 3D camera movements on a map that displays an MKDirectionsRequest-produced path. The path is rendered by MKOverlayRenderer like so: -(void)showRoute:(MKDirectionsResponse *)response { for (MKRoute *route in response.routes) { [self.map addOverlay:route.polyline level:MKOverlayLevelAboveRoads]; } } - (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id < MKOverlay >)overlay { MKPolylineRenderer *renderer = [[MKPolylineRenderer

Detecting touches on MKOverlay in iOS7 (MKOverlayRenderer)

社会主义新天地 提交于 2019-11-27 18:34:05
I have an MKMapView with possibly hundreds of polygons drawn. Using MKPolygon and MKPolygonRenderer as one is suppose to on iOS7. What I need is a way of acting upon the user touching one of the polygons. They represent an area on the map with a certain population density for example. On iOS6 the MKOverlays were drawn as MKOverlayViews so touch detection was more straightforward. Now using renderers I don't really see how this is suppose to be done. I'm not sure this will help or is even relevant but as a reference I'll post some code: This adds all the MKOverlays to the MKMapView using

draw line on MKMapView with pattern image

半城伤御伤魂 提交于 2019-11-27 14:15:08
问题 I try to draw a line on a MKMapView with a pattern image. The drawing is done by adding a custom MKMapOverlay view. I'm able to get the line drawn, but it seems that the drawing is done using only the left, topmost pixel of the pattern image, instead of the whole image. Here is my drawing routine: void drawPatternCellCallback(void *info, CGContextRef cgContext) { UIImage *patternImage = [UIImage imageNamed:@"tmpLine"]; CGContextDrawImage(cgContext, CGRectMake(0, 0, patternImage.size.width,