Commit d118176655a93a13b1d2fd25768de24764c8f48f

Authored by Edmar Moretti
1 parent 4c3b171d

--no commit message

classesjs/classe_interface.js
... ... @@ -1379,15 +1379,16 @@ i3GEO.Interface = {
1379 1379 var bounds,sw,ne;
1380 1380 g_operacao = "";
1381 1381 g_tipoacao = "";
1382   - //bounds = i3GeoMap.getBounds();
1383 1382 sw = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(0,i3GEO.parametros.h));
1384 1383 ne = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(i3GEO.parametros.w,0));
1385   - //if(bounds){
1386   - //sw = bounds.getSouthWest();
1387   - //ne = bounds.getNorthEast();
1388   - i3GEO.parametros.mapexten = sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat();
1389   - i3GEO.parametros.mapscale = i3GEO.Interface.googlemaps.calcescala();
1390   - //}
  1384 + i3GEO.parametros.mapexten = sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat();
  1385 + i3GEO.parametros.mapscale = i3GEO.Interface.googlemaps.calcescala();
  1386 + sw = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(0,1));
  1387 + ne = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(1,0));
  1388 +
  1389 + i3GEO.parametros.pixelsize = sw.lng() - ne.lng();
  1390 + if(i3GEO.parametros.pixelsize < 0)
  1391 + {i3GEO.parametros.pixelsize = i3GEO.parametros.pixelsize * -1;}
