Commit 39d97e37376cea5cad1a4fd67c3a5c29a6fb73f1
1 parent
59f3254d
Exists in
master
and in
7 other branches
--no commit message
Showing
6 changed files
with
58 additions
and
24 deletions
Show diff stats
admin/admin.db
No preview for this file type
ferramentas/storymap/default.php
| 1 | <?php | 1 | <?php |
| 2 | -//TODO incluir camadas do i3geo como WMS | 2 | +//exemplo: http://localhost/i3geo/ferramentas/storymap/default.php?tema=_lreal&layers=_lbiomashp _llocali |
| 3 | +//temas do i3geo podem ser incluidos em &layers separados por espacos | ||
| 3 | if(empty($_GET["tema"])){ | 4 | if(empty($_GET["tema"])){ |
| 4 | echo "&tema nao definido"; | 5 | echo "&tema nao definido"; |
| 5 | exit; | 6 | exit; |
| @@ -9,6 +10,14 @@ | @@ -9,6 +10,14 @@ | ||
| 9 | echo "&tema nao existe"; | 10 | echo "&tema nao existe"; |
| 10 | exit; | 11 | exit; |
| 11 | } | 12 | } |
| 13 | + //$map_type = "stamen:watercolor"; | ||
| 14 | + $map_type = "stamen:toner-lite"; | ||
| 15 | + if($_GET["layers"] != ""){ | ||
| 16 | + $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); | ||
| 17 | + $url = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].":". $_SERVER['SERVER_PORT']; | ||
| 18 | + $url .= str_replace("/ferramentas/storymap/default.php","",$_SERVER["PHP_SELF"]); | ||
| 19 | + $map_type = $url."/ogc.php?tema=".strip_tags($_GET["layers"])."&DESLIGACACHE=&Z={z}&X={x}&Y={y}"; | ||
| 20 | + } | ||
| 12 | ?> | 21 | ?> |
| 13 | <!DOCTYPE html> | 22 | <!DOCTYPE html> |
| 14 | <html lang="en"> | 23 | <html lang="en"> |
| @@ -63,23 +72,26 @@ html, body { | @@ -63,23 +72,26 @@ html, body { | ||
| 63 | <!-- JavaScript--> | 72 | <!-- JavaScript--> |
| 64 | <script src="../../pacotes/knightlab/StoryMapJS/compiled/js/storymap.js"></script> | 73 | <script src="../../pacotes/knightlab/StoryMapJS/compiled/js/storymap.js"></script> |
| 65 | <script> | 74 | <script> |
| 75 | + //http://localhost/ogc.php?tema=_llocali&DESLIGACACHE=&tms=/_llocali/{z}/{x}/{y}.png | ||
| 66 | VCO.Language = { | 76 | VCO.Language = { |
| 67 | - name: "Português", | ||
| 68 | - lang: "pt", | ||
| 69 | - messages: { | ||
| 70 | - loading: "carregando", | ||
| 71 | - wikipedia: "da Wikipedia, a enciclopédia livre", | ||
| 72 | - start: "Explore" | ||
| 73 | - }, | ||
| 74 | - buttons: { | ||
| 75 | - map_overview: "vista geral do mapa", | ||
| 76 | - overview: "vista geral", | ||
| 77 | - backtostart: "voltar ao começo", | ||
| 78 | - collapse_toggle: "ocultar o mapa", | ||
| 79 | - uncollapse_toggle: "mostrar o mapa" | ||
| 80 | - } | ||
| 81 | -}; | 77 | + name: "Português", |
| 78 | + lang: "pt", | ||
| 79 | + messages: { | ||
| 80 | + loading: "carregando", | ||
| 81 | + wikipedia: "da Wikipedia, a enciclopédia livre", | ||
| 82 | + start: "Explore" | ||
| 83 | + }, | ||
| 84 | + buttons: { | ||
| 85 | + map_overview: "vista geral do mapa", | ||
| 86 | + overview: "vista geral", | ||
| 87 | + backtostart: "voltar ao começo", | ||
| 88 | + collapse_toggle: "ocultar o mapa", | ||
| 89 | + uncollapse_toggle: "mostrar o mapa" | ||
| 90 | + } | ||
| 91 | + }; | ||
| 92 | + | ||
| 82 | var storymap = new VCO.StoryMap('storymap', '../../json.php?tema=<?php echo strip_tags($_GET["tema"]);?>&format=storymap&', { | 93 | var storymap = new VCO.StoryMap('storymap', '../../json.php?tema=<?php echo strip_tags($_GET["tema"]);?>&format=storymap&', { |
| 94 | + "map_type": "<?php echo $map_type;?>", | ||
| 83 | "show_lines": false | 95 | "show_lines": false |
| 84 | }); | 96 | }); |
| 85 | window.onresize = function(event) { | 97 | window.onresize = function(event) { |
ferramentas/storymap/index.js
| @@ -180,7 +180,7 @@ i3GEOF.storymap = | @@ -180,7 +180,7 @@ i3GEOF.storymap = | ||
| 180 | var b = new YAHOO.widget.Button("i3GEOstobotao1", { | 180 | var b = new YAHOO.widget.Button("i3GEOstobotao1", { |
| 181 | onclick : { | 181 | onclick : { |
| 182 | fn : function() { | 182 | fn : function() { |
| 183 | - window.open(i3GEO.configura.locaplic + "/ferramentas/storymap/default.php?tema=" + i3GEOF.storymap.tema); | 183 | + window.open(i3GEO.configura.locaplic + "/ferramentas/storymap/default.php?layers=&tema=" + i3GEOF.storymap.tema); |
| 184 | } | 184 | } |
| 185 | } | 185 | } |
| 186 | }); | 186 | }); |
mashups/osm.php
| @@ -357,7 +357,13 @@ if($temas != ""){ | @@ -357,7 +357,13 @@ if($temas != ""){ | ||
| 357 | } | 357 | } |
| 358 | // nesse caso o layer e adicionado como TMS | 358 | // nesse caso o layer e adicionado como TMS |
| 359 | // tms leva os parametros do TMS | 359 | // tms leva os parametros do TMS |
| 360 | - $objOpenLayers[] = 'new OpenLayers.Layer.TMS("'.$tituloLayer.'", "'.$servidor.'?'.$nocache.'tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'",{'.$teffect.' tileOrigin: new OpenLayers.LonLat(-180, -90),opacity:'.$opacidade.',serviceVersion:"&tms=",visibility:'.$visivel.',isBaseLayer:'.$ebase.',layername:"'.$nomeLayer.'",type:"png", ferramentas :'.$ferramentas.'})'; | 360 | + //$objOpenLayers[] = 'new OpenLayers.Layer.TMS("'.$tituloLayer.'", "'.$servidor.'?'.$nocache.'tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'",{'.$teffect.' tileOrigin: new OpenLayers.LonLat(-180, -90),opacity:'.$opacidade.',serviceVersion:"&tms=",visibility:'.$visivel.',isBaseLayer:'.$ebase.',layername:"'.$nomeLayer.'",type:"png", ferramentas :'.$ferramentas.'})'; |
| 361 | + $objOpenLayers[] = 'new OpenLayers.Layer.OSM("'.$tituloLayer.'", "'.$servidor.'?'.$nocache.'tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&Z=${z}&X=${x}&Y=${y}",{'.$teffect.' tileOrigin: new OpenLayers.LonLat(-180, -90),opacity:'.$opacidade.',serviceVersion:"&tms=",visibility:'.$visivel.',isBaseLayer:'.$ebase.',layername:"'.$nomeLayer.'",type:"png", ferramentas :'.$ferramentas.'})'; | ||
| 362 | + //layer = new OpenLayers.Layer.OSM(camada.name, urllayer + "&Z=${z}&X=${x}&Y=${y}", { | ||
| 363 | + // isBaseLayer : false | ||
| 364 | + //}); | ||
| 365 | + | ||
| 366 | + | ||
| 361 | // cria um clone WMS para efeitos de getfeatureinfo | 367 | // cria um clone WMS para efeitos de getfeatureinfo |
| 362 | $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$tituloLayer.'", "'.$servidor.'?'.$nocache.'tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&",{cloneTMS:"'.$nomeLayer.'",layers:"'.$nomeLayer.'",transparent: "true", format: "image/png"},{displayInLayerSwitcher:false,transitionEffect : null,singleTile:true,visibility:false,isBaseLayer:false, ferramentas :'.$ferramentas.'})'; | 368 | $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$tituloLayer.'", "'.$servidor.'?'.$nocache.'tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&",{cloneTMS:"'.$nomeLayer.'",layers:"'.$nomeLayer.'",transparent: "true", format: "image/png"},{displayInLayerSwitcher:false,transitionEffect : null,singleTile:true,visibility:false,isBaseLayer:false, ferramentas :'.$ferramentas.'})'; |
| 363 | } | 369 | } |
ogc.php
| @@ -709,14 +709,29 @@ if(isset($_GET["tms"])){ | @@ -709,14 +709,29 @@ if(isset($_GET["tms"])){ | ||
| 709 | if(isset($_GET["Z"]) && isset($_GET["X"])){ | 709 | if(isset($_GET["Z"]) && isset($_GET["X"])){ |
| 710 | $x = $_GET["X"]; | 710 | $x = $_GET["X"]; |
| 711 | $y = $_GET["Y"]; | 711 | $y = $_GET["Y"]; |
| 712 | - $z = $_GET["Z"]; | ||
| 713 | - $layer0 = $oMap->getlayer(0); | 712 | + $z = $_GET["Z"]; |
| 713 | + | ||
| 714 | + if(file_exists($tema)){ | ||
| 715 | + $layer0 = $oMap->getlayer(0); | ||
| 716 | + $layer0->set("status",MS_DEFAULT); | ||
| 717 | + $layer0->setProjection("proj=latlong,a=6378137,b=6378137"); | ||
| 718 | + } | ||
| 719 | + else{ | ||
| 720 | + //pode ter mais de um tema | ||
| 721 | + $lista = explode(" ",$tema); | ||
| 722 | + foreach($lista as $nomeLayer){ | ||
| 723 | + $layer0 = $oMap->getlayerbyname($nomeLayer); | ||
| 724 | + $layer0->set("status",MS_DEFAULT); | ||
| 725 | + $layer0->setProjection("proj=latlong,a=6378137,b=6378137"); | ||
| 726 | + } | ||
| 727 | + } | ||
| 714 | // | 728 | // |
| 715 | //numero de pixels que serao considerados para corte da imagem no caso de cache ativo e tema de pontos | 729 | //numero de pixels que serao considerados para corte da imagem no caso de cache ativo e tema de pontos |
| 716 | // | 730 | // |
| 717 | if ($layer0->getmetadata("cortepixels") != ""){ | 731 | if ($layer0->getmetadata("cortepixels") != ""){ |
| 718 | $cortePixels = $layer0->getmetadata("cortepixels"); | 732 | $cortePixels = $layer0->getmetadata("cortepixels"); |
| 719 | } | 733 | } |
| 734 | + | ||
| 720 | if($cache == true){ | 735 | if($cache == true){ |
| 721 | carregaCacheImagem($cachedir,$nomeMapfileTmp,"/googlemaps/$layer0->name/$z/$x/$y"); | 736 | carregaCacheImagem($cachedir,$nomeMapfileTmp,"/googlemaps/$layer0->name/$z/$x/$y"); |
| 722 | } | 737 | } |
| @@ -742,9 +757,10 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ | @@ -742,9 +757,10 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ | ||
| 742 | $oMap->setsize(256,256); | 757 | $oMap->setsize(256,256); |
| 743 | $oMap->setExtent($poPoint1->x,$poPoint1->y,$poPoint2->x,$poPoint2->y); | 758 | $oMap->setExtent($poPoint1->x,$poPoint1->y,$poPoint2->x,$poPoint2->y); |
| 744 | 759 | ||
| 745 | - $oMap->getlayer(0)->set("status",MS_DEFAULT); | 760 | + |
| 761 | + | ||
| 746 | $oMap->setProjection("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"); | 762 | $oMap->setProjection("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"); |
| 747 | - $layer0->setProjection("proj=latlong,a=6378137,b=6378137"); | 763 | + |
| 748 | // | 764 | // |
| 749 | //se o layer foi marcado para corte altera os parametros para ampliar o mapa | 765 | //se o layer foi marcado para corte altera os parametros para ampliar o mapa |
| 750 | //antes de gerar a imagem | 766 | //antes de gerar a imagem |
temas/_lbiomashp.map
| @@ -11,7 +11,7 @@ MAP | @@ -11,7 +11,7 @@ MAP | ||
| 11 | "CLASSE" "SIM" | 11 | "CLASSE" "SIM" |
| 12 | "permitekmz" "nao" | 12 | "permitekmz" "nao" |
| 13 | "ITENSDESC" "Bioma Teste de acentuação" | 13 | "ITENSDESC" "Bioma Teste de acentuação" |
| 14 | - #"TILES" "NAO" | 14 | + "TILES" "SIM" |
| 15 | "ESCALA" "1000000" | 15 | "ESCALA" "1000000" |
| 16 | "METAESTAT_CODIGO_TIPO_REGIAO" "" | 16 | "METAESTAT_CODIGO_TIPO_REGIAO" "" |
| 17 | "permitedownload" "sim" | 17 | "permitedownload" "sim" |
| @@ -31,7 +31,7 @@ MAP | @@ -31,7 +31,7 @@ MAP | ||
| 31 | STATUS OFF | 31 | STATUS OFF |
| 32 | TEMPLATE "none.htm" | 32 | TEMPLATE "none.htm" |
| 33 | TILEITEM "location" | 33 | TILEITEM "location" |
| 34 | - OPACITY 40 | 34 | + OPACITY 100 |
| 35 | TYPE POLYGON | 35 | TYPE POLYGON |
| 36 | UNITS METERS | 36 | UNITS METERS |
| 37 | CLASS | 37 | CLASS |