CATiledLayer documentation
-
Hi!
I would like to create a map view using several tile images: the map
is made of tiles; tiles are available for various zoom levels.
Seems like CATiledLayer seems the right thing to use. Problem is that
I can't seem to find any documentation beyond a rehash of the header
file.
Is there any documentation? Is there sample code?
Pierre -
Hi,
I have an example on my blog of using the CATiledLayer with a big pdf
file and the CA book (I am the author) has an example of using image
tiles.
http://www.pragprog.com/titles/bdcora
http://bill.dudney.net/roller/objc
Good luck,
-bd-
On Aug 18, 2008, at 10:37 AM, Houdah - ML Pierre Bernard wrote:
> Hi!
>
> I would like to create a map view using several tile images: the map
> is made of tiles; tiles are available for various zoom levels.
>
> Seems like CATiledLayer seems the right thing to use. Problem is
> that I can't seem to find any documentation beyond a rehash of the
> header file.
>
> Is there any documentation? Is there sample code?
>
> Pierre
-
Hi Bill!
I had indeed found your sample code. Which actually happens to be the
only sample code I could find.
Unfortunately, the sample code left me confused. Seems to me that your
drawing method always does the same thing. I find no notion of tiling.
Obviously there is: when I set a breakpoint on the drawing method I
can clearly see the view being drawn bit by bit. I just don't
understand how it works.
Of course, I would have hoped for an example with multiple image
source containing tiles.
I wanted to access the web site of your book. I was hoping for an
eBook to purchase. The server however hasn't been responding all day.
Best,
Pierre Bernard
Houdah Software s.à r.l.
On 18 Aug 2008, at 19:16, Bill Dudney wrote:
> Hi,
>
> I have an example on my blog of using the CATiledLayer with a big
> pdf file and the CA book (I am the author) has an example of using
> image tiles.
>
> http://www.pragprog.com/titles/bdcora
> http://bill.dudney.net/roller/objc
>
> Good luck,
>
> -bd-
>
> On Aug 18, 2008, at 10:37 AM, Houdah - ML Pierre Bernard wrote:
>
>> Hi!
>>
>> I would like to create a map view using several tile images: the
>> map is made of tiles; tiles are available for various zoom levels.
>>
>> Seems like CATiledLayer seems the right thing to use. Problem is
>> that I can't seem to find any documentation beyond a rehash of the
>> header file.
>>
>> Is there any documentation? Is there sample code?
>>
>> Pierre
>
-
On Aug 18, 2008, at 10:54 AM, Houdah - ML Pierre Bernard wrote:
> Unfortunately, the sample code left me confused. Seems to me that
> your drawing method always does the same thing. I find no notion of
> tiling. Obviously there is: when I set a breakpoint on the drawing
> method I can clearly see the view being drawn bit by bit. I just
> don't understand how it works.
Actually, thats the intended model. When a tiled layer calls on its
delegate's -drawLayer:inContext: (or its own -drawInContext:) method,
the context has already been transformed and clipped to capture what
is necessary for the tile that its drawing. This allows for a model
where you don't have to be concerned with the tiling if you don't want
to be.
If you do want to be concerned with the tiles, then you can use
CGContextGetClipBoundingBox() to determine the tile that you are being
asked to draw. If your using the level of detail as well, you can
either use that same clip box (carefully) to deduce the scale, or use
CGContextGetCTM() to get the current transform matrix and use that to
deduce the scale (although this relies on certain assumptions about
the CTM that will be applied).
> Of course, I would have hoped for an example with multiple image
> source containing tiles.
Noted. :).
--
David Duncan
Apple DTS Animation and Printing -
Hi Pierre,
The sample code from the book is concerned with the bounding box and
the zoom level.
As David discussed in his response (he was instrumental in me getting
my head wrapped around the tiled layer, thx David!).
You can get the code even if you don't have the book (just go to the
book's site and click on code).
Good luck!
-bd-
On Aug 18, 2008, at 11:54 AM, Houdah - ML Pierre Bernard wrote:
> Hi Bill!
>
> I had indeed found your sample code. Which actually happens to be
> the only sample code I could find.
>
> Unfortunately, the sample code left me confused. Seems to me that
> your drawing method always does the same thing. I find no notion of
> tiling. Obviously there is: when I set a breakpoint on the drawing
> method I can clearly see the view being drawn bit by bit. I just
> don't understand how it works.
>
> Of course, I would have hoped for an example with multiple image
> source containing tiles.
>
> I wanted to access the web site of your book. I was hoping for an
> eBook to purchase. The server however hasn't been responding all day.
>
> Best,
> Pierre Bernard
> Houdah Software s.à r.l.
>
> On 18 Aug 2008, at 19:16, Bill Dudney wrote:
>
>> Hi,
>>
>> I have an example on my blog of using the CATiledLayer with a big
>> pdf file and the CA book (I am the author) has an example of using
>> image tiles.
>>
>> http://www.pragprog.com/titles/bdcora
>> http://bill.dudney.net/roller/objc
>>
>> Good luck,
>>
>> -bd-
>>
>> On Aug 18, 2008, at 10:37 AM, Houdah - ML Pierre Bernard wrote:
>>
>>> Hi!
>>>
>>> I would like to create a map view using several tile images: the
>>> map is made of tiles; tiles are available for various zoom levels.
>>>
>>> Seems like CATiledLayer seems the right thing to use. Problem is
>>> that I can't seem to find any documentation beyond a rehash of the
>>> header file.
>>>
>>> Is there any documentation? Is there sample code?
>>>
>>> Pierre
>>
>



