I was tinkering with UIScrollView a while back, just doing a simple demo to First , use a CATiledLayer as the layer class for my Starview. My current approach involves hosting a CATiledLayer (to fetch & render tiles in the current view frame) inside a UIScrollView (for event. The built-in zoom support in CATiledLayer integrates well (i.e., easily) with a UIScrollView, but it doesn’t quite work the way I’d like, and it’s not.

Author: Kakinos Gror
Country: Malta
Language: English (Spanish)
Genre: Business
Published (Last): 19 October 2018
Pages: 237
PDF File Size: 7.97 Mb
ePub File Size: 18.71 Mb
ISBN: 336-6-36191-643-3
Downloads: 88384
Price: Free* [*Free Regsitration Required]
Uploader: Mazura

Things that were not immediately obvious to me. And catiledlaayer view is completely redrawn each time a small subrectangle is requested, which defeats the purpose of the tiling, at least as far as speed goes.

CATiledLayer (Part 2) | Things that were not immediately obvious to me

The changes are pretty straightforward. Message was edited by: Cocoa and layers and sublayers vs. But after reading and googling a lot, I still find it difficult to understand the basics of CATiledLayer for this task-I’m somehow lost between Quartz vs. When I do that, the view appears with scale factor 1.

I am trying to do exactly the same thing and are having similar hassles to what you are To find out more, including how to control cookies, see here: The starViewScale could be different for tiles visible at the same time. This arrangement will tend to produce a higher-quality, more efficient image than would be obtained by simply applying a raw scaling catileclayer to the full-resolution tiles.

When I zoomed in, the image was very blurry. Sep 23, 2: Aside from being slightly confusing, this makes the process of resizing the world — which might make sense for certain applications — potentially more complex. Sign up using Email and Password. But I did not see any difference between your first code sample and the second one.


Sign up using Facebook. By continuing to use this website, you agree to their use. The scrollview should just scroll horizontal, no zooming or vertical scrolling required. Ideally I would like to keep the Graph class untouched, just draw the context uiscrkllview, split it into tiles and scroll those. Sorry, your blog cannot share posts by email.

iphone – UIScrollView and CATiledLayer from the ground up – Stack Overflow

The scale factor is always 1. For instance, if you were applying a scale factor of 0. My suspicion is uiscro,lview is going wrong in one of the threads owned by CATiledLayer; I don’t get any subsequent calls to drawLayer: I wanted to get the pinch scrolling to work so that I could pan around an image.

With all that said, we can understand sizeContent a bit better. By clicking “Post Your Answer”, you acknowledge that you have read our updated terms of serviceprivacy policy and cookie policyand that your continued use of the website is subject to these policies. You can run the demo, and see the zooming goodness.

Services Drop me a note here. This entry was posted in iPhone. And, just to keep things clear, you should probably update the comment at the top of this method, as well:. Sep 29, 4: Also, there are some weird drawing issues with very large contentSize values. Panning outside of this region is an exercise left to the reader.

I discovered I could get the delegate situation sorted out by adding the tile layer as a sublayer of the NativeMapView: Post was not sent – check your email addresses! It should return discrete values based on powers of 2, and not be continuous as it is in the demo.


Sep 23, 3: By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. So I’m building my own native iPhone map. Determines the maximum scale factor that can be applied to the viewport s.

I’ve logged my screen geometry stats here: The big change to TiledView has to do with tile index calculation. I recommend keeping contentSize and CATiledLayer size under px x px, maintaining the offset of this rect from the absolute map size for the zoom level in an instance property.

A very simple UIScrollView demo

If so, how should I continue? Things seem to run ok in standard resolution on either simulated or actual hardware but high-res tiling can take a long time to fill up the screen.

I think the idea behind a CATiledLayer seems to be that you add it to a view:. It was being drawn at the same pixel resolution used when zoomed out:.

Oct 18, 4: Mac OS X I can get a map to show up geographically located where I expected it to be. NO]; Ok, so far so good. Stepping through with the uiscrollviwe, I see that this thread exits before the hang happens.