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

Stephen Woodbridge woodbri at swoodbridge.com
Sat May 8 18:35:31 EDT 2010

Hi Nathan,

I can not speak for the dev team, but as a user that is also trying to 
better support multitouch devices, I would love to see OpenLayers have 
better awareness and support for multitouch devices.

One option to discuss with the dev team might be to load your changes 
into a sandbox to make it easier for them and other to review and try 
out your changes.

Best regards,
   -Steve W

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 <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:
>> 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).
>> 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 <http://calftrail.com/>
>> _______________________________________________
>> Dev mailing list
>> Dev at openlayers.org <mailto:Dev at openlayers.org>
>> http://openlayers.org/mailman/listinfo/dev
> ------------------------------------------------------------------------
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev

More information about the Dev mailing list