1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
OpenLayers.Handler.Feature.prototype.triggerCallback = function(type, mode, args) {
var key = this.EVENTMAP[type][mode];
if(key) {
if(type == 'click' && this.up && this.down) {
// for click/clickout, only trigger callback if tolerance is met
var dpx = Math.sqrt(
Math.pow(this.up.x - this.down.x, 2) +
Math.pow(this.up.y - this.down.y, 2)
);
if(dpx <= this.clickTolerance) {
this.callback(key, args);
}
this.down = null; //résolution du problème de calcul de dpx
} else {
this.callback(key, args);
}
}
}; |
Partager