[OpenLayers-Users] Click handler lost
Andy Colson
andy at squeakycode.net
Wed Dec 17 11:06:51 PST 2014
Woot. Yeah, that works much better. I delete all the clickControl
stuff and used this:
var hand = new OpenLayers.Control.Navigation( {
title: 'Pan, dbl-click to zoom/center, shift-drag to zoom',
zoomWheelEnabled: false,
defaultClick: onClick
});
And it works fine.
Thanks for the pointer to activate/deactivate!
-Andy
On 12/17/2014 12:52 PM, Andy Colson wrote:
> Ahh.. after some alert() calls in activate/deactivate I see the problem.
> I thought hand (of type Control.Navigation) was doing the single click.
> But its not, there is a different control (clickControl) that's not
> even in the button panel that's doing it. And it never gets
> active/deactive.
>
> I really dont even need that clickControl... right? Control.Navigation
> probably has a click event I can just hook? Yes?
>
> -Andy
>
>
> On 12/17/2014 9:59 AM, Max Demars wrote:
>> Hi,
>>
>> I am not sure what is going on, but If you deactivate your clickControl
>> when measure tool are selected and activate it back when the hand tool
>> is selected, it wont get in conflict. I think its a good practice in
>> general to activate/deactivate controls when tools are selected.
>>
>> Cheers,
>>
>> -Max Demars
>>
>> On Wed, Dec 17, 2014 at 10:30 AM, Andy Colson <andy at squeakycode.net
>> <mailto:andy at squeakycode.net>> wrote:
>>
>> Hi All,
>>
>> We host maps here:
>>
>>
>> http://testmaps.camavision.__com/map/washingtonmn?pin=16.__028.21.11.0039
>>
>> <http://testmaps.camavision.com/map/washingtonmn?pin=16.028.21.11.0039>
>>
>> This is the test page. When the hand tool is selected you can click
>> some place and it'll pop up an info box.
>>
>> If you click one of the other tools, then click right back to the
>> hand, the pop up still works.
>>
>> If you click the zoom tool, drag and area, then go back to hand
>> tool, it still works.
>>
>> BUT, if you click one of the measure tools, and actually measure
>> something, then when you go back to the hand tool, the info box
>> never comes back.
>>
>> Anyone seen anything like this? Maybe some pointers on how I might
>> fix it?
>>
>> Thanks for your time,
>>
>> -Andy
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
More information about the Users
mailing list