[OpenLayers-Users] How to prevent PanZoomBar clicks from propagating to Click control

Rohan Parkes rohan.parkes at pelicancorp.com
Thu Aug 5 01:39:18 EDT 2010


My map has a click control that allows users to re-centre the map by
clicking on it.

However, there is one drawback - it responds to clicks on the PanZoomBar
control, creating a strange blend of panning and zooming when the user
zooms.

It doesn't respond to the Zoom In or Zoom Out icons - just the bar element. 

Presumably I have to find a way to prevent clicks on the Zoom bar from
propagating to the map.

If the user clicks on the map at least once, it works correctly, and the map
does not pan when the user zooms. But if they start by clicking on the zoom
bar, they get the unwanted behaviour.

I've been messing around with the Handler.Click class, but I can't get
anything to work.

The code for the OpenLayers.Control.Click control is from the OL Click Event
example. The trigger member just calls a function that re-centres the map.

Rohan Parkes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100805/290f4801/attachment.html


More information about the Users mailing list