1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
   |  
var chrono = null;
function onmousemove(e) {
 	if (chrono!=null){
		clearTimeout(chrono); //reset du chrono
  		chrono = null;
  		chrono = setTimeout(mouseStop(e), 600);
 	}
 	else{
		chrono = setTimeout(mouseStop(e), 600);
 	}
}
 
 
function mouseStop(e){
 	chrono = null;
 	e = (e)?e:((event)?event:null);
	var x = e.pageX;
        var y = e.pageY;
	var adjCoords = this.adjustPixPosition(x, y);
	var p = this.kaMap.pixToGeo(adjCoords[0], adjCoords[1]);
        myFct(p[0], p[1]);
}
 
function onmouseout(e){
 	if (chrono!=null){
		clearTimeout(chrono);
  		chrono = null;
 	}
}
 
function myFct(x, y){
	alert(x + ", " + y);
} | 
Partager