Commit 0071618824edf101fadc202d54911cafaf9de905

Authored by Edmar Moretti
1 parent 7b3087fa

--no commit message

Showing 2 changed files with 40 additions and 3 deletions   Show diff stats
temas/_llocali.map
1 MAP 1 MAP
2 FONTSET "../symbols/fontes.txt" 2 FONTSET "../symbols/fontes.txt"
3 #SYMBOLSET "../symbols/vazio.sym" 3 #SYMBOLSET "../symbols/vazio.sym"
4 - SYMBOLSET "../symbols/simbolos.sym" 4 + SYMBOLSET "../symbols/simbolosv6.sym"
  5 +SYMBOL
  6 + NAME "teste"
  7 + TYPE pixmap
  8 + IMAGE "/var/www/i3geo/imagens/google/foto.png"
  9 +END
5 LAYER 10 LAYER
6 CONNECTION "" 11 CONNECTION ""
7 DATA "/var/www/i3geo/aplicmap/dados/locali.shp" 12 DATA "/var/www/i3geo/aplicmap/dados/locali.shp"
@@ -65,7 +70,7 @@ MAP @@ -65,7 +70,7 @@ MAP
65 COLOR 62 9 41 70 COLOR 62 9 41
66 OFFSET 0 0 71 OFFSET 0 0
67 SIZE 6 72 SIZE 6
68 - SYMBOL "ponto" 73 + SYMBOL "teste"
69 END # STYLE 74 END # STYLE
70 END # CLASS 75 END # CLASS
71 CLASS 76 CLASS
testamapfile.php
@@ -258,6 +258,7 @@ function verifica($map,$solegenda){ @@ -258,6 +258,7 @@ function verifica($map,$solegenda){
258 } 258 }
259 $numlayers = $nmapa->numlayers; 259 $numlayers = $nmapa->numlayers;
260 $dados = ""; 260 $dados = "";
  261 + $simbolos = array();
261 for ($i=0;$i < $numlayers;$i++){ 262 for ($i=0;$i < $numlayers;$i++){
262 $layern = $nmapa->getlayer($i); 263 $layern = $nmapa->getlayer($i);
263 $layern->set("status",MS_DEFAULT); 264 $layern->set("status",MS_DEFAULT);
@@ -292,6 +293,36 @@ function verifica($map,$solegenda){ @@ -292,6 +293,36 @@ function verifica($map,$solegenda){
292 $layern->set("type",$tipotemp); 293 $layern->set("type",$tipotemp);
293 } 294 }
294 ms_newLayerObj($mapa, $layern); 295 ms_newLayerObj($mapa, $layern);
  296 +
  297 +
  298 + //pega simbolos locais e aplica no novo mapa
  299 + $numclasses = $layern->numclasses;
  300 + for($ci=0;$ci < $numclasses;$ci++){
  301 + $classe = $layern->getclass($ci);
  302 + $numestilos = $classe->numstyles;
  303 + for($ei=0;$ei < $numestilos;$ei++){
  304 + $estilo = $classe->getstyle($ei);
  305 + if($estilo->symbolname != ""){
  306 + $nomesimbolo = $estilo->symbolname;
  307 +
  308 + $simbolo = new symbolObj($nmapa, $nomesimbolo);
  309 + $ipath = $simbolo->imagepath;
  310 + if(ms_newSymbolObj($nmapa, $nomesimbolo) != ms_newSymbolObj($mapa, $nomesimbolo)+1){
  311 + $simbolon = new symbolObj($mapa, $nomesimbolo);
  312 + $simbolon->setImagePath($ipath);
  313 + $simbolon->set("inmapfile",MS_TRUE);
  314 + }
  315 + //algumas versoes do mapserver nao funciona
  316 + if($simbolon->imagePath != $ipath){
  317 + $layern->set("status",MS_DELETE);
  318 + }
  319 + }
  320 + }
  321 + }
  322 +
  323 +
  324 +
  325 +
295 if ($layern->data == ""){ 326 if ($layern->data == ""){
296 $dados = $layern->connection; 327 $dados = $layern->connection;
297 } 328 }
@@ -322,7 +353,7 @@ function verifica($map,$solegenda){ @@ -322,7 +353,7 @@ function verifica($map,$solegenda){
322 353
323 } 354 }
324 if ($tipo == "mini"){ 355 if ($tipo == "mini"){
325 - $mapa->setsize(50,50); 356 + $mapa->setsize(50,50);
326 $sca = $mapa->scalebar; 357 $sca = $mapa->scalebar;
327 $sca->set("status",MS_OFF); 358 $sca->set("status",MS_OFF);
328 } 359 }
@@ -338,6 +369,7 @@ function verifica($map,$solegenda){ @@ -338,6 +369,7 @@ function verifica($map,$solegenda){
338 } 369 }
339 $destino = $dir_tmp."/".nomeRandomico().".map"; 370 $destino = $dir_tmp."/".nomeRandomico().".map";
340 $mapa->save($destino); 371 $mapa->save($destino);
  372 + //echo $destino;exit;
341 $mapa = ms_newMapObj($destino); 373 $mapa = ms_newMapObj($destino);
342 $objImagem = @$mapa->draw(); 374 $objImagem = @$mapa->draw();
343 $objImagemLegenda = @$mapa->drawLegend(); 375 $objImagemLegenda = @$mapa->drawLegend();