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]];
user1724168
source share