I have extracted some code from the PhotoScroller sample code from Apple to use the CATiledLayer
. I have an image of 8000x7000px loaded from internet, in tiles.
This is kind of a map-function in my app. I also have two almost identical images, with different overlays (tried to only add the overlay without luck).
I have an UISegmentedControl
to toggle between the three choices, and I want the imageView to load the images from the selected image. So if the user zoomes in on one of the images, and selects another option, then the scale and coordinated stays the same, and the imageView loads the chosen image in the necessary tile-spots.
I have partially managed this. Or, I have actually managed this, but when I select another option, the whole screen goes black when the function [imageView removeFromSuperview];
is called. After being black in a couple of seconds(depending on internet speed) it shows the correct tiles.
I want the layer to "fade" over to the next layer if possible. As you maybe know, when using CATiledLayer
, the first layer is the whole image in low resolution, but when zooming in, the necessary tiles "fade" in to the next layer with smaller tiles.
I basically need to give the (TilingView*)imageView
a "reload"-command, and want it to "fade" over the last image.
I tried to comment out the [imageView removeFromSuperview];
, and that actually got me close to what I want. When I zoomed in, and selected another option, the new image actually faded over the old one, however, when I zoomed back out, the old image was clearly sticking around in the background(behind the new image), not responding to anything. I need to remove it from the superView at a later point, but I have no longer access to it as the new image has taken its place as imageView. I know people might want to see code here, but I have really no idea what code to show.. And the CATiledLayer
is SO POORLY documented I am really having a hard time understanding what's going on.