From ff54390c8194132c7c971fd9703d66f745ca70ac Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Wed, 27 Sep 2017 13:17:19 -0300 Subject: [PATCH] Correção de erros do tipo Warning em códigos PHP --- mashups/openlayers.php | 18 +++++++++++++----- mashups/openlayersdebug.php | 32 ++++++++++++++++++++------------ mashups/osm.php | 2 +- ogc/index.php | 6 ++++++ 4 files changed, 40 insertions(+), 18 deletions(-) diff --git a/mashups/openlayers.php b/mashups/openlayers.php index 498faa7..4d253e8 100755 --- a/mashups/openlayers.php +++ b/mashups/openlayers.php @@ -8,7 +8,7 @@ include_once (dirname(__FILE__) . "/../ms_configura.php"); include_once (dirname(__FILE__) . "/../classesphp/sani_request.php"); include_once (dirname(__FILE__) . "/../classesphp/carrega_ext.php"); include_once (dirname(__FILE__) . "/../classesphp/funcoes_gerais.php"); -// error_reporting(0); +error_reporting(0); // variaveis utilizadas $parurl = array_merge($_GET, $_POST); if(count($parurl) == 0){ @@ -60,14 +60,15 @@ if (isset($parurl["altura"])) { if (isset($parurl["largura"])) { $estilo .= ";width:" . $parurl["largura"] . "px"; } -$controles = $parurl["controles"]; + // // define quais controles serão mostrados no mapa // $objControles = array( "new ol.control.Attribution({collapsible: true})" ); -if (isset($controles)) { +if (isset($parurl["controles"])) { + $controles = $parurl["controles"]; $controles = str_replace(" ", ",", $controles); $controles = strtolower($controles); $controles = explode(",", $controles); @@ -87,18 +88,19 @@ if (isset($controles)) { $objControles[] = "new ol.control.OverviewMap()"; } } else { + $controles = ""; $objControles[] = "new ol.control.Zoom()"; $objControles[] = "new ol.control.ZoomSlider()"; $objControles[] = "new ol.control.ScaleLine()"; $objControles[] = "new ol.control.MousePosition({coordinateFormat : function(c){return ol.coordinate.toStringHDMS(c);}})"; } -$botoes = $parurl["botoes"]; // // define quais botoes serão mostrados no mapa // $objBotoes = array(); $objBotoesHtml = array(); -if (isset($botoes)) { +if (isset($parurl["botoes"])) { + $botoes = $parurl["botoes"]; $botoes = str_replace(" ", ",", $botoes); $botoes = strtolower($botoes); $botoes = explode(",", $botoes); @@ -312,7 +314,13 @@ if(isset($parurl["ativarodadomouse"]) && $parurl["ativarodadomouse"] == "false") else{ $ativarodadomouse = "new ol.interaction.MouseWheelZoom(),"; } +if(!isset($parurl["legendahtml"])){ + $parurl["legendahtml"] = ""; +} $legendahtml = $parurl["legendahtml"]; +if(!isset($parurl["layerDefault"])){ + $parurl["layerDefault"] = ""; +} $layerDefault = $parurl["layerDefault"]; // cria as pastas temporarias caso nao existam if (! file_exists($dir_tmp)) { diff --git a/mashups/openlayersdebug.php b/mashups/openlayersdebug.php index dd43517..b5f03d8 100755 --- a/mashups/openlayersdebug.php +++ b/mashups/openlayersdebug.php @@ -8,7 +8,7 @@ include_once (dirname(__FILE__) . "/../ms_configura.php"); include_once (dirname(__FILE__) . "/../classesphp/sani_request.php"); include_once (dirname(__FILE__) . "/../classesphp/carrega_ext.php"); include_once (dirname(__FILE__) . "/../classesphp/funcoes_gerais.php"); -// error_reporting(0); +//error_reporting(0); // variaveis utilizadas $parurl = array_merge($_GET, $_POST); if(count($parurl) == 0){ @@ -60,14 +60,15 @@ if (isset($parurl["altura"])) { if (isset($parurl["largura"])) { $estilo .= ";width:" . $parurl["largura"] . "px"; } -$controles = $parurl["controles"]; + // // define quais controles serão mostrados no mapa // $objControles = array( "new ol.control.Attribution({collapsible: true})" ); -if (isset($controles)) { +if (isset($parurl["controles"])) { + $controles = $parurl["controles"]; $controles = str_replace(" ", ",", $controles); $controles = strtolower($controles); $controles = explode(",", $controles); @@ -87,18 +88,19 @@ if (isset($controles)) { $objControles[] = "new ol.control.OverviewMap()"; } } else { + $controles = ""; $objControles[] = "new ol.control.Zoom()"; $objControles[] = "new ol.control.ZoomSlider()"; $objControles[] = "new ol.control.ScaleLine()"; $objControles[] = "new ol.control.MousePosition({coordinateFormat : function(c){return ol.coordinate.toStringHDMS(c);}})"; } -$botoes = $parurl["botoes"]; // // define quais botoes serão mostrados no mapa // $objBotoes = array(); $objBotoesHtml = array(); -if (isset($botoes)) { +if (isset($parurl["botoes"])) { + $botoes = $parurl["botoes"]; $botoes = str_replace(" ", ",", $botoes); $botoes = strtolower($botoes); $botoes = explode(",", $botoes); @@ -312,7 +314,13 @@ if(isset($parurl["ativarodadomouse"]) && $parurl["ativarodadomouse"] == "false") else{ $ativarodadomouse = "new ol.interaction.MouseWheelZoom(),"; } +if(!isset($parurl["legendahtml"])){ + $parurl["legendahtml"] = ""; +} $legendahtml = $parurl["legendahtml"]; +if(!isset($parurl["layerDefault"])){ + $parurl["layerDefault"] = ""; +} $layerDefault = $parurl["layerDefault"]; // cria as pastas temporarias caso nao existam if (! file_exists($dir_tmp)) { @@ -338,19 +346,21 @@ if (file_exists($dir_tmp)) { if (empty($opacidade)) { $opacidade = 1; } - +if(!isset($parurl["fundo"])){ + $parurl["fundo"] = ""; +} function ajuda() { echo "

 	Mashup OpenLayers
 	Parâmetros:
