Commit 5625e412b4b47d9a93f8f8e7c38b5804a18ac028
1 parent
a18e9bd7
Exists in
master
and in
7 other branches
$1
Showing
5 changed files
with
67 additions
and
59 deletions
Show diff stats
admin/php/editortexto.php
| ... | ... | @@ -65,7 +65,7 @@ body { |
| 65 | 65 | echo "</TEXTAREA>"; |
| 66 | 66 | $mapfile = str_replace("\\","/",$mapfile); |
| 67 | 67 | $mapa = ms_newMapObj($mapfile); |
| 68 | - echo "<iframe id='mapaPreview' src='../../mashups/openlayers.php?controles=navigation,panzoombar,scaleline,mouseposition&botoes=identifica&largura=490&fundo=".$mapfile."&temas=".$mapfile."' cols=100 rows=20 style='position:relative;top:2px;overflow:hidden;width:500px;height:500px;border:1px solid gray;'>"; | |
| 68 | + echo "<iframe id='mapaPreview' src='../../mashups/openlayers.php?DESLIGACACHE=sim&controles=navigation,panzoombar,scaleline,mouseposition&botoes=identifica&largura=490&fundo=".$mapfile."&temas=".$mapfile."' cols=100 rows=20 style='position:relative;top:2px;overflow:hidden;width:500px;height:500px;border:1px solid gray;'>"; | |
| 69 | 69 | echo "</iframe>"; |
| 70 | 70 | echo "<input type=hidden name=tipo value=gravar />"; |
| 71 | 71 | ... | ... |
mashups/openlayers.js
| 1 | -/*çjslint white:false,undef: false, rhino: true, onevar: true, evil: false */ | |
| 2 | 1 | $i = function(id) |
| 3 | 2 | {return document.getElementById(id);}; |
| 4 | 3 | //seta as variáveis navn e navm |
| ... | ... | @@ -418,10 +417,10 @@ i3GEO.editorOL = { |
| 418 | 417 | return i3GEO.editorOL.layersLigados()[id]; |
| 419 | 418 | }, |
| 420 | 419 | listaItens: function(layer,idonde,idobj){ |
| 421 | - if(!layer){return;} | |
| 422 | - if(!layer.params){return;} | |
| 423 | - var u = layer.url+"&request=describefeaturetype&service=wfs&version=1.0.0"; | |
| 424 | - u += "&typename="+layer.params.LAYERS; | |
| 420 | + if(!layer){return;} | |
| 421 | + if(!layer.params){return;} | |
| 422 | + var u = layer.url+"&request=describefeaturetype&service=wfs&version=1.0.0"; | |
| 423 | + u += "&typename="+layer.params.LAYERS; | |
| 425 | 424 | document.body.style.cursor="wait"; |
| 426 | 425 | document.getElementById("i3geoMapa").style.cursor = "wait"; |
| 427 | 426 | OpenLayers.Request.issue({ |
| ... | ... | @@ -454,9 +453,9 @@ i3GEO.editorOL = { |
| 454 | 453 | busca: function(layer,item,palavra,onde){ |
| 455 | 454 | document.body.style.cursor="wait"; |
| 456 | 455 | document.getElementById("i3geoMapa").style.cursor = "wait"; |
| 457 | - var u = layer.url+"&request=getfeature&service=wfs&version=1.0.0"; | |
| 458 | - u += "&OUTPUTFORMAT=gml2&typename="+layer.params.LAYERS; | |
| 459 | - u += "&filter=<Filter><PropertyIsLike wildcard=* singleChar=. escape=! ><PropertyName>"+item+"</PropertyName><Literal>*"+palavra+"*</Literal></PropertyIsLike></Filter>"; | |
| 456 | + var u = layer.url+"&request=getfeature&service=wfs&version=1.0.0"; | |
| 457 | + u += "&OUTPUTFORMAT=gml2&typename="+layer.params.LAYERS; | |
| 458 | + u += "&filter=<Filter><PropertyIsLike wildcard=* singleChar=. escape=! ><PropertyName>"+item+"</PropertyName><Literal>*"+palavra+"*</Literal></PropertyIsLike></Filter>"; | |
| 460 | 459 | document.body.style.cursor="wait"; |
| 461 | 460 | document.getElementById("i3geoMapa").style.cursor = "wait"; |
| 462 | 461 | document.getElementById(onde).innerHTML = "..."; |
| ... | ... | @@ -534,9 +533,9 @@ i3GEO.editorOL = { |
| 534 | 533 | var layers = [i3GEO.editorOL.layerAtivo()], |
| 535 | 534 | xy = lonlat.split(","), |
| 536 | 535 | u = layers[0].url+"&request=getfeature&service=wfs&version=1.0.0"; |
| 537 | - u += "&OUTPUTFORMAT=gml2&typename="+layers[0].params.LAYERS; | |
| 536 | + u += "&OUTPUTFORMAT=gml2&typename="+layers[0].params.LAYERS; | |
| 538 | 537 | |
| 539 | - //u += "&filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Point><gml:coordinates>"+lonlat+"</gml:coordinates></gml:Point></Intersects></Filter>"; | |
| 538 | + //u += "&filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Point><gml:coordinates>"+lonlat+"</gml:coordinates></gml:Point></Intersects></Filter>"; | |
| 540 | 539 | |
| 541 | 540 | xy[0] = xy[0] * 1; |
| 542 | 541 | xy[1] = xy[1] * 1; |
| ... | ... | @@ -618,9 +617,9 @@ i3GEO.editorOL = { |
| 618 | 617 | ins += "<b>Atributos: "+i+"</b><br>"; |
| 619 | 618 | var a = geos[i].attributes; |
| 620 | 619 | for(key in a){ |
| 621 | - if(a[key]){ | |
| 622 | - ins += key+" = "+a[key]+"<br>"; | |
| 623 | - } | |
| 620 | + if(a[key]){ | |
| 621 | + ins += key+" = "+a[key]+"<br>"; | |
| 622 | + } | |
| 624 | 623 | } |
| 625 | 624 | } |
| 626 | 625 | var w = window.open(); |
| ... | ... | @@ -632,28 +631,28 @@ i3GEO.editorOL = { |
| 632 | 631 | }, |
| 633 | 632 | criaBotoes: function(botoes){ |
| 634 | 633 | var sketchSymbolizers = { |
| 635 | - "Point": { | |
| 636 | - pointRadius: 4, | |
| 637 | - graphicName: "square", | |
| 638 | - fillColor: "white", | |
| 639 | - fillOpacity: 1, | |
| 640 | - strokeWidth: 1, | |
| 641 | - strokeOpacity: 1, | |
| 642 | - strokeColor: "#333333" | |
| 643 | - }, | |
| 644 | - "Line": { | |
| 645 | - strokeWidth: 3, | |
| 646 | - strokeOpacity: 1, | |
| 647 | - strokeColor: "#666666", | |
| 648 | - strokeDashstyle: "dash" | |
| 649 | - }, | |
| 650 | - "Polygon": { | |
| 651 | - strokeWidth: 2, | |
| 652 | - strokeOpacity: 1, | |
| 653 | - strokeColor: "#666666", | |
| 654 | - fillColor: "white", | |
| 655 | - fillOpacity: 0.3 | |
| 656 | - } | |
| 634 | + "Point": { | |
| 635 | + pointRadius: 4, | |
| 636 | + graphicName: "square", | |
| 637 | + fillColor: "white", | |
| 638 | + fillOpacity: 1, | |
| 639 | + strokeWidth: 1, | |
| 640 | + strokeOpacity: 1, | |
| 641 | + strokeColor: "#333333" | |
| 642 | + }, | |
| 643 | + "Line": { | |
| 644 | + strokeWidth: 3, | |
| 645 | + strokeOpacity: 1, | |
| 646 | + strokeColor: "#666666", | |
| 647 | + strokeDashstyle: "dash" | |
| 648 | + }, | |
| 649 | + "Polygon": { | |
| 650 | + strokeWidth: 2, | |
| 651 | + strokeOpacity: 1, | |
| 652 | + strokeColor: "#666666", | |
| 653 | + fillColor: "white", | |
| 654 | + fillOpacity: 0.3 | |
| 655 | + } | |
| 657 | 656 | }, |
| 658 | 657 | style = new OpenLayers.Style(), |
| 659 | 658 | styleMap = new OpenLayers.StyleMap({"default": style}), |
| ... | ... | @@ -661,7 +660,7 @@ i3GEO.editorOL = { |
| 661 | 660 | button, |
| 662 | 661 | controles = []; |
| 663 | 662 | style.addRules([ |
| 664 | - new OpenLayers.Rule({symbolizer: sketchSymbolizers}) | |
| 663 | + new OpenLayers.Rule({symbolizer: sketchSymbolizers}) | |
| 665 | 664 | ]); |
| 666 | 665 | i3GEOpanelEditor = new OpenLayers.Control.Panel({ |
| 667 | 666 | displayClass: "olControlEditingToolbar1 noprint", |
| ... | ... | @@ -1248,24 +1247,24 @@ i3GEO.editorOL = { |
| 1248 | 1247 | {return;} |
| 1249 | 1248 | var SHADOW_Z_INDEX = 10, |
| 1250 | 1249 | MARKER_Z_INDEX = 11, |
| 1251 | - layer = new OpenLayers.Layer.Vector( | |
| 1252 | - "pontos", | |
| 1253 | - { | |
| 1254 | - styleMap: new OpenLayers.StyleMap({ | |
| 1255 | - externalGraphic: i3GEO.editorOL.marca, | |
| 1256 | - backgroundGraphic: "../pacotes/openlayers/img/marker_shadow.png", | |
| 1257 | - backgroundXOffset: 0, | |
| 1258 | - backgroundYOffset: -7, | |
| 1259 | - graphicZIndex: MARKER_Z_INDEX, | |
| 1260 | - backgroundGraphicZIndex: SHADOW_Z_INDEX, | |
| 1261 | - pointRadius: 10 | |
| 1262 | - }), | |
| 1263 | - isBaseLayer: false, | |
| 1264 | - rendererOptions: {yOrdering: true}, | |
| 1250 | + layer = new OpenLayers.Layer.Vector( | |
| 1251 | + "pontos", | |
| 1252 | + { | |
| 1253 | + styleMap: new OpenLayers.StyleMap({ | |
| 1254 | + externalGraphic: i3GEO.editorOL.marca, | |
| 1255 | + backgroundGraphic: "../pacotes/openlayers/img/marker_shadow.png", | |
| 1256 | + backgroundXOffset: 0, | |
| 1257 | + backgroundYOffset: -7, | |
| 1258 | + graphicZIndex: MARKER_Z_INDEX, | |
| 1259 | + backgroundGraphicZIndex: SHADOW_Z_INDEX, | |
| 1260 | + pointRadius: 10 | |
| 1261 | + }), | |
| 1262 | + isBaseLayer: false, | |
| 1263 | + rendererOptions: {yOrdering: true}, | |
| 1265 | 1264 | displayInLayerSwitcher:true, |
| 1266 | 1265 | visibility:true |
| 1267 | - } | |
| 1268 | - ), | |
| 1266 | + } | |
| 1267 | + ), | |
| 1269 | 1268 | index, |
| 1270 | 1269 | x = [], |
| 1271 | 1270 | y = [], | ... | ... |
mashups/openlayers.php
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * DESLIGACACHE (opcional) {sim|nao} - forca a nao usar o cache de imagens qd definido como "sim", do contrário, o uso ou não do cache será definido automaticamente | |
| 4 | + */ | |
| 2 | 5 | include_once("../ms_configura.php"); |
| 3 | 6 | include_once("../classesphp/pega_variaveis.php"); |
| 4 | 7 | include_once("../classesphp/carrega_ext.php"); |
| ... | ... | @@ -163,7 +166,7 @@ if($temas != ""){ |
| 163 | 166 | foreach($temas as $tema){ |
| 164 | 167 | $nomeLayer = str_replace(".map","",basename($tema)); |
| 165 | 168 | $nomeLayer = str_replace(".php","",$nomeLayer); |
| 166 | - $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$tema.'", "'.$servidor.'?tema='.$tema.'&",{layers:"'.$nomeLayer.'",transparent: "true", format: "image/png"},{isBaseLayer:false})'; | |
| 169 | + $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$tema.'", "'.$servidor.'?tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&",{layers:"'.$nomeLayer.'",transparent: "true", format: "image/png"},{isBaseLayer:false})'; | |
| 167 | 170 | } |
| 168 | 171 | } |
| 169 | 172 | else{ |
| ... | ... | @@ -172,7 +175,7 @@ if($temas != ""){ |
| 172 | 175 | include_once($locaplic."/pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php"); |
| 173 | 176 | $gm = new gvsig2mapfile($locaplic."/temas/".$tema.".gvp"); |
| 174 | 177 | $gvsigview = $gm->getViewsNames(); |
| 175 | - $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$gvsigview[0].'", "../ogc.php?tema='.$tema.'&",{layers:"'.$tema.'",transparent: "true", format: "image/png"},{singleTile:false,visibility:true,isBaseLayer:false})'; | |
| 178 | + $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$gvsigview[0].'", "../ogc.php?tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&",{layers:"'.$tema.'",transparent: "true", format: "image/png"},{singleTile:false,visibility:true,isBaseLayer:false})'; | |
| 176 | 179 | } |
| 177 | 180 | else{ |
| 178 | 181 | $nomeMap = ""; |
| ... | ... | @@ -213,12 +216,12 @@ if($temas != ""){ |
| 213 | 216 | if($nlayers == 1 && strtoupper($layern->getmetadata("cache")) == "SIM"){ |
| 214 | 217 | //nesse caso o layer e adicionado como TMS |
| 215 | 218 | //tms leva os parametros do TMS |
| 216 | - $objOpenLayers[] = 'new OpenLayers.Layer.TMS("'.$tituloLayer.'", "../ogc.php?tema='.$tema.'",{tileOrigin: new OpenLayers.LonLat(-180, -90),serviceVersion:"&tms=",visibility:'.$visivel.',isBaseLayer:'.$ebase.',layername:"'.$nomeLayer.'",type:"png"})'; | |
| 219 | + $objOpenLayers[] = 'new OpenLayers.Layer.TMS("'.$tituloLayer.'", "../ogc.php?tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'",{tileOrigin: new OpenLayers.LonLat(-180, -90),serviceVersion:"&tms=",visibility:'.$visivel.',isBaseLayer:'.$ebase.',layername:"'.$nomeLayer.'",type:"png"})'; | |
| 217 | 220 | //cria um clone WMS para efeitos de getfeatureinfo |
| 218 | - $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$tituloLayer.'", "../ogc.php?tema='.$tema.'&",{cloneTMS:"'.$nomeLayer.'",layers:"'.$nomeLayer.'",transparent: "true", format: "image/png"},{displayInLayerSwitcher:false,singleTile:true,visibility:false,isBaseLayer:false})'; | |
| 221 | + $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$tituloLayer.'", "../ogc.php?tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&",{cloneTMS:"'.$nomeLayer.'",layers:"'.$nomeLayer.'",transparent: "true", format: "image/png"},{displayInLayerSwitcher:false,singleTile:true,visibility:false,isBaseLayer:false})'; | |
| 219 | 222 | } |
| 220 | 223 | else{ |
| 221 | - $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$tituloLayer.'", "../ogc.php?tema='.$tema.'&",{layers:"'.$nomeLayer.'",transparent: "true", format: "image/png"},{singleTile:true,visibility:'.$visivel.',isBaseLayer:'.$ebase.'})'; | |
| 224 | + $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$tituloLayer.'", "../ogc.php?tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&",{layers:"'.$nomeLayer.'",transparent: "true", format: "image/png"},{singleTile:true,visibility:'.$visivel.',isBaseLayer:'.$ebase.'})'; | |
| 222 | 225 | } |
| 223 | 226 | //var_dump($objOpenLayers);exit; |
| 224 | 227 | } | ... | ... |
ogc.php
| ... | ... | @@ -48,6 +48,8 @@ format - (opcional) pode ser utilizado a op&ccedil;&atilde;o &format=application |
| 48 | 48 | |
| 49 | 49 | id_medida_variavel - id da medida de variavel - utilizado apenas quando a fonte para definicao do layer for o sistema de metadados estatisticos |
| 50 | 50 | nao deve ser utilizado junto com tema |
| 51 | + | |
| 52 | +DESLIGACACHE (opcional) {sim|nao} - forca a nao usar o cache de imagens qd definido como "sim", do contrário, o uso ou não do cache será definido automaticamente | |
| 51 | 53 | |
| 52 | 54 | Exemplos: |
| 53 | 55 | |
| ... | ... | @@ -189,6 +191,10 @@ if(isset($_GET["tms"])){ |
| 189 | 191 | } |
| 190 | 192 | if(isset($_GET["Z"]) && isset($_GET["X"])){ |
| 191 | 193 | $agora .= "google"; |
| 194 | +} | |
| 195 | +if(isset($_GET["DESLIGACACHE"]) && $_GET["DESLIGACACHE"] == "sim"){ | |
| 196 | + $agora = time(); | |
| 197 | + $cache = false; | |
| 192 | 198 | } |
| 193 | 199 | $nomeMapfileTmp = $dir_tmp."/ogc_".md5($tema)."_".$agora.".map"; |
| 194 | 200 | $nomeMapfileTmp = str_replace(",","",$nomeMapfileTmp); | ... | ... |