[OpenLayers-Users] Panning button in the editing toolbar re-enables zoom via scroll wheel

Christopher Dale chrelad at gmail.com
Fri Aug 21 12:40:37 EDT 2009


Good news,

Figured out how to at least get the navigation control in the editing
toolbar to not allow zooming via the scroll wheel until the zooming
gets fixed. After adding your Navigation control to the map, drop this
in:

var controls = map.getControlsByClass('OpenLayers.Control.Navigation');
for(var i = 0; i < controls.length; ++i)
      controls[i].disableZoomWheel();

That'll take care of telling all other navigation controls not to
allow zooming with the scroll wheel.

Thanks to this site for steering me in the right direction:
http://www.stoimen.com/blog/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/

Can we add a bug report for the zooming stuff though? That seems like
it might be a big issue.

Thanks everyone,

Chrelad

On Fri, Aug 21, 2009 at 11:31 AM, Christopher Dale<chrelad at gmail.com> wrote:
> Hey team OpenLayers,
>
> Just another shot of the bug mentioned in the first message. This time
> I managed to capture the panning problem as well as the zoom problem.
>
> http://yfrog.com/15openlayers3g
>
> Lemme know what you think and thanks,
>
> Chrelad
>
> On Fri, Aug 21, 2009 at 11:20 AM, Christopher Dale<chrelad at gmail.com> wrote:
>> Hi everyone,
>>
>> I tested this on Chrome and it seems to do the same thing. Just
>> checking to make sure it wasn't a Firefox only thing.
>>
>> I took a sec to record this attempt also.
>>
>> http://yfrog.com/15openlayers2g
>>
>> Lemme know what you think and thank you,
>>
>> Chrelad
>>
>> On Fri, Aug 21, 2009 at 10:47 AM, Christopher Dale<chrelad at gmail.com> wrote:
>>> Hi everyone,
>>>
>>> I thought maybe an example of what I'm talking about might help
>>> everyone here get an idea of what I'm talking about.
>>>
>>> http://yfrog.com/74openlayers1g
>>>
>>> Let me know what you think and thanks again,
>>>
>>> Chrelad
>>>
>>> On Fri, Aug 21, 2009 at 10:03 AM, Christopher Dale<chrelad at gmail.com> wrote:
>>>> Hi everyone,
>>>>
>>>> Couple things :)
>>>>
>>>> First off, I found that zooming with the scroll wheel can cause some
>>>> big headaches. Here are some of the things I ran into while zooming in
>>>> and out and panning. Note that all tests were done with Firefox 3 +
>>>> OpenLayers SVN + Virtual Earth base tiles + Spherical mercator +
>>>> vector layer.
>>>>
>>>> - When you zoom with your scroll wheel, the map zooms in, but vector
>>>> features appear (sometimes) offset from their proper location
>>>> (left/right).
>>>> - Rolled forward one click which zoomed in properly, panned left. When
>>>> I lifted my finger off left mouse button to stop panning left, the map
>>>> zoomed in again one zoom level.
>>>>
>>>> I eventually just disabled zooming using the zoomWheelEnabled property
>>>> for the Navigation control. This works great, until I draw a feature
>>>> and then click the navigation button in the editing toolbar. I know
>>>> for a fact that the problem begins when you click the navigation
>>>> button in the editing toolbar.
>>>>
>>>> Could anyone recommend either a way to get zooming via the scroll
>>>> wheel to work properly (ie. fixing the top-most two bugs) or getting
>>>> the pan button to not re-enable scroll wheel zooming?
>>>>
>>>> Thanks team OpenLayers!
>>>>
>>>> Chrelad
>>>>
>>>
>>
>



More information about the Users mailing list