From 28fc52ff80f1eca4afcf9ec699876f8d1a5dcd8a Mon Sep 17 00:00:00 2001
From: Edmar Moretti
Date: Thu, 25 Oct 2012 12:42:19 +0000
Subject: [PATCH] Correção na função de carregamento de javascript
---
admin/admin.db | Bin 146432 -> 0 bytes
admin/js/listatemas.js | 16 ++++++++--------
admin/php/menutemas.php | 40 ++++++++++++++++++++--------------------
classesjs/i3geo47.js | 2 +-
geraminiatura.php | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------
interface/googlemaps.phtml | 2 +-
interface/minima.htm | 32 ++++++++++++++++----------------
interface/ol_parametros.php | 20 ++++++++++----------
interface/openlayers.htm | 6 +++---
interface/openlayers1.htm | 36 ++++++++++++++++++------------------
interface/openlayers_t.htm | 16 ++++++++--------
interface/zerocal.htm | 28 ++++++++++++++--------------
interface/zerocalol.htm | 42 +++++++++++++++++++++---------------------
kml.php | 25 +++++++++++++------------
mashups/openlayers.php | 25 +++++++++++++------------
ms_criamapa.php | 3 +--
ogc.htm | 38 +++++++++++++++-----------------------
ogc.php | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------
18 files changed, 351 insertions(+), 361 deletions(-)
diff --git a/admin/admin.db b/admin/admin.db
index 142bb37..cdc2db9 100644
Binary files a/admin/admin.db and b/admin/admin.db differ
diff --git a/admin/js/listatemas.js b/admin/js/listatemas.js
index cf9ba04..939ef09 100644
--- a/admin/js/listatemas.js
+++ b/admin/js/listatemas.js
@@ -35,7 +35,7 @@ function montaEditorTema(dados)
{ label: "Salva", value: "OK", checked: false},
{ label: "Cancela", value: "CANCEL", checked: false }
]);
- editorBotoes.on("checkedButtonChange", on_editorCheckBoxChange);
+ editorBotoes.on("checkedButtonChange", on_editorCheckBoxChange);
YAHOO.admin.container.panelEditorTema = new YAHOO.widget.Panel("janela_editor_tema", { fixedcenter:true,close:true,width:"400px", height:"400px",overflow:"auto", visible:false,constraintoviewport:true } );
YAHOO.admin.container.panelEditorTema.render();
var fecha = function()
@@ -90,19 +90,19 @@ function montaDivTemas(i)
ins += "WMS
";
- ins += "Permite acesso via WMS/WFS? ";
+ ins += "
Permite acesso via WMS/WFS? (nã restringe em temas do tipo gvSIG) ";
ins += "";
ins += core_combosimnao(i.ogc_tema);
ins += "
";
- ins += "Permite o download na aplicação datadownload.htm? (não afeta a permissão de download definida no item 'disponibilidade' existente em cada layer) ";
+ ins += "
Permite o download na aplicação datadownload.htm? (nã afeta temas do tipo gvSIG) (não afeta a permissão de download definida no item 'disponibilidade' existente em cada layer) ";
ins += "";
ins += core_combosimnao(i.download_tema);
ins += "
";
- ins += "Permite acesso via kml? ";
+ ins += "
Permite acesso via kml? (nã restringe em temas do tipo gvSIG) ";
ins += "";
ins += core_combosimnao(i.kml_tema);
ins += "
";
- ins += "Permite acesso via kmz (kml com dados vetoriais)? ";
+ ins += "
Permite acesso via kmz (kml com dados vetoriais)? (nã restringe em temas do tipo gvSIG) ";
ins += "";
ins += core_combosimnao(i.kmz_tema);
ins += "
";
@@ -133,7 +133,7 @@ function atualizaMiniatura(){
},
failure:core_handleFailure,
argument: { foo:"foo", bar:"bar" }
- };
+ };
core_makeRequest(sUrl,callback,"GET");
}
function gravaDadosTema(id)
@@ -141,7 +141,7 @@ function gravaDadosTema(id)
//validacao
if($i("kml_tema") && $i("ogc_tema")){
if(($i("ogc_tema").value).toLowerCase() == "sim")
- {$i("kml_tema").value = "SIM";}
+ {$i("kml_tema").value = "SIM";}
}
if($i("kml_tema") && $i("kmz_tema")){
if(($i("kmz_tema").value).toLowerCase() == "sim")
@@ -190,6 +190,6 @@ function gravaDadosTema(id)
},
failure:core_handleFailure,
argument: { foo:"foo", bar:"bar" }
- };
+ };
core_makeRequest(sUrl,callback,"POST");
}
\ No newline at end of file
diff --git a/admin/php/menutemas.php b/admin/php/menutemas.php
index 3cf3b0a..ebd356a 100644
--- a/admin/php/menutemas.php
+++ b/admin/php/menutemas.php
@@ -481,12 +481,11 @@ switch (strtoupper($funcao))
case "ALTERATEMAS":
//$r será igual ao novo id criado, no caso de inserção de um novo tema
$r = alteraTemas();
- if($id == "")
- {
+ if($id == ""){
retornaJSON($r);
}
- else
- {retornaJSON(pegaDados("select * from ".$esquemaadmin."i3geoadmin_temas where id_tema = $id"));
+ else{
+ retornaJSON(pegaDados("select * from ".$esquemaadmin."i3geoadmin_temas where id_tema = $id"));
}
exit;
break;
@@ -1125,26 +1124,27 @@ function alteraTemas()
$q = $dbh->query($sql,PDO::FETCH_ASSOC);
$resultado = $q->fetchAll();
$mapfile = $resultado[0]["codigo_tema"];
- $mapfile = $locaplic."/temas/".$mapfile.".map";
-
- if($mapa = @ms_newMapObj($mapfile))
- {
- $mapa = ms_newMapObj($mapfile);
- $numlayers = $mapa->numlayers;
- for ($i=0;$i < $numlayers;$i++)
+ if(file_exists($locaplic."/temas/".$mapfile.".map")){
+ $mapfile = $locaplic."/temas/".$mapfile.".map";
+ if($mapa = @ms_newMapObj($mapfile))
{
- $layer = $mapa->getlayer($i);
- $layer->setmetadata("permitedownload",strtolower($download));
- $layer->setmetadata("permiteogc",strtolower($ogc));
- $layer->setmetadata("permitekml",strtolower($kml));
- $layer->setmetadata("permitekmz",strtolower($kmz));
- if(count($nomes) == 1)
+ $mapa = ms_newMapObj($mapfile);
+ $numlayers = $mapa->numlayers;
+ for ($i=0;$i < $numlayers;$i++)
{
- $layer->setmetadata("tema",$nomeo);
+ $layer = $mapa->getlayer($i);
+ $layer->setmetadata("permitedownload",strtolower($download));
+ $layer->setmetadata("permiteogc",strtolower($ogc));
+ $layer->setmetadata("permitekml",strtolower($kml));
+ $layer->setmetadata("permitekmz",strtolower($kmz));
+ if(count($nomes) == 1)
+ {
+ $layer->setmetadata("tema",$nomeo);
+ }
}
+ $mapa->save($mapfile);
+ removeCabecalho($mapfile);
}
- $mapa->save($mapfile);
- removeCabecalho($mapfile);
}
}
else
diff --git a/classesjs/i3geo47.js b/classesjs/i3geo47.js
index f58b9fd..0ed59d3 100644
--- a/classesjs/i3geo47.js
+++ b/classesjs/i3geo47.js
@@ -58,7 +58,7 @@ $i = function(id)
for (i = 0; i < scripts.length; i++) {
var src = scripts[i].getAttribute('src');
if (src) {
- var index = src.lastIndexOf("i3geo.js");
+ var index = src.lastIndexOf("i3geo47.js");
// is it found, at the end of the URL?
if ((index > -1) && (index + "i3geo47.js".length == src.length)) {
scriptLocation = src.slice(0, -"i3geo47.js".length);
diff --git a/geraminiatura.php b/geraminiatura.php
index 774ecf8..329a6b2 100644
--- a/geraminiatura.php
+++ b/geraminiatura.php
@@ -142,12 +142,17 @@ function verificaMiniatura($map,$tipo,$admin=false)
$tema = "";
$map = str_replace("\\","/",$map);
$map = basename($map);
- if (file_exists($locaplic.'/temas/'.$map))
- {$tema = $locaplic.'/temas/'.$map;}
- if (file_exists($locaplic.'/temas/'.$map.'.map'))
- {$tema = $locaplic.'/temas/'.$map.".map";}
- if ($tema != "")
- {
+ $extensao = ".map";
+ if (file_exists($locaplic.'/temas/'.$map)){
+ $tema = $locaplic.'/temas/'.$map;
+ }
+ else{
+ if (file_exists($locaplic.'/temas/'.$map.'.gvp')){
+ $extensao = ".gvp";
+ }
+ $tema = $locaplic.'/temas/'.$map.$extensao;
+ }
+ if ($tema != ""){
if(isset($base) && $base != ""){
if(file_exists($base))
{$f = $base;}
@@ -158,13 +163,12 @@ function verificaMiniatura($map,$tipo,$admin=false)
exit;
}
}
- else
- {
+ else{
$f = "";
- if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN'))
- {$f = $locaplic."/aplicmap/geral1windowsv".$versao.".map";}
- else
- {
+ if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){
+ $f = $locaplic."/aplicmap/geral1windowsv".$versao.".map";
+ }
+ else{
if($f == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv'.$versao.'.map')){
$f = "/var/www/i3geo/aplicmap/geral1debianv".$versao.".map";
}
@@ -174,53 +178,62 @@ function verificaMiniatura($map,$tipo,$admin=false)
if($f == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){
$f = "/opt/www/html/i3geo/aplicmap/geral1v".$versao.".map";
}
- if($f == "")
- {$f = $locaplic."/aplicmap/geral1v".$versao.".map";}
+ if($f == ""){
+ $f = $locaplic."/aplicmap/geral1v".$versao.".map";
+ }
}
}
$mapa = ms_newMapObj($f);
- if(@ms_newMapObj($tema))
- {$nmapa = ms_newMapObj($tema);}
- else
- {
- echo "erro no arquivo $tema ";
- return;
- }
- $dados = "";
- $numlayers = $nmapa->numlayers;
- for ($i=0;$i < $numlayers;$i++)
- {
- $layern = $nmapa->getlayer($i);
- $layern->set("status",MS_DEFAULT);
- ms_newLayerObj($mapa, $layern);
- autoClasses($layern,$mapa,$locaplic);
- if ($layern->data == "")
- {$dados = $layern->connection;}
- else
- {$dados = $layern->data;}
- $pegarext = $teman;
- }
- if (isset($postgis_mapa))
- {
- if ($postgis_mapa != "")
- {
- $numlayers = $mapa->numlayers;
- for ($i=0;$i < $numlayers;++$i)
- {
- $layer = $mapa->getlayer($i);
- if ($layer->connectiontype == MS_POSTGIS)
- {
- if ($layer->connection == " ")
- {
- $layer->set("connection",$postgis_mapa);
+ if($extensao == ".map"){
+ if(@ms_newMapObj($tema)){
+ $nmapa = ms_newMapObj($tema);
+ }
+ else{
+ echo "erro no arquivo $tema ";
+ return;
+ }
+ $dados = "";
+ $numlayers = $nmapa->numlayers;
+ for ($i=0;$i < $numlayers;$i++){
+ $layern = $nmapa->getlayer($i);
+ $layern->set("status",MS_DEFAULT);
+ ms_newLayerObj($mapa, $layern);
+ autoClasses($layern,$mapa,$locaplic);
+ if ($layern->data == ""){
+ $dados = $layern->connection;
+ }
+ else{
+ $dados = $layern->data;
+ }
+ $pegarext = $teman->name;
+ }
+ if (isset($postgis_mapa)){
+ if ($postgis_mapa != ""){
+ $numlayers = $mapa->numlayers;
+ for ($i=0;$i < $numlayers;++$i){
+ $layer = $mapa->getlayer($i);
+ if ($layer->connectiontype == MS_POSTGIS){
+ if ($layer->connection == " "){
+ $layer->set("connection",$postgis_mapa);
+ }
}
}
}
}
+ zoomTemaMiniatura($pegarext,$mapa);
}
- zoomTemaMiniatura($pegarext,$mapa);
- if ($tipo == "mini" || $tipo == "todos")
- {
+ if($extensao == ".gvp"){
+ include_once($locaplic."/pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php");
+ $gm = new gvsig2mapfile($tema);
+ $gvsigview = $gm->getViewsNames();
+ $gvsigview = $gvsigview[0];
+ $dataView = $gm->getViewData($gvsigview);
+ $next = $dataView["extent"];
+ $ext = $mapa->extent;
+ $ext->setextent($next[0],$next[1],$next[2],$next[3]);
+ $mapa = $gm->addLayers($mapa,$gvsigview,$dataView["layerNames"]);
+ }
+ if ($tipo == "mini" || $tipo == "todos"){
$mapa->setsize(50,50);
$sca = $mapa->scalebar;
$sca->set("status",MS_OFF);
@@ -230,8 +243,7 @@ function verificaMiniatura($map,$tipo,$admin=false)
$weboM = $mapa->web;
$urlM = $weboM->imageurl."/".$map;
}
- if ($tipo == "grande" || $tipo == "todos")
- {
+ if ($tipo == "grande" || $tipo == "todos"){
$mapa->setsize(300,300);
$sca = $mapa->scalebar;
$sca->set("status",MS_OFF);
@@ -241,23 +253,21 @@ function verificaMiniatura($map,$tipo,$admin=false)
$weboG = $mapa->web;
$urlG = $weboG->imageurl."/".$map;
}
- if($tipo=="mini" || $tipo == "todos")
- {
- if($objImagemM->imagepath == "")
- {echo "Erro IMAGEPATH vazio";return;}
+ if($tipo=="mini" || $tipo == "todos"){
+ if($objImagemM->imagepath == ""){
+ echo "Erro IMAGEPATH vazio";return;
+ }
$nomecM = ($objImagemM->imagepath).$map.".mini.png";
$objImagemM->saveImage($nomecM);
}
- if($tipo=="grande" || $tipo == "todos")
- {
- if($objImagemG->imagepath == "")
- {echo "Erro IMAGEPATH vazio";return;}
+ if($tipo=="grande" || $tipo == "todos"){
+ if($objImagemG->imagepath == ""){
+ echo "Erro IMAGEPATH vazio";return;
+ }
$nomecG = ($objImagemG->imagepath).$map.".grande.png";
$objImagemG->saveImage($nomecG);
}
-
- if($admin == false)
- {
+ if($admin == false){
if($tipo=="mini" || $tipo == "todos")
{echo " ";}
if($tipo=="grande" || $tipo == "todos")
@@ -266,8 +276,7 @@ function verificaMiniatura($map,$tipo,$admin=false)
//
//copia a imagem
//
- if($admin == true)
- {
+ if($admin == true){
$dir = $locaplic."/temas/miniaturas";
$mini = $dir."/".$map.".map.mini.png";
$grande = $dir."/".$map.".map.grande.png";
diff --git a/interface/googlemaps.phtml b/interface/googlemaps.phtml
index 9cce7e7..adea3d7 100644
--- a/interface/googlemaps.phtml
+++ b/interface/googlemaps.phtml
@@ -106,7 +106,7 @@ include_once("../ms_configura.php");
-
+
+
@@ -33,7 +33,7 @@ arquivos não compactados, bastando substituir por i3geonaocompacto -->
-
+
@@ -59,15 +59,15 @@ arquivos não compactados, bastando substituir por i3geonaocompacto -->
-