Skip to content

Commit

Permalink
Merge pull request #32 from nworr/compatibility-37
Browse files Browse the repository at this point in the history
Compatibility Lizmap 3.7
  • Loading branch information
Gustry authored Feb 7, 2024
2 parents 0744374 + 3eed1dd commit 1c3d9ac
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
16 changes: 8 additions & 8 deletions altiProfil/install/www/altiprofil/js/altiProfil.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ function resizePlot(id){
}

function getProfil(p1,p2){
var p1Point = new OpenLayers.LonLat(p1.x, p1.y);
var p2Point = new OpenLayers.LonLat(p2.x, p2.y);
if(lizMap.map.projection.projCode != "EPSG:4326"){
var fromProjection = new OpenLayers.Projection(lizMap.map.projection.projCode);
var toProjection = new OpenLayers.Projection("EPSG:4326");
var p1ConvertedPoint = new OpenLayers.LonLat(p1.x, p1.y);
var p2ConvertedPoint = new OpenLayers.LonLat(p2.x, p2.y);
p1ConvertedPoint.transform(fromProjection, toProjection);
p2ConvertedPoint.transform(fromProjection, toProjection);
p1Point.transform(fromProjection, toProjection);
p2Point.transform(fromProjection, toProjection);
}

var qParams = {
'p1Lon': p1ConvertedPoint.lon,
'p1Lat': p1ConvertedPoint.lat,
'p2Lon': p2ConvertedPoint.lon,
'p2Lat': p2ConvertedPoint.lat,
'p1Lon': p1Point.lon,
'p1Lat': p1Point.lat,
'p2Lon': p2Point.lon,
'p2Lat': p2Point.lat,
'srs': lizMap.map.projection.projCode,
'repository': lizUrls.params.repository,
'project': lizUrls.params.project,
Expand Down
9 changes: 7 additions & 2 deletions altiProfil/lib/AltiConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ class AltiConfig

function __construct()
{
$altiProfilConfigFile = \jApp::configPath('altiProfil.ini.php');
if (method_exists('jApp', 'varConfigPath')) {
// LWC >= 3.6
$altiProfilConfigFile = \jApp::varConfigPath('altiProfil.ini.php');
} else {
$altiProfilConfigFile = \jApp::configPath('altiProfil.ini.php');
}
$defaultValues = array(
'altisource' => '',
'altiProfileTable' => '',
Expand Down Expand Up @@ -73,4 +78,4 @@ public function getIgnServiceUrl($path, $parameters)
$url .= '?'. http_build_query($parameters, '', '&');
return $url;
}
}
}
10 changes: 8 additions & 2 deletions altiProfilAdmin/controllers/config.classic.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ class configCtrl extends jController {

function __construct( $request ) {
parent::__construct( $request );
$monfichier = jApp::configPath('altiProfil.ini.php');
$this->ini = new jIniFileModifier ($monfichier);
if (method_exists('jApp', 'varConfigPath')) {
// LWC >= 3.6
$monfichier = \jApp::varConfigPath('altiProfil.ini.php');
$this->ini = new \Jelix\IniFile\IniModifier($monfichier);
} else {
$monfichier = \jApp::configPath('altiProfil.ini.php');
$this->ini = new jIniFileModifier($monfichier);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LIZMAP_DIR=$(shell pwd)/lizmap
LIZMAP_USER_ID:=$(shell id -u)
LIZMAP_USER_GID:=$(shell id -g)

LIZMAP_VERSION_TAG:=3.6
LIZMAP_VERSION_TAG:=3.7
QGIS_VERSION_TAG:=3.22
POSTGIS_VERSION_TAG:=13-3

Expand Down

0 comments on commit 1c3d9ac

Please sign in to comment.