Select to view content in your preferred language

map.on click event fires two times in Firefox 29.0.1 (API for JavScript 3.9)

1485
5
05-14-2014 04:04 AM
PauPérez_Puigcerver
Emerging Contributor
Hi,

When I click on map, using API Javascript 3.9 and Firefox 29.0.1, that there is defined a map.on event click, the event fires two times. In Google Chrome 34.0.1847.131 and IE 9.0.8112.16421 works fine (only one click event fires).

The test site is located here:

http://cartoweb.cma.gva.es/test.html

In Firefox, watching the JavaScript Console you can see that the event fires two times.

Does anyone know what is going on? Is it a bug of Firefox? of API?

Thanks in advance.

Pau Pérez Puigcerver
http://cartoweb.cma.gva.es
0 Kudos
5 Replies
JeffPace
MVP Alum
On mouse over and on mouse out seem to fire repeatedly also. I think Firefox 29 has issues
0 Kudos
JonathanUihlein
Esri Regular Contributor
Interesting... I am also using Firefox 29.0.1 (on Win7 64) but am unable to replicate this issue.

@Jeff, in the sample Pau linked, are you seeing the event fire twice?
0 Kudos
JeffPace
MVP Alum
in firefox 29.0.1 i am only seeing one logged event per click
0 Kudos
PauPérez_Puigcerver
Emerging Contributor
I have Windows Vista SP2 and a colleague of mine who has tested the site has had the same error. He has the same verions and operating system.

I attach an image how the event fires in one click.

Thanks!
0 Kudos
PauPérez_Puigcerver
Emerging Contributor
I have a temporary workaround for the event that run two times.

 
                var evento;
                ................
                function clickInfo (evt){
   console.log("Clicked" + (++clickCount));
   if (navigator.userAgent.indexOf('Firefox') !=-1){
    evento.remove();
    setTimeout(function(){evento = map.on("click", clickInfo);}, 500);
   }
  }

  evento = map.on("click", clickInfo);


The website is:

http://cartoweb.cma.gva.es/test.html

Thanks!

Pau Pérez Puigcerver
http://cartoweb.cma.gva.es
0 Kudos