Skip to content

Commit

Permalink
Desactivate Popup Control when using Altiprofil (#36)
Browse files Browse the repository at this point in the history
* update default installed conf file

* update js for 3.7 compatibility
  • Loading branch information
nworr authored Mar 28, 2024
1 parent 6f505b2 commit 9c7eac6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion altiProfil/install/config/altiProfil.ini.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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"
10 changes: 10 additions & 0 deletions altiProfil/install/www/altiprofil/js/altiProfil.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand All @@ -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( "..." );
Expand Down

0 comments on commit 9c7eac6

Please sign in to comment.