MapOverlay flickering after shrinking and zooming in iOS

I have two questions. First of all, once I have allocated memory for coordinates, see the code below, should I free up free memory (coords)? Secondly, as you see the code below, I get an overlay and add it to the map. However, there are different timestamps, and they should update the map. Like a radar map changing the shape of an overlay with different timestamps. The initial update is very good; however, as soon as the user zooms out and zooms out, he will blink or flicker. I wonder why this flicker occurs? Has anyone experienced this problem before?

NSArray *ants = [mapView overlays]; for(bb = 0; bb < [polygonArray count]; bb++){ int attr=[[idArray objectAtIndex:bb]floatValue]; coords = malloc(sizeof(CLLocationCoordinate2D) * [[polygonArray objectAtIndex:bb] count]); for (int a = 0;a < [[polygonArray objectAtIndex:bb] count]; a++){ coords[a].latitude = [[[[polygonArray objectAtIndex:bb]objectAtIndex:a]objectAtIndex:0]doubleValue]; coords[a].longitude = [[[[polygonArray objectAtIndex:bb]objectAtIndex:a]objectAtIndex:1]doubleValue]; } polygon = [[MKPolygon alloc]init]; polygon = [MKPolygon polygonWithCoordinates:coords count:[[polygonArray objectAtIndex:bb]count]]; //free(coords); [previousPolygons addObject:polygon]; } [mapView addOverlay:polygon]; } } [mapView removeOverlays:ants]; 
+7
source share
2 answers

Download Apples

BreadCrumbs Demo

App.
Using this demo, you see the recommended technique for completing your task.
I used this demo in my application and it worked like a charm.

The approach with MkPolygon does not work well with large polygons or polygon changes.

+2
source

I tested the BreadCrumbs demo on iOS 6.1 (iPad 3) and it flickered. This is a mistake of the new MKMapView (sad). I sent an Apple error.

+2
source

All Articles