Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click control get broken after removing and adding a navigation control #1205

Open
mswedgar opened this issue Dec 16, 2013 · 0 comments
Open

Comments

@mswedgar
Copy link

Here is the step to reproduce it,

function clickme() {
var control = map.getControlsByClass("OpenLayers.Control.Navigation")[0];
map.removeControl(control);
control.destroy();
var newControl = new OpenLayers.Control.Navigation();
map.addControl(newControl);
}

  1. Add the code to the file /OpenLayers2.13.1/examples/click.html
  2. add a button and make its click event point to this function.

3.run the example, and click the map, you'll see a javascript alert "you clicked XXX"

4.then click the button that just added.

5.click the map again, there is no alert anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant