Commit 85ccb84c30b39e621c2612d80a411c435e1ec6e5
1 parent
8b17f029
Exists in
master
and in
7 other branches
--no commit message
Showing
12 changed files
with
219 additions
and
82 deletions
Show diff stats
classesjs/classe_barradebotoes.js
@@ -992,6 +992,76 @@ i3GEO.barraDeBotoes = { | @@ -992,6 +992,76 @@ i3GEO.barraDeBotoes = { | ||
992 | try | 992 | try |
993 | {clearTimeout(timeAjudaBotoes);} | 993 | {clearTimeout(timeAjudaBotoes);} |
994 | catch(e){} | 994 | catch(e){} |
995 | + }, | ||
996 | + editor:{ | ||
997 | + inicia: function(){ | ||
998 | + //var idjanela = i3GEO.barraDeBotoes.editor.criaJanela(); | ||
999 | + i3GEO.barraDeBotoes.editor.carregaJs(); | ||
1000 | + }, | ||
1001 | + carregaJs: function(idjanela){ | ||
1002 | + i3GEO.util.scriptTag( | ||
1003 | + i3GEO.configura.locaplic+"/mashups/openlayers.js.php", | ||
1004 | + "i3GEO.barraDeBotoes.editor.ativaPainel('"+idjanela+"')", | ||
1005 | + "openlayers.js.php", | ||
1006 | + true | ||
1007 | + ); | ||
1008 | + }, | ||
1009 | + criaJanela: function(){ | ||
1010 | + if($i("i3GEOjanelaEditor")) | ||
1011 | + {return "i3GEOjanelaEditor";} | ||
1012 | + var janela,divid,temp,titulo,cabecalho,minimiza; | ||
1013 | + cabecalho = function(){}; | ||
1014 | + minimiza = function(){ | ||
1015 | + i3GEO.janela.minimiza("i3GEOjanelaEditor"); | ||
1016 | + }; | ||
1017 | + //cria a janela flutuante | ||
1018 | + titulo = "Editor vetorial"; | ||
1019 | + janela = i3GEO.janela.cria( | ||
1020 | + "300px", | ||
1021 | + "200px", | ||
1022 | + "", | ||
1023 | + "", | ||
1024 | + "", | ||
1025 | + titulo, | ||
1026 | + "i3GEOjanelaEditor", | ||
1027 | + false, | ||
1028 | + "hd", | ||
1029 | + cabecalho, | ||
1030 | + minimiza | ||
1031 | + ); | ||
1032 | + divid = janela[2].id; | ||
1033 | + $i("i3GEOjanelaEditor_corpo").style.backgroundColor = "white"; | ||
1034 | + $i("i3GEOjanelaEditor_corpo").style.textAlign = "left"; | ||
1035 | + return divid; | ||
1036 | + }, | ||
1037 | + ativaPainel: function(idjanela){ | ||
1038 | + OpenLayers.ImgPath = i3GEO.configura.locaplic+"/pacotes/openlayers/img/"; | ||
1039 | + i3GEOOL.fundo = "";//i3GEOOL é criado pelo script carregado | ||
1040 | + i3GEOOL.mapa = i3geoOL; | ||
1041 | + i3GEOOL.maxext = ""; | ||
1042 | + i3GEOOL.controles = []; | ||
1043 | + i3GEOOL.botoes = { | ||
1044 | + 'pan':false, | ||
1045 | + 'zoombox':false, | ||
1046 | + 'zoomtot':false, | ||
1047 | + 'legenda':false, | ||
1048 | + 'distancia':false, | ||
1049 | + 'area':false, | ||
1050 | + 'identifica':true, | ||
1051 | + 'linha':true, | ||
1052 | + 'ponto':true, | ||
1053 | + 'poligono':true, | ||
1054 | + 'edita':true, | ||
1055 | + 'apaga':true, | ||
1056 | + 'procura':false, | ||
1057 | + 'salva':true | ||
1058 | + } | ||
1059 | + i3GEOOL.layergrafico = new OpenLayers.Layer.Vector("Edição",{displayInLayerSwitcher:false,visibility:true}); | ||
1060 | + i3GEOOL.mapa.addLayers([i3GEOOL.layergrafico]); | ||
1061 | + i3GEOOL.criaBotoes(i3GEOOL.botoes); | ||
1062 | + i3GEOOL.criaJanelaAtivaTema(); | ||
1063 | + //i3GEOOL.inicia(); | ||
1064 | + } | ||
995 | } | 1065 | } |
996 | }; | 1066 | }; |
997 | //YAHOO.log("carregou classe barradebotoes", "Classes i3geo"); | 1067 | //YAHOO.log("carregou classe barradebotoes", "Classes i3geo"); |
998 | \ No newline at end of file | 1068 | \ No newline at end of file |
classesjs/classe_configura.js
@@ -152,7 +152,8 @@ i3GEO.configura = { | @@ -152,7 +152,8 @@ i3GEO.configura = { | ||
152 | ], | 152 | ], |
153 | "janelas": [ | 153 | "janelas": [ |
154 | { id:"omenudataJanelas1",text: $trad("u15"), url: "javascript:i3GEO.barraDeBotoes.reativa(0);i3GEO.barraDeBotoes.reativa(1)" }, | 154 | { id:"omenudataJanelas1",text: $trad("u15"), url: "javascript:i3GEO.barraDeBotoes.reativa(0);i3GEO.barraDeBotoes.reativa(1)" }, |
155 | - { id:"omenudataJanelas2",text: $trad("u16"), url: "javascript:i3GEO.ajuda.abreJanela()" } | 155 | + { id:"omenudataJanelas2",text: $trad("u16"), url: "javascript:i3GEO.ajuda.abreJanela()" }, |
156 | + { id:"omenudataJanelas3",text: $trad("u29"), url: "javascript:i3GEO.barraDeBotoes.editor.inicia()" } | ||
156 | ], | 157 | ], |
157 | "arquivos": [ | 158 | "arquivos": [ |
158 | { id:"omenudataArquivos1",text: $trad("u17"), url: "javascript:i3GEO.mapa.dialogo.salvaMapa()" }, | 159 | { id:"omenudataArquivos1",text: $trad("u17"), url: "javascript:i3GEO.mapa.dialogo.salvaMapa()" }, |
classesjs/classe_gadgets.js
@@ -867,6 +867,9 @@ i3GEO.gadgets = { | @@ -867,6 +867,9 @@ i3GEO.gadgets = { | ||
867 | if(i3GEO.Interface.ATUAL === "googleearth" && $i("omenudataJanelas1")){ | 867 | if(i3GEO.Interface.ATUAL === "googleearth" && $i("omenudataJanelas1")){ |
868 | MM.getMenuItem("omenudataJanelas1").cfg.setProperty("disabled", true); | 868 | MM.getMenuItem("omenudataJanelas1").cfg.setProperty("disabled", true); |
869 | } | 869 | } |
870 | + if(i3GEO.Interface.ATUAL !== "openlayers" && $i("omenudataJanelas3")){ | ||
871 | + MM.getMenuItem("omenudataJanelas3").cfg.setProperty("disabled", true); | ||
872 | + } | ||
870 | // | 873 | // |
871 | //corrige problemas de estilo | 874 | //corrige problemas de estilo |
872 | // | 875 | // |
classesjs/classe_interface.js
@@ -922,7 +922,7 @@ i3GEO.Interface = { | @@ -922,7 +922,7 @@ i3GEO.Interface = { | ||
922 | temp = camada.transitioneffect === "nao" ? opcoes.transitionEffect = "null" : opcoes.transitionEffect = "resize"; | 922 | temp = camada.transitioneffect === "nao" ? opcoes.transitionEffect = "null" : opcoes.transitionEffect = "resize"; |
923 | if(camada.connectiontype === 7 && camada.wmsurl !== ""){ | 923 | if(camada.connectiontype === 7 && camada.wmsurl !== ""){ |
924 | urllayer = camada.wmsurl+"&r="+Math.random(); | 924 | urllayer = camada.wmsurl+"&r="+Math.random(); |
925 | - layer = new OpenLayers.Layer.WMS(camada.name, urllayer,{format:camada.wmsformat,transparent:true},opcoes); | 925 | + layer = new OpenLayers.Layer.WMS(camada.name, urllayer,{LAYERS:camada.name,format:camada.wmsformat,transparent:true},opcoes); |
926 | if(camada.wmssrs != "") | 926 | if(camada.wmssrs != "") |
927 | {layer.url = layer.url+"&SRS="+camada.wmssrs+"&CRS="+camada.wmssrs;} | 927 | {layer.url = layer.url+"&SRS="+camada.wmssrs+"&CRS="+camada.wmssrs;} |
928 | } | 928 | } |
@@ -932,7 +932,7 @@ i3GEO.Interface = { | @@ -932,7 +932,7 @@ i3GEO.Interface = { | ||
932 | else{ | 932 | else{ |
933 | temp = camada.type === 3 ? opcoes.singleTile = false : opcoes.singleTile = !(i3GEO.Interface.openlayers.TILES); | 933 | temp = camada.type === 3 ? opcoes.singleTile = false : opcoes.singleTile = !(i3GEO.Interface.openlayers.TILES); |
934 | } | 934 | } |
935 | - layer = new OpenLayers.Layer.WMS(camada.name, urllayer,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},opcoes); | 935 | + layer = new OpenLayers.Layer.WMS(camada.name, urllayer,{LAYERS:camada.name,map_imagetype:i3GEO.Interface.OUTPUTFORMAT},opcoes); |
936 | } | 936 | } |
937 | } | 937 | } |
938 | catch(e){} | 938 | catch(e){} |
classesjs/classe_util.js
@@ -1287,7 +1287,7 @@ i3GEO.util = { | @@ -1287,7 +1287,7 @@ i3GEO.util = { | ||
1287 | 1287 | ||
1288 | js {String} - endereco do JS | 1288 | js {String} - endereco do JS |
1289 | 1289 | ||
1290 | - ini - funcao do JS que será executada ao ser carregado o script (pode ser "") | 1290 | + ini {String} - funcao que será executada ao ser carregado o script (pode ser "") |
1291 | 1291 | ||
1292 | id - id do elemento script que será criado | 1292 | id - id do elemento script que será criado |
1293 | 1293 |
classesjs/compactajs.php
@@ -170,7 +170,8 @@ $cssfiles = array( | @@ -170,7 +170,8 @@ $cssfiles = array( | ||
170 | "../pacotes/yui270/build/carousel/assets/skins/sam/carousel.css", | 170 | "../pacotes/yui270/build/carousel/assets/skins/sam/carousel.css", |
171 | "../pacotes/yui270/build/slider/assets/skins/sam/slider.css", | 171 | "../pacotes/yui270/build/slider/assets/skins/sam/slider.css", |
172 | "../pacotes/yui270/build/resize/assets/skins/sam/resize.css", | 172 | "../pacotes/yui270/build/resize/assets/skins/sam/resize.css", |
173 | -"../css/corrigeyui_geral.css" | 173 | +"../css/corrigeyui_geral.css", |
174 | +"../mashups/openlayers.css" | ||
174 | ); | 175 | ); |
175 | 176 | ||
176 | $buffer = ""; | 177 | $buffer = ""; |
classesjs/dicionario.js
@@ -409,6 +409,13 @@ en:"Centro médio", | @@ -409,6 +409,13 @@ en:"Centro médio", | ||
409 | es:"Centro médio", | 409 | es:"Centro médio", |
410 | it:"Centro médio" | 410 | it:"Centro médio" |
411 | }], | 411 | }], |
412 | +"u29": [ | ||
413 | +{ | ||
414 | +pt: "Editor vetorial", | ||
415 | +en:"Editor vetorial", | ||
416 | +es:"Editor vetorial", | ||
417 | +it:"Editor vetorial" | ||
418 | +}], | ||
412 | //arvore com a lista de temas | 419 | //arvore com a lista de temas |
413 | "t1": [ | 420 | "t1": [ |
414 | { | 421 | { |
classesjs/i3geonaocompacto.js
@@ -87,7 +87,8 @@ | @@ -87,7 +87,8 @@ | ||
87 | "../pacotes/yui270/build/button/assets/skins/sam/button.css", | 87 | "../pacotes/yui270/build/button/assets/skins/sam/button.css", |
88 | "../pacotes/yui270/build/slider/assets/skins/sam/slider.css", | 88 | "../pacotes/yui270/build/slider/assets/skins/sam/slider.css", |
89 | "../pacotes/yui270/build/resize/assets/skins/sam/resize.css", | 89 | "../pacotes/yui270/build/resize/assets/skins/sam/resize.css", |
90 | - "../css/corrigeyui_geral.css" | 90 | + "../css/corrigeyui_geral.css", |
91 | + "../mashups/openlayers.css" | ||
91 | ); | 92 | ); |
92 | for (i = 0; i < cssfiles.length; i++) | 93 | for (i = 0; i < cssfiles.length; i++) |
93 | { | 94 | { |
classesphp/mapa_openlayers.php
@@ -107,7 +107,7 @@ if($qy) | @@ -107,7 +107,7 @@ if($qy) | ||
107 | foreach ($shp as $indx) | 107 | foreach ($shp as $indx) |
108 | {$mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} | 108 | {$mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} |
109 | } | 109 | } |
110 | -if(!isset($_GET["telaR"])){//no caso de projecoes remotas, o mapfile nao´e alterado | 110 | +if(!isset($_GET["telaR"])){//no caso de projecoes remotas, o mapfile nao e alterado |
111 | $numlayers = $mapa->numlayers; | 111 | $numlayers = $mapa->numlayers; |
112 | $cache = false; | 112 | $cache = false; |
113 | for($i = 0;$i < $numlayers;$i++) | 113 | for($i = 0;$i < $numlayers;$i++) |
@@ -150,6 +150,12 @@ if(!isset($_GET["telaR"])){//no caso de projecoes remotas, o mapfile nao´e alter | @@ -150,6 +150,12 @@ if(!isset($_GET["telaR"])){//no caso de projecoes remotas, o mapfile nao´e alter | ||
150 | } | 150 | } |
151 | } | 151 | } |
152 | $l->set("template","none.htm"); | 152 | $l->set("template","none.htm"); |
153 | + if($_GET["REQUEST"] == "GetFeatureInfo" || $_GET["request"] == "getfeature"){ | ||
154 | + $l->setmetadata("gml_include_items","all"); | ||
155 | + $l->setmetadata("WMS_INCLUDE_ITEMS","all"); | ||
156 | + $l->setmetadata("WFS_INCLUDE_ITEMS","all"); | ||
157 | + $l->set("dump",MS_TRUE); | ||
158 | + } | ||
153 | } | 159 | } |
154 | } | 160 | } |
155 | if($qy || $_GET["HEIGHT"] != 256 ) | 161 | if($qy || $_GET["HEIGHT"] != 256 ) |
@@ -168,10 +174,32 @@ if($cache == true) | @@ -168,10 +174,32 @@ if($cache == true) | ||
168 | 174 | ||
169 | $map_size = explode(" ",$_GET["map_size"]); | 175 | $map_size = explode(" ",$_GET["map_size"]); |
170 | $mapa->setsize($map_size[0],$map_size[1]); | 176 | $mapa->setsize($map_size[0],$map_size[1]); |
177 | +if(isset($_GET["mapext"])){ | ||
178 | + $mapext = explode(" ",$_GET["mapext"]); | ||
179 | + $mapa->setExtent($mapext[0],$mapext[1],$mapext[2],$mapext[3]); | ||
180 | +} | ||
181 | +// | ||
182 | +//qd a cahamda e para um WMS, redireciona para ogc.php | ||
183 | +// | ||
184 | +if($_GET["REQUEST"] == "GetFeatureInfo" || $_GET["request"] == "getfeature"){ | ||
185 | + $req = ms_newowsrequestobj(); | ||
186 | + $_GET = array_merge($_GET,$_POST); | ||
187 | + foreach ($_GET as $k=>$v){ | ||
188 | + $req->setParameter($k, $v); | ||
189 | + } | ||
190 | + $proto = "http" . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "s" : "") . "://"; | ||
191 | + $server = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; | ||
192 | + $or = $proto.$server.$_SERVER['PHP_SELF']; | ||
193 | + $mapa->setmetadata("wfs_onlineresource",$or."?".$_SERVER["QUERY_STRING"]); | ||
171 | 194 | ||
172 | -$mapext = explode(" ",$_GET["mapext"]); | ||
173 | -$mapa->setExtent($mapext[0],$mapext[1],$mapext[2],$mapext[3]); | ||
174 | - | 195 | + ms_ioinstallstdouttobuffer(); |
196 | + $mapa->owsdispatch($req); | ||
197 | + $contenttype = ms_iostripstdoutbuffercontenttype(); | ||
198 | + header("Content-type: $contenttype"); | ||
199 | + ms_iogetStdoutBufferBytes(); | ||
200 | + ms_ioresethandlers(); | ||
201 | + exit; | ||
202 | +} | ||
175 | $o = $mapa->outputformat; | 203 | $o = $mapa->outputformat; |
176 | $o->set("imagemode",MS_IMAGEMODE_RGBA); | 204 | $o->set("imagemode",MS_IMAGEMODE_RGBA); |
177 | $legenda = $mapa->legend; | 205 | $legenda = $mapa->legend; |
interface/openlayers.htm
@@ -145,8 +145,20 @@ | @@ -145,8 +145,20 @@ | ||
145 | </td> | 145 | </td> |
146 | </tr> | 146 | </tr> |
147 | </table> | 147 | </table> |
148 | -<script src="../classesjs/i3geo.js"></script> | 148 | +<script src="../classesjs/i3geonaocompacto.js"></script> |
149 | <script src="../pacotes/openlayers/OpenLayers29.js.php"></script> | 149 | <script src="../pacotes/openlayers/OpenLayers29.js.php"></script> |
150 | +<!-- estilo necessário para a ferramenta de edição --> | ||
151 | +<style> | ||
152 | +.olControlEditingToolbar1 div { | ||
153 | + background-image:url(../mashups/openlayers.png); | ||
154 | + background-repeat:no-repeat; | ||
155 | + float:right; | ||
156 | + right: 0px; | ||
157 | + height:29px; | ||
158 | + margin:2px; | ||
159 | + width:29px; | ||
160 | +} | ||
161 | +</style> | ||
150 | <script> | 162 | <script> |
151 | /* | 163 | /* |
152 | Title: Interface Openlayers | 164 | Title: Interface Openlayers |
mashups/openlayers.js.php
@@ -77,23 +77,26 @@ i3GEOOL = { | @@ -77,23 +77,26 @@ i3GEOOL = { | ||
77 | i; | 77 | i; |
78 | if(i3GEOOL.mapa === "") | 78 | if(i3GEOOL.mapa === "") |
79 | {alert("O objeto i3GEOOL.mapa precisa ser criado com new OpenLayers.Map()");return;} | 79 | {alert("O objeto i3GEOOL.mapa precisa ser criado com new OpenLayers.Map()");return;} |
80 | - i3GEOOL.mapa.setOptions({ | ||
81 | - numZoomLevels: i3GEOOL.numzoom, | ||
82 | - maxExtent: i3GEOOL.maxext | ||
83 | - }); | 80 | + if(i3GEOOL.maxext != ""){ |
81 | + i3GEOOL.mapa.setOptions({ | ||
82 | + numZoomLevels: i3GEOOL.numzoom, | ||
83 | + maxExtent: i3GEOOL.maxext | ||
84 | + }); | ||
85 | + } | ||
84 | for(i=0;i<ncontroles;i++){ | 86 | for(i=0;i<ncontroles;i++){ |
85 | i3GEOOL.mapa.addControl(i3GEOOL.controles[i]); | 87 | i3GEOOL.mapa.addControl(i3GEOOL.controles[i]); |
86 | } | 88 | } |
87 | - for(i=nfundo-1;i>=0;i--){ | ||
88 | - try{ | ||
89 | - eval("i3GEOOL."+fundo[i]+".transitionEffect = 'resize';"); | ||
90 | - eval("i3GEOOL."+fundo[i]+".setVisibility(false);"); | ||
91 | - eval("alayers.push(i3GEOOL."+fundo[i]+");"); | 89 | + if(i3GEOOL.fundo != ""){ |
90 | + for(i=nfundo-1;i>=0;i--){ | ||
91 | + try{ | ||
92 | + eval("i3GEOOL."+fundo[i]+".transitionEffect = 'resize';"); | ||
93 | + eval("i3GEOOL."+fundo[i]+".setVisibility(false);"); | ||
94 | + eval("alayers.push(i3GEOOL."+fundo[i]+");"); | ||
95 | + } | ||
96 | + catch(e){alayers[0].setVisibility(true);} | ||
92 | } | 97 | } |
93 | - catch(e){alayers[0].setVisibility(true);} | ||
94 | } | 98 | } |
95 | i3GEOOL.mapa.addLayers(alayers); | 99 | i3GEOOL.mapa.addLayers(alayers); |
96 | - | ||
97 | if(i3GEOOL.layersIniciais != ""){ | 100 | if(i3GEOOL.layersIniciais != ""){ |
98 | var n = i3GEOOL.layersIniciais.length; | 101 | var n = i3GEOOL.layersIniciais.length; |
99 | for(i=0;i<n;i++) | 102 | for(i=0;i<n;i++) |
@@ -103,7 +106,8 @@ i3GEOOL = { | @@ -103,7 +106,8 @@ i3GEOOL = { | ||
103 | i3GEOOL.mapa.addLayers([i3GEOOL.layergrafico]); | 106 | i3GEOOL.mapa.addLayers([i3GEOOL.layergrafico]); |
104 | } | 107 | } |
105 | i3GEOOL.adicionaMarcas(); | 108 | i3GEOOL.adicionaMarcas(); |
106 | - i3GEOOL.mapa.zoomToMaxExtent(); | 109 | + if(i3GEOOL.maxext != "") |
110 | + {i3GEOOL.mapa.zoomToMaxExtent();} | ||
107 | i3GEOOL.coordenadas(); | 111 | i3GEOOL.coordenadas(); |
108 | i3GEOOL.criaJanelaBusca(); | 112 | i3GEOOL.criaJanelaBusca(); |
109 | i3GEOOL.criaJanelaAtivaTema(); | 113 | i3GEOOL.criaJanelaAtivaTema(); |
@@ -115,7 +119,7 @@ i3GEOOL = { | @@ -115,7 +119,7 @@ i3GEOOL = { | ||
115 | var nlayers = layers.length; | 119 | var nlayers = layers.length; |
116 | var ins = new Array(); | 120 | var ins = new Array(); |
117 | for(i=0;i<nlayers;i++){ | 121 | for(i=0;i<nlayers;i++){ |
118 | - if(layers[i].isBaseLayer == false){ | 122 | + if(layers[i].isBaseLayer == false && layers[i].visibility == true){ |
119 | ins.push(layers[i]); | 123 | ins.push(layers[i]); |
120 | } | 124 | } |
121 | } | 125 | } |
@@ -211,7 +215,11 @@ i3GEOOL = { | @@ -211,7 +215,11 @@ i3GEOOL = { | ||
211 | document.getElementById("i3GEOOLlistaTemasAtivos").value = id; | 215 | document.getElementById("i3GEOOLlistaTemasAtivos").value = id; |
212 | }, | 216 | }, |
213 | layerAtivo: function(){ | 217 | layerAtivo: function(){ |
214 | - var id = document.getElementById("i3GEOOLlistaTemasAtivos").value; | 218 | + var id = document.getElementById("i3GEOOLlistaTemasAtivos"); |
219 | + if(id) | ||
220 | + {id = id.value;} | ||
221 | + else | ||
222 | + {id = i3GEO.temaAtivo;} | ||
215 | return i3GEOOL.layersLigados()[id]; | 223 | return i3GEOOL.layersLigados()[id]; |
216 | }, | 224 | }, |
217 | listaItens: function(layer,idonde,idobj){ | 225 | listaItens: function(layer,idonde,idobj){ |
@@ -319,13 +327,15 @@ i3GEOOL = { | @@ -319,13 +327,15 @@ i3GEOOL = { | ||
319 | u += "&filter=<Filter><Intersect><PropertyName>Geometry</PropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:posList>"+poligono+"</gml:posList></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersect></Filter>"; | 327 | u += "&filter=<Filter><Intersect><PropertyName>Geometry</PropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:posList>"+poligono+"</gml:posList></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersect></Filter>"; |
320 | 328 | ||
321 | document.body.style.cursor="wait"; | 329 | document.body.style.cursor="wait"; |
322 | - document.getElementById("i3geoMapa").style.cursor = "wait"; | 330 | + if(document.getElementById("i3geoMapa")) |
331 | + {document.getElementById("i3geoMapa").style.cursor = "wait";} | ||
323 | OpenLayers.Request.issue({ | 332 | OpenLayers.Request.issue({ |
324 | method: "GET", | 333 | method: "GET", |
325 | url: u, | 334 | url: u, |
326 | callback: function(retorno){ | 335 | callback: function(retorno){ |
327 | document.body.style.cursor="default"; | 336 | document.body.style.cursor="default"; |
328 | - document.getElementById("i3geoMapa").style.cursor = "default"; | 337 | + if(document.getElementById("i3geoMapa")) |
338 | + {document.getElementById("i3geoMapa").style.cursor = "default";} | ||
329 | var fromgml = new OpenLayers.Format.GML({ | 339 | var fromgml = new OpenLayers.Format.GML({ |
330 | geometryName: "msGeometry" | 340 | geometryName: "msGeometry" |
331 | }); | 341 | }); |
@@ -334,7 +344,8 @@ i3GEOOL = { | @@ -334,7 +344,8 @@ i3GEOOL = { | ||
334 | }, | 344 | }, |
335 | failure: function(){ | 345 | failure: function(){ |
336 | document.body.style.cursor="default"; | 346 | document.body.style.cursor="default"; |
337 | - document.getElementById("i3geoMapa").style.cursor = "default"; | 347 | + if(document.getElementById("i3geoMapa")) |
348 | + {document.getElementById("i3geoMapa").style.cursor = "default";} | ||
338 | alert("Erro"); | 349 | alert("Erro"); |
339 | } | 350 | } |
340 | }) | 351 | }) |
@@ -426,8 +437,8 @@ i3GEOOL = { | @@ -426,8 +437,8 @@ i3GEOOL = { | ||
426 | trigger: function(){YAHOO.procura.container.panel.show();}, | 437 | trigger: function(){YAHOO.procura.container.panel.show();}, |
427 | title: "Procurar" | 438 | title: "Procurar" |
428 | }); | 439 | }); |
429 | - controles.push(button); | ||
430 | - var adiciona = true; | 440 | + controles.push(button); |
441 | + var adiciona = true; | ||
431 | } | 442 | } |
432 | if(botoes.pan==true){ | 443 | if(botoes.pan==true){ |
433 | controles.push(new OpenLayers.Control.Navigation({title: "Deslocar",displayClass:"pan"})); | 444 | controles.push(new OpenLayers.Control.Navigation({title: "Deslocar",displayClass:"pan"})); |
@@ -496,31 +507,32 @@ i3GEOOL = { | @@ -496,31 +507,32 @@ i3GEOOL = { | ||
496 | var adiciona = true; | 507 | var adiciona = true; |
497 | } | 508 | } |
498 | if(botoes.identifica==true){ | 509 | if(botoes.identifica==true){ |
499 | - botaoIdentifica = new OpenLayers.Control.WMSGetFeatureInfo({ | ||
500 | - maxFeatures:1, | ||
501 | - infoFormat:'text/plain', //'application/vnd.ogc.gml', | ||
502 | - layers: [i3GEOOL.layerAtivo()], | ||
503 | - queryVisible: true, | ||
504 | - title: "Identificar", | ||
505 | - displayClass: "identifica", | ||
506 | - eventListeners: { | ||
507 | - getfeatureinfo: function(event) { | 510 | + botaoIdentifica = new OpenLayers.Control.WMSGetFeatureInfo({ |
511 | + maxFeatures:1, | ||
512 | + infoFormat:'text/plain', //'application/vnd.ogc.gml', | ||
513 | + layers: [i3GEOOL.layerAtivo()], | ||
514 | + queryVisible: true, | ||
515 | + title: "Identificar", | ||
516 | + displayClass: "identifica", | ||
517 | + eventListeners: { | ||
518 | + getfeatureinfo: function(event) { | ||
508 | var lonlat = i3GEOOL.mapa.getLonLatFromPixel(event.xy); | 519 | var lonlat = i3GEOOL.mapa.getLonLatFromPixel(event.xy); |
509 | - var lonlattexto = "<hr><pre><span style=color:blue;cursor:pointer onclick='i3GEOOL.captura(\""+lonlat.lon+","+lonlat.lat+"\")'>captura</span></pre>"; | ||
510 | - i3GEOOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud( | ||
511 | - "chicken", | ||
512 | - i3GEOOL.mapa.getLonLatFromPixel(event.xy), | ||
513 | - null, | ||
514 | - lonlattexto+"<pre>"+event.text+"</pre>", | ||
515 | - null, | ||
516 | - true | ||
517 | - )); | ||
518 | - }, | 520 | + var lonlattexto = "<hr><pre><span style=color:blue;cursor:pointer onclick='i3GEOOL.captura(\""+lonlat.lon+","+lonlat.lat+"\")'>captura</span></pre>"; |
521 | + i3GEOOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud( | ||
522 | + "chicken", | ||
523 | + i3GEOOL.mapa.getLonLatFromPixel(event.xy), | ||
524 | + null, | ||
525 | + lonlattexto+"<pre>"+event.text+"</pre>", | ||
526 | + null, | ||
527 | + true | ||
528 | + )); | ||
529 | + }, | ||
519 | activate: function(){ | 530 | activate: function(){ |
520 | - YAHOO.temaativo.container.panel.show(); | 531 | + try{YAHOO.temaativo.container.panel.show();} |
532 | + catch(e){} | ||
521 | } | 533 | } |
522 | - } | ||
523 | - }); | 534 | + } |
535 | + }); | ||
524 | //button.events.register("getfeatureinfo", this, showInfo); | 536 | //button.events.register("getfeatureinfo", this, showInfo); |
525 | controles.push(botaoIdentifica); | 537 | controles.push(botaoIdentifica); |
526 | var adiciona = true; | 538 | var adiciona = true; |
@@ -528,11 +540,11 @@ i3GEOOL = { | @@ -528,11 +540,11 @@ i3GEOOL = { | ||
528 | if(botoes.linha==true){ | 540 | if(botoes.linha==true){ |
529 | button = new OpenLayers.Control.DrawFeature( | 541 | button = new OpenLayers.Control.DrawFeature( |
530 | i3GEOOL.layergrafico, | 542 | i3GEOOL.layergrafico, |
531 | - OpenLayers.Handler.Path, | ||
532 | - { | ||
533 | - displayClass: "linha", | ||
534 | - title: "digitalizar linha" | ||
535 | - } | 543 | + OpenLayers.Handler.Path, |
544 | + { | ||
545 | + displayClass: "linha", | ||
546 | + title: "digitalizar linha" | ||
547 | + } | ||
536 | ); | 548 | ); |
537 | controles.push(button); | 549 | controles.push(button); |
538 | var adiciona = true; | 550 | var adiciona = true; |
@@ -540,11 +552,11 @@ i3GEOOL = { | @@ -540,11 +552,11 @@ i3GEOOL = { | ||
540 | if(botoes.ponto==true){ | 552 | if(botoes.ponto==true){ |
541 | button = new OpenLayers.Control.DrawFeature( | 553 | button = new OpenLayers.Control.DrawFeature( |
542 | i3GEOOL.layergrafico, | 554 | i3GEOOL.layergrafico, |
543 | - OpenLayers.Handler.Point, | ||
544 | - { | ||
545 | - displayClass: "ponto", | ||
546 | - title: "digitalizar ponto" | ||
547 | - } | 555 | + OpenLayers.Handler.Point, |
556 | + { | ||
557 | + displayClass: "ponto", | ||
558 | + title: "digitalizar ponto" | ||
559 | + } | ||
548 | ); | 560 | ); |
549 | controles.push(button); | 561 | controles.push(button); |
550 | var adiciona = true; | 562 | var adiciona = true; |
@@ -552,11 +564,11 @@ i3GEOOL = { | @@ -552,11 +564,11 @@ i3GEOOL = { | ||
552 | if(botoes.poligono==true){ | 564 | if(botoes.poligono==true){ |
553 | button = new OpenLayers.Control.DrawFeature( | 565 | button = new OpenLayers.Control.DrawFeature( |
554 | i3GEOOL.layergrafico, | 566 | i3GEOOL.layergrafico, |
555 | - OpenLayers.Handler.Polygon, | ||
556 | - { | ||
557 | - displayClass: "poligono", | ||
558 | - title: "digitalizar polígono" | ||
559 | - } | 567 | + OpenLayers.Handler.Polygon, |
568 | + { | ||
569 | + displayClass: "poligono", | ||
570 | + title: "digitalizar polígono" | ||
571 | + } | ||
560 | ); | 572 | ); |
561 | controles.push(button); | 573 | controles.push(button); |
562 | var adiciona = true; | 574 | var adiciona = true; |
@@ -564,10 +576,10 @@ i3GEOOL = { | @@ -564,10 +576,10 @@ i3GEOOL = { | ||
564 | if(botoes.edita==true){ | 576 | if(botoes.edita==true){ |
565 | button = new OpenLayers.Control.ModifyFeature( | 577 | button = new OpenLayers.Control.ModifyFeature( |
566 | i3GEOOL.layergrafico, | 578 | i3GEOOL.layergrafico, |
567 | - { | ||
568 | - displayClass: "edita", | ||
569 | - title: "edita elemento" | ||
570 | - } | 579 | + { |
580 | + displayClass: "edita", | ||
581 | + title: "edita elemento" | ||
582 | + } | ||
571 | ); | 583 | ); |
572 | controles.push(button); | 584 | controles.push(button); |
573 | var adiciona = true; | 585 | var adiciona = true; |
@@ -576,17 +588,17 @@ i3GEOOL = { | @@ -576,17 +588,17 @@ i3GEOOL = { | ||
576 | if(botoes.apaga==true){ | 588 | if(botoes.apaga==true){ |
577 | button = new OpenLayers.Control.SelectFeature( | 589 | button = new OpenLayers.Control.SelectFeature( |
578 | i3GEOOL.layergrafico, | 590 | i3GEOOL.layergrafico, |
579 | - { | ||
580 | - displayClass: "selecao", | ||
581 | - title: "seleciona elemento", | ||
582 | - clickout: true, | ||
583 | - toggle: true, | ||
584 | - multiple: false, | ||
585 | - hover: false, | ||
586 | - toggleKey: "ctrlKey", // ctrl key removes from selection | ||
587 | - multipleKey: "shiftKey", // shift key adds to selection | ||
588 | - box: false | ||
589 | - } | 591 | + { |
592 | + displayClass: "selecao", | ||
593 | + title: "seleciona elemento", | ||
594 | + clickout: true, | ||
595 | + toggle: true, | ||
596 | + multiple: false, | ||
597 | + hover: false, | ||
598 | + toggleKey: "ctrlKey", // ctrl key removes from selection | ||
599 | + multipleKey: "shiftKey", // shift key adds to selection | ||
600 | + box: false | ||
601 | + } | ||
590 | ); | 602 | ); |
591 | controles.push(button); | 603 | controles.push(button); |
592 | var adiciona = true; | 604 | var adiciona = true; |
mashups/openlayers.php
@@ -86,6 +86,7 @@ if(isset($fundo) && $fundo != ""){ | @@ -86,6 +86,7 @@ if(isset($fundo) && $fundo != ""){ | ||
86 | // | 86 | // |
87 | //define quais os layers que comporão o mapa | 87 | //define quais os layers que comporão o mapa |
88 | // | 88 | // |
89 | + | ||
89 | if($temas != "") | 90 | if($temas != "") |
90 | { | 91 | { |
91 | $temas = str_replace(" ",",",$temas); | 92 | $temas = str_replace(" ",",",$temas); |
@@ -119,6 +120,7 @@ if($temas != "") | @@ -119,6 +120,7 @@ if($temas != "") | ||
119 | } | 120 | } |
120 | } | 121 | } |
121 | } | 122 | } |
123 | + | ||
122 | function ajuda(){ | 124 | function ajuda(){ |
123 | echo " | 125 | echo " |
124 | <pre><b> | 126 | <pre><b> |