diff --git a/altiProfil/install/config/altiProfil.ini.php.dist b/altiProfil/install/config/altiProfil.ini.php.dist index 2b89571..09afe85 100755 --- a/altiProfil/install/config/altiProfil.ini.php.dist +++ b/altiProfil/install/config/altiProfil.ini.php.dist @@ -13,4 +13,4 @@ dock=dock ;si cas IGN altiProfileProvider=ign ignServiceKey=essentiels -ignServiceUrl=https://wxs.ign.fr/ +ignServiceUrl="https://data.geopf.fr/altimetrie/1.0/calcul" diff --git a/altiProfil/install/www/altiprofil/js/altiProfil.js b/altiProfil/install/www/altiprofil/js/altiProfil.js index bb60275..6447fe3 100755 --- a/altiProfil/install/www/altiprofil/js/altiProfil.js +++ b/altiProfil/install/www/altiprofil/js/altiProfil.js @@ -233,7 +233,9 @@ function initAltiProfil() { altiProfilLayer.setVisibility(true); } + // add altiprofilCtrl prop to Control with value true to distiguish it OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { + 'altiprofilCtrl' :true, defaultHandlerOptions: { 'single': true, 'double': false, @@ -292,6 +294,10 @@ function initAltiProfil() { if (ctrl.CLASS_NAME == 'OpenLayers.Control.WMSGetFeatureInfo'){ ctrl.deactivate(); } + // desactivate existing control which handle single click (TODO : should store previous state if multiple controls of this kind) + if (ctrl.CLASS_NAME == 'OpenLayers.Control' && ctrl.defaultHandlerOptions?.single == true && ctrl?.altiprofilCtrl != true) { + ctrl.deactivate(); + } }); altiProfilLayer.setVisibility(true); profilClick.activate(); @@ -303,6 +309,10 @@ function initAltiProfil() { if (ctrl.CLASS_NAME == 'OpenLayers.Control.WMSGetFeatureInfo'){ ctrl.activate(); } + // activate existing control which handle single click + if (ctrl.CLASS_NAME == 'OpenLayers.Control' && ctrl.defaultHandlerOptions?.single == true && ctrl?.altiprofilCtrl != true) { + ctrl.activate(); + } }); $('#altiProfil .menu-content #profil-chart-container').empty(); $('#altiProfil .menu-content span').html( "..." );