Skip to content
Snippets Groups Projects
Commit 81beb244 authored by Anthony Borghi's avatar Anthony Borghi
Browse files

Merge remote-tracking branch 'origin/next_version' into vitis_stockage_S3

parents 6f9b9a96 4f3da349
Branches
Tags
No related merge requests found
vas/rest/class/*
vas/rest/class/!*/
vas/rest/class/!*.*
vas/sql/*
vas/sql/!*/
vas/sql/!*.*
<?php <?php
session_start(); session_start();
require_once '../rest/conf/properties.inc';
$_SERVER['VAS_PATH'] = pathinfo(dirname($_SERVER['SCRIPT_FILENAME']))['dirname'];
require_once $_SERVER['VAS_PATH'] . '/rest/conf/properties.inc';
function returnOverview($sFolder, $parent) { function returnOverview($sFolder, $parent) {
$aModules = array(); $aModules = array();
...@@ -17,10 +20,12 @@ function returnOverview($sFolder, $parent) { ...@@ -17,10 +20,12 @@ function returnOverview($sFolder, $parent) {
} }
} }
} }
return $aModules; return $aModules;
} }
$aOverview = returnOverview(__DIR__ . "/../rest/ws", ""); $aOverview = returnOverview($_SERVER['VAS_PATH'] . "/rest/ws", "");
error_log('$aOverview: '. print_r($aOverview, true));
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
...@@ -154,4 +159,3 @@ foreach ($aOverview as $key => $value) { ...@@ -154,4 +159,3 @@ foreach ($aOverview as $key => $value) {
</div> </div>
</body> </body>
</html> </html>
<?php <?php
$_SERVER['VAS_PATH'] = pathinfo(dirname($_SERVER['SCRIPT_FILENAME']))['dirname'];
header('Content-Type: application/json'); header('Content-Type: application/json');
require_once "../rest/conf/properties.inc"; require_once $_SERVER['VAS_PATH'] . "/rest/conf/properties.inc";
require("vendor/autoload.php"); require("vendor/autoload.php");
$swagger = \Swagger\scan('../rest/ws/'.$_REQUEST['service']); $swagger = \Swagger\scan($_SERVER['VAS_PATH'] . '/rest/ws/'.$_REQUEST['service']);
$aServer = explode("://", $properties["web_server_name"]); $aServer = explode("://", $properties["web_server_name"]);
$swagger = str_replace("[service_alias]", $properties["services_alias"], $swagger); $swagger = str_replace("[service_alias]", $properties["services_alias"], $swagger);
$swagger = str_replace("[protocol]", $aServer[0], $swagger); $swagger = str_replace("[protocol]", $aServer[0], $swagger);
......
<?php <?php
$_SERVER['VAS_PATH'] = pathinfo(dirname($_SERVER['SCRIPT_FILENAME']))['dirname'];
require_once("class/vitis_lib/VitisError.class.inc"); require_once("class/vitis_lib/VitisError.class.inc");
require_once("class/vmlib/cryptUtil.inc"); require_once("class/vmlib/cryptUtil.inc");
require_once("conf/properties.inc"); require_once("conf/properties.inc");
......
...@@ -85,19 +85,19 @@ class Properties extends Vitis { ...@@ -85,19 +85,19 @@ class Properties extends Vitis {
} else { } else {
$this->aFields = $this->aProperties; $this->aFields = $this->aProperties;
} }
require_once __DIR__ . "/../../conf/version.inc"; require_once dirname($_SERVER['SCRIPT_FILENAME']) . "/conf/version.inc";
if (VM_STATUS != "STABLE") { if (VM_STATUS != "STABLE") {
$this->aFields['VM_STATUS'] = "UNSTABLE"; $this->aFields['VM_STATUS'] = "UNSTABLE";
} else { } else {
$this->aFields['VM_STATUS'] = "STABLE"; $this->aFields['VM_STATUS'] = "STABLE";
if ($pointeur = opendir(__DIR__ . "/../../conf/")) { if ($pointeur = opendir(dirname($_SERVER['SCRIPT_FILENAME']) . "/conf/")) {
while (($fichier = readdir($pointeur)) !== false) { while (($fichier = readdir($pointeur)) !== false) {
if (($fichier != '.') && ($fichier != '..')) { if (($fichier != '.') && ($fichier != '..')) {
if (is_dir(__DIR__ . "/../../conf/" . $fichier)) { if (is_dir(dirname($_SERVER['SCRIPT_FILENAME']) . "/conf/" . $fichier)) {
$sTexte = file_get_contents(__DIR__ . "/../../conf/" . $fichier . "/version.inc"); $sTexte = file_get_contents(dirname($_SERVER['SCRIPT_FILENAME']) . "/conf/" . $fichier . "/version.inc");
if (strpos($sTexte, "define (\"VM_STATUS\", \"STABLE\");") == false) { if (strpos($sTexte, "define (\"VM_STATUS\", \"STABLE\");") == false) {
$this->aFields['VM_STATUS'] = "UNSTABLE"; $this->aFields['VM_STATUS'] = "UNSTABLE";
...@@ -348,9 +348,9 @@ class Properties extends Vitis { ...@@ -348,9 +348,9 @@ class Properties extends Vitis {
// Sauve le fichier (LOCK_EX = accés exclusif au fichier) // Sauve le fichier (LOCK_EX = accés exclusif au fichier)
if ($this->aValues['module_name'] == 'vitis') if ($this->aValues['module_name'] == 'vitis')
$sPathProperties = __DIR__ . '/../../conf/properties.inc'; $sPathProperties = dirname($_SERVER['SCRIPT_FILENAME']) . '/conf/properties.inc';
else else
$sPathProperties = __DIR__ . '/../../conf/' . $this->aValues['module_name'] . '/properties.inc'; $sPathProperties = dirname($_SERVER['SCRIPT_FILENAME']) . '/conf/' . $this->aValues['module_name'] . '/properties.inc';
// //
if (file_put_contents($sPathProperties, $sPropertiesFile, LOCK_EX) === false) if (file_put_contents($sPathProperties, $sPropertiesFile, LOCK_EX) === false)
$aReturn = array('status' => 0, 'message' => "FORM_ERROR_FILE_WRITING_CONFIGURATION"); $aReturn = array('status' => 0, 'message' => "FORM_ERROR_FILE_WRITING_CONFIGURATION");
......
...@@ -63,6 +63,9 @@ PrintMap = function (opt_options) { ...@@ -63,6 +63,9 @@ PrintMap = function (opt_options) {
// Supprime tous les controls par défaut // Supprime tous les controls par défaut
this.removeMapControls(); this.removeMapControls();
// Taille des icones en fonction de la résolution demandée
this.setMapSymbolsResolution(this.map, this.resolutionCoeff)
// Si aucune étendue a été donnée et que seul un point a été donné, alors zoom sur this.defaultScale // Si aucune étendue a été donnée et que seul un point a été donné, alors zoom sur this.defaultScale
if (!isDef(opt_options.extent) && !isDef(this.features)) { if (!isDef(opt_options.extent) && !isDef(this.features)) {
if (this.features.length === 1 && this.features[0].getGeometry().getType() === 'Point') { if (this.features.length === 1 && this.features[0].getGeometry().getType() === 'Point') {
...@@ -368,3 +371,20 @@ PrintMap.prototype.getGeomFromEWKT = function (EWKTGeom, proj) { ...@@ -368,3 +371,20 @@ PrintMap.prototype.getGeomFromEWKT = function (EWKTGeom, proj) {
} }
}; };
/**
* For WMS layers set MAP.RESOLUTION and MAP.DEFRESOLUTION to rise the symbols size
*
* @param {object} olMap
* @param {integer} resolutionCoeff
*/
PrintMap.prototype.setMapSymbolsResolution = function (olMap, resolutionCoeff) {
var newRes = resolutionCoeff * 72;
var aLayers = olMap.getLayers().getArray();
for (var i = 0; i < aLayers.length; i++) {
if (aLayers[i].get('type') === 'imagewms' || aLayers[i].get('type') === 'tilewms') {
aLayers[i].getSource().updateParams({'MAP.RESOLUTION': newRes, 'MAP.DEFRESOLUTION': 72});
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment