I am using CATiledLayer and UIScrollView, how can I dynamically set CATiledLayer properties?
Basically speaking I am making a map framework (like Route-me and Google Maps). I want to change some properties of CATiledLayers which are not documented. So I dont know if it is possible:
I want to dynamically set properties of CATiledLayer, such as layer size, tile numbers, what conditions to trigger rel开发者_Python百科oading tile source, and binding a function when CATiledLayer realoding sources?
Not sure why you would think that it is not documented, aren't you referring to the things below?
Dynamically set properties of CATiledLayer, such as layer size, tile numbers
tiledLayer.levelsOfDetail = ...
tiledLayer.levelsOfDetailBias = ...
tiledLayer.frame = ...
What conditions to trigger reloading tile source -> You should be able to call -setNeedsDisplay
to trigger reload when you want to.
Binding a function when CATiledLayer realoding sources -> Implement -drawLayer:inContext:
in a delegate
精彩评论