diff --git a/module/javascript/app/vmap/map/mapcompare.js b/module/javascript/app/vmap/map/mapcompare.js index 54e49269cbbaf97404ab2076d7dcbeed043a3028..b3304a3c7800e0e991cc42b0c80bd0a11e4ee882 100644 --- a/module/javascript/app/vmap/map/mapcompare.js +++ b/module/javascript/app/vmap/map/mapcompare.js @@ -592,11 +592,11 @@ nsVmap.MapCompare.prototype.mapCompareController.prototype.synchronizeMap = func var this_ = this; // Synchro Échelle - $(this_.map.getTargetElement()).on('mouseleave', function(){ + this_.map.getTargetElement().addEventListener('mouseleave', function(){ oVmap.getMap().getOLMap().on("moveend", this_.updateCompareScaleMap, this_); this_.map.un("moveend", this_.updateScaleMap, this_); }); - $(this_.map.getTargetElement()).on('mouseenter', function(){ + this_.map.getTargetElement().addEventListener('mouseenter', function(){ oVmap.getMap().getOLMap().un("moveend", this_.updateCompareScaleMap, this_); this_.map.on("moveend", this_.updateScaleMap, this_); }); @@ -664,20 +664,13 @@ nsVmap.MapCompare.prototype.mapCompareController.prototype.synchronizeMap = func this_.targetOverlay_.setPosition(convertCoord); }); - - // Si la souris n'est pas sur la carte comparée, déclenche un mouseleave - if (!$(this_.map.getTargetElement()).is(':hover')) { - $(this_.map.getTargetElement()).trigger('mouseleave'); - } }; /** * Update the map extent with animation * @returns {undefined} */ -nsVmap.MapCompare.prototype.mapCompareController.prototype.updateCompareScaleMap = function(e) { - oVmap.log('nsVmap.MapCompare.updateCompareScaleMap'); - +nsVmap.MapCompare.prototype.mapCompareController.prototype.updateCompareScaleMap = function(e) { console.log('updateCompareScaleMap'); var this_ = this this_.updateCenterCompareMap(); oVmap.getMapCompare().setScale(oVmap.getMap().getScale()); @@ -689,9 +682,7 @@ nsVmap.MapCompare.prototype.mapCompareController.prototype.updateCompareScaleMap * Update the map extent with animation * @returns {undefined} */ -nsVmap.MapCompare.prototype.mapCompareController.prototype.updateScaleMap = function(e) { - oVmap.log('nsVmap.MapCompare.updateScaleMap'); - +nsVmap.MapCompare.prototype.mapCompareController.prototype.updateScaleMap = function(e) { console.log('updateScaleMap'); var this_ = this this_.updateCenterMap(); oVmap.getMap().setScale(oVmap.getMapCompare().getScale());