i want to add the functionality of switching the option to pan the map and put it in a checkbox. But im not quite sure how i can do that.
The reason I want to do this is: I have a layer which displays features and has a select and hover control. So theres no way to pan the map, because the clickEvent triggers direct action from the Handlers (click,hover). I want to add a checkbox where i can activate/deactivate the possibility to pan the map, so i can pan the map when there are features present, which normally would trigger a reaction to the mouseover the feature.
The way ive tried to do it is this one but it didnt work. I attached the function to the checkbox but it never worked :/
function allowPan() {
if(panAct == false){
highlightCtrl.activate();
selectedControl.activate();
alert("controls activated!!")
panAct = true;
}
if(panAct == true){
highlightCtrl.deactivate();
selectedControl.deactivate();
alert("controls deactivated!!");
panAct = false;
}
}