From f9e8da49ca901373d5ef23686b3550b07b2f5fe0 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 16 Jun 2015 19:40:39 +0000 Subject: [PATCH] Correção na ferramenta telaremota --- ferramentas/telaremota/index.js | 13 ++++++++++++- ferramentas/telaremota/openlayers1.php | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------- 2 files changed, 96 insertions(+), 22 deletions(-) diff --git a/ferramentas/telaremota/index.js b/ferramentas/telaremota/index.js index ab725af..e0bf2fb 100644 --- a/ferramentas/telaremota/index.js +++ b/ferramentas/telaremota/index.js @@ -85,8 +85,19 @@ i3GEOF.telaremota = { ins += '

'; $i(divid).innerHTML += ins; mostraLink = function(retorno){ + //pega o fundo no caso do openlayers - o objeto fundo deve existir no php que abre a tela remota + var fundo = ""; + if(i3GEO.Interface.ATUAL === "openlayers"){ + var n = i3GEO.Interface.openlayers.LAYERSADICIONAIS.length; + var i; + for(i= 0; i < n; i++){ + if(i3GEO.Interface.openlayers.LAYERSADICIONAIS[i].isBaseLayer === true && i3GEO.Interface.openlayers.LAYERSADICIONAIS[i].visibility === true){ + fundo = i; + } + } + } var ins = ""; - var url1 = "?tempo=7000&telaR="+retorno.data+"&g_sid="+i3GEO.configura.sid; + var url1 = "?tempo=7000&telaR="+retorno.data+"&g_sid="+i3GEO.configura.sid+"&fundo=" + fundo; var url2 = i3GEO.configura.locaplic+"/ferramentas/telaremota/openlayers1.php"+url1; ins += "

Openlayers:


"; ins += ""+url2+""; diff --git a/ferramentas/telaremota/openlayers1.php b/ferramentas/telaremota/openlayers1.php index e2c6789..9446333 100644 --- a/ferramentas/telaremota/openlayers1.php +++ b/ferramentas/telaremota/openlayers1.php @@ -1,3 +1,9 @@ + @@ -112,7 +118,7 @@ function inicia(){ if (app==='N'){navn=true;}else{navm=true;} OpenLayers.ImgPath = "../../pacotes/openlayers/img/" OpenLayers.Lang.setCode("pt-BR"); - var urlLayer = "../../classesphp/mapa_openlayers.php?DESLIGACACHE=sim&g_sid=&telaR="; + var urlLayer = "../../classesphp/mapa_openlayers.php?DESLIGACACHE=sim&g_sid=&telaR="; var remoto = new OpenLayers.Layer.WMS( "Remoto", @@ -120,18 +126,68 @@ function inicia(){ {transparent: "false", format: "image/png"}, {isBaseLayer:false,singleTile:true,buffer:0,gutter:0,ratio:1} ); - var remotoFundo = new OpenLayers.Layer.WMS( - "Fundo", - urlLayer+"&tipolayer=fundo", - {transparent: "false", format: "image/png"}, - {isBaseLayer:true,singleTile:true,visibility:true,buffer:0,gutter:0,ratio:1} - ); - var bra = new OpenLayers.Layer.WMS( - "Base carto MMA", - "http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map", - {layers:"baseraster",srs:"EPSG:4618",format:"image/png"}, - {isBaseLayer:true,visibility:false} - ); + + var eng = new OpenLayers.Layer.ArcGIS93Rest( + "ESRI National Geographic", + "http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/export", + { + format : "jpeg" + }, { + isBaseLayer : true, + visibility : true + }); + var oce = new OpenLayers.Layer.ArcGIS93Rest( + "ESRI Ocean Basemap", + "http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/export", + { + format : "jpeg" + }, { + isBaseLayer : true, + visibility : true + }); + var ims = new OpenLayers.Layer.ArcGIS93Rest( + "ESRI Imagery World 2D", + "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export", + { + format : "jpeg" + }, { + isBaseLayer : true, + visibility : true + }); + var wsm = new OpenLayers.Layer.ArcGIS93Rest( + "ESRI World Street Map", + "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/export", + { + format : "jpeg" + }, { + isBaseLayer : true, + visibility : true + }); + var bra = new OpenLayers.Layer.WMS( + "Base carto MMA", + "http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map", + { + layers : "baseraster", + srs : "EPSG:4618", + format : "image/png", + isBaseLayer : false + }, { + isBaseLayer : true, + visibility : true + }); + + var tms = new OpenLayers.Layer.TMS("OSGEO", + "http://tilecache.osgeo.org/wms-c/Basic.py/", { + layername : "basic", + type : "png", + // set if different than the bottom left of map.maxExtent + tileOrigin : new OpenLayers.LonLat(-180, -90), + isBaseLayer : true, + visibility : true + }); + + var LAYERSADICIONAIS = [ eng, oce, ims, wsm, tms, bra ]; + mapaRemoto = new OpenLayers.Map({ div: "openlayers", controls: [ @@ -139,9 +195,14 @@ function inicia(){ new OpenLayers.Control.LayerSwitcher(), new OpenLayers.Control.ScaleLine(), new OpenLayers.Control.Navigation() - ] - }); - mapaRemoto.addLayers([remotoFundo,bra,remoto]); + ] + }); + if( !== ""){ + mapaRemoto.addLayers([LAYERSADICIONAIS[],remoto]); + } + else{ + mapaRemoto.addLayers([remoto]); + } recuperaMapa(); } function zoom2ext(ext){ @@ -155,11 +216,13 @@ function atualizaMapa(){ nlayers = layers.length, i; for(i=0;i