1391 1392 }
1392 1393 catch(e){
1393 1394 i3GEO.parametros.mapexten = "0 0 0 0";
... ...
classesjs/classe_php.js
... ... @@ -503,37 +503,46 @@ i3GEO.php = {
503 503 /*
504 504 Function: mudaext
505 505  
  506 + O parâmetro "atualiza" é do tipo booleano e indica se o redesenho do mapa será feito ou não.
  507 +
  508 + O parâmetro "geo" é do tipo booleano e indica se as coordenadas deverão ser convertidas para geográficas ao serem salvas no mapfile
  509 +
506 510 <MUDAEXT>
507 511 */
508   - mudaext: function(funcao,tipoimagem,ext,locaplic,sid){
  512 + mudaext: function(funcao,tipoimagem,ext,locaplic,sid,atualiza,geo){
509 513 var retorno,p;
510 514 if(arguments.length === 3){
511 515 i3GEO.php.verifica();
512 516 locaplic = i3GEO.configura.locaplic;
513 517 sid = i3GEO.configura.sid;
  518 + atualiza = true;
  519 + geo = false;
514 520 }
  521 + if(geo === 'undefined')
  522 + {geo = false;}
  523 + if(atualiza === 'undefined')
  524 + {atualiza = true;}
515 525 if(ext === 'undefined')
516 526 {alert("extensao nao definida");return;}
517 527 retorno = function(retorno){
518 528 if(i3GEO.Interface.ATUAL === "googlemaps"){
519   - i3GEO.Interface.googlemaps.zoom2extent(ext);
520   - i3GEO.janela.fechaAguarde();
  529 + if(atualiza === true)
  530 + {i3GEO.Interface.googlemaps.zoom2extent(ext);}
521 531 }
522 532 if(i3GEO.Interface.ATUAL === "googleearth"){
523 533 i3GEO.Interface.googleearth.redesenha();
524   - i3GEO.janela.fechaAguarde();
525 534 }
526 535 if(i3GEO.Interface.ATUAL === "openlayers"){
527   - i3GEO.Interface.openlayers.zoom2ext(ext);
528   - i3GEO.janela.fechaAguarde();
  536 + i3GEO.Interface.openlayers.zoom2ext(ext);
529 537 }
  538 + i3GEO.janela.fechaAguarde();
530 539 //
531 540 //o try é necessario para não dar erro
532 541 //
533 542 try{funcao.call(retorno);}
534 543 catch(e){}
535 544 };
536   - p = locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+sid;
  545 + p = locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&tipoimagem="+tipoimagem+"&ext="+ext+"&g_sid="+sid+"&geo="+geo;
537 546 cpJSON.call(p,"mudaext",retorno);
538 547 },
539 548 /*
... ...
classesjs/datadownload.js
... ... @@ -304,6 +304,7 @@ function datadownload_download(tema)
304 304 YAHOO.datadownloadLista.panel.show();
305 305 //document.getElementById("corpo").innerHTML = "Aguarde. Gerando arquivos..."
306 306 var p = g_locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=download3&tema="+tema;
  307 + temaEscolhidoDownload = tema;
307 308 var cp = new cpaint();
308 309 //cp.set_debug(2)
309 310 cp.set_response_type("JSON");
... ... @@ -330,8 +331,10 @@ function mostraDownload(retorno)
330 331 {
331 332 ins += "<a href='"+window.location.protocol+"//"+window.location.host+"/"+arqs[arq]+"'>"+arqs[arq]+"</a><br>"
332 333 }
  334 + ins += "<br><a href='"+g_locaplic+"/fontetema.php?tema="+temaEscolhidoDownload+"' target=blank >Fonte</a>";
333 335 if(retorno.nreg)
334 336 {ins += "<br><br>N&uacute;mero de registros ="+retorno.nreg;}
  337 +
335 338 }
336 339 }
337 340 else
... ...
classesphp/classe_analise.php
... ... @@ -42,7 +42,7 @@ class Analise
42 42  
43 43 Objeto mapa
44 44 */
45   - protected $mapa;
  45 + public $mapa;
46 46 /*
47 47 Variavel: $arquivo
48 48  
... ... @@ -966,13 +966,13 @@ $locaplic - Localização do I3geo.
966 966 if ($layerPt->getNumresults() > 0){$existesel = "sim";}
967 967 if ($existesel == "nao")
968 968 {
  969 + if($layerPt->getProjection() == "" )
  970 + {
  971 + if($layerPt->getProjection() == "" )
  972 + {$layerPt->setProjection("init=epsg:4291");}
  973 + $layerPt->setProjection("init=epsg:4291");
  974 + }
969 975 $layerPt->queryByrect($this->mapa->extent);
970   - //$qstring = "/.*/";
971   - //if($layerPt->connectiontype == MS_POSTGIS)
972   - //{$layerPt->queryByrect($this->mapa->extent);}
973   - //$qstring = $itemspt[0].' ~* \'^.\' ';
974   - //else
975   - //{$layerPt->queryByAttributes($itemspt[0], $qstring, 1);}
976 976 }
977 977 $res_count = $layerPt->getNumresults();
978 978 $pontos = array();
... ... @@ -1130,6 +1130,8 @@ function distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorig
1130 1130 $layerorigem->close();
1131 1131 $layeroverlay->set("tolerance",0);
1132 1132 $layerdestino->set("tolerance",0);
  1133 + if($layeroverlay->getProjection() == "" )
  1134 + {$layeroverlay->setProjection("init=epsg:4291");}
1133 1135 $layeroverlay->queryByrect($this->mapa->extent);
1134 1136 $layerdestino->queryByFeatures($layeroverlay->index);
1135 1137 $sopen = $layerdestino->open();
... ... @@ -1861,22 +1863,36 @@ $locaplic - Localização do I3geo
1861 1863 {$db = xbase_create($nomeshp.".dbf", $def);xbase_close($db);}
1862 1864 else
1863 1865 {$db = dbase_create($nomeshp.".dbf", $def);dbase_close($db);}
  1866 +
  1867 + if($layerPo->getProjection() == "" )
  1868 + {$layerPo->setProjection("init=epsg:4291");}
  1869 + if($layerPt->getProjection() == "" )
  1870 + {$layerPt->setProjection("init=epsg:4291");}
  1871 +
1864 1872 //acrescenta os pontos no novo shapefile
1865 1873 $dbname = $nomeshp.".dbf";
1866 1874 $db=xbase_open($dbname,2);
1867 1875 $sopen = $layerPo->open();
1868 1876 if($sopen == MS_FAILURE){return "erro";}
1869   - $layerPo->whichShapes($this->mapa->extent);
1870   - while ($shape = $layerPo->nextShape())
  1877 +
  1878 + $layerPo->querybyrect($this->mapa->extent);
  1879 + $sopen = $layerPo->open();
  1880 + $res_count = $layerPo->getNumresults();
  1881 + for ($i = 0; $i < $res_count; ++$i)
1871 1882 {
  1883 + $result = $layerPo->getResult($i);
  1884 + $shp_index = $result->shapeindex;
  1885 + $shape = $layerPo->getfeature($shp_index,-1);
1872 1886 $novoreg = array();
1873 1887 foreach($itenspo as $ipo)
1874 1888 {$novoreg[] = $shape->values[$ipo];}
1875 1889 $layerPt->querybyshape($shape);
  1890 + //echo $layerPt->getNumresults();
1876 1891 $novoreg[] = $layerPt->getNumresults();
1877 1892 $novoshpf->addShape($shape);
1878 1893 xbase_add_record($db,$novoreg);
1879 1894 }
  1895 + $fechou = $layerPo->close();
1880 1896 $novoshpf->free();
1881 1897 xbase_close($db);
1882 1898 //adiciona o novo tema no mapa
... ... @@ -2424,7 +2440,11 @@ function gravaCoordenadasPt($tema,$limitepontos=&quot;TRUE&quot;,$extendelimite)
2424 2440 {$this->mapa->loadquery($this->qyfile);}
2425 2441 if ($layerPt->getNumresults() > 0){$existesel = "sim";}
2426 2442 if ($existesel == "nao")
2427   - {$layerPt->queryByrect($this->mapa->extent);}
  2443 + {
  2444 + if($layerPt->getProjection() == "" )
  2445 + {$layerPt->setProjection("init=epsg:4291");}
  2446 + $layerPt->queryByrect($this->mapa->extent);
  2447 + }
2428 2448 $res_count = $layerPt->getNumresults();
2429 2449 $pontos = array();
2430 2450 //pega um shape especifico
... ...
classesphp/classe_atributos.php
... ... @@ -93,6 +93,8 @@ $ext - (opcional) extensão geográfica que será aplicada ao mapa
93 93 $this->arquivo = $map_file;
94 94 if($tema != "" && @$this->mapa->getlayerbyname($tema))
95 95 $this->layer = $this->mapa->getlayerbyname($tema);
  96 + if($this->layer->getProjection() == "" )
  97 + {$this->layer->setProjection("init=epsg:4291");}
96 98 $this->nome = $tema;
97 99 if($ext && $ext != ""){
98 100 $e = explode(" ",$ext);
... ...
classesphp/classe_selecao.php
... ... @@ -43,7 +43,7 @@ class Selecao
43 43  
44 44 Objeto mapa
45 45 */
46   - protected $mapa;
  46 + public $mapa;
47 47 /*
48 48 Variavel: $arquivo
49 49  
... ...
classesphp/classe_temas.php
... ... @@ -43,7 +43,7 @@ class Temas
43 43  
44 44 Objeto mapa
45 45 */
46   - protected $mapa;
  46 + public $mapa;
47 47 /*
48 48 Variavel: $arquivo
49 49  
... ...
classesphp/graficos.php
... ... @@ -373,8 +373,14 @@ function iniciaParGrafico($gw,$gh,$res,$dir_tmp,$gfile_name,$margem,$margemexter
373 373 }
374 374 function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,$percentual,$ext="")
375 375 {
  376 + global $interface;
376 377 //pega os valores
377 378 $map = ms_newMapObj($map_file);
  379 + if($interface == "googlemaps")
  380 + {
  381 + $projMapa = $map->getProjection();
  382 + $map->setProjection("init=epsg:4291");
  383 + }
378 384 if($ext && $ext != ""){
379 385 $e = explode(" ",$ext);
380 386 $extatual = $map->extent;
... ...
classesphp/mapa_controle.php
... ... @@ -388,9 +388,16 @@ Salva o mapa acrescentando um novo layer com o resultado.
388 388 */
389 389 case "PONTOEMPOLIGONO":
390 390 include_once("classe_analise.php");
391   - copiaSeguranca($map_file);
  391 + copiaSeguranca($map_file);
392 392 $m = new Analise($map_file,$tema,$locaplic,$ext);
  393 + if($interface == "googlemaps")
  394 + {
  395 + $projMapa = $m->mapa->getProjection();
  396 + $m->mapa->setProjection("init=epsg:4291");
  397 + }
393 398 $retorno = $m->pontoEmPoligono($temaPt,$temasPo,$locaplic);
  399 + if($interface == "googlemaps")
  400 + {$m->mapa->setProjection($projMapa);}
394 401 $m->salva();
395 402 break;
396 403 /*
... ... @@ -406,7 +413,14 @@ Salva o mapa acrescentando um novo layer com o resultado.
406 413 include_once("classe_analise.php");
407 414 copiaSeguranca($map_file);
408 415 $m = new Analise($map_file,$tema,$locaplic,$ext);
  416 + if($interface == "googlemaps")
  417 + {
  418 + $projMapa = $m->mapa->getProjection();
  419 + $m->mapa->setProjection("init=epsg:4291");
  420 + }
409 421 $retorno = $m->nptPol($temaPt,$temaPo,$locaplic);
  422 + if($interface == "googlemaps")
  423 + {$m->mapa->setProjection($projMapa);}
410 424 $m->salva();
411 425 break;
412 426 /*
... ... @@ -442,8 +456,15 @@ São considerados apenas os pontos próximos definidos por um buffer.
442 456 include_once("classe_analise.php");
443 457 copiaSeguranca($map_file);
444 458 $m = new Analise($map_file,$temaorigem,$locaplic,$ext);
  459 + if($interface == "googlemaps")
  460 + {
  461 + $projMapa = $m->mapa->getProjection();
  462 + $m->mapa->setProjection("init=epsg:4291");
  463 + }
445 464 $temaoverlay = $m->criaBuffer($distancia,$locaplic);
446 465 $retorno = $m->distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorigem,$itemdestino);
  466 + if($interface == "googlemaps")
  467 + {$m->mapa->setProjection($projMapa);}
447 468 $m->salva();
448 469 break;
449 470 /*
... ... @@ -458,8 +479,15 @@ Salva o mapa acrescentando um novo layer com os pontos.
458 479 case "CRIACENTROIDE":
459 480 include_once("classe_analise.php");
460 481 copiaSeguranca($map_file);
461   - $m = new Analise($map_file,$tema);
  482 + $m = new Analise($map_file,$tema,$locaplic);
  483 + if($interface == "googlemaps")
  484 + {
  485 + $projMapa = $m->mapa->getProjection();
  486 + $m->mapa->setProjection("init=epsg:4291");
  487 + }
462 488 $retorno = $m->criaCentroide($locaplic);
  489 + if($interface == "googlemaps")
  490 + {$m->mapa->setProjection($projMapa);}
463 491 $m->salva();
464 492 break;
465 493 /*
... ... @@ -477,9 +505,16 @@ Executa script R para gerar a imagem.
477 505 if(!isset($tema2))
478 506 {$tema2 = "";}
479 507 if(!isset($limitepontos))
480   - {$limitepontos = "";}
  508 + {$limitepontos = "";}
481 509 $m = new Analise($map_file,$tema,$locaplic,$ext);
  510 + if($interface == "googlemaps")
  511 + {
  512 + $projMapa = $m->mapa->getProjection();
  513 + $m->mapa->setProjection("init=epsg:4291");
  514 + }
482 515 $retorno = $m->analiseDistriPt($locaplic,$dir_tmp,$R_path,$numclasses,$tipo,$cori,$corf,$tmpurl,$sigma,$limitepontos,$tema2,$extendelimite);
  516 + if($interface == "googlemaps")
  517 + {$m->mapa->setProjection($projMapa);}
483 518 $m->salva();
484 519 break;
485 520 /*
... ... @@ -559,7 +594,6 @@ Reinicia um mapa restaurando a cópia de segurança.
559 594 $qyfile = str_replace(".map",".qy",$map_file);
560 595 if (file_exists($qyfile))
561 596 {unlink ($qyfile);}
562   -
563 597 unlink($map_file);
564 598 copy(str_replace(".map","reinc.map",$map_file),$map_file);
565 599 $retorno = "ok";
... ... @@ -573,13 +607,10 @@ Recupera o mapfile de segurança.
573 607 $qyfile = str_replace(".map",".qy",$map_file);
574 608 if (file_exists($qyfile))
575 609 {unlink ($qyfile);}
576   -
577 610 unlink($map_file);
578 611 $nmf = str_replace(".map","seguranca.map",$map_file);
579 612 if(file_exists($nmf))
580   - {
581   - copy($nmf,$map_file);
582   - }
  613 + {copy($nmf,$map_file);}
583 614 else
584 615 {
585 616 $nmf = str_replace(".map","reinc.map",$map_file);
... ... @@ -948,7 +979,7 @@ Gera a imagem do mapa de referência.
948 979 $objMapa = ms_newMapObj($map_file);
949 980 $nomeImagem = nomeRandomico();
950 981 if(!isset($ext))
951   - {$ext = "";}
  982 + {$ext = "";}
952 983 $retorno = retornaReferencia($ext);
953 984 break;
954 985 /*
... ... @@ -960,7 +991,7 @@ Gera a imagem do mapa de referência de forma dinâmica, variando com a escala do
960 991 //$objMapa = ms_newMapObj($map_file);
961 992 $nomeImagem = nomeRandomico();
962 993 if(!isset($ext))
963   - {$ext = "";}
  994 + {$ext = "";}
964 995 $retorno = retornaReferenciaDinamica($ext);
965 996 break;
966 997 /*
... ... @@ -1051,9 +1082,7 @@ Gera uma imagem que será utilizada para destacar um determinado tema.
1051 1082 <Temas->geraDestaque>
1052 1083 */
1053 1084 case "GERADESTAQUE":
1054   - include_once("classe_temas.php");
1055   - if(isset($ext) && $ext != "" && $interface == "googlemaps")
1056   - {$ext = projetaExt($map_file,$ext);}
  1085 + include_once("classe_temas.php");
1057 1086 $m = new Temas($map_file,$tema,"",$ext);
1058 1087 $retorno = $m->geraDestaque();
1059 1088 break;
... ... @@ -1283,8 +1312,15 @@ Gera graficos automaticamente para os elementos de um tema
1283 1312 case "GRAFICOTEMA":
1284 1313 include_once("classe_temas.php");
1285 1314 copiaSeguranca($map_file);
1286   - $m = new Temas($map_file,$tema);
  1315 + $m = new Temas($map_file,$tema,$locaplic);
  1316 + if($interface == "googlemaps")
  1317 + {
  1318 + $projMapa = $m->mapa->getProjection();
  1319 + $m->mapa->setProjection("init=epsg:4291");
  1320 + }
1287 1321 $m->graficotema($lista,$tamanho,$tipo,$outlinecolor,$offset);
  1322 + if($interface == "googlemaps")
  1323 + {$m->mapa->setProjection($projMapa);}
1288 1324 $m->salva();
1289 1325 redesenhaMapa();
1290 1326 break;
... ... @@ -1303,8 +1339,6 @@ Altera uma classe de um tema, aplicando uma nova classificação ou modificando pa
1303 1339 case "ALTERACLASSE":
1304 1340 include_once("classe_alteraclasse.php");
1305 1341 copiaSeguranca($map_file);
1306   - if(isset($ext) && $ext != "" && $interface == "googlemaps")
1307   - {$ext = projetaExt($map_file,$ext);}
1308 1342 $m = new Alteraclasse($map_file,$tema,"",$ext);
1309 1343 if ($opcao == "adicionaclasse")
1310 1344 {$retorno = $m->adicionaclasse();}
... ... @@ -1519,8 +1553,6 @@ Pega os dados necessários para a geração dos gráficos da ferramenta seleção
1519 1553 */
1520 1554 case "GRAFICOSELECAO":
1521 1555 include_once("graficos.php");
1522   - if(isset($ext) && $ext != "" && $interface == "googlemaps")
1523   - {$ext = projetaExt($map_file,$ext);}
1524 1556 if(!isset($exclui))
1525 1557 {$exclui = "";}
1526 1558 if(!isset($tipo))
... ... @@ -1628,8 +1660,6 @@ Pega os dados de um tema para geração do gráfico de linha do tempo.
1628 1660 */
1629 1661 case "DADOSLINHADOTEMPO":
1630 1662 include_once("graficos.php");
1631   - if(isset($ext) && $ext != "" && $interface == "googlemaps")
1632   - {$ext = projetaExt($map_file,$ext);}
1633 1663 if(!isset($ext))
1634 1664 {$ext = "";}
1635 1665 $retorno = dadosLinhaDoTempo($map_file,$tema,$ext);
... ... @@ -1937,8 +1967,6 @@ Procura valores em uma tabela que aderem a uma palavra de busca.
1937 1967 case "LISTAVALORESITENS":
1938 1968 include_once("classe_atributos.php");
1939 1969 if(!isset($tema)){$tema = "";}
1940   - if(isset($ext) && $ext != "" && $interface == "googlemaps")
1941   - {$ext = projetaExt($map_file,$ext);}
1942 1970 $m = new Atributos($map_file,$tema,"",$ext);
1943 1971 $retorno = $m->buscaRegistros($palavra,$lista,$tipo,$onde);
1944 1972 break;
... ... @@ -2026,9 +2054,9 @@ Pega todos os valores dos itens de uma tabela de um tema.
2026 2054 <Atributos->listaRegistros>
2027 2055 */
2028 2056 case "LISTAREGISTROS":
2029   - if(isset($ext) && $ext != "" && $interface == "googlemaps")
2030   - {$ext = projetaExt($map_file,$ext);}
2031 2057 include_once("classe_atributos.php");
  2058 + if(isset($ext) && $ext != "" && $interface == "googlemaps" && $geo == false)
  2059 + {$ext = projetaExt($map_file,$ext);}
2032 2060 $m = new Atributos($map_file,$tema,"",$ext);
2033 2061 if(!isset($tipo)){$tipo = "";}
2034 2062 if(!isset($inicio)){$inicio = 0;}
... ... @@ -2086,9 +2114,12 @@ Muda a extensão geográfica do mapa.
2086 2114 case "MUDAEXT":
2087 2115 include_once("classe_navegacao.php");
2088 2116 copiaSeguranca($map_file);
2089   - if (!isset($ext) || $ext == "" || $ext == " "){$ext="-76.512593 -39.392568 -29.585185 9.490149";}
  2117 + if (!isset($ext) || $ext == "" || $ext == " ")
  2118 + {$ext="-76.512593 -39.392568 -29.585185 9.490149";}
  2119 + if(!isset($geo))
  2120 + {$geo = false;}
2090 2121 $m = new Navegacao($map_file);
2091   - if(isset($ext) && $ext != "" && $interface == "googlemaps")
  2122 + if(isset($ext) && $ext != "" && $interface == "googlemaps" && $geo == false)
2092 2123 {$ext = projetaExt($map_file,$ext);}
2093 2124 $m->mudaExtensao($ext);
2094 2125 $m->salva();
... ... @@ -2436,9 +2467,13 @@ Seleciona elementos utilizando um ponto.
2436 2467 foreach($temas as $tema)
2437 2468 {
2438 2469 $m = new Selecao($map_file,$tema,$ext);
  2470 + if($interface == "googlemaps")
  2471 + {
  2472 + $projMapa = $m->mapa->getProjection();
  2473 + $m->mapa->setProjection("init=epsg:4291");
  2474 + }
2439 2475 $ok[] = $m->selecaoPT($xy,$tipo,$tolerancia);
2440 2476 }
2441   - //$retorno = implode(",",$ok);
2442 2477 redesenhaMapa();
2443 2478 break;
2444 2479 /*
... ... @@ -2454,7 +2489,12 @@ Seleciona elementos utilizando a extensão do mapa.
2454 2489 $temas = explode(",",$tema);
2455 2490 foreach($temas as $tema)
2456 2491 {
2457   - $m = new Selecao($map_file,$tema);
  2492 + $m = new Selecao($map_file,$tema,$ext);
  2493 + if($interface == "googlemaps")
  2494 + {
  2495 + $projMapa = $m->mapa->getProjection();
  2496 + $m->mapa->setProjection("init=epsg:4291");
  2497 + }
2458 2498 $ok[] = $m->selecaoEXT($tipo);
2459 2499 }
2460 2500 //$retorno = implode(",",$ok);
... ... @@ -2474,10 +2514,14 @@ Seleciona elementos utilizando um retângulo.
2474 2514 foreach($temas as $tema)
2475 2515 {
2476 2516 $m = new Selecao($map_file,$tema);
2477   - if(isset($ext) && $ext != "" && $interface == "googlemaps")
2478   - {$ext = projetaExt($map_file,$ext);}
  2517 + if($interface == "googlemaps")
  2518 + {
  2519 + $projMapa = $m->mapa->getProjection();
  2520 + $m->mapa->setProjection("init=epsg:4291");
  2521 + }
2479 2522 $ok[] = $m->selecaoBOX($tipo,$ext);
2480 2523 }
  2524 +
2481 2525 redesenhaMapa();
2482 2526 break;
2483 2527  
... ... @@ -2491,7 +2535,7 @@ Seleciona elementos com base nos atributos.
2491 2535 case "SELECAOATRIB":
2492 2536 include_once("classe_selecao.php");
2493 2537 copiaSeguranca($map_file);
2494   - $m = new Selecao($map_file,$tema);
  2538 + $m = new Selecao($map_file,$tema,$ext);
2495 2539 $retorno = $m->selecaoAtributos($tipo,$item,$operador,$valor);
2496 2540 redesenhaMapa();
2497 2541 break;
... ... @@ -2505,7 +2549,7 @@ Seleciona elementos com base nos atributos utilizando sintaxe complexa.
2505 2549 case "SELECAOATRIB2":
2506 2550 include_once("classe_selecao.php");
2507 2551 copiaSeguranca($map_file);
2508   - $m = new Selecao($map_file,$tema);
  2552 + $m = new Selecao($map_file,$tema,$ext);
2509 2553 $retorno = $m->selecaoAtributos2($filtro,$tipo);
2510 2554 redesenhaMapa();
2511 2555 break;
... ... @@ -2523,6 +2567,11 @@ Sleciona elementos de um tema com base em outro tema.
2523 2567 foreach($temas as $tema)
2524 2568 {
2525 2569 $m = new Selecao($map_file,$tema);
  2570 + if($interface == "googlemaps")
  2571 + {
  2572 + $projMapa = $m->mapa->getProjection();
  2573 + $m->mapa->setProjection("init=epsg:4291");
  2574 + }
2526 2575 $ok[] = $m->selecaoTema($temao,$tipo);
2527 2576 }
2528 2577 $retorno = implode(",",$ok);
... ... @@ -2745,7 +2794,6 @@ Return:
2745 2794 function projetaExt($map_file,$ext,$separador=" ")
2746 2795 {
2747 2796 $ext = str_replace($separador," ",$ext);
2748   -
2749 2797 $extA = explode(" ",$ext);
2750 2798 $mapa = ms_newMapObj($map_file);
2751 2799 $ponto = false;
... ... @@ -2802,7 +2850,14 @@ function selecaoPoli($xs,$ys,$tema,$tipo)
2802 2850 foreach($temas as $tema)
2803 2851 {
2804 2852 $m = new Selecao($map_file,$tema);
  2853 + if($interface == "googlemaps")
  2854 + {
  2855 + $projMapa = $m->mapa->getProjection();
  2856 + $m->mapa->setProjection("init=epsg:4291");
  2857 + }
2805 2858 $ok[] = $m->selecaoPorPoligono($tipo,$xs,$ys);
  2859 + if($interface == "googlemaps")
  2860 + {$m->mapa->setProjection($projMapa);}
2806 2861 $m->salva();
2807 2862 }
2808 2863 return implode(",",$ok);
... ...
ferramentas/convertemapakml/index.js.php
... ... @@ -81,7 +81,7 @@ i3GEOF.converteMapaKml = {
81 81 titulo = "Kml <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=2&idajuda=13' >&nbsp;&nbsp;&nbsp;</a>";
82 82 janela = i3GEO.janela.cria(
83 83 "440px",
84   - "305px",
  84 + "315px",
85 85 "",
86 86 "",
87 87 "",
... ...
ferramentas/convertews/index.js.php
... ... @@ -91,7 +91,7 @@ i3GEOF.converteMapaWS = {
91 91 titulo = "WMS <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=2&idajuda=12' >&nbsp;&nbsp;&nbsp;</a>";
92 92 janela = i3GEO.janela.cria(
93 93 "440px",
94   - "280px",
  94 + "290px",
95 95 "",
96 96 "",
97 97 "",
... ...
ferramentas/gradepol/index.js.php
... ... @@ -147,6 +147,7 @@ i3GEOF.gradeDePoligonos = {
147 147 ins += "Segundo<input onclick='javascript:this.select();' class=digitar id='i3GEOgradedepoligonosiys' title='segundo' type=text size=5 value='00.00'/>";
148 148 g_tipoacao = "capturaponto";
149 149 i3GEO.util.proximoAnterior("i3GEOF.gradeDePoligonos.t1()","i3GEOF.gradeDePoligonos.t3()",ins,"i3GEOF.gradeDePoligonos.t2","i3GEOgradedepoligonosresultado");
  150 +
150 151 if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEOF.gradeDePoligonos.capturaPonto()") < 0)
151 152 {i3GEO.eventos.MOUSECLIQUE.push("i3GEOF.gradeDePoligonos.capturaPonto()");}
152 153 temp = function(){
... ...
ferramentas/nptpol/index.js.php
... ... @@ -158,8 +158,13 @@ i3GEOF.nptpol = {
158 158 else
159 159 {i3GEO.atualiza();}
160 160 i3GEOF.nptpol.aguarde.visibility = "hidden";
161   - };
162   - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=nptPol&temaPt="+$i("i3GEOnptpolPontos").value+"&temaPo="+$i("i3GEOnptpolPoligonos").value+"&ext="+i3GEO.parametros.mapexten;
  161 + },
  162 + ext;
  163 + if(i3GEO.Interface.ATUAL === "googlemaps")
  164 + {ext = i3GEO.Interface.googlemaps.bbox();}
  165 + else
  166 + {ext = i3GEO.parametros.mapexten;}
  167 + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=nptPol&temaPt="+$i("i3GEOnptpolPontos").value+"&temaPo="+$i("i3GEOnptpolPoligonos").value+"&ext="+ext;
163 168 cp = new cpaint();
164 169 cp.set_response_type("JSON");
165 170 cp.call(p,"nptpol",fim);
... ...
ferramentas/salvamapa/index.js.php
... ... @@ -58,12 +58,18 @@ i3GEOF.salvaMapa = {
58 58 try{
59 59 var map_file = i3GEO.parametros.mapfile,
60 60 local = map_file.split("ms_tmp");
61   - local = window.location.protocol+"//"+window.location.host+"/ms_tmp"+local[1];
  61 + local = i3GEO.util.protocolo()+"://"+window.location.host+"/ms_tmp"+local[1];
62 62 $i(iddiv).innerHTML += i3GEOF.salvaMapa.html()+"<a href='"+local+"' target='_blank' >Clique aqui para baixar o arquivo</a>";
63 63 }
64 64 catch(erro){alert(erro);}
65   - };
66   - i3GEO.php.mudaext(temp,"nenhum",i3GEO.parametros.mapexten);
  65 + },
  66 + atualiza = true,
  67 + geo = false;
  68 + if(i3GEO.Interface.ATUAL === "googlemaps"){
  69 + atualiza = false;
  70 + geo = true;
  71 + }
  72 + i3GEO.php.mudaext(temp,"nenhum",i3GEO.parametros.mapexten,i3GEO.configura.locaplic,i3GEO.configura.sid,atualiza,geo);
67 73 },
68 74 /*
69 75 Function: html
... ...
ferramentas/selecao/index.js.php
... ... @@ -241,6 +241,8 @@ i3GEOF.selecao = {
241 241 var i = $i("i3GEOF.selecao_c").style;
242 242 i3GEO.janela.ULTIMOZINDEX++;
243 243 i.zIndex = 10000 + i3GEO.janela.ULTIMOZINDEX;
  244 + if(i3GEO.Interface.ATUAL == "googlemaps")
  245 + {i3GEO.Interface.googlemaps.recalcPar();}
244 246 },
245 247 /*
246 248 Function: mudaicone
... ...
menutemas/admin.db
No preview for this file type