jessedc / JCTiledScrollView

A set of classes that wrap UIScrollView and CATiledLayer. It aims to simplify displaying large images and PDFs at multiple zoom scales.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding overlays and annotations to JCTiledScrollView

Vratislav opened this issue · comments

Hello

I really like what you are doing here. It really gave me a kickstart on my current project. :)

I would like to donate annotations and overlays functionality to JCTiledScrollView. My plan is to take the annotations and overlay implementation from Route-Me library and adapt it to the JCTiledScrollView needs. It has some very nice and advanced anotations stuff including automatic annotations grouping. I have a working prototype but It needs a lot of refactoring to be nice and reusable.

For annotations and overlays to work, I will need to create a new encapsulating view, that will hold the overlay view and the current JCTiledScrollView. I think, the best way to go about with this is to rename current JCTiledScrollView to something else and name the encapsulating view as a JCTiledScrollView. This new encapsulating view will act to the outside world as a current JCTiledScrollView and will include additional methods for adding annotations.

I will fork this project and start working on this. If you like how it is coming along, I would be pleased, if my overlay implementation would merge into the master branch of JCTiledScrollView.

In order to make the overlay extension as compatible as possible with the current JCTiledScrollView project, I want to respect your coding standards and I would like to ask you, how to rename the current JCTiledScrollView and give this name to the newly created encapsulating view.

Hi Vratislav,

I have put together a basic implementation of overlays and it does require an intermediate view on top the CATiledLayer backed view, and inside the zoomable view of the UIScrollView.

I implemented this by adding the overlay handling methods to JCTiledScrollView directly and hiding the underlying implementation.

I'm planning on adding my basic implementation to the project soon, I'd be keen on your feedback - and I'm also keen to see the work you're planning on doing with the Route-Me code.

Cheers!

Jesse,

You can see the prototype in my fork of your project. I went with what you suggested and I have integrated the implementation into the JCTiledScrollView.

Everything is rough around the corners at the moment. It will need a lot of refactoring.

Right now, it only supports RMMarker type of annotations but I will be adding RMPath and RMCircle soon. I'd be keen on your feedback.

Have a great rest of the week!

Hi Vratislav,

I've spend some time over the past week implementing annotations in my own way using scrollViewDidScroll and UIViews rather CALayers and KVO of the contentOffset. I found your approach a good guide but I thought it had a lot of extra code that may not be needed.

I find my current implementation (see the annotations branch) handles the scrollView zoomBouncing and other animation related edge cases quite well and asking for a UIView in the delegate will be easier for the average user to grasp as it's more similar to MKMapViewDelegate.

At this point there's a number of things missing (like annotation selection) but I'm setting up some issues and a milestone to track what's left to do.