Commit b0644b4837879000eb7021118365be2db0cdf739
1 parent
f89f2699
Exists in
master
and in
7 other branches
--no commit message
Showing
9 changed files
with
102 additions
and
29 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesjs/classe_arvoredecamadas.js
@@ -1422,6 +1422,11 @@ i3GEO.arvoreDeCamadas = { | @@ -1422,6 +1422,11 @@ i3GEO.arvoreDeCamadas = { | ||
1422 | while(i < nelementos); | 1422 | while(i < nelementos); |
1423 | } | 1423 | } |
1424 | }, | 1424 | }, |
1425 | + /* | ||
1426 | + Function: verificaAbrangenciaTemas | ||
1427 | + | ||
1428 | + Verifica se um tema está ou não na abrangência espacial do mapa atual modificando a cor com que o nome é mostrado na árvore | ||
1429 | + */ | ||
1425 | verificaAbrangenciaTemas: function(){ | 1430 | verificaAbrangenciaTemas: function(){ |
1426 | if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.verificaAbrangenciaTemas()");} | 1431 | if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.verificaAbrangenciaTemas()");} |
1427 | if(i3GEO.arvoreDeCamadas.VERIFICAABRANGENCIATEMAS == false) | 1432 | if(i3GEO.arvoreDeCamadas.VERIFICAABRANGENCIATEMAS == false) |
@@ -1454,5 +1459,35 @@ i3GEO.arvoreDeCamadas = { | @@ -1454,5 +1459,35 @@ i3GEO.arvoreDeCamadas = { | ||
1454 | } | 1459 | } |
1455 | } | 1460 | } |
1456 | catch(e){} | 1461 | catch(e){} |
1457 | - } | 1462 | + }, |
1463 | + /* | ||
1464 | + Function: verificaAplicaExtensao | ||
1465 | + | ||
1466 | + Verifica se algum tema está marcado com o metadado Aplicaextensao. Retorna a primeira ocorrência se houver | ||
1467 | + | ||
1468 | + Return: | ||
1469 | + | ||
1470 | + {string} código do tema ou "" | ||
1471 | + */ | ||
1472 | + verificaAplicaExtensao: function(){ | ||
1473 | + if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.verificaAplicaExtensao()");} | ||
1474 | + try{ | ||
1475 | + var i = 0, | ||
1476 | + temp = "", | ||
1477 | + nelementos = i3GEO.arvoreDeCamadas.CAMADAS.length, | ||
1478 | + ltema; | ||
1479 | + if (nelementos > 0){ | ||
1480 | + do{ | ||
1481 | + ltema = i3GEO.arvoreDeCamadas.CAMADAS[i]; | ||
1482 | + if(ltema.aplicaextensao == "sim"){ | ||
1483 | + temp = ltema.name; | ||
1484 | + } | ||
1485 | + i++; | ||
1486 | + } | ||
1487 | + while(i < nelementos); | ||
1488 | + } | ||
1489 | + } | ||
1490 | + catch(e){return "";} | ||
1491 | + return temp; | ||
1492 | + } | ||
1458 | }; | 1493 | }; |
classesjs/classe_i3geo.js
@@ -484,6 +484,12 @@ i3GEO = { | @@ -484,6 +484,12 @@ i3GEO = { | ||
484 | i3GEO.navega.entorno.ajustaPosicao(); | 484 | i3GEO.navega.entorno.ajustaPosicao(); |
485 | } | 485 | } |
486 | i3GEO.ajuda.mostraJanela("Tempo de redesenho em segundos: "+retorno.data.variaveis.tempo,""); | 486 | i3GEO.ajuda.mostraJanela("Tempo de redesenho em segundos: "+retorno.data.variaveis.tempo,""); |
487 | + // | ||
488 | + //verifica se deve ser feito o zoom em algum tema | ||
489 | + // | ||
490 | + var temp = i3GEO.arvoreDeCamadas.verificaAplicaExtensao(); | ||
491 | + if(temp != "") | ||
492 | + {i3GEO.tema.zoom(temp)} | ||
487 | } | 493 | } |
488 | }, | 494 | }, |
489 | /* | 495 | /* |
classesphp/classe_atributos.php
@@ -1145,7 +1145,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | @@ -1145,7 +1145,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | ||
1145 | $mapa = desligamargem($mapa); | 1145 | $mapa = desligamargem($mapa); |
1146 | $imgo = $mapa->draw(); | 1146 | $imgo = $mapa->draw(); |
1147 | 1147 | ||
1148 | - $formatoinfo = "MIME"; | 1148 | + //$formatoinfo = "MIME"; |
1149 | $formatosinfo = $layer->getmetadata("formatosinfo"); | 1149 | $formatosinfo = $layer->getmetadata("formatosinfo"); |
1150 | if ($formatosinfo != "") | 1150 | if ($formatosinfo != "") |
1151 | { | 1151 | { |
@@ -1157,6 +1157,14 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | @@ -1157,6 +1157,14 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | ||
1157 | {$formatoinfo = "text/plain";} | 1157 | {$formatoinfo = "text/plain";} |
1158 | } | 1158 | } |
1159 | } | 1159 | } |
1160 | + else | ||
1161 | + { | ||
1162 | + $formatoinfo = $layer->getmetadata("wms_feature_info_type"); | ||
1163 | + if($formatoinfo == "") | ||
1164 | + {$formatoinfo = $layer->getmetadata("wms_feature_info_mime_type");} | ||
1165 | + if($formatoinfo == "") | ||
1166 | + {$formatoinfo = "text/plain";} | ||
1167 | + } | ||
1160 | /* | 1168 | /* |
1161 | $srs = $layer->getmetadata("wms_srs"); | 1169 | $srs = $layer->getmetadata("wms_srs"); |
1162 | $srss = explode(" ",$srs); | 1170 | $srss = explode(" ",$srs); |
@@ -1193,32 +1201,39 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | @@ -1193,32 +1201,39 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | ||
1193 | } | 1201 | } |
1194 | */ | 1202 | */ |
1195 | $n = array(); | 1203 | $n = array(); |
1196 | - foreach($resposta as $r) | 1204 | + if(strtoupper($formatoinfo) == "TEXT/HTML") |
1197 | { | 1205 | { |
1198 | - $t = explode("=",$r); | ||
1199 | - $v = str_replace("\\n","",$t[1]); | ||
1200 | - $v = str_replace("\\r","",$v); | ||
1201 | - if(trim($v) != "") | ||
1202 | - { | ||
1203 | - $va = trim($v); | ||
1204 | - $va = $this->converte($va); | ||
1205 | - $n[] = array("alias"=>trim($t[0]),"valor"=>$va,"link"=>"","img"=>""); | ||
1206 | - } | 1206 | + $n[] = array("alias"=>"","valor"=>"<iframe width=270px src='".$res."'></iframe>","link"=>"","img"=>""); |
1207 | } | 1207 | } |
1208 | - //caso esri | ||
1209 | - if($n[0] == "") | 1208 | + else |
1210 | { | 1209 | { |
1211 | - //error_reporting(E_ALL); | ||
1212 | - $resposta = file($res); | ||
1213 | - $cabecalho = str_replace('" "','"|"',$resposta[0]); | ||
1214 | - $cabecalho = explode("|",$cabecalho); | ||
1215 | - | ||
1216 | - $linha = str_replace('" "','"|"',$resposta[1]); | ||
1217 | - $linha = explode("|",$linha); | ||
1218 | - for($i=0;$i < count($cabecalho);++$i) | 1210 | + foreach($resposta as $r) |
1219 | { | 1211 | { |
1220 | - $va = $this->converte($linha[$i]); | ||
1221 | - $n[] = array("alias"=>$cabecalho[$i],"valor"=>$va,"link"=>"","img"=>""); | 1212 | + $t = explode("=",$r); |
1213 | + $v = str_replace("\\n","",$t[1]); | ||
1214 | + $v = str_replace("\\r","",$v); | ||
1215 | + if(trim($v) != "") | ||
1216 | + { | ||
1217 | + $va = trim($v); | ||
1218 | + $va = $this->converte($va); | ||
1219 | + $n[] = array("alias"=>trim($t[0]),"valor"=>$va,"link"=>"","img"=>""); | ||
1220 | + } | ||
1221 | + } | ||
1222 | + //caso esri | ||
1223 | + if($n[0] == "") | ||
1224 | + { | ||
1225 | + //error_reporting(E_ALL); | ||
1226 | + $resposta = file($res); | ||
1227 | + $cabecalho = str_replace('" "','"|"',$resposta[0]); | ||
1228 | + $cabecalho = explode("|",$cabecalho); | ||
1229 | + | ||
1230 | + $linha = str_replace('" "','"|"',$resposta[1]); | ||
1231 | + $linha = explode("|",$linha); | ||
1232 | + for($i=0;$i < count($cabecalho);++$i) | ||
1233 | + { | ||
1234 | + $va = $this->converte($linha[$i]); | ||
1235 | + $n[] = array("alias"=>$cabecalho[$i],"valor"=>$va,"link"=>"","img"=>""); | ||
1236 | + } | ||
1222 | } | 1237 | } |
1223 | } | 1238 | } |
1224 | $n[] = array("alias"=>"Link WMS","valor"=>"getfeatureinfo ".$formatoinfo,"link"=>$res,"img"=>""); | 1239 | $n[] = array("alias"=>"Link WMS","valor"=>"getfeatureinfo ".$formatoinfo,"link"=>$res,"img"=>""); |
classesphp/classe_mapa.php
@@ -231,6 +231,9 @@ string - javascript com os parametros | @@ -231,6 +231,9 @@ string - javascript com os parametros | ||
231 | $permitecomentario = "nao"; | 231 | $permitecomentario = "nao"; |
232 | if($oLayer->getmetadata("nomeoriginal") != "" && strtoupper($oLayer->getmetadata("pemitecomentario")) != "NAO") | 232 | if($oLayer->getmetadata("nomeoriginal") != "" && strtoupper($oLayer->getmetadata("pemitecomentario")) != "NAO") |
233 | {$permitecomentario = "sim";} | 233 | {$permitecomentario = "sim";} |
234 | + $aplicaextensao = "nao"; | ||
235 | + if(strtoupper($oLayer->getmetadata("aplicaextensao")) == "SIM") | ||
236 | + {$aplicaextensao = "sim";} | ||
234 | $temas[] = array( | 237 | $temas[] = array( |
235 | "name"=>($oLayer->name), | 238 | "name"=>($oLayer->name), |
236 | "status"=>($oLayer->status), | 239 | "status"=>($oLayer->status), |
@@ -252,7 +255,8 @@ string - javascript com os parametros | @@ -252,7 +255,8 @@ string - javascript com os parametros | ||
252 | "iconetema"=>($oLayer->getmetadata("iconetema")), | 255 | "iconetema"=>($oLayer->getmetadata("iconetema")), |
253 | "classe"=>($oLayer->getmetadata("classe")), | 256 | "classe"=>($oLayer->getmetadata("classe")), |
254 | "permitecomentario"=>$permitecomentario, | 257 | "permitecomentario"=>$permitecomentario, |
255 | - "exttema"=>$exttema | 258 | + "exttema"=>$exttema, |
259 | + "aplicaextensao"=>$aplicaextensao | ||
256 | ); | 260 | ); |
257 | } | 261 | } |
258 | } | 262 | } |
@@ -924,8 +928,8 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | @@ -924,8 +928,8 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | ||
924 | // | 928 | // |
925 | //verifica se deve ser feito o zoom para o tema | 929 | //verifica se deve ser feito o zoom para o tema |
926 | // | 930 | // |
927 | - if(strtolower($l->getmetadata("aplicaextensao")) == "sim") | ||
928 | - {$zoomlayer = $nlayer->name;} | 931 | + //if(strtolower($l->getmetadata("aplicaextensao")) == "sim") |
932 | + //{$zoomlayer = $nlayer->name;} | ||
929 | //reposiciona o layer se for o caso | 933 | //reposiciona o layer se for o caso |
930 | if ($l->group == "") | 934 | if ($l->group == "") |
931 | { | 935 | { |
@@ -955,7 +959,8 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | @@ -955,7 +959,8 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | ||
955 | } | 959 | } |
956 | // | 960 | // |
957 | //faz o zoom para o tema se for o caso | 961 | //faz o zoom para o tema se for o caso |
958 | - // | 962 | + //essa função foi desabilitada |
963 | + /* | ||
959 | if($zoomlayer != "") | 964 | if($zoomlayer != "") |
960 | { | 965 | { |
961 | $this->salva(); | 966 | $this->salva(); |
@@ -968,6 +973,7 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | @@ -968,6 +973,7 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | ||
968 | // | 973 | // |
969 | return(false); | 974 | return(false); |
970 | } | 975 | } |
976 | + */ | ||
971 | return(true); | 977 | return(true); |
972 | } | 978 | } |
973 | /* | 979 | /* |
classesphp/classe_temas.php
@@ -387,6 +387,10 @@ Calcula a extensão geográfica de um tema e ajusta o mapa para essa extensão. | @@ -387,6 +387,10 @@ Calcula a extensão geográfica de um tema e ajusta o mapa para essa extensão. | ||
387 | } | 387 | } |
388 | $extatual = $this->mapa->extent; | 388 | $extatual = $this->mapa->extent; |
389 | $ret = $this->layer->getmetadata("extensao"); | 389 | $ret = $this->layer->getmetadata("extensao"); |
390 | + // | ||
391 | + //necessário para evitar que em qualquer redesenho do mapa, seja aplicado o zoom para o tema marcado com aplicaextensao | ||
392 | + // | ||
393 | + $this->layer->setmetadata("aplicaextensao",""); | ||
390 | if($ret == "" && $this->layer->type == MS_LAYER_RASTER) | 394 | if($ret == "" && $this->layer->type == MS_LAYER_RASTER) |
391 | {$ret = "-75.233614607 -33.7515829981 -27.592958622 5.272156";} | 395 | {$ret = "-75.233614607 -33.7515829981 -27.592958622 5.272156";} |
392 | if ($ret == "") | 396 | if ($ret == "") |
@@ -405,6 +409,7 @@ Calcula a extensão geográfica de um tema e ajusta o mapa para essa extensão. | @@ -405,6 +409,7 @@ Calcula a extensão geográfica de um tema e ajusta o mapa para essa extensão. | ||
405 | { | 409 | { |
406 | $ret = explode(" ",$ret); | 410 | $ret = explode(" ",$ret); |
407 | $extatual->setextent($ret[0],$ret[1],$ret[2],$ret[3]); | 411 | $extatual->setextent($ret[0],$ret[1],$ret[2],$ret[3]); |
412 | + //echo "oi";exit; | ||
408 | } | 413 | } |
409 | return("ok"); | 414 | return("ok"); |
410 | } | 415 | } |
classesphp/mapa_controle.php
@@ -964,7 +964,7 @@ Adiciona um novo tema ao mapa. | @@ -964,7 +964,7 @@ Adiciona um novo tema ao mapa. | ||
964 | $m = new Mapa($map_file); | 964 | $m = new Mapa($map_file); |
965 | $salvar = $m->adicionaTema($temas,$locaplic); | 965 | $salvar = $m->adicionaTema($temas,$locaplic); |
966 | if($salvar) | 966 | if($salvar) |
967 | - $m->salva(); | 967 | + {$m->salva();} |
968 | $retorno = "ok"; | 968 | $retorno = "ok"; |
969 | if($interface != "openlayers"){ | 969 | if($interface != "openlayers"){ |
970 | $teste = testaMapa($map_file,$postgis_mapa); | 970 | $teste = testaMapa($map_file,$postgis_mapa); |
ms_criamapa.php
@@ -567,6 +567,10 @@ function incluiTemasIniciais() | @@ -567,6 +567,10 @@ function incluiTemasIniciais() | ||
567 | {$layern->set("data",$locaplic."/aplicmap/dados/estados.shp");} | 567 | {$layern->set("data",$locaplic."/aplicmap/dados/estados.shp");} |
568 | $layern->setmetadata("NOMEORIGINAL",$layern->name); | 568 | $layern->setmetadata("NOMEORIGINAL",$layern->name); |
569 | autoClasses(&$layern,$mapn); | 569 | autoClasses(&$layern,$mapn); |
570 | + // | ||
571 | + //necessário para não alterar a extensão do mapa por esse parâmetro | ||
572 | + // | ||
573 | + $layern->setmetadata("aplicaextensao",""); | ||
570 | ms_newLayerObj(&$mapn, $layern); | 574 | ms_newLayerObj(&$mapn, $layern); |
571 | } | 575 | } |
572 | } | 576 | } |
temas/biomashp.map
@@ -29,6 +29,8 @@ MAP | @@ -29,6 +29,8 @@ MAP | ||
29 | "identifica" "NAO" | 29 | "identifica" "NAO" |
30 | "editorsql" "" | 30 | "editorsql" "" |
31 | "ltempoitemfim" "" | 31 | "ltempoitemfim" "" |
32 | + "extensao" "-44 -23 -39 -21" | ||
33 | + "aplicaextensao" "SIM" | ||
32 | END | 34 | END |
33 | NAME "biomashp" | 35 | NAME "biomashp" |
34 | STATUS OFF | 36 | STATUS OFF |