[OpenLayers-Dev] Multitouch, tile layer contributions [repost]

Nathan Vander Wilt nate-lists at calftrail.com
Tue May 18 18:03:38 EDT 2010


(replying to list this time, as originally intended)
On May 10, 2010, at 3:58 AM, Andreas Hocevar wrote:
> Hi Nathan,
> 
> I am sure there is a lot of interest in your improvements, but for potential reviewers it would be much easier if the listed improvements would have tickets with patches attached, preferably with unit tests and examples. Also note that it is much better to have several small patches (resulting in several tickets also), instead of one big one.
> 
> Thanks a lot for your effort, it is much appreciated.

Thanks for the advice. I've been busy with a few other tasks (and also improving the tile layer internally which should get added to the public demo sooner or later) but hope to divide the patches as well as possible. For example the scroll wheel stuff is mostly unrelated, and the multitouch controls should work with any layer that supports fractional zoom.

regards,
-natevw




> On May 8, 2010, at 23:40 , Nathan Vander Wilt wrote:
> 
>> Sorry, my thread appears to have been quickly hijacked.
>> Is there any interest in getting the multitouch-oriented improvements described and demonstrated below into trunk?
>> 
>> thanks,
>> -natevw
>> http://calftrail.com
>> 
>> 
>> 
>> 
>> On May 4, 2010, at 3:00 PM, Nathan Vander Wilt wrote:
>>> Hello all,
>>> 
>>> I have created a number of patches to OpenLayers around the overall goal of having it work well in iPhone/iPad's Mobile Safari (and preliminary testing in Android). While there are still a few remaining issues on my own TODO list, I'd appreciate some code review/advice for potential integration of these contributions with trunk at some point.
>>> 
>>> 
>>> Here's what I've done:
>>> 
>>> 
>>> === SCROLL WHEEL TWEAKS ===
>>> 
>>> Some modifications to OpenLayers.Handler.MouseWheel.prototype.wheelZoom to only respond to vertical zoom events. (Not directly related to multitouch, but was bothering me while I tested on the desktop.)
>>> 
>>> Reverted OpenLayers.Control.Navigation.prototype.wheelChange back to 2.8 so it once again allows fractional zoom (and modified .wheelUp/.wheelDown to pass original fractional delta).
>>> 
>>> 
>>> === MULTITOUCH CONTROLS ===
>>> 
>>> Made an OpenLayers.Handler.Multitouch that mimics Handler.Drag to work for OpenLayers.Control.MultitouchNavigation. This latter is a simple subclass of OpenLayers.Control.DragPan to instantiate the correct handler and to handle the zoom events (simply using OpenLayers.Control.Navigation.wheelChange code in its OpenLayers 2.8 form.)
>>> 
>>> Some previous work on this had been done (http://trac.openlayers.org/ticket/1994), but I wanted to do it in less code in a way that was more compatible with the existing mouse controls/handlers.
>>> 
>>> 
>>> === New Tile layer ===
>>> 
>>> This is the big one, but also most likely in need of discussion. With multitouch, the layer needs to follow the fingers in real time, which means the map should support fractional zooming. So I have created an OpenLayers.Layer.Tile subclass of OpenLayers.Layer.HTTPRequest that basically replaces OpenLayers.Layer.Grid, but focuses only on powers-of-two style tilesets.
>>> 
>>> I initially planned to just modify OpenLayers.Layer.Grid to support the fractional zooming, but their were a number of issues with its architecture (esp. with regard to tile callbacks) that would have basically meant adding a third "mode" to that existing class. 
>>> There was some work done to that effect a while back (http://trac.openlayers.org/ticket/442) but it was only for animation tweening.
>>> 
>>> This new layer is designed to rest at any zoom level whatsoever; it will "overzoom" the best available tiles when necessary. It preserves loaded tiles until its replacements from a new zoom level load, although it does not use Tile.Image backbuffer and does some other semi-kludgy things to deal with the OpenLayers.Tile architecture. The callback is tile (z, x, y)-based rather than bounds, so that all a user/subclass typically needs to do is form an appropriate URL string instead of any geometry calculations.
>>> 
>>> 
>>> You can see a demo of all of this working together at http://calftrail.com/Share/multitouch/ (for best results use Safari with a smooth-scrolling mouse/trackpad or on the iPhone/iPad). What I'm wondering is how well this all fits in with OpenLayer's goals and how I can go about getting this contributed and integrated. Would it be best to split each area into its own ticket and attach patches for individual review? Are there upcoming changes on the roadmap that this code should target?
>>> 
>>> thanks,
>>> -natevw
>>> http://calftrail.com
>>> _______________________________________________
>>> Dev mailing list
>>> Dev at openlayers.org
>>> http://openlayers.org/mailman/listinfo/dev
>> 
>> _______________________________________________
>> Dev mailing list
>> Dev at openlayers.org
>> http://openlayers.org/mailman/listinfo/dev
> 
> 
> 
> -- 
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20100518/6a42485e/attachment.html


More information about the Dev mailing list