Commit 2711d9d8d230464c98bb0bfd3c096bc69f6367c1
1 parent
8b66e407
Exists in
master
and in
7 other branches
Camadas do tipo WMS agora podem ter o SLD gerado automaticamente com base nas cl…
…asses definidas (desde que se use CLASSITEM). Dessa forma, a geração do SLD para definir a legenda poderá ser feito de forma mais simples
Showing
9 changed files
with
183 additions
and
16 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/js/editormapfile.js
@@ -126,6 +126,11 @@ objalignment = [ | @@ -126,6 +126,11 @@ objalignment = [ | ||
126 | {texto:"MS_ALIGN_CENTER",valor:"1"}, | 126 | {texto:"MS_ALIGN_CENTER",valor:"1"}, |
127 | {texto:"MS_ALIGN_RIGHT",valor:"2"} | 127 | {texto:"MS_ALIGN_RIGHT",valor:"2"} |
128 | ]; | 128 | ]; |
129 | +objtipooriginal = [ | ||
130 | + {texto:"poligonal",valor:"poligonal"}, | ||
131 | + {texto:"linear",valor:"linear"}, | ||
132 | + {texto:"pontual",valor:"pontual"} | ||
133 | +]; | ||
129 | 134 | ||
130 | YAHOO.namespace("example.container"); | 135 | YAHOO.namespace("example.container"); |
131 | /* | 136 | /* |
@@ -1206,6 +1211,8 @@ function montaEditorMetadados(dados) | @@ -1206,6 +1211,8 @@ function montaEditorMetadados(dados) | ||
1206 | }; | 1211 | }; |
1207 | var paramOWS = { | 1212 | var paramOWS = { |
1208 | "linhas":[ | 1213 | "linhas":[ |
1214 | + {ajuda:"Tipo de representação das feições mostradas da camada. É importante definir esse parâmetro para que as funções de geração de SLD funcionem corretamente.", | ||
1215 | + titulo:"Tipo de representação (tipooriginal)",id:"",value:dados.tipooriginal,tipo:"text",div:"<div id=cTipooriginal ></div>"}, | ||
1209 | {ajuda:"space-delimited list of EPSG projection codes supported by the remote server. You normally get this from the server’s capabilities output. This value should be upper case (EPSG:4236.....not epsg:4236) to avoid problems with case sensitive platforms. The value is used to set the SRS WMS URL parameter", | 1216 | {ajuda:"space-delimited list of EPSG projection codes supported by the remote server. You normally get this from the server’s capabilities output. This value should be upper case (EPSG:4236.....not epsg:4236) to avoid problems with case sensitive platforms. The value is used to set the SRS WMS URL parameter", |
1210 | titulo:"wms_srs",id:"wms_srs",value:dados.wms_srs,tipo:"text"}, | 1217 | titulo:"wms_srs",id:"wms_srs",value:dados.wms_srs,tipo:"text"}, |
1211 | {ajuda:"comma-separated list of layers to be fetched from the remote WMS server. This value is used to set the LAYERS and QUERY_LAYERS WMS URL parameters.", | 1218 | {ajuda:"comma-separated list of layers to be fetched from the remote WMS server. This value is used to set the LAYERS and QUERY_LAYERS WMS URL parameters.", |
@@ -1292,6 +1299,13 @@ function montaEditorMetadados(dados) | @@ -1292,6 +1299,13 @@ function montaEditorMetadados(dados) | ||
1292 | temp += "</select>" | 1299 | temp += "</select>" |
1293 | $i("cPermitecomentario").innerHTML = temp | 1300 | $i("cPermitecomentario").innerHTML = temp |
1294 | } | 1301 | } |
1302 | + if($i("cTipooriginal")){ | ||
1303 | + temp = "<select id='tipooriginal' >" | ||
1304 | + temp += core_comboObjeto(objtipooriginal,"valor","texto",dados.tipooriginal) | ||
1305 | + temp += "</select>" | ||
1306 | + $i("cTipooriginal").innerHTML = temp | ||
1307 | + } | ||
1308 | + | ||
1295 | if($i("cDownload")){ | 1309 | if($i("cDownload")){ |
1296 | temp = "<select id='download' >" | 1310 | temp = "<select id='download' >" |
1297 | temp += core_combosimnao(dados.download) | 1311 | temp += core_combosimnao(dados.download) |
admin/php/editormapfile.php
@@ -1356,6 +1356,7 @@ function pegaMetadados() | @@ -1356,6 +1356,7 @@ function pegaMetadados() | ||
1356 | $dados["wms_connectiontimeout"] = $layer->getmetadata("wms_connectiontimeout"); | 1356 | $dados["wms_connectiontimeout"] = $layer->getmetadata("wms_connectiontimeout"); |
1357 | $dados["wms_latlonboundingbox"] = $layer->getmetadata("wms_latlonboundingbox"); | 1357 | $dados["wms_latlonboundingbox"] = $layer->getmetadata("wms_latlonboundingbox"); |
1358 | $dados["wms_proxy_auth_type"] = $layer->getmetadata("wms_proxy_auth_type"); | 1358 | $dados["wms_proxy_auth_type"] = $layer->getmetadata("wms_proxy_auth_type"); |
1359 | + | ||
1359 | $dados["wms_proxy_host"] = $layer->getmetadata("wms_proxy_host"); | 1360 | $dados["wms_proxy_host"] = $layer->getmetadata("wms_proxy_host"); |
1360 | $dados["wms_proxy_port"] = $layer->getmetadata("wms_proxy_port"); | 1361 | $dados["wms_proxy_port"] = $layer->getmetadata("wms_proxy_port"); |
1361 | $dados["wms_proxy_type"] = $layer->getmetadata("wms_proxy_type"); | 1362 | $dados["wms_proxy_type"] = $layer->getmetadata("wms_proxy_type"); |
@@ -1367,12 +1368,13 @@ function pegaMetadados() | @@ -1367,12 +1368,13 @@ function pegaMetadados() | ||
1367 | $dados["wms_bgcolor"] = $layer->getmetadata("wms_bgcolor"); | 1368 | $dados["wms_bgcolor"] = $layer->getmetadata("wms_bgcolor"); |
1368 | $dados["wms_transparent"] = $layer->getmetadata("wms_transparent"); | 1369 | $dados["wms_transparent"] = $layer->getmetadata("wms_transparent"); |
1369 | $dados["wms_time"] = $layer->getmetadata("wms_time"); | 1370 | $dados["wms_time"] = $layer->getmetadata("wms_time"); |
1371 | + $dados["tipooriginal"] = $layer->getmetadata("tipooriginal"); | ||
1370 | } | 1372 | } |
1371 | return $dados; | 1373 | return $dados; |
1372 | } | 1374 | } |
1373 | function alterarMetadados() | 1375 | function alterarMetadados() |
1374 | { | 1376 | { |
1375 | - global $legendaimg,$wms_srs,$wms_name,$wms_server_version,$wms_format,$wms_auth_username,$wms_auth_password,$wms_auth_type,$wms_connectiontimeout,$wms_latlonboundingbox,$wms_proxy_auth_type,$wms_proxy_host,$wms_proxy_port,$wms_proxy_type,$wms_proxy_username,$wms_proxy_password,$wms_sld_body,$wms_sld_url,$wms_style,$wms_bgcolor,$wms_transparent,$wms_time,$permitecomentario,$itembuscarapida,$iconetema,$ltempoformatodata,$ltempoiteminicio,$ltempoitemfim,$ltempoitemtitulo,$ltempoitemdescricao,$ltempoitemtip,$ltempoitemimagem,$ltempoitemicone,$ltempoitemlink,$description_template,$palletestep,$palletefile,$arquivodownload,$temporizador,$arquivokmz,$codigoMap,$codigoLayer,$locaplic,$aplicaextensao,$classestamanho,$classessimbolo,$classescor,$classesnome,$classesitem,$mensagem,$identifica,$transitioneffect,$extensao,$escondido,$download,$escala,$tema,$classe,$tip,$itenslink,$itens,$itensdesc,$editorsql,$cache; | 1377 | + global $tipooriginal,$legendaimg,$wms_srs,$wms_name,$wms_server_version,$wms_format,$wms_auth_username,$wms_auth_password,$wms_auth_type,$wms_connectiontimeout,$wms_latlonboundingbox,$wms_proxy_auth_type,$wms_proxy_host,$wms_proxy_port,$wms_proxy_type,$wms_proxy_username,$wms_proxy_password,$wms_sld_body,$wms_sld_url,$wms_style,$wms_bgcolor,$wms_transparent,$wms_time,$permitecomentario,$itembuscarapida,$iconetema,$ltempoformatodata,$ltempoiteminicio,$ltempoitemfim,$ltempoitemtitulo,$ltempoitemdescricao,$ltempoitemtip,$ltempoitemimagem,$ltempoitemicone,$ltempoitemlink,$description_template,$palletestep,$palletefile,$arquivodownload,$temporizador,$arquivokmz,$codigoMap,$codigoLayer,$locaplic,$aplicaextensao,$classestamanho,$classessimbolo,$classescor,$classesnome,$classesitem,$mensagem,$identifica,$transitioneffect,$extensao,$escondido,$download,$escala,$tema,$classe,$tip,$itenslink,$itens,$itensdesc,$editorsql,$cache; |
1376 | $dados = array(); | 1378 | $dados = array(); |
1377 | $mapfile = $locaplic."/temas/".$codigoMap.".map"; | 1379 | $mapfile = $locaplic."/temas/".$codigoMap.".map"; |
1378 | $mapa = ms_newMapObj($mapfile); | 1380 | $mapa = ms_newMapObj($mapfile); |
@@ -1423,23 +1425,34 @@ function alterarMetadados() | @@ -1423,23 +1425,34 @@ function alterarMetadados() | ||
1423 | $layer->setmetadata("wms_name",$wms_name); | 1425 | $layer->setmetadata("wms_name",$wms_name); |
1424 | $layer->setmetadata("wms_server_version",$wms_server_version); | 1426 | $layer->setmetadata("wms_server_version",$wms_server_version); |
1425 | $layer->setmetadata("wms_format",$wms_format); | 1427 | $layer->setmetadata("wms_format",$wms_format); |
1426 | - $layer->setmetadata("wms_auth_username",$wms_auth_username); | ||
1427 | - $layer->setmetadata("wms_auth_password",$wms_auth_password); | ||
1428 | - $layer->setmetadata("wms_auth_type",$wms_auth_type); | 1428 | + if($wms_auth_username != ""){ |
1429 | + $layer->setmetadata("wms_auth_username",$wms_auth_username); | ||
1430 | + $layer->setmetadata("wms_auth_password",$wms_auth_password); | ||
1431 | + $layer->setmetadata("wms_auth_type",$wms_auth_type); | ||
1432 | + } | ||
1429 | $layer->setmetadata("wms_connectiontimeout",$wms_connectiontimeout); | 1433 | $layer->setmetadata("wms_connectiontimeout",$wms_connectiontimeout); |
1430 | - $layer->setmetadata("wms_latlonboundingbox",$wms_latlonboundingbox); | ||
1431 | - $layer->setmetadata("wms_proxy_auth_type",$wms_proxy_auth_type); | ||
1432 | - $layer->setmetadata("wms_proxy_host",$wms_proxy_host); | ||
1433 | - $layer->setmetadata("wms_proxy_port",$wms_proxy_port); | ||
1434 | - $layer->setmetadata("wms_proxy_type",$wms_proxy_type); | ||
1435 | - $layer->setmetadata("wms_proxy_username",$wms_proxy_username); | ||
1436 | - $layer->setmetadata("wms_proxy_password",$wms_proxy_password); | ||
1437 | - $layer->setmetadata("wms_sld_body",$wms_sld_body); | ||
1438 | - $layer->setmetadata("wms_sld_url",$wms_sld_url); | 1434 | + if($wms_latlonboundingbox != "") |
1435 | + {$layer->setmetadata("wms_latlonboundingbox",$wms_latlonboundingbox);} | ||
1436 | + if($wms_proxy_host != ""){ | ||
1437 | + $layer->setmetadata("wms_proxy_auth_type",$wms_proxy_auth_type); | ||
1438 | + $layer->setmetadata("wms_proxy_host",$wms_proxy_host); | ||
1439 | + $layer->setmetadata("wms_proxy_port",$wms_proxy_port); | ||
1440 | + $layer->setmetadata("wms_proxy_type",$wms_proxy_type); | ||
1441 | + $layer->setmetadata("wms_proxy_username",$wms_proxy_username); | ||
1442 | + $layer->setmetadata("wms_proxy_password",$wms_proxy_password); | ||
1443 | + } | ||
1444 | + if($wms_sld_body != "") | ||
1445 | + {$layer->setmetadata("wms_sld_body",$wms_sld_body);} | ||
1446 | + if($wms_sld_url != "") | ||
1447 | + {$layer->setmetadata("wms_sld_url",$wms_sld_url);} | ||
1439 | $layer->setmetadata("wms_style",$wms_style); | 1448 | $layer->setmetadata("wms_style",$wms_style); |
1449 | + if($wms_bgcolor != "") | ||
1440 | $layer->setmetadata("wms_bgcolor",$wms_bgcolor); | 1450 | $layer->setmetadata("wms_bgcolor",$wms_bgcolor); |
1451 | + if($wms_transparent != "") | ||
1441 | $layer->setmetadata("wms_transparent",$wms_transparent); | 1452 | $layer->setmetadata("wms_transparent",$wms_transparent); |
1453 | + if($wms_time != "") | ||
1442 | $layer->setmetadata("wms_time",$wms_time); | 1454 | $layer->setmetadata("wms_time",$wms_time); |
1455 | + $layer->setmetadata("tipooriginal",$tipooriginal); | ||
1443 | } | 1456 | } |
1444 | $mapa->save($mapfile); | 1457 | $mapa->save($mapfile); |
1445 | removeCabecalho($mapfile); | 1458 | removeCabecalho($mapfile); |
classesphp/classe_mapa.php
@@ -979,6 +979,26 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | @@ -979,6 +979,26 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | ||
979 | if($nomeunico[$lr]) | 979 | if($nomeunico[$lr]) |
980 | $nlayer->set("group",$nomeunico[$lr]); | 980 | $nlayer->set("group",$nomeunico[$lr]); |
981 | } | 981 | } |
982 | + // | ||
983 | + //verifica se é um WMS e se existem classes definidas | ||
984 | + //se existirem as classes, é criado um SLD para ser aplicado ao layer | ||
985 | + //O SLD só funciona se CLASSITEM estiver definido | ||
986 | + // | ||
987 | + | ||
988 | + if($nlayer->classitem != "" && $nlayer->connectiontype == 7 && $nlayer->numclasses > 0 && $nlayer->getmetadata("wms_sld_body") == ""){ | ||
989 | + $tipotemp = $nlayer->type; | ||
990 | + $tiporep = $nlayer->getmetadata("tipooriginal"); | ||
991 | + $nlayer->set("type",MS_LAYER_POLYGON); | ||
992 | + if ($tiporep == "linear") | ||
993 | + {$nlayer->set("type",MS_LAYER_LINE);} | ||
994 | + if ($tiporep == "pontual") | ||
995 | + {$nlayer->set("type",MS_LAYER_POINT);} | ||
996 | + $sld = $nlayer->generateSLD(); | ||
997 | + if($sld != "") | ||
998 | + $nlayer->setmetadata("wms_sld_body",str_replace('"',"'",$sld)); | ||
999 | + $nlayer->set("type",$tipotemp); | ||
1000 | + } | ||
1001 | + | ||
982 | ms_newLayerObj($this->mapa, $nlayer); | 1002 | ms_newLayerObj($this->mapa, $nlayer); |
983 | $l = $this->mapa->getlayerbyname($nlayer->name); | 1003 | $l = $this->mapa->getlayerbyname($nlayer->name); |
984 | // | 1004 | // |
@@ -1182,7 +1202,7 @@ $nomecamada - nome da camada do WMS | @@ -1182,7 +1202,7 @@ $nomecamada - nome da camada do WMS | ||
1182 | $dir_tmp - diretório temporário do I3Geo | 1202 | $dir_tmp - diretório temporário do I3Geo |
1183 | $imgdir - diretório temporário das imagens | 1203 | $imgdir - diretório temporário das imagens |
1184 | $imgurl - url do imgdir | 1204 | $imgurl - url do imgdir |
1185 | -$tiporep - tipo de representação das feições do mapa | 1205 | +$tiporep - tipo de representação das feições do mapa. Quando definido, é criado um sld para ser aplicado ao layer. poligonal|linear|pontual |
1186 | $suportasld - Suporta SLD sim|nao. | 1206 | $suportasld - Suporta SLD sim|nao. |
1187 | $formatosinfo - lista de formatos da requisição de atributos para a função getfeatureinfo (default text/plain) | 1207 | $formatosinfo - lista de formatos da requisição de atributos para a função getfeatureinfo (default text/plain) |
1188 | $time - específico para WMS-T (parâmentro wms_time) | 1208 | $time - específico para WMS-T (parâmentro wms_time) |
@@ -1269,7 +1289,7 @@ Include: | @@ -1269,7 +1289,7 @@ Include: | ||
1269 | $layer->setmetadata("wms_force_separate_request","1"); | 1289 | $layer->setmetadata("wms_force_separate_request","1"); |
1270 | if($time != "") | 1290 | if($time != "") |
1271 | $layer->setmetadata("wms_time",$time); | 1291 | $layer->setmetadata("wms_time",$time); |
1272 | - //pega o timpo de formato de imagem que deve ser requisitado | 1292 | + //pega o tipo de formato de imagem que deve ser requisitado |
1273 | //a preferência é png, mas se não for possível, pega o primeiro da lista de formatos | 1293 | //a preferência é png, mas se não for possível, pega o primeiro da lista de formatos |
1274 | //disponíveis no formato | 1294 | //disponíveis no formato |
1275 | if (stristr($formato,"png")) | 1295 | if (stristr($formato,"png")) |
classesphp/mapa_controle.php
@@ -1020,6 +1020,7 @@ Adiciona um novo tema ao mapa. | @@ -1020,6 +1020,7 @@ Adiciona um novo tema ao mapa. | ||
1020 | $_SESSION["contadorsalva"]++; | 1020 | $_SESSION["contadorsalva"]++; |
1021 | } | 1021 | } |
1022 | $retorno = "ok"; | 1022 | $retorno = "ok"; |
1023 | + /* | ||
1023 | if($interface != "openlayers"){ | 1024 | if($interface != "openlayers"){ |
1024 | $teste = testaMapa($map_file,$postgis_mapa); | 1025 | $teste = testaMapa($map_file,$postgis_mapa); |
1025 | if ($teste == "ok") | 1026 | if ($teste == "ok") |
@@ -1027,6 +1028,7 @@ Adiciona um novo tema ao mapa. | @@ -1027,6 +1028,7 @@ Adiciona um novo tema ao mapa. | ||
1027 | else | 1028 | else |
1028 | {$retorno = array("erro"=>"A camada nao pode ser adicionada. ".$teste);} | 1029 | {$retorno = array("erro"=>"A camada nao pode ser adicionada. ".$teste);} |
1029 | } | 1030 | } |
1031 | + */ | ||
1030 | break; | 1032 | break; |
1031 | /* | 1033 | /* |
1032 | Valor: EXCLUITEMA | 1034 | Valor: EXCLUITEMA |
ferramentas/legenda/index.js.php
@@ -303,7 +303,7 @@ i3GEOF.legenda = { | @@ -303,7 +303,7 @@ i3GEOF.legenda = { | ||
303 | '<div id=i3GEOlegendaguia4obj style="width:99%;text-align:left;">'+ | 303 | '<div id=i3GEOlegendaguia4obj style="width:99%;text-align:left;">'+ |
304 | '</div>'+ | 304 | '</div>'+ |
305 | '<div id=i3GEOlegendaguia5obj style="width:99%;text-align:left;">'+ | 305 | '<div id=i3GEOlegendaguia5obj style="width:99%;text-align:left;">'+ |
306 | - ' <p class=paragrafo >Gera um arquivo XML, no padrão SLD, contendo a legenda atual da camada. Para maiores informações, veja <a href="http://mapserver.org/ogc/sld.html#sld" target=_blank >Mapserver SLD</a>'+ | 306 | + ' <p class=paragrafo >Gera um arquivo XML, no padrão SLD, contendo a legenda atual da camada. Para maiores informações, veja <a href="http://mapserver.org/ogc/sld.html#sld" target=_blank >Mapserver SLD</a> (O SLD só é gerado ou aplicado corretamente em camadas que utilizam expressões simples e o elemento CLASSITEM)'+ |
307 | ' <p class=paragrafo ><input id=i3GEOlegendabotaoSLDe size="25" type="button" value="Exportar SLD"></p>'+ | 307 | ' <p class=paragrafo ><input id=i3GEOlegendabotaoSLDe size="25" type="button" value="Exportar SLD"></p>'+ |
308 | ' <p class=paragrafo >Aplica um arquivo SLD à camada ativa' + | 308 | ' <p class=paragrafo >Aplica um arquivo SLD à camada ativa' + |
309 | ' <p class=paragrafo ><input id=i3GEOlegendabotaoSLDi size="25" type="button" value="Aplicar SLD"></p>'+ | 309 | ' <p class=paragrafo ><input id=i3GEOlegendabotaoSLDi size="25" type="button" value="Aplicar SLD"></p>'+ |
ms_criamapa.php
@@ -415,6 +415,7 @@ if(isset($linhas)) | @@ -415,6 +415,7 @@ if(isset($linhas)) | ||
415 | 415 | ||
416 | if(isset($poligonos)) | 416 | if(isset($poligonos)) |
417 | {inserePoligonosUrl();} | 417 | {inserePoligonosUrl();} |
418 | + | ||
418 | if(isset($url_wms)) | 419 | if(isset($url_wms)) |
419 | {incluiTemaWms();} | 420 | {incluiTemaWms();} |
420 | 421 | ||
@@ -586,6 +587,7 @@ function incluiTemasIniciais() | @@ -586,6 +587,7 @@ function incluiTemasIniciais() | ||
586 | $maptemp = @ms_newMapObj($arqtemp); | 587 | $maptemp = @ms_newMapObj($arqtemp); |
587 | for($i=0;$i<($maptemp->numlayers);++$i) | 588 | for($i=0;$i<($maptemp->numlayers);++$i) |
588 | { | 589 | { |
590 | + //error_reporting(E_ALL); | ||
589 | $layern = $maptemp->getLayer($i); | 591 | $layern = $maptemp->getLayer($i); |
590 | if($layern->type == MS_LAYER_RASTER) | 592 | if($layern->type == MS_LAYER_RASTER) |
591 | {$existeraster = true;} | 593 | {$existeraster = true;} |
@@ -597,6 +599,23 @@ function incluiTemasIniciais() | @@ -597,6 +599,23 @@ function incluiTemasIniciais() | ||
597 | //necessário para não alterar a extensão do mapa por esse parâmetro | 599 | //necessário para não alterar a extensão do mapa por esse parâmetro |
598 | // | 600 | // |
599 | $layern->setmetadata("aplicaextensao",""); | 601 | $layern->setmetadata("aplicaextensao",""); |
602 | + //cria e aplica sld se for wms e existirem classes | ||
603 | + if($layern->classitem != "" && $layern->connectiontype == 7 && $layern->numclasses > 0 && $layern->getmetadata("wms_sld_body") == ""){ | ||
604 | + $tipotemp = $layern->type; | ||
605 | + $statustemp = $layern->status; | ||
606 | + $tiporep = $layern->getmetadata("tipooriginal"); | ||
607 | + $layern->set("type",MS_LAYER_POLYGON); | ||
608 | + if ($tiporep == "linear") | ||
609 | + {$layern->set("type",MS_LAYER_LINE);} | ||
610 | + if ($tiporep == "pontual") | ||
611 | + {$layern->set("type",MS_LAYER_POINT);} | ||
612 | + $layern->set("status",MS_DEFAULT); | ||
613 | + $sld = $layern->generateSLD(); | ||
614 | + if($sld != "") | ||
615 | + $layern->setmetadata("wms_sld_body",str_replace('"',"'",$sld)); | ||
616 | + $layern->set("type",$tipotemp); | ||
617 | + $layern->set("status",statustemp); | ||
618 | + } | ||
600 | ms_newLayerObj(&$mapn, $layern); | 619 | ms_newLayerObj(&$mapn, $layern); |
601 | } | 620 | } |
602 | } | 621 | } |
@@ -0,0 +1,85 @@ | @@ -0,0 +1,85 @@ | ||
1 | +MAP | ||
2 | + FONTSET "c:\ms4w\apache\htdocs\i3geo/symbols/fontes.txt" | ||
3 | + SYMBOLSET "c:\ms4w\apache\htdocs\i3geo/symbols/simbolos.sym" | ||
4 | + LAYER | ||
5 | + CLASSITEM "ID" | ||
6 | + CONNECTION "http://localhost/i3geo/ogc.php?tema=biomashp" | ||
7 | + CONNECTIONTYPE WMS | ||
8 | + METADATA | ||
9 | + "tipooriginal" "" | ||
10 | + "wms_srs" "EPSG:4291" | ||
11 | + "wms_exceptions_format" "application/vnd.ogc.se_xml" | ||
12 | + "cache" "" | ||
13 | + "ltempoitemimagem" "" | ||
14 | + "ltempoitemdescricao" "" | ||
15 | + "CLASSE" "SIM" | ||
16 | + "ltempoiteminicio" "" | ||
17 | + "palletestep" "" | ||
18 | + "wfs" "nao" | ||
19 | + "ltempoitemtip" "" | ||
20 | + "permitekmz" "nao" | ||
21 | + "temporizador" "" | ||
22 | + "ltempoitemtitulo" "" | ||
23 | + "description_template" "" | ||
24 | + "iconetema" "" | ||
25 | + "ltempoitemlink" "" | ||
26 | + "TEXTO" "NAO" | ||
27 | + "wms_force_separate_request" "1" | ||
28 | + "wms_transparent" "" | ||
29 | + "wms_name" "biomashp" | ||
30 | + "formatosinfo" "text/plain,application/vnd.ogc.gml" | ||
31 | + "legendawms" "http://localhost/i3geo/ogc.php?tema=biomashp&service=wms&request=getlegendgraphic&version=1.1.0&service=wms&layer=biomashp&format=image/png" | ||
32 | + "palletefile" "" | ||
33 | + "ltempoformatodata" "" | ||
34 | + "permitedownload" "nao" | ||
35 | + "ltempoitemicone" "" | ||
36 | + "permitecomentario" "" | ||
37 | + "wms_time" "" | ||
38 | + "wms_formatlist" "image/png,image/gif,image/png; mode=24bit,image/jpeg,image/vnd.wap.wbmp,image/tiff,image/svg xml" | ||
39 | + "wms_format" "image/png" | ||
40 | + "wms_sld_body" "" | ||
41 | + "itembuscarapida" "" | ||
42 | + "wms_connectiontimeout" "30" | ||
43 | + "arquivodownload" "" | ||
44 | + "arquivokmz" "" | ||
45 | + "permiteogc" "nao" | ||
46 | + "permitekml" "nao" | ||
47 | + "TEMA" "Biomas WMS SLD" | ||
48 | + "wms_server_version" "1.1.0" | ||
49 | + "editorsql" "" | ||
50 | + "ltempoitemfim" "" | ||
51 | + "legendaimg" "" | ||
52 | + "wms_crs" "EPSG:4291" | ||
53 | + "wms_style" "default" | ||
54 | + END | ||
55 | + NAME "biomashpwms" | ||
56 | + OFFSITE 255 255 255 | ||
57 | + STATUS OFF | ||
58 | + TEMPLATE "none.htm" | ||
59 | + OPACITY 50 | ||
60 | + TYPE RASTER | ||
61 | + UNITS METERS | ||
62 | + CLASS | ||
63 | + NAME "CAATINGA" | ||
64 | + EXPRESSION "2.00" | ||
65 | + STYLE | ||
66 | + ANGLE 360 | ||
67 | + COLOR 138 0 0 | ||
68 | + SYMBOL 0 | ||
69 | + WIDTH 1 | ||
70 | + END | ||
71 | + END | ||
72 | + CLASS | ||
73 | + NAME "AMAZONIA" | ||
74 | + EXPRESSION "1.00" | ||
75 | + STYLE | ||
76 | + ANGLE 360 | ||
77 | + COLOR 0 255 0 | ||
78 | + SYMBOL 0 | ||
79 | + WIDTH 1 | ||
80 | + END | ||
81 | + END | ||
82 | + END | ||
83 | + | ||
84 | +END | ||
85 | + |
testamapfile.php
@@ -196,6 +196,20 @@ function verifica($map,$solegenda) | @@ -196,6 +196,20 @@ function verifica($map,$solegenda) | ||
196 | } | 196 | } |
197 | 197 | ||
198 | autoClasses(&$layern,$nmapa); | 198 | autoClasses(&$layern,$nmapa); |
199 | + if($layern->classitem != "" && $layern->connectiontype == 7 && $layern->numclasses > 0 && $layern->getmetadata("wms_sld_body") == ""){ | ||
200 | + $tipotemp = $layern->type; | ||
201 | + $tiporep = $layern->getmetadata("tipooriginal"); | ||
202 | + $layern->set("type",MS_LAYER_POLYGON); | ||
203 | + if ($tiporep == "linear") | ||
204 | + {$layern->set("type",MS_LAYER_LINE);} | ||
205 | + if ($tiporep == "pontual") | ||
206 | + {$layern->set("type",MS_LAYER_POINT);} | ||
207 | + $sld = $layern->generateSLD(); | ||
208 | + if($sld != "") | ||
209 | + $layern->setmetadata("wms_sld_body",str_replace('"',"'",$sld)); | ||
210 | + $layern->set("type",$tipotemp); | ||
211 | + } | ||
212 | + | ||
199 | ms_newLayerObj($mapa, $layern); | 213 | ms_newLayerObj($mapa, $layern); |
200 | if ($layern->data == "") | 214 | if ($layern->data == "") |
201 | $dados = $layern->connection; | 215 | $dados = $layern->connection; |