-	.restauramapa - id do mapa armazenado no sistema de administracao e que será restaurado para ser aberto novamente (veja em i3geo/admin/html/mapas.html)
+	.restauramapa - id do mapa armazenado no sistema de administracao e que será restaurado para ser aberto novamente (veja em i3geo/admin1/catalogo/mapas/index.php)
 	.opacidade - opacidade (de 0 a 1) aplicada aos temas do tipo poligonal ou raster (default 1)
 	.kml - lista de endereços (url) de um arquivos kml que serão adicionados ao mapa. Separado por ','
 	.temas - lista com os temas (mapfiles) do i3Geo que serão incluídos no mapa. Pode ser incluído um arquivo mapfile que esteja fora da pasta i3geo/temas. Nesse caso, deve-se definir o caminho completo do arquivo e também o parâmetro &layers
 	.visiveis - lista de temas (mesmos nomes do parâmetro temas) que iniciarão como visíveis no mapa. Se não for definido, todos os temas serão visíveis.
-	.numzoomlevels - número de níveis de zoom, default=12
+	.numzoomlevels - número de níveis de zoom
 	.maxextent - extensão geográfica máxima do mapa (xmin,ymin,xmax,ymax)
 	.mapext - extensão geográfica inicial do mapa (xmin,ymin,xmax,ymax)
 	.largura - lagura do mapa em pixels
@@ -377,11 +387,9 @@ function ajuda()
 	Os seguintes fundos podem usados nessa lista: (lista completa na variavel i3GEO.Interface.openlayers.LAYERSADICIONAIS que pode ser verificada por meio do console javascript do navegador)
 
 	eng
-    oce - ESRI Ocean Basemap
+	oce - ESRI Ocean Basemap
 	ims - ESRI Imagery World 2D
 	wsm - ESRI World Street Map
-	mma - base cartográfica do Brasil
-	wms - base mundial da Meta Carta
 
 	.controles - lista com os nomes dos controles que serão adicionados ao mapa. Se não for definido, todos os controles serão adicionados
 	   navigation
@@ -1259,4 +1267,4 @@ function ajuda()
 	
 
 
-
+
\ No newline at end of file
diff --git a/mashups/osm.php b/mashups/osm.php
index 673e318..7232fed 100755
--- a/mashups/osm.php
+++ b/mashups/osm.php
@@ -8,7 +8,7 @@ include_once (dirname(__FILE__) . "/../ms_configura.php");
 include_once (dirname(__FILE__) . "/../classesphp/sani_request.php");
 include_once (dirname(__FILE__) . "/../classesphp/carrega_ext.php");
 include_once (dirname(__FILE__) . "/../classesphp/funcoes_gerais.php");
-// error_reporting(0);
+error_reporting(0);
 // variaveis utilizadas
 $parurl = array_merge($_GET, $_POST);
 if (count($parurl) == 0) {
diff --git a/ogc/index.php b/ogc/index.php
index 5fcd99e..fada81a 100755
--- a/ogc/index.php
+++ b/ogc/index.php
@@ -10,6 +10,12 @@ if ($ogcwsmap == "") {
 $map = ms_newMapObj ( $ogcwsmap );
 $mapext = $map->extent->minx . "," . $map->extent->miny . "," . $map->extent->maxx . "," . $map->extent->maxy;
 include (ONDEI3GEO."/init/head.php");
+if(!isset($_GET["temaOgc"])){
+    $_GET["temaOgc"] = "";
+}
+if(!isset($_GET["temaDownload"])){
+    $_GET["temaDownload"] = "";
+}
 ?>
 
 
--
libgit2 0.21.2