Commit 2aff3400eb69a0cf2cebc212a61e21ae79c8a70a
1 parent
180b25e2
Exists in
master
and in
7 other branches
$1
Showing
7 changed files
with
215 additions
and
103 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/php/editormapfile.php
... | ... | @@ -1620,7 +1620,8 @@ function alterarEditavel() |
1620 | 1620 | $layer->setmetadata("COLUNAIDUNICO",$colunaidunico); |
1621 | 1621 | $layer->setmetadata("TABELAEDITAVEL",$tabelaeditavel); |
1622 | 1622 | $layer->setmetadata("ESQUEMATABELAEDITAVEL",$esquematabelaeditavel); |
1623 | - $layer->setmetadata("COLUNAGEOMETRIA",$colunageometria); | |
1623 | + $layer->setmetadata("COLUNAGEOMETRIA",$colunageometria); | |
1624 | + $layer->setmetadata("cache",""); | |
1624 | 1625 | $mapa->save($mapfile); |
1625 | 1626 | removeCabecalho($mapfile); |
1626 | 1627 | return "ok"; | ... | ... |
classesphp/mapa_googlemaps.php
... | ... | @@ -88,48 +88,56 @@ else{ |
88 | 88 | if(!isset($_SESSION["map_file"])){ |
89 | 89 | exit; |
90 | 90 | } |
91 | -// | |
91 | + | |
92 | 92 | $map_fileX = $_SESSION["map_file"]; |
93 | 93 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
94 | 94 | $cachedir = $_SESSION["cachedir"]; |
95 | 95 | $i3georendermode = $_SESSION["i3georendermode"]; |
96 | -// | |
97 | -//converte a requisição do tile em coordenadas geo | |
98 | -//http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#tile_numbers_to_lon.2Flat_2 | |
99 | -// | |
100 | -$x = $_GET["X"]; | |
101 | -$y = $_GET["Y"]; | |
102 | -$z = $_GET["Z"]; | |
103 | - | |
104 | -$qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; | |
105 | -$qy = file_exists($qyfile); | |
106 | 96 | |
107 | -if($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){ | |
108 | - carregaCacheImagem(); | |
97 | +if(!empty($_GET["request"])){ | |
98 | + $_GET["REQUEST"] = $_GET["request"]; | |
109 | 99 | } |
100 | +if($_GET["REQUEST"] == "GetFeatureInfo" || strtolower($_GET["REQUEST"]) == "getfeature"){ | |
101 | + $_GET["DESLIGACACHE"] = "sim"; | |
102 | + $_GET["SRS"] = "EPSG:3857"; | |
103 | +} | |
104 | +else{ | |
105 | + // | |
106 | + //converte a requisição do tile em coordenadas geo | |
107 | + //http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#tile_numbers_to_lon.2Flat_2 | |
108 | + // | |
109 | + $x = $_GET["X"]; | |
110 | + $y = $_GET["Y"]; | |
111 | + $z = $_GET["Z"]; | |
112 | + | |
113 | + $qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; | |
114 | + $qy = file_exists($qyfile); | |
115 | + if($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){ | |
116 | + carregaCacheImagem(); | |
117 | + } | |
110 | 118 | |
111 | -$n = pow(2,$z); | |
112 | -$lon1 = $x / $n * 360.0 - 180.0; | |
113 | -$lat2 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n)))); | |
114 | -$x++; | |
115 | -$y++; | |
116 | -$lon2 = $x / $n * 360.0 - 180.0; | |
117 | -$lat1 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n)))); | |
118 | -$x--; | |
119 | -$y--; | |
120 | - | |
121 | -$projInObj = ms_newprojectionobj("proj=latlong,a=6378137,b=6378137"); | |
122 | -$projOutObj = ms_newprojectionobj("proj=merc,a=6378137,b=6378137,lat_ts=0.0,lon_0=0.0,x_0=0.0,y_0=0,k=1.0,units=m"); | |
123 | - | |
124 | -$poPoint1 = ms_newpointobj(); | |
125 | -$poPoint1->setXY($lon1, $lat1); | |
126 | -$poPoint1->project($projInObj, $projOutObj); | |
127 | -$poPoint2 = ms_newpointobj(); | |
128 | -$poPoint2->setXY($lon2, $lat2); | |
129 | -$poPoint2->project($projInObj, $projOutObj); | |
130 | -$_GET["BBOX"] = $poPoint1->x." ".$poPoint1->y." ".$poPoint2->x." ".$poPoint2->y; | |
131 | -$_GET["mapext"] = str_replace(","," ",$_GET["BBOX"]); | |
132 | - | |
119 | + $n = pow(2,$z); | |
120 | + $lon1 = $x / $n * 360.0 - 180.0; | |
121 | + $lat2 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n)))); | |
122 | + $x++; | |
123 | + $y++; | |
124 | + $lon2 = $x / $n * 360.0 - 180.0; | |
125 | + $lat1 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n)))); | |
126 | + $x--; | |
127 | + $y--; | |
128 | + | |
129 | + $projInObj = ms_newprojectionobj("proj=latlong,a=6378137,b=6378137"); | |
130 | + $projOutObj = ms_newprojectionobj("proj=merc,a=6378137,b=6378137,lat_ts=0.0,lon_0=0.0,x_0=0.0,y_0=0,k=1.0,units=m"); | |
131 | + | |
132 | + $poPoint1 = ms_newpointobj(); | |
133 | + $poPoint1->setXY($lon1, $lat1); | |
134 | + $poPoint1->project($projInObj, $projOutObj); | |
135 | + $poPoint2 = ms_newpointobj(); | |
136 | + $poPoint2->setXY($lon2, $lat2); | |
137 | + $poPoint2->project($projInObj, $projOutObj); | |
138 | + $_GET["BBOX"] = $poPoint1->x." ".$poPoint1->y." ".$poPoint2->x." ".$poPoint2->y; | |
139 | + $_GET["mapext"] = str_replace(","," ",$_GET["BBOX"]); | |
140 | +} | |
133 | 141 | $mapa = ms_newMapObj($map_fileX); |
134 | 142 | $ret = $mapa->extent; |
135 | 143 | |
... | ... | @@ -175,6 +183,18 @@ if(!isset($_GET["telaR"])){ |
175 | 183 | if(strtolower($l->getmetadata("cache")) == "sim"){ |
176 | 184 | $cache = true; |
177 | 185 | } |
186 | + if($_GET["REQUEST"] == "GetFeatureInfo" || strtolower($_GET["REQUEST"]) == "getfeature" ){ | |
187 | + $l->setmetadata("gml_include_items","all"); | |
188 | + $l->set("template","none.htm"); | |
189 | + $l->setmetadata("WMS_INCLUDE_ITEMS","all"); | |
190 | + $l->setmetadata("WFS_INCLUDE_ITEMS","all"); | |
191 | + $l->setmetadata("ows_enable_request","*"); | |
192 | + $l->set("dump",MS_TRUE); | |
193 | + $l->setmetadata("ows_srs","AUTO"); | |
194 | + if(strtolower($_GET["REQUEST"]) == "getfeature"){ | |
195 | + $_GET["TYPENAME"] = $l->name; | |
196 | + } | |
197 | + } | |
178 | 198 | } |
179 | 199 | } |
180 | 200 | } |
... | ... | @@ -187,6 +207,39 @@ else{ |
187 | 207 | {$l->setProjection("proj=latlong,a=6378137,b=6378137");} |
188 | 208 | } |
189 | 209 | } |
210 | + | |
211 | +// | |
212 | +//qd a cahamda e para um WMS, redireciona para ogc.php | |
213 | +// | |
214 | +if($_GET["REQUEST"] == "GetFeatureInfo" || $_GET["REQUEST"] == "getfeature"){ | |
215 | + //echo $_GET["mapext"];exit; | |
216 | + if($_GET["REQUEST"] == "GetFeatureInfo"){ | |
217 | + $mapa->setsize(256,256); | |
218 | + $mapext = explode(",",$_GET["BBOX"]); | |
219 | + $mapa->setExtent($mapext[0],$mapext[1],$mapext[2],$mapext[3]); | |
220 | + } | |
221 | + else{ | |
222 | + $mapa->setExtent(-21309420.490489,-8061966.246171,21505099.28287,16906647.661876); | |
223 | + } | |
224 | + $req = ms_newowsrequestobj(); | |
225 | + $_GET = array_merge($_GET,$_POST); | |
226 | + foreach ($_GET as $k=>$v){ | |
227 | + $req->setParameter($k, $v); | |
228 | + } | |
229 | + $proto = "http" . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "s" : "") . "://"; | |
230 | + $server = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; | |
231 | + $or = $proto.$server.$_SERVER['PHP_SELF']; | |
232 | + $mapa->setmetadata("wfs_onlineresource",$or."?".$_SERVER["QUERY_STRING"]); | |
233 | + | |
234 | + ms_ioinstallstdouttobuffer(); | |
235 | + $mapa->owsdispatch($req); | |
236 | + $contenttype = ms_iostripstdoutbuffercontenttype(); | |
237 | + header("Content-type: $contenttype"); | |
238 | + ms_iogetStdoutBufferBytes(); | |
239 | + ms_ioresethandlers(); | |
240 | + exit; | |
241 | +} | |
242 | + | |
190 | 243 | if($_GET["layer"] == "") |
191 | 244 | {$cache = true;} |
192 | 245 | ... | ... |
mashups/openlayers.js
... | ... | @@ -302,22 +302,25 @@ i3GEO.editorOL = { |
302 | 302 | return false; |
303 | 303 | }, |
304 | 304 | layertms2wms: function(tms){ |
305 | - var layer = new OpenLayers.Layer.WMS( | |
305 | + var layer,url; | |
306 | + url = tms.url.replace("&cache=sim","&DESLIGACACHE=sim"); | |
307 | + url = url.replace("&Z=${z}&X=${x}&Y=${y}",""); | |
308 | + layer = new OpenLayers.Layer.WMS( | |
306 | 309 | tms.layername+"_clone", |
307 | - tms.url.replace("&cache=sim","&DESLIGACACHE=sim"), | |
308 | - { | |
309 | - layers:tms.name, | |
310 | - transparent:true | |
311 | - }, | |
312 | - { | |
313 | - gutter:0, | |
314 | - isBaseLayer:false, | |
315 | - displayInLayerSwitcher:false, | |
316 | - opacity: 1, | |
317 | - visibility:true, | |
318 | - singleTile: true | |
319 | - } | |
320 | - ); | |
310 | + url, | |
311 | + { | |
312 | + layers:tms.name, | |
313 | + transparent:true | |
314 | + }, | |
315 | + { | |
316 | + gutter:0, | |
317 | + isBaseLayer:false, | |
318 | + displayInLayerSwitcher:false, | |
319 | + opacity: 1, | |
320 | + visibility:true, | |
321 | + singleTile: true | |
322 | + } | |
323 | + ); | |
321 | 324 | //i3GEO.editorOL.mapa.addLayer(layer); |
322 | 325 | return layer; |
323 | 326 | }, |
... | ... | @@ -589,9 +592,11 @@ i3GEO.editorOL = { |
589 | 592 | //if(i3GEO.editorOL.layergrafico !== ""){return;} |
590 | 593 | var layers = [i3GEO.editorOL.layerAtivo()], |
591 | 594 | xy = lonlat.split(","), |
592 | - u = layers[0].url+"&request=getfeature&service=wfs&version=1.0.0"; | |
595 | + u = layers[0].url+"&REQUEST=getfeature&service=wfs&version=1.0.0"; | |
593 | 596 | u += "&OUTPUTFORMAT=gml2&typename="+layers[0].params.LAYERS; |
594 | - | |
597 | + //remove parametros nao desejados | |
598 | + u = u.replace("&cache=sim","&DESLIGACACHE=sim"); | |
599 | + u = u.replace("&Z=${z}&X=${x}&Y=${y}",""); | |
595 | 600 | //u += "&filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Point><gml:coordinates>"+lonlat+"</gml:coordinates></gml:Point></Intersects></Filter>"; |
596 | 601 | |
597 | 602 | xy[0] = xy[0] * 1; |
... | ... | @@ -679,20 +684,21 @@ i3GEO.editorOL = { |
679 | 684 | listaGeometriasSel: function(){ |
680 | 685 | var geos = i3GEO.editorOL.layergrafico.selectedFeatures, |
681 | 686 | n = geos.length, |
682 | - ins = "",i,a,w; | |
687 | + ins = "",i,a,w,g; | |
683 | 688 | for(i=0;i<n;i++){ |
684 | - ins += "<b>Geometria: "+i+"</b><br>"+geos[i].geometry+"<br><br>"; | |
689 | + g = geos[i]; | |
690 | + ins += "<b>Geometria: "+i+"</b><br>"+i3GEO.editorOL.google2wgs(g.geometry)+"<br><br>"; | |
685 | 691 | ins += "<b>Atributos: "+i+"</b><br>"; |
686 | - a = geos[i].attributes; | |
692 | + a = g.attributes; | |
687 | 693 | for(key in a){ |
688 | 694 | if(a[key]){ |
689 | 695 | ins += key+" = "+a[key]+"<br>"; |
690 | 696 | } |
691 | 697 | } |
692 | 698 | //lista os registros se for fruto de uma captura |
693 | - if(geos[i].attributes.registros){ | |
699 | + if(g.attributes.registros){ | |
694 | 700 | ins += "<b>Registros: "+i+"</b><br>"; |
695 | - a = geos[i].attributes.registros; | |
701 | + a = g.attributes.registros; | |
696 | 702 | for(key in a){ |
697 | 703 | if(a[key]){ |
698 | 704 | ins += key+" = "+a[key]+"<br>"; |
... | ... | @@ -718,7 +724,8 @@ i3GEO.editorOL = { |
718 | 724 | var registros = "", |
719 | 725 | valorunico = "", |
720 | 726 | nometema = $i("editorOLcomboTemaEditavel").value, |
721 | - key,tema,redesenha,p; | |
727 | + key="",tema,redesenha,p, | |
728 | + g = i3GEO.editorOL.google2wgs(geos[0].geometry); | |
722 | 729 | if(nometema == ""){ |
723 | 730 | return; |
724 | 731 | } |
... | ... | @@ -744,12 +751,12 @@ i3GEO.editorOL = { |
744 | 751 | //cria um novo registro |
745 | 752 | if(valorunico == ""){ |
746 | 753 | p = i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid; |
747 | - cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+geos[0].geometry); | |
754 | + cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+g); | |
748 | 755 | } |
749 | 756 | else{ |
750 | 757 | //atualiza a geometria |
751 | 758 | p = i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid; |
752 | - cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+geos[0].geometry); | |
759 | + cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+g); | |
753 | 760 | } |
754 | 761 | } |
755 | 762 | }, |
... | ... | @@ -939,7 +946,6 @@ i3GEO.editorOL = { |
939 | 946 | var lonlat = i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy), |
940 | 947 | lonlattexto = "<hr>", |
941 | 948 | formata; |
942 | - | |
943 | 949 | if( botoes.linha === true || botoes.ponto === true || botoes.poligono === true || botoes.edita === true){ |
944 | 950 | lonlattexto += "<pre><span style=font-size:12px;color:blue;cursor:pointer onclick='i3GEO.editorOL.captura(\""+lonlat.lon+","+lonlat.lat+"\")'>edita geometria</span></pre><br>"; |
945 | 951 | } |
... | ... | @@ -982,9 +988,9 @@ i3GEO.editorOL = { |
982 | 988 | i3GEO.editorOL.removeClone(); |
983 | 989 | }, |
984 | 990 | beforegetfeatureinfo: function(event){ |
985 | - var temp,ativo = [i3GEO.editorOL.layerAtivo()]; | |
991 | + var ativo = [i3GEO.editorOL.layerAtivo()]; | |
986 | 992 | //se for TMS tem de pegar o clone wms |
987 | - if(ativo[0].CLASS_NAME == "OpenLayers.Layer.TMS"){ | |
993 | + if(ativo[0].CLASS_NAME == "OpenLayers.Layer.TMS" || ativo[0].CLASS_NAME == "OpenLayers.Layer.OSM"){ | |
988 | 994 | ativo = [i3GEO.editorOL.layertms2wms(ativo[0])]; |
989 | 995 | } |
990 | 996 | event.object.layers = ativo; |
... | ... | @@ -1397,7 +1403,7 @@ i3GEO.editorOL = { |
1397 | 1403 | } |
1398 | 1404 | }); |
1399 | 1405 | // |
1400 | - //adiciona o painel ao mapa se alguma op��o foi inserida | |
1406 | + //adiciona o painel ao mapa se alguma opcao foi inserida | |
1401 | 1407 | // |
1402 | 1408 | if(adiciona === true){ |
1403 | 1409 | i3GEOpanelEditor.addControls(controles); |
... | ... | @@ -1935,5 +1941,15 @@ i3GEO.editorOL = { |
1935 | 1941 | desativaRodaDoMouse: function(){ |
1936 | 1942 | var controls = i3GEO.editorOL.mapa.getControlsByClass('OpenLayers.Control.Navigation'); |
1937 | 1943 | for(var i = 0; i<controls.length; ++i){controls[i].disableZoomWheel();} |
1944 | + }, | |
1945 | + google2wgs: function(obj){ | |
1946 | + if(i3GEO.Interface.openlayers.googleLike === true){ | |
1947 | + var projWGS84 = new OpenLayers.Projection("EPSG:4326"), | |
1948 | + proj900913 = new OpenLayers.Projection("EPSG:900913"); | |
1949 | + return obj.transform(proj900913, projWGS84); | |
1950 | + } | |
1951 | + else{ | |
1952 | + return obj; | |
1953 | + } | |
1938 | 1954 | } |
1939 | 1955 | }; | ... | ... |
mashups/openlayers_compacto.js
... | ... | @@ -3315,9 +3315,12 @@ return(layers[i]); |
3315 | 3315 | return false; |
3316 | 3316 | }, |
3317 | 3317 | layertms2wms: function(tms){ |
3318 | -var layer = new OpenLayers.Layer.WMS( | |
3318 | +var layer,url; | |
3319 | +url = tms.url.replace("&cache=sim","&DESLIGACACHE=sim"); | |
3320 | +url = url.replace("&Z=${z}&X=${x}&Y=${y}",""); | |
3321 | +layer = new OpenLayers.Layer.WMS( | |
3319 | 3322 | tms.layername+"_clone", |
3320 | -tms.url.replace("&cache=sim","&DESLIGACACHE=sim"), | |
3323 | +url, | |
3321 | 3324 | { |
3322 | 3325 | layers:tms.name, |
3323 | 3326 | transparent:true |
... | ... | @@ -3600,8 +3603,11 @@ captura: function(lonlat){ |
3600 | 3603 | //if(i3GEO.editorOL.layergrafico !== ""){return;} |
3601 | 3604 | var layers = [i3GEO.editorOL.layerAtivo()], |
3602 | 3605 | xy = lonlat.split(","), |
3603 | -u = layers[0].url+"&request=getfeature&service=wfs&version=1.0.0"; | |
3606 | +u = layers[0].url+"&REQUEST=getfeature&service=wfs&version=1.0.0"; | |
3604 | 3607 | u += "&OUTPUTFORMAT=gml2&typename="+layers[0].params.LAYERS; |
3608 | +//remove parametros nao desejados | |
3609 | +u = u.replace("&cache=sim","&DESLIGACACHE=sim"); | |
3610 | +u = u.replace("&Z=${z}&X=${x}&Y=${y}",""); | |
3605 | 3611 | //u += "&filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Point><gml:coordinates>"+lonlat+"</gml:coordinates></gml:Point></Intersects></Filter>"; |
3606 | 3612 | xy[0] = xy[0] * 1; |
3607 | 3613 | xy[1] = xy[1] * 1; |
... | ... | @@ -3687,20 +3693,21 @@ i3GEO.editorOL.processageo("converteSHP"); |
3687 | 3693 | listaGeometriasSel: function(){ |
3688 | 3694 | var geos = i3GEO.editorOL.layergrafico.selectedFeatures, |
3689 | 3695 | n = geos.length, |
3690 | -ins = "",i,a,w; | |
3696 | +ins = "",i,a,w,g; | |
3691 | 3697 | for(i=0;i<n;i++){ |
3692 | -ins += "<b>Geometria: "+i+"</b><br>"+geos[i].geometry+"<br><br>"; | |
3698 | +g = geos[i]; | |
3699 | +ins += "<b>Geometria: "+i+"</b><br>"+i3GEO.editorOL.google2wgs(g.geometry)+"<br><br>"; | |
3693 | 3700 | ins += "<b>Atributos: "+i+"</b><br>"; |
3694 | -a = geos[i].attributes; | |
3701 | +a = g.attributes; | |
3695 | 3702 | for(key in a){ |
3696 | 3703 | if(a[key]){ |
3697 | 3704 | ins += key+" = "+a[key]+"<br>"; |
3698 | 3705 | } |
3699 | 3706 | } |
3700 | 3707 | //lista os registros se for fruto de uma captura |
3701 | -if(geos[i].attributes.registros){ | |
3708 | +if(g.attributes.registros){ | |
3702 | 3709 | ins += "<b>Registros: "+i+"</b><br>"; |
3703 | -a = geos[i].attributes.registros; | |
3710 | +a = g.attributes.registros; | |
3704 | 3711 | for(key in a){ |
3705 | 3712 | if(a[key]){ |
3706 | 3713 | ins += key+" = "+a[key]+"<br>"; |
... | ... | @@ -3726,7 +3733,8 @@ if(geos[0].geometry){ |
3726 | 3733 | var registros = "", |
3727 | 3734 | valorunico = "", |
3728 | 3735 | nometema = $i("editorOLcomboTemaEditavel").value, |
3729 | -key,tema,redesenha,p; | |
3736 | +key="",tema,redesenha,p, | |
3737 | +g = i3GEO.editorOL.google2wgs(geos[0].geometry); | |
3730 | 3738 | if(nometema == ""){ |
3731 | 3739 | return; |
3732 | 3740 | } |
... | ... | @@ -3751,12 +3759,12 @@ i3GEO.janela.AGUARDEMODAL = false; |
3751 | 3759 | //cria um novo registro |
3752 | 3760 | if(valorunico == ""){ |
3753 | 3761 | p = i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid; |
3754 | -cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+geos[0].geometry); | |
3762 | +cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+g); | |
3755 | 3763 | } |
3756 | 3764 | else{ |
3757 | 3765 | //atualiza a geometria |
3758 | 3766 | p = i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid; |
3759 | -cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+geos[0].geometry); | |
3767 | +cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+g); | |
3760 | 3768 | } |
3761 | 3769 | } |
3762 | 3770 | }, |
... | ... | @@ -3988,9 +3996,9 @@ true |
3988 | 3996 | i3GEO.editorOL.removeClone(); |
3989 | 3997 | }, |
3990 | 3998 | beforegetfeatureinfo: function(event){ |
3991 | -var temp,ativo = [i3GEO.editorOL.layerAtivo()]; | |
3999 | +var ativo = [i3GEO.editorOL.layerAtivo()]; | |
3992 | 4000 | //se for TMS tem de pegar o clone wms |
3993 | -if(ativo[0].CLASS_NAME == "OpenLayers.Layer.TMS"){ | |
4001 | +if(ativo[0].CLASS_NAME == "OpenLayers.Layer.TMS" || ativo[0].CLASS_NAME == "OpenLayers.Layer.OSM"){ | |
3994 | 4002 | ativo = [i3GEO.editorOL.layertms2wms(ativo[0])]; |
3995 | 4003 | } |
3996 | 4004 | event.object.layers = ativo; |
... | ... | @@ -4402,7 +4410,7 @@ if(document.getElementById("panellistagEditor")) |
4402 | 4410 | } |
4403 | 4411 | }); |
4404 | 4412 | // |
4405 | -//adiciona o painel ao mapa se alguma op��o foi inserida | |
4413 | +//adiciona o painel ao mapa se alguma opcao foi inserida | |
4406 | 4414 | // |
4407 | 4415 | if(adiciona === true){ |
4408 | 4416 | i3GEOpanelEditor.addControls(controles); |
... | ... | @@ -4934,5 +4942,15 @@ ls.maximizeDiv.click(); |
4934 | 4942 | desativaRodaDoMouse: function(){ |
4935 | 4943 | var controls = i3GEO.editorOL.mapa.getControlsByClass('OpenLayers.Control.Navigation'); |
4936 | 4944 | for(var i = 0; i<controls.length; ++i){controls[i].disableZoomWheel();} |
4945 | +}, | |
4946 | +google2wgs: function(obj){ | |
4947 | +if(i3GEO.Interface.openlayers.googleLike === true){ | |
4948 | +var projWGS84 = new OpenLayers.Projection("EPSG:4326"), | |
4949 | +proj900913 = new OpenLayers.Projection("EPSG:900913"); | |
4950 | +return obj.transform(proj900913, projWGS84); | |
4951 | +} | |
4952 | +else{ | |
4953 | +return obj; | |
4954 | +} | |
4937 | 4955 | } |
4938 | 4956 | }; | ... | ... |
mashups/openlayers_compacto.js.php
... | ... | @@ -3315,9 +3315,12 @@ return(layers[i]); |
3315 | 3315 | return false; |
3316 | 3316 | }, |
3317 | 3317 | layertms2wms: function(tms){ |
3318 | -var layer = new OpenLayers.Layer.WMS( | |
3318 | +var layer,url; | |
3319 | +url = tms.url.replace("&cache=sim","&DESLIGACACHE=sim"); | |
3320 | +url = url.replace("&Z=${z}&X=${x}&Y=${y}",""); | |
3321 | +layer = new OpenLayers.Layer.WMS( | |
3319 | 3322 | tms.layername+"_clone", |
3320 | -tms.url.replace("&cache=sim","&DESLIGACACHE=sim"), | |
3323 | +url, | |
3321 | 3324 | { |
3322 | 3325 | layers:tms.name, |
3323 | 3326 | transparent:true |
... | ... | @@ -3600,8 +3603,11 @@ captura: function(lonlat){ |
3600 | 3603 | //if(i3GEO.editorOL.layergrafico !== ""){return;} |
3601 | 3604 | var layers = [i3GEO.editorOL.layerAtivo()], |
3602 | 3605 | xy = lonlat.split(","), |
3603 | -u = layers[0].url+"&request=getfeature&service=wfs&version=1.0.0"; | |
3606 | +u = layers[0].url+"&REQUEST=getfeature&service=wfs&version=1.0.0"; | |
3604 | 3607 | u += "&OUTPUTFORMAT=gml2&typename="+layers[0].params.LAYERS; |
3608 | +//remove parametros nao desejados | |
3609 | +u = u.replace("&cache=sim","&DESLIGACACHE=sim"); | |
3610 | +u = u.replace("&Z=${z}&X=${x}&Y=${y}",""); | |
3605 | 3611 | //u += "&filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Point><gml:coordinates>"+lonlat+"</gml:coordinates></gml:Point></Intersects></Filter>"; |
3606 | 3612 | xy[0] = xy[0] * 1; |
3607 | 3613 | xy[1] = xy[1] * 1; |
... | ... | @@ -3687,20 +3693,21 @@ i3GEO.editorOL.processageo("converteSHP"); |
3687 | 3693 | listaGeometriasSel: function(){ |
3688 | 3694 | var geos = i3GEO.editorOL.layergrafico.selectedFeatures, |
3689 | 3695 | n = geos.length, |
3690 | -ins = "",i,a,w; | |
3696 | +ins = "",i,a,w,g; | |
3691 | 3697 | for(i=0;i<n;i++){ |
3692 | -ins += "<b>Geometria: "+i+"</b><br>"+geos[i].geometry+"<br><br>"; | |
3698 | +g = geos[i]; | |
3699 | +ins += "<b>Geometria: "+i+"</b><br>"+i3GEO.editorOL.google2wgs(g.geometry)+"<br><br>"; | |
3693 | 3700 | ins += "<b>Atributos: "+i+"</b><br>"; |
3694 | -a = geos[i].attributes; | |
3701 | +a = g.attributes; | |
3695 | 3702 | for(key in a){ |
3696 | 3703 | if(a[key]){ |
3697 | 3704 | ins += key+" = "+a[key]+"<br>"; |
3698 | 3705 | } |
3699 | 3706 | } |
3700 | 3707 | //lista os registros se for fruto de uma captura |
3701 | -if(geos[i].attributes.registros){ | |
3708 | +if(g.attributes.registros){ | |
3702 | 3709 | ins += "<b>Registros: "+i+"</b><br>"; |
3703 | -a = geos[i].attributes.registros; | |
3710 | +a = g.attributes.registros; | |
3704 | 3711 | for(key in a){ |
3705 | 3712 | if(a[key]){ |
3706 | 3713 | ins += key+" = "+a[key]+"<br>"; |
... | ... | @@ -3726,7 +3733,8 @@ if(geos[0].geometry){ |
3726 | 3733 | var registros = "", |
3727 | 3734 | valorunico = "", |
3728 | 3735 | nometema = $i("editorOLcomboTemaEditavel").value, |
3729 | -key,tema,redesenha,p; | |
3736 | +key="",tema,redesenha,p, | |
3737 | +g = i3GEO.editorOL.google2wgs(geos[0].geometry); | |
3730 | 3738 | if(nometema == ""){ |
3731 | 3739 | return; |
3732 | 3740 | } |
... | ... | @@ -3751,12 +3759,12 @@ i3GEO.janela.AGUARDEMODAL = false; |
3751 | 3759 | //cria um novo registro |
3752 | 3760 | if(valorunico == ""){ |
3753 | 3761 | p = i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid; |
3754 | -cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+geos[0].geometry); | |
3762 | +cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+g); | |
3755 | 3763 | } |
3756 | 3764 | else{ |
3757 | 3765 | //atualiza a geometria |
3758 | 3766 | p = i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid; |
3759 | -cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+geos[0].geometry); | |
3767 | +cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+g); | |
3760 | 3768 | } |
3761 | 3769 | } |
3762 | 3770 | }, |
... | ... | @@ -3988,9 +3996,9 @@ true |
3988 | 3996 | i3GEO.editorOL.removeClone(); |
3989 | 3997 | }, |
3990 | 3998 | beforegetfeatureinfo: function(event){ |
3991 | -var temp,ativo = [i3GEO.editorOL.layerAtivo()]; | |
3999 | +var ativo = [i3GEO.editorOL.layerAtivo()]; | |
3992 | 4000 | //se for TMS tem de pegar o clone wms |
3993 | -if(ativo[0].CLASS_NAME == "OpenLayers.Layer.TMS"){ | |
4001 | +if(ativo[0].CLASS_NAME == "OpenLayers.Layer.TMS" || ativo[0].CLASS_NAME == "OpenLayers.Layer.OSM"){ | |
3994 | 4002 | ativo = [i3GEO.editorOL.layertms2wms(ativo[0])]; |
3995 | 4003 | } |
3996 | 4004 | event.object.layers = ativo; |
... | ... | @@ -4402,7 +4410,7 @@ if(document.getElementById("panellistagEditor")) |
4402 | 4410 | } |
4403 | 4411 | }); |
4404 | 4412 | // |
4405 | -//adiciona o painel ao mapa se alguma op��o foi inserida | |
4413 | +//adiciona o painel ao mapa se alguma opcao foi inserida | |
4406 | 4414 | // |
4407 | 4415 | if(adiciona === true){ |
4408 | 4416 | i3GEOpanelEditor.addControls(controles); |
... | ... | @@ -4934,6 +4942,16 @@ ls.maximizeDiv.click(); |
4934 | 4942 | desativaRodaDoMouse: function(){ |
4935 | 4943 | var controls = i3GEO.editorOL.mapa.getControlsByClass('OpenLayers.Control.Navigation'); |
4936 | 4944 | for(var i = 0; i<controls.length; ++i){controls[i].disableZoomWheel();} |
4945 | +}, | |
4946 | +google2wgs: function(obj){ | |
4947 | +if(i3GEO.Interface.openlayers.googleLike === true){ | |
4948 | +var projWGS84 = new OpenLayers.Projection("EPSG:4326"), | |
4949 | +proj900913 = new OpenLayers.Projection("EPSG:900913"); | |
4950 | +return obj.transform(proj900913, projWGS84); | |
4951 | +} | |
4952 | +else{ | |
4953 | +return obj; | |
4954 | +} | |
4937 | 4955 | } |
4938 | 4956 | }; |
4939 | 4957 | ... | ... |
temas/_lbairros.map
... | ... | @@ -2,41 +2,47 @@ MAP |
2 | 2 | FONTSET "../symbols/fontes.txt" |
3 | 3 | SYMBOLSET "../symbols/simbolos.sym" |
4 | 4 | LAYER |
5 | - CONNECTION "user=postgres password=postgres dbname=geosaude host=localhost port=5432" | |
5 | + CONNECTION "user=postgres password=postgres dbname=i3geosaude host=localhost port=5432" | |
6 | 6 | CONNECTIONTYPE POSTGIS |
7 | 7 | DATA "the_geom from (select * from i3geo_metaestat.bairros) as foo using unique gid using srid=4326" |
8 | 8 | METADATA |
9 | 9 | "METAESTAT_ID_MEDIDA_VARIAVEL" "" |
10 | 10 | "ID_MEDIDA_VARIAVEL" "" |
11 | + "cache" "" | |
11 | 12 | "ltempoitemimagem" "" |
12 | - "cache" "SIM" | |
13 | - "ltempoitemdescricao" "" | |
14 | 13 | "CLASSE" "SIM" |
15 | - "ltempoiteminicio" "" | |
14 | + "ltempoitemdescricao" "" | |
16 | 15 | "palletestep" "" |
17 | - "ltempoitemtip" "" | |
16 | + "ltempoiteminicio" "" | |
18 | 17 | "permitekmz" "nao" |
19 | - "ltempoitemtitulo" "" | |
18 | + "ltempoitemtip" "" | |
20 | 19 | "description_template" "" |
20 | + "ltempoitemtitulo" "" | |
21 | + "EDITAVEL" "SIM" | |
21 | 22 | "ltempoitemlink" "" |
22 | 23 | "METAESTAT_CODIGO_TIPO_REGIAO" "" |
23 | 24 | "palletefile" "" |
24 | - "ltempoformatodata" "" | |
25 | 25 | "permitedownload" "sim" |
26 | + "ltempoformatodata" "" | |
26 | 27 | "ltempoitemicone" "" |
27 | 28 | "metaestat" "" |
29 | + "ESQUEMATABELAEDITAVEL" "i3geo_metaestat" | |
28 | 30 | "itembuscarapida" "no_bairro" |
29 | - "permitekml" "sim" | |
30 | 31 | "permiteogc" "sim" |
31 | - "convcaracter" "" | |
32 | + "permitekml" "sim" | |
32 | 33 | "TEMA" "Bairros IBGE" |
33 | - "ltempoconvencode" "" | |
34 | + "convcaracter" "" | |
35 | + "COLUNAGEOMETRIA" "the_geom" | |
36 | + "COLUNAIDUNICO" "teste" | |
34 | 37 | "editorsql" "" |
38 | + "ltempoconvencode" "" | |
39 | + "TABELAEDITAVEL" "bairros" | |
35 | 40 | "ltempoitemfim" "" |
36 | 41 | END # METADATA |
37 | 42 | NAME "_lbairros" |
38 | 43 | STATUS DEFAULT |
39 | 44 | TEMPLATE "none.htm" |
45 | + TILEITEM "location" | |
40 | 46 | TYPE POLYGON |
41 | 47 | UNITS METERS |
42 | 48 | CLASS | ... | ... |