Commit 79208fce176805d9fd203d2f583b0f37cd5ba91d
1 parent
057adc91
Exists in
master
and in
7 other branches
Modificação do mashup openlayers OSM
Showing
3 changed files
with
2028 additions
and
768 deletions
Show diff stats
mashups/openlayers.php
| @@ -15,6 +15,7 @@ if(count($parurl) == 0){ | @@ -15,6 +15,7 @@ if(count($parurl) == 0){ | ||
| 15 | ajuda(); | 15 | ajuda(); |
| 16 | exit; | 16 | exit; |
| 17 | } | 17 | } |
| 18 | + | ||
| 18 | if (isset($parurl["opacidade"])) { | 19 | if (isset($parurl["opacidade"])) { |
| 19 | $opacidade = $parurl["opacidade"] * 1; | 20 | $opacidade = $parurl["opacidade"] * 1; |
| 20 | } else { | 21 | } else { |
| @@ -1122,7 +1123,7 @@ function ajuda() | @@ -1122,7 +1123,7 @@ function ajuda() | ||
| 1122 | //$('.iconeGuiaMovel').tooltip('show'); | 1123 | //$('.iconeGuiaMovel').tooltip('show'); |
| 1123 | $("#i3GEOguiaMovelConteudo").mCustomScrollbar({scrollbarPosition: "outside",theme:"inset-2-dark"}); | 1124 | $("#i3GEOguiaMovelConteudo").mCustomScrollbar({scrollbarPosition: "outside",theme:"inset-2-dark"}); |
| 1124 | adicionaBotoesEditor(); | 1125 | adicionaBotoesEditor(); |
| 1125 | - $i("openlayers").style.backgroundColor = "rgb(255,255,255)"; | 1126 | + $i("openlayers").style.backgroundColor = "rgb(245,245,245)"; |
| 1126 | }, | 1127 | }, |
| 1127 | //parametros de configuracao de diferentes componentes do mapa, como o catalogo de temas, balao de info, etc | 1128 | //parametros de configuracao de diferentes componentes do mapa, como o catalogo de temas, balao de info, etc |
| 1128 | components : { | 1129 | components : { |
mashups/osm.php
| 1 | -jeto <?php | 1 | +<?php |
| 2 | /** | 2 | /** |
| 3 | * DESLIGACACHE (opcional) {sim|nao} - forca a nao usar o cache de imagens qd | 3 | * DESLIGACACHE (opcional) {sim|nao} - forca a nao usar o cache de imagens qd |
| 4 | * definido como "sim", do contrário, o uso ou não do cache | 4 | * definido como "sim", do contrário, o uso ou não do cache |
| 5 | * será definido automaticamente | 5 | * será definido automaticamente |
| 6 | */ | 6 | */ |
| 7 | -include_once(dirname(__FILE__)."/../ms_configura.php"); | ||
| 8 | -include_once(dirname(__FILE__)."/../classesphp/sani_request.php"); | ||
| 9 | -include_once(dirname(__FILE__)."/../classesphp/carrega_ext.php"); | ||
| 10 | -include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); | ||
| 11 | -//error_reporting(0); | ||
| 12 | -//variaveis utilizadas | ||
| 13 | -$parurl = array_merge($_GET,$_POST); | ||
| 14 | -$desligacache = $parurl["desligacache"]; | ||
| 15 | -$opacidade = $parurl["opacidade"]; | ||
| 16 | -$nocache = $parurl["nocache"]; | ||
| 17 | -$restauramapa = $parurl["restauramapa"]; | ||
| 18 | -$mapext = $parurl["mapext"]; | ||
| 19 | -$temas = $parurl["temas"]; | ||
| 20 | -$layers = $parurl["layers"]; | ||
| 21 | -$layerDefault = $parurl["layerDefault"]; | ||
| 22 | - | ||
| 23 | -$altura = $parurl["altura"]; | ||
| 24 | -$largura = $parurl["largura"]; | ||
| 25 | -$controles = $parurl["controles"]; | ||
| 26 | -$botoes = $parurl["botoes"]; | ||
| 27 | -$fundo = $parurl["fundo"]; | ||
| 28 | -$visiveis = $parurl["visiveis"]; | ||
| 29 | -$servidor = $parurl["servidor"]; | ||
| 30 | -$kml = $parurl["kml"]; | ||
| 31 | -$numzoomlevels = $parurl["numzoomlevels"]; | ||
| 32 | -$minresolution = $parurl["minresolution"]; | ||
| 33 | -$maxextent = $parurl["maxextent"]; | ||
| 34 | - | ||
| 35 | -$pontos = $parurl["pontos"]; | ||
| 36 | -$marca = $parurl["marca"]; | ||
| 37 | -$tiles = $parurl["tiles"]; | ||
| 38 | -$incluilayergrafico = $parurl["incluilayergrafico"]; | ||
| 39 | -$ativalayerswicther = $parurl["ativalayerswicther"]; | ||
| 40 | -$ativarodadomouse = $parurl["ativarodadomouse"]; | ||
| 41 | -$legendahtml = $parurl["legendahtml"]; | ||
| 42 | -$nocache = $parurl["nocache"]; | ||
| 43 | - | ||
| 44 | -//cria as pastas temporarias caso nao existam | ||
| 45 | -if (! file_exists ( $dir_tmp )) { | ||
| 46 | - @mkdir ( $dir_tmp, 0744 ); | ||
| 47 | -} | ||
| 48 | -if (file_exists ( $dir_tmp )) { | ||
| 49 | - if (! file_exists ( $dir_tmp . "/comum" )) { | ||
| 50 | - @mkdir ( $dir_tmp . "/comum", 0744 ); | ||
| 51 | - } | ||
| 52 | - if (! file_exists ( $dir_tmp . "/saiku-datasources" )) { | ||
| 53 | - @mkdir ( $dir_tmp . "/saiku-datasources", 0744 ); | ||
| 54 | - chmod ( $dir_tmp . "/saiku-datasources", 0744 ); | ||
| 55 | - } | ||
| 56 | - if (! file_exists ( $dir_tmp . "/cache" )) { | ||
| 57 | - @mkdir ( $dir_tmp . "/cache", 0744 ); | ||
| 58 | - chmod ( $dir_tmp . "/cache", 0744 ); | ||
| 59 | - } | ||
| 60 | - if (! file_exists ( $dir_tmp . "/cache/googlemaps" )) { | ||
| 61 | - @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 ); | ||
| 62 | - chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); | ||
| 63 | - } | ||
| 64 | -} | ||
| 65 | -if(!empty($desligacache)){ | ||
| 66 | - $DESLIGACACHE = $desligacache; | ||
| 67 | -} | ||
| 68 | -if(empty($opacidade)){ | ||
| 69 | - $opacidade = 1; | 7 | +include_once (dirname(__FILE__) . "/../ms_configura.php"); |
| 8 | +include_once (dirname(__FILE__) . "/../classesphp/sani_request.php"); | ||
| 9 | +include_once (dirname(__FILE__) . "/../classesphp/carrega_ext.php"); | ||
| 10 | +include_once (dirname(__FILE__) . "/../classesphp/funcoes_gerais.php"); | ||
| 11 | +// error_reporting(0); | ||
| 12 | +// variaveis utilizadas | ||
| 13 | +$parurl = array_merge($_GET, $_POST); | ||
| 14 | +if(count($parurl) == 0){ | ||
| 15 | + ajuda(); | ||
| 16 | + exit; | ||
| 70 | } | 17 | } |
| 71 | -// | ||
| 72 | -//verifica se em cada camada deve ser inserido um parametro aleatorio para evitar cache de imagem do lado do cliente | ||
| 73 | -// | ||
| 74 | -if($nocache == "sim"){ | ||
| 75 | - $nocache = "a".mt_rand(0, 1000)."&"; | 18 | +if(!isset($parurl["fundo"])){ |
| 19 | + $parurl["fundo"] = "osm"; | ||
| 76 | } | 20 | } |
| 77 | -else{ | ||
| 78 | - $nocache = ""; | 21 | +if (isset($parurl["opacidade"])) { |
| 22 | + $opacidade = $parurl["opacidade"] * 1; | ||
| 23 | +} else { | ||
| 24 | + $opacidade = "''"; | ||
| 79 | } | 25 | } |
| 80 | -//guarda os parametros das camadas que possuem plugins configurados | ||
| 81 | -$temasPluginI3Geo = array(); | ||
| 82 | -// | ||
| 83 | -// recupera um mapa salvo no banco de administracao | ||
| 84 | -// | ||
| 85 | -if(!empty($restauramapa)){ | ||
| 86 | - $xbase = restauraMapaAdmin($restauramapa,$dir_tmp); | ||
| 87 | - validaAcessoTemas($xbase,true); | ||
| 88 | - $m = ms_newMapObj($xbase); | ||
| 89 | - $w = $m->web; | ||
| 90 | - $w->set("imagepath",dirname($w->imagepath)."/"); | ||
| 91 | - $w->set("imageurl",dirname($w->imageurl)."/"); | ||
| 92 | - // apaga algumas camadas | ||
| 93 | - $l = $m->getlayerbyname("rosadosventos"); | ||
| 94 | - if($l != ""){ | ||
| 95 | - $l->set("status",MS_DELETE); | ||
| 96 | - } | ||
| 97 | - $l = $m->getlayerbyname("copyright"); | ||
| 98 | - if($l != ""){ | ||
| 99 | - $l->set("status",MS_DELETE); | ||
| 100 | - } | ||
| 101 | - $m->save($xbase); | ||
| 102 | - $temas = $xbase; | ||
| 103 | - if (!isset($mapext)){ | ||
| 104 | - $mapext = $m->extent->minx." ".$m->extent->miny." ".$m->extent->maxx." ".$m->extent->maxy; | ||
| 105 | - } | ||
| 106 | -} | ||
| 107 | -if(!isset($mapext)){ | ||
| 108 | - $versao = versao(); | ||
| 109 | - $versao = $versao["principal"]; | ||
| 110 | - if(isset($base) && $base != ""){ | ||
| 111 | - if(file_exists($base)){ | ||
| 112 | - $f = $base; | ||
| 113 | - } | ||
| 114 | - else{ | ||
| 115 | - $f = $locaplic."/aplicmap/".$base.".map"; | ||
| 116 | - } | ||
| 117 | - } | ||
| 118 | - else | ||
| 119 | - { | ||
| 120 | - $f = ""; | ||
| 121 | - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ | ||
| 122 | - $f = $locaplic."/aplicmap/geral1windowsv".$versao.".map"; | ||
| 123 | - } | ||
| 124 | - else{ | ||
| 125 | - if($f == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv'.$versao.'.map')){ | ||
| 126 | - $f = "/var/www/i3geo/aplicmap/geral1debianv".$versao.".map"; | ||
| 127 | - } | ||
| 128 | - if($f == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ | ||
| 129 | - $f = "/var/www/html/i3geo/aplicmap/geral1fedorav".$versao.".map"; | ||
| 130 | - } | ||
| 131 | - if($f == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ | ||
| 132 | - $f = "/opt/www/html/i3geo/aplicmap/geral1v".$versao.".map"; | ||
| 133 | - } | ||
| 134 | - if($f == "") | ||
| 135 | - { | ||
| 136 | - $f = $locaplic."/aplicmap/geral1v".$versao.".map"; | ||
| 137 | - } | ||
| 138 | - } | ||
| 139 | - } | ||
| 140 | - if(@ms_newMapObj($f)){ | ||
| 141 | - $mapae = ms_newMapObj($f); | ||
| 142 | - $c = $mapae->extent; | ||
| 143 | - $mapext = $c->minx.",".$c->miny.",".$c->maxx.",".$c->maxy; | ||
| 144 | - } | 26 | +if (isset($parurl["restauramapa"])) { |
| 27 | + $restauramapa = $parurl["restauramapa"] * 1; | ||
| 28 | +} else { | ||
| 29 | + $restauramapa = "''"; | ||
| 145 | } | 30 | } |
| 146 | -// | ||
| 147 | -// imprime na tela a ajuda ao usuário | ||
| 148 | -// | ||
| 149 | -if(!isset($temas) && isset($layers)){ | ||
| 150 | - $temas = $layers; | 31 | +if (isset($parurl["mapext"])) { |
| 32 | + $mapext = str_replace(" ", ",", $parurl["mapext"]); | ||
| 33 | + $mapext = "[$mapext]"; | ||
| 34 | +} else { | ||
| 35 | + $mapext = "[]"; | ||
| 36 | +} | ||
| 37 | +if (! isset($parurl["temas"]) && isset($parurl["layers"])) { | ||
| 38 | + $parurl["temas"] = $parurl["layers"]; | ||
| 151 | } | 39 | } |
| 152 | -if(!isset($temas)){ | ||
| 153 | - ajuda(); | 40 | +$temas = explode(",", str_replace(" ", ",", $parurl["temas"])); |
| 41 | +if(!isset($parurl["visiveis"])){ | ||
| 42 | + $parurl["visiveis"] = $parurl["temas"]; | ||
| 154 | } | 43 | } |
| 155 | -// problema na versão 211 do OpenLayers. Tamanho em % não é | ||
| 156 | -// aceito | ||
| 157 | -// if(!isset($largura)) | ||
| 158 | - // {$largura = 500;} | ||
| 159 | -if(isset($largura) && !isset($altura)){ | ||
| 160 | - $altura = $largura; | 44 | +$visiveis = explode(",", str_replace(" ", ",", $parurl["visiveis"])); |
| 45 | +$off = array_diff($temas, $visiveis); | ||
| 46 | +//filtros | ||
| 47 | +$filtros = array(); | ||
| 48 | +foreach($temas as $tema){ | ||
| 49 | + if(isset($parurl["map_layer_".$tema."_filter"])){ | ||
| 50 | + $filtros[] = array( | ||
| 51 | + "layer"=>$tema, | ||
| 52 | + "expression"=>$parurl["map_layer_".$tema."_filter"] | ||
| 53 | + ); | ||
| 54 | + } | ||
| 161 | } | 55 | } |
| 162 | -if(isset($altura) && !isset($largura)){ | ||
| 163 | - $largura = $altura; | 56 | +$filtros = json_encode($filtros); |
| 57 | + | ||
| 58 | +$estilo = ""; | ||
| 59 | +if (isset($parurl["altura"])) { | ||
| 60 | + $estilo .= ";height:" . $parurl["altura"] . "px"; | ||
| 61 | +} | ||
| 62 | +if (isset($parurl["largura"])) { | ||
| 63 | + $estilo .= ";width:" . $parurl["largura"] . "px"; | ||
| 164 | } | 64 | } |
| 65 | +$controles = $parurl["controles"]; | ||
| 165 | // | 66 | // |
| 166 | // define quais controles serão mostrados no mapa | 67 | // define quais controles serão mostrados no mapa |
| 167 | // | 68 | // |
| 168 | -$objControles = array(); | ||
| 169 | -if(isset($controles)){ | ||
| 170 | - $controles = str_replace(" ",",",$controles); | ||
| 171 | - $controles = strtolower($controles); | ||
| 172 | - $controles = explode(",",$controles); | ||
| 173 | - if(in_array("navigation",$controles)){ | ||
| 174 | - $objControles[] = "new OpenLayers.Control.Navigation()"; | ||
| 175 | - } | ||
| 176 | - if(in_array("panzoombar",$controles)){ | ||
| 177 | - $objControles[] = "new OpenLayers.Control.PanZoomBar()"; | ||
| 178 | - } | ||
| 179 | - if(in_array("layerswitcher",$controles)){ | ||
| 180 | - $objControles[] = "new OpenLayers.Control.LayerSwitcher({'ascending':false})"; | ||
| 181 | - } | ||
| 182 | - if(in_array("scaleline",$controles)){ | ||
| 183 | - $objControles[] = "new OpenLayers.Control.ScaleLine()"; | ||
| 184 | - } | ||
| 185 | - if(in_array("mouseposition",$controles)) | ||
| 186 | - { | ||
| 187 | - $objControles[] = "new OpenLayers.Control.MousePosition({'separator':' '})"; | ||
| 188 | - } | ||
| 189 | - if(in_array("overviewmap",$controles)){ | ||
| 190 | - $objControles[] = "new OpenLayers.Control.OverviewMap()"; | ||
| 191 | - } | ||
| 192 | - if(in_array("keyboarddefaults",$controles)){ | ||
| 193 | - $objControles[] = "new OpenLayers.Control.KeyboardDefaults()"; | ||
| 194 | - } | 69 | +$objControles = array( |
| 70 | + "new ol.control.Attribution({collapsible: true})" | ||
| 71 | +); | ||
| 72 | +if (isset($controles)) { | ||
| 73 | + $controles = str_replace(" ", ",", $controles); | ||
| 74 | + $controles = strtolower($controles); | ||
| 75 | + $controles = explode(",", $controles); | ||
| 76 | + if (in_array("navigation", $controles)) { | ||
| 77 | + $objControles[] = "new ol.control.Zoom()"; | ||
| 78 | + } | ||
| 79 | + if (in_array("panzoombar", $controles)) { | ||
| 80 | + $objControles[] = "new ol.control.ZoomSlider()"; | ||
| 81 | + } | ||
| 82 | + if (in_array("scaleline", $controles)) { | ||
| 83 | + $objControles[] = "new ol.control.ScaleLine()"; | ||
| 84 | + } | ||
| 85 | + if (in_array("mouseposition", $controles)) { | ||
| 86 | + $objControles[] = "new ol.control.MousePosition({coordinateFormat : function(c){return ol.coordinate.toStringHDMS(c);}})"; | ||
| 87 | + } | ||
| 88 | + if (in_array("overviewmap", $controles)) { | ||
| 89 | + $objControles[] = "new ol.control.OverviewMap()"; | ||
| 90 | + } | ||
| 91 | +} else { | ||
| 92 | + $objControles[] = "new ol.control.Zoom()"; | ||
| 93 | + $objControles[] = "new ol.control.ZoomSlider()"; | ||
| 94 | + $objControles[] = "new ol.control.ScaleLine()"; | ||
| 95 | + $objControles[] = "new ol.control.MousePosition({coordinateFormat : function(c){return ol.coordinate.toStringHDMS(c);}})"; | ||
| 195 | } | 96 | } |
| 97 | +$botoes = $parurl["botoes"]; | ||
| 196 | // | 98 | // |
| 197 | // define quais botoes serão mostrados no mapa | 99 | // define quais botoes serão mostrados no mapa |
| 198 | // | 100 | // |
| 199 | $objBotoes = array(); | 101 | $objBotoes = array(); |
| 200 | -if(isset($botoes)){ | ||
| 201 | - $botoes = str_replace(" ",",",$botoes); | ||
| 202 | - $botoes = strtolower($botoes); | ||
| 203 | - $botoes = explode(",",$botoes); | ||
| 204 | - if(in_array("grid",$botoes)){ | ||
| 205 | - $objBotoes[] = "'grid':true"; | ||
| 206 | - } | ||
| 207 | - if(in_array("imprimir",$botoes)){ | ||
| 208 | - $objBotoes[] = "'imprimir':true"; | ||
| 209 | - } | ||
| 210 | - if(in_array("pan",$botoes)){ | ||
| 211 | - $objBotoes[] = "'pan':true"; | ||
| 212 | - } | ||
| 213 | - if(in_array("zoombox",$botoes)){ | ||
| 214 | - $objBotoes[] = "'zoombox':true"; | ||
| 215 | - } | ||
| 216 | - if(in_array("zoomtot",$botoes)){ | ||
| 217 | - $objBotoes[] = "'zoomtot':true"; | ||
| 218 | - } | ||
| 219 | - if(in_array("zoomout",$botoes)){ | ||
| 220 | - $objBotoes[] = "'zoomout':true"; | ||
| 221 | - } | ||
| 222 | - if(in_array("zoomin",$botoes)) | ||
| 223 | - { | ||
| 224 | - $objBotoes[] = "'zoomin':true"; | ||
| 225 | - } | ||
| 226 | - if(in_array("legenda",$botoes)){ | ||
| 227 | - $objBotoes[] = "'legenda':true"; | ||
| 228 | - } | ||
| 229 | - if(in_array("distancia",$botoes)){ | ||
| 230 | - $objBotoes[] = "'distancia':true"; | ||
| 231 | - } | ||
| 232 | - if(in_array("area",$botoes)){ | ||
| 233 | - $objBotoes[] = "'area':true"; | ||
| 234 | - } | ||
| 235 | - if(in_array("identifica",$botoes)){ | ||
| 236 | - $objBotoes[] = "'identifica':true"; | ||
| 237 | - } | ||
| 238 | - if(in_array("linha",$botoes)){ | ||
| 239 | - $objBotoes[] = "'linha':true"; | ||
| 240 | - } | ||
| 241 | - if(in_array("ponto",$botoes)){ | ||
| 242 | - $objBotoes[] = "'ponto':true"; | ||
| 243 | - } | ||
| 244 | - if(in_array("poligono",$botoes)){ | ||
| 245 | - $objBotoes[] = "'poligono':true"; | ||
| 246 | - } | ||
| 247 | - if(in_array("edita",$botoes)){ | ||
| 248 | - $objBotoes[] = "'edita':true"; | ||
| 249 | - } | ||
| 250 | - if(in_array("listag",$botoes)){ | ||
| 251 | - $objBotoes[] = "'listag':true"; | ||
| 252 | - } | ||
| 253 | - if(in_array("corta",$botoes)){ | ||
| 254 | - $objBotoes[] = "'corta':true"; | ||
| 255 | - } | ||
| 256 | - if(in_array("apaga",$botoes)){ | ||
| 257 | - $objBotoes[] = "'apaga':true"; | ||
| 258 | - } | ||
| 259 | - if(in_array("procura",$botoes)){ | ||
| 260 | - $objBotoes[] = "'procura':true"; | ||
| 261 | - } | ||
| 262 | - if(in_array("salva",$botoes)){ | ||
| 263 | - $objBotoes[] = "'salva':true"; | ||
| 264 | - } | ||
| 265 | - if(in_array("ajuda",$botoes)){ | ||
| 266 | - $objBotoes[] = "'ajuda':true"; | ||
| 267 | - } | ||
| 268 | - if(in_array("fecha",$botoes)){ | ||
| 269 | - $objBotoes[] = "'fecha':true"; | ||
| 270 | - } | ||
| 271 | - if(in_array("tools",$botoes)){ | ||
| 272 | - $objBotoes[] = "'tools':true"; | ||
| 273 | - } | ||
| 274 | - if(in_array("undo",$botoes)){ | ||
| 275 | - $objBotoes[] = "'undo':true"; | ||
| 276 | - } | ||
| 277 | - if(in_array("propriedades",$botoes)){ | ||
| 278 | - $objBotoes[] = "'propriedades':true"; | ||
| 279 | - } | ||
| 280 | - if(in_array("frente",$botoes)){ | ||
| 281 | - $objBotoes[] = "'frente':true"; | ||
| 282 | - } | ||
| 283 | - if(in_array("texto",$botoes)){ | ||
| 284 | - $objBotoes[] = "'texto':true"; | ||
| 285 | - } | ||
| 286 | - if(in_array("novaaba",$botoes)){ | ||
| 287 | - $objBotoes[] = "'novaaba':true"; | ||
| 288 | - } | ||
| 289 | - $botoes = "{".implode(",",$objBotoes)."}"; | ||
| 290 | -} | 102 | +$objBotoesHtml = array(); |
| 103 | +if (isset($botoes)) { | ||
| 104 | + $botoes = str_replace(" ", ",", $botoes); | ||
| 105 | + $botoes = strtolower($botoes); | ||
| 106 | + $botoes = explode(",", $botoes); | ||
| 107 | + if (in_array("imprimir", $botoes)) { | ||
| 108 | + $objBotoes[] = "'imprimir':true"; | ||
| 109 | + } | ||
| 110 | + if (in_array("pan", $botoes)) { | ||
| 111 | + $objBotoes[] = "'pan':true"; | ||
| 112 | + } | ||
| 113 | + $objBotoesHtml["zoombox"] = "hidden"; | ||
| 114 | + if (in_array("zoombox", $botoes)) { | ||
| 115 | + // usa bootstrap | ||
| 116 | + $objBotoes[] = "'zoombox':false"; | ||
| 117 | + $objBotoesHtml["zoombox"] = ""; | ||
| 118 | + } | ||
| 119 | + $objBotoesHtml["analise"] = "hidden"; | ||
| 120 | + if (in_array("analise", $botoes)) { | ||
| 121 | + // usa bootstrap | ||
| 122 | + $objBotoesHtml["analise"] = ""; | ||
| 123 | + } | ||
| 124 | + $objBotoesHtml["camadas"] = "hidden"; | ||
| 125 | + if (in_array("camadas", $botoes)) { | ||
| 126 | + // usa bootstrap | ||
| 127 | + $objBotoesHtml["camadas"] = ""; | ||
| 128 | + } | ||
| 129 | + $objBotoesHtml["catalogo"] = "hidden"; | ||
| 130 | + if (in_array("catalogo", $botoes)) { | ||
| 131 | + // usa bootstrap | ||
| 132 | + $objBotoesHtml["catalogo"] = ""; | ||
| 133 | + } | ||
| 134 | + $objBotoesHtml["legenda"] = "hidden"; | ||
| 135 | + if (in_array("legenda", $botoes)) { | ||
| 136 | + // usa bootstrap | ||
| 137 | + $objBotoes[] = "'legenda':false"; | ||
| 138 | + $objBotoesHtml["legenda"] = ""; | ||
| 139 | + } | ||
| 140 | + $objBotoesHtml["procura"] = "hidden"; | ||
| 141 | + if (in_array("procura", $botoes)) { | ||
| 142 | + // usa bootstrap | ||
| 143 | + $objBotoes[] = "'procura':false"; | ||
| 144 | + $objBotoesHtml["procura"] = ""; | ||
| 145 | + } | ||
| 146 | + $objBotoesHtml["identifica"] = "hidden"; | ||
| 147 | + if (in_array("identifica", $botoes)) { | ||
| 148 | + // usa bootstrap | ||
| 149 | + $objBotoes[] = "'identifica':false"; | ||
| 150 | + $objBotoesHtml["identifica"] = ""; | ||
| 151 | + } | ||
| 152 | + $objBotoesHtml["zoomtot"] = "hidden"; | ||
| 153 | + if (in_array("zoomtot", $botoes)) { | ||
| 154 | + // usa bootstrap | ||
| 155 | + $objBotoes[] = "'zoomtot':false"; | ||
| 156 | + $objBotoesHtml["zoomtot"] = ""; | ||
| 157 | + } | ||
| 158 | + $objBotoesHtml["zoomanterior"] = "hidden"; | ||
| 159 | + if (in_array("zoomanterior", $botoes)) { | ||
| 160 | + // usa bootstrap | ||
| 161 | + $objBotoesHtml["zoomanterior"] = ""; | ||
| 162 | + } | ||
| 163 | + $objBotoesHtml["zoomproximo"] = "hidden"; | ||
| 164 | + if (in_array("zoomproximo", $botoes)) { | ||
| 165 | + // usa bootstrap | ||
| 166 | + $objBotoesHtml["zoomproximo"] = ""; | ||
| 167 | + } | ||
| 168 | + $objBotoesHtml["grid"] = "hidden"; | ||
| 169 | + if (in_array("grid", $botoes)) { | ||
| 170 | + // usa bootstrap | ||
| 171 | + $objBotoes[] = "'grid':false"; | ||
| 172 | + $objBotoesHtml["grid"] = ""; | ||
| 173 | + } | ||
| 174 | + $objBotoesHtml["marcador"] = "hidden"; | ||
| 175 | + if (in_array("marcador", $botoes)) { | ||
| 176 | + // usa bootstrap | ||
| 177 | + $objBotoesHtml["marcador"] = ""; | ||
| 178 | + } | ||
| 179 | + if (in_array("zoomout", $botoes)) { | ||
| 180 | + $objBotoes[] = "'zoomout':true"; | ||
| 181 | + } | ||
| 182 | + if (in_array("zoomin", $botoes)) { | ||
| 183 | + $objBotoes[] = "'zoomin':true"; | ||
| 184 | + } | ||
| 185 | + if (in_array("distancia", $botoes)) { | ||
| 186 | + $objBotoes[] = "'distancia':true"; | ||
| 187 | + } | ||
| 188 | + if (in_array("area", $botoes)) { | ||
| 189 | + $objBotoes[] = "'area':true"; | ||
| 190 | + } | ||
| 191 | + if (in_array("linha", $botoes)) { | ||
| 192 | + $objBotoes[] = "'linha':true"; | ||
| 193 | + } | ||
| 194 | + if (in_array("ponto", $botoes)) { | ||
| 195 | + $objBotoes[] = "'ponto':true"; | ||
| 196 | + } | ||
| 197 | + if (in_array("poligono", $botoes)) { | ||
| 198 | + $objBotoes[] = "'poligono':true"; | ||
| 199 | + } | ||
| 200 | + if (in_array("edita", $botoes)) { | ||
| 201 | + $objBotoes[] = "'edita':true"; | ||
| 202 | + } | ||
| 203 | + if (in_array("listag", $botoes)) { | ||
| 204 | + $objBotoes[] = "'listag':true"; | ||
| 205 | + } | ||
| 206 | + if (in_array("corta", $botoes)) { | ||
| 207 | + $objBotoes[] = "'corta':true"; | ||
| 208 | + } | ||
| 209 | + if (in_array("apaga", $botoes)) { | ||
| 210 | + $objBotoes[] = "'apaga':true"; | ||
| 211 | + } | ||
| 212 | + if (in_array("salva", $botoes)) { | ||
| 213 | + $objBotoes[] = "'salva':true"; | ||
| 214 | + } | ||
| 215 | + if (in_array("ajuda", $botoes)) { | ||
| 216 | + $objBotoes[] = "'ajuda':true"; | ||
| 217 | + } | ||
| 218 | + if (in_array("fecha", $botoes)) { | ||
| 219 | + $objBotoes[] = "'fecha':true"; | ||
| 220 | + } | ||
| 221 | + if (in_array("tools", $botoes)) { | ||
| 222 | + $objBotoes[] = "'tools':true"; | ||
| 223 | + } | ||
| 224 | + if (in_array("undo", $botoes)) { | ||
| 225 | + $objBotoes[] = "'undo':true"; | ||
| 226 | + } | ||
| 227 | + if (in_array("propriedades", $botoes)) { | ||
| 228 | + $objBotoes[] = "'propriedades':true"; | ||
| 229 | + } | ||
| 230 | + if (in_array("frente", $botoes)) { | ||
| 231 | + $objBotoes[] = "'frente':true"; | ||
| 232 | + } | ||
| 233 | + if (in_array("texto", $botoes)) { | ||
| 234 | + $objBotoes[] = "'texto':true"; | ||
| 235 | + } | ||
| 236 | + if (in_array("novaaba", $botoes)) { | ||
| 237 | + $objBotoes[] = "'novaaba':true"; | ||
| 238 | + } | ||
| 239 | + $botoes = "{" . implode(",", $objBotoes) . "}"; | ||
| 240 | +} else { | ||
| 241 | + $objBotoes[] = "'imprimir':true"; | ||
| 242 | + $objBotoesHtml["zoombox"] = ""; | ||
| 243 | + $objBotoesHtml["analise"] = ""; | ||
| 244 | + $objBotoesHtml["camadas"] = ""; | ||
| 245 | + $objBotoesHtml["catalogo"] = ""; | ||
| 246 | + $objBotoesHtml["legenda"] = ""; | ||
| 247 | + $objBotoesHtml["procura"] = ""; | ||
| 248 | + $objBotoesHtml["identifica"] = ""; | ||
| 249 | + $objBotoesHtml["zoomtot"] = ""; | ||
| 250 | + $objBotoesHtml["zoomanterior"] = ""; | ||
| 251 | + $objBotoesHtml["zoomproximo"] = ""; | ||
| 252 | + $objBotoesHtml["grid"] = ""; | ||
| 253 | + $objBotoesHtml["marcador"] = ""; | ||
| 254 | + $objBotoes[] = "'distancia':true"; | ||
| 255 | + $objBotoes[] = "'area':true"; | ||
| 256 | + $objBotoes[] = "'linha':true"; | ||
| 257 | + $objBotoes[] = "'ponto':true"; | ||
| 258 | + $objBotoes[] = "'poligono':true"; | ||
| 259 | + $objBotoes[] = "'edita':true"; | ||
| 260 | + $objBotoes[] = "'listag':true"; | ||
| 261 | + $objBotoes[] = "'corta':true"; | ||
| 262 | + $objBotoes[] = "'apaga':true"; | ||
| 263 | + $objBotoes[] = "'salva':true"; | ||
| 264 | + $objBotoes[] = "'tools':true"; | ||
| 265 | + $objBotoes[] = "'undo':true"; | ||
| 266 | + $objBotoes[] = "'propriedades':true"; | ||
| 267 | + $objBotoes[] = "'frente':true"; | ||
| 268 | + | ||
| 269 | + $botoes = "{" . implode(",", $objBotoes) . "}"; | ||
| 291 | 270 | ||
| 292 | -// | ||
| 293 | -// define a lista de layers do tipo baselayers | ||
| 294 | -// $fundo é um array com a lista dos nomes possíveis ou passados | ||
| 295 | -// pela url | ||
| 296 | -// cada um deve ser definido em openlayers.js.php | ||
| 297 | -// | ||
| 298 | -if(isset($fundo) && $fundo != ""){ | ||
| 299 | - $fundo = str_replace(","," ",$fundo); | ||
| 300 | - $fundo = explode(" ",$fundo); | ||
| 301 | } | 271 | } |
| 302 | -// | ||
| 303 | -// define quais os layers que comporão o mapa | ||
| 304 | -// | ||
| 305 | -//$objOpenLayers guarda a string javascript que sera usada para criar os objetos | ||
| 306 | -//layer do OpenLayers | ||
| 307 | -if(isset($temas)){ | ||
| 308 | - $objOpenLayers = array(); | ||
| 309 | -} | ||
| 310 | -if($temas != ""){ | ||
| 311 | - $temas = str_replace(" ",",",$temas); | ||
| 312 | - // $temas = strtolower($temas); | ||
| 313 | - $temas = explode(",",$temas); | ||
| 314 | - if(!isset($visiveis)){ | ||
| 315 | - $visiveis = $temas; | ||
| 316 | - } | ||
| 317 | - else{ | ||
| 318 | - $visiveis = str_replace(" ",",",$visiveis); | ||
| 319 | - $visiveis = explode(",",$visiveis); | ||
| 320 | - } | ||
| 321 | - $objOpenLayers = array(); | ||
| 322 | - if(!isset($servidor)){ | ||
| 323 | - $servidor = "../ogc.php"; | ||
| 324 | - } | ||
| 325 | - // | ||
| 326 | - //lista de ferramentas | ||
| 327 | - //lista os nomes de metadados que contem os parametros das | ||
| 328 | - //ferramentas customizaveis e que seraco incluidas na propriedade do layer | ||
| 329 | - // | ||
| 330 | - $listaFerramentas = array("tme","storymap","animagif"); | ||
| 331 | - $dadosTemas = pegaDadosAdminKey("SELECT codigo_tema,link_tema FROM __esq__i3geoadmin_temas WHERE codigo_tema IN('".implode($temas,',')."')","__esq__"); | ||
| 332 | - foreach($temas as $tema){ | ||
| 333 | - // | ||
| 334 | - //utilzado para obter os parametros de ferramentas especificas indicadas nos metadados do LAYER | ||
| 335 | - // | ||
| 336 | - $ferramentas = array(); | ||
| 337 | - if(file_exists($locaplic."/temas/".$tema.".gvp")){ | ||
| 338 | - include_once($locaplic."/pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php"); | ||
| 339 | - $gm = new gvsig2mapfile($locaplic."/temas/".$tema.".gvp"); | ||
| 340 | - $gvsigview = $gm->getViewsNames(); | ||
| 341 | - $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$gvsigview[0].'", "'.$servidor.'?'.$nocache.'tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&",{layers:"'.$tema.'",transparent: "true", format: "image/png"},{singleTile:false,visibility:true,isBaseLayer:false, ferramentas :'.$ferramentas.')'; | ||
| 342 | - } | ||
| 343 | - else{ | ||
| 344 | - $nomeMap = ""; | ||
| 345 | - if(file_exists($locaplic."/temas/".$tema.".map")){ | ||
| 346 | - $nomeMap = $locaplic."/temas/".$tema.".map"; | ||
| 347 | - } | ||
| 348 | - else{ | ||
| 349 | - if(file_exists($tema)){ | ||
| 350 | - $nomeMap = $tema; | ||
| 351 | - } | ||
| 352 | - else{ | ||
| 353 | - // acontece caso o mapfile tenha sido gerado na pasta | ||
| 354 | - // temporaria por algum sistema | ||
| 355 | - if(file_exists($dir_tmp."/".$tema.".map")){ | ||
| 356 | - $nomeMap = $dir_tmp."/".$tema.".map"; | ||
| 357 | - } | ||
| 358 | - } | ||
| 359 | - } | ||
| 360 | - if($nomeMap != ""){ | ||
| 361 | - $layersNomes = array(); | ||
| 362 | - $layers = array(); | ||
| 363 | - $maptemp = @ms_newMapObj($nomeMap); | ||
| 364 | - if($maptemp){ | ||
| 365 | - $nlayers = $maptemp->numlayers; | ||
| 366 | - for($i=0;$i<($nlayers);++$i) { | ||
| 367 | - $layern = $maptemp->getLayer($i); | ||
| 368 | - // | ||
| 369 | - //verifica se o layer contem ferramentas parametrizadas | ||
| 370 | - // | ||
| 371 | - foreach($listaFerramentas as $lf){ | ||
| 372 | - $meta = $layern->getmetadata($lf); | ||
| 373 | - if($meta != ""){ | ||
| 374 | - $ferramentas[] = "'".$lf."':".$meta; | ||
| 375 | - } | ||
| 376 | - } | ||
| 377 | - $ferramentas = '{'.implode(",",$ferramentas).'}'; | ||
| 378 | - if($layern->getmetadata("PLUGINI3GEO") != ""){ | ||
| 379 | - //obtem os dados necessarios para iniciar o plugin | ||
| 380 | - //os objetos layer (openLayers) sao criados apenas no final | ||
| 381 | - //do processo, pois necessitam usar javascript e nao apenas PHP | ||
| 382 | - $temasPluginI3Geo[] = array( | ||
| 383 | - "name"=>$layern->name, | ||
| 384 | - "tema"=>$layern->getmetadata("tema"), | ||
| 385 | - "plugin"=>$layern->getmetadata("PLUGINI3GEO"), | ||
| 386 | - "cache"=>strtoupper($layern->getmetadata("cache")), | ||
| 387 | - "transitioneffect"=>strtoupper($layern->getmetadata("transitioneffect")), | ||
| 388 | - "tiles"=>strtoupper($layern->getmetadata("tiles")), | ||
| 389 | - "posicaoLayer"=>count($objOpenLayers), | ||
| 390 | - "ferramentas"=>$ferramentas | ||
| 391 | - ); | ||
| 392 | - $objOpenLayers[] = ""; | ||
| 393 | - } | ||
| 394 | - else{ | ||
| 395 | - $layersNomes[] = $layern->name; | ||
| 396 | - $layers[] = $layern; | ||
| 397 | - } | ||
| 398 | - } | ||
| 399 | - $nomeLayer = implode(",",$layersNomes); | ||
| 400 | - $tituloLayer = $layern->getmetadata("tema"); | ||
| 401 | - $ebase = "false"; | ||
| 402 | - if(isset($fundo) && $fundo != ""){ | ||
| 403 | - if(in_array($tema,$fundo)){ | ||
| 404 | - $ebase = "true"; | ||
| 405 | - } | ||
| 406 | - } | ||
| 407 | - $visivel = "false"; | ||
| 408 | - if(in_array($tema,$visiveis)){ | ||
| 409 | - $visivel = "true"; | ||
| 410 | - } | ||
| 411 | - if(strtolower($DESLIGACACHE) != "sim" && $nlayers == 1 && strtoupper($layern->getmetadata("cache")) == "SIM" && $layern->getmetadata("PLUGINI3GEO") == ""){ | ||
| 412 | - // | ||
| 413 | - //obtem a fonte | ||
| 414 | - // | ||
| 415 | - $link_tema = $dadosTemas[$layern->name]; | ||
| 416 | - $link_tema = $link_tema["link_tema"]; | ||
| 417 | - if($layern->type != 2 && $layern->type != 3){ | ||
| 418 | - $opacidade = 1; | ||
| 419 | - } | ||
| 420 | - // | ||
| 421 | - //verifica se deve aplicar filtro | ||
| 422 | - // | ||
| 423 | - $filtro = $_GET["map_layer_".$layern->name."_filter"]; | ||
| 424 | - if(!empty($filtro)){ | ||
| 425 | - $DESLIGACACHE = "sim"; | ||
| 426 | - $nocache = "map_layer_".$layern->name."_filter=".$filtro."&".$nocache; | ||
| 427 | - } | ||
| 428 | - $teffect = 'transitionEffect: "resize",'; | ||
| 429 | - if(strtoupper($layern->getmetadata("transitioneffect")) == "NAO"){ | ||
| 430 | - $teffect = 'transitionEffect: null,'; | ||
| 431 | - } | ||
| 432 | - // nesse caso o layer e adicionado como TMS | ||
| 433 | - // tms leva os parametros do TMS | ||
| 434 | - //$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.'})'; | ||
| 435 | - $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.',link_tema:"'.$link_tema.'"})'; | 272 | +if (isset($parurl["kml"])) { |
| 273 | + $kml = $parurl["kml"]; | ||
| 274 | + $kml = str_replace(" ", ",", $kml); | ||
| 275 | + $kml = explode(",", $kml); | ||
| 276 | + $kml = "'" . implode("','", $kml) . "'"; | ||
| 277 | +} else { | ||
| 278 | + $kml = ""; | ||
| 279 | +} | ||
| 280 | +if (isset($parurl["DESLIGACACHE"])) { | ||
| 281 | + $DESLIGACACHE = $parurl["DESLIGACACHE"]; | ||
| 282 | +} else { | ||
| 283 | + $DESLIGACACHE = ""; | ||
| 284 | +} | ||
| 285 | +if (isset($parurl["numzoomlevels"])) { | ||
| 286 | + $numzoomlevels = $parurl["numzoomlevels"]; | ||
| 287 | +} else { | ||
| 288 | + $numzoomlevels = 20; | ||
| 289 | +} | ||
| 290 | +if (isset($parurl["maxextent"])) { | ||
| 291 | + $maxextent = "[" . $parurl["maxextent"] . "]"; | ||
| 292 | +} else { | ||
| 293 | + $maxextent = "undefined"; | ||
| 294 | +} | ||
| 295 | +if (isset($parurl["pontos"])) { | ||
| 296 | + $pontos = str_replace(" ", ",", $parurl["pontos"]); | ||
| 297 | +} else { | ||
| 298 | + $pontos = ""; | ||
| 299 | +} | ||
| 300 | +if(isset($parurl["marca"])){ | ||
| 301 | + $marca = $parurl["marca"]; | ||
| 302 | +} else { | ||
| 303 | + $marca = "../pacotes/openlayers/img/marker-gold.png"; | ||
| 304 | +} | ||
| 305 | +if(isset($parurl["tiles"])){ | ||
| 306 | + $tiles = $parurl["tiles"]; | ||
| 307 | +} | ||
| 308 | +else{ | ||
| 309 | + $tiles = "true"; | ||
| 310 | +} | ||
| 311 | +if(isset($parurl["ativarodadomouse"]) && $parurl["ativarodadomouse"] == "false"){ | ||
| 312 | + $ativarodadomouse = ""; | ||
| 313 | +} | ||
| 314 | +else{ | ||
| 315 | + $ativarodadomouse = "new ol.interaction.MouseWheelZoom(),"; | ||
| 316 | +} | ||
| 317 | +$legendahtml = $parurl["legendahtml"]; | ||
| 318 | +$layerDefault = $parurl["layerDefault"]; | ||
| 319 | +// cria as pastas temporarias caso nao existam | ||
| 320 | +if (! file_exists($dir_tmp)) { | ||
| 321 | + @mkdir($dir_tmp, 0744); | ||
| 322 | +} | ||
| 323 | +if (file_exists($dir_tmp)) { | ||
| 324 | + if (! file_exists($dir_tmp . "/comum")) { | ||
| 325 | + @mkdir($dir_tmp . "/comum", 0744); | ||
| 326 | + } | ||
| 327 | + if (! file_exists($dir_tmp . "/saiku-datasources")) { | ||
| 328 | + @mkdir($dir_tmp . "/saiku-datasources", 0744); | ||
| 329 | + chmod($dir_tmp . "/saiku-datasources", 0744); | ||
| 330 | + } | ||
| 331 | + if (! file_exists($dir_tmp . "/cache")) { | ||
| 332 | + @mkdir($dir_tmp . "/cache", 0744); | ||
| 333 | + chmod($dir_tmp . "/cache", 0744); | ||
| 334 | + } | ||
| 335 | + if (! file_exists($dir_tmp . "/cache/googlemaps")) { | ||
| 336 | + @mkdir($dir_tmp . "/cache/googlemaps", 0744); | ||
| 337 | + chmod($dir_tmp . "/cache/googlemaps", 0744); | ||
| 338 | + } | ||
| 339 | +} | ||
| 340 | +if (empty($opacidade)) { | ||
| 341 | + $opacidade = 1; | ||
| 342 | +} | ||
| 436 | 343 | ||
| 437 | - // cria um clone WMS para efeitos de getfeatureinfo | ||
| 438 | - $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.',link_tema:"'.$link_tema.'"})'; | ||
| 439 | - } | ||
| 440 | - else{ | ||
| 441 | - foreach($layers as $l){ | ||
| 442 | - $singleTile = "false"; | ||
| 443 | - if(strtoupper($l->getmetadata("TILES")) == "NAO"){ | ||
| 444 | - $singleTile = "true"; | ||
| 445 | - } | ||
| 446 | - $tituloLayer = $l->getmetadata("tema"); | ||
| 447 | - $nomeLayer = $l->name; | ||
| 448 | - $link_tema = $dadosTemas[$nomeLayer]; | ||
| 449 | - $link_tema = $link_tema["link_tema"]; | ||
| 450 | - $visivel = "false"; | ||
| 451 | - //if($l->status == MS_DEFAULT || in_array($tema,$visiveis)){ | ||
| 452 | - if(in_array($tema,$visiveis)){ | ||
| 453 | - $visivel = "true"; | ||
| 454 | - } | ||
| 455 | - if($l->type != 2 && $l->type != 3){ | ||
| 456 | - $opacidade = 1; | ||
| 457 | - } | ||
| 458 | - // | ||
| 459 | - //verifica se deve aplicar filtro | ||
| 460 | - // | ||
| 461 | - $filtro = $_GET["map_layer_".$l->name."_filter"]; | ||
| 462 | - if(!empty($filtro)){ | ||
| 463 | - $DESLIGACACHE = "sim"; | ||
| 464 | - $nocache = "map_layer_".$l->name."_filter=".$filtro."&".$nocache; | ||
| 465 | - } | ||
| 466 | - $teffect = 'transitionEffect: "resize",'; | ||
| 467 | - if(strtoupper($l->getmetadata("transitioneffect")) == "NAO"){ | ||
| 468 | - $teffect = 'transitionEffect: null,'; | ||
| 469 | - } | ||
| 470 | - if($tituloLayer != ""){ | ||
| 471 | - $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$tituloLayer.'", "'.$servidor.'?'.$nocache.'tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&",{opacity:'.$opacidade.',layers:"'.$nomeLayer.'",transparent: "true", format: "image/png"},{'.$teffect.' singleTile:'.$singleTile.',visibility:'.$visivel.',isBaseLayer:'.$ebase.', ferramentas :'.$ferramentas.',link_tema:"'.$link_tema.'"})'; | ||
| 472 | - } | ||
| 473 | - else{ | ||
| 474 | - $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$tituloLayer.'", "'.$servidor.'?'.$nocache.'tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&",{opacity:'.$opacidade.',layers:"'.$nomeLayer.'",transparent: "true", format: "image/png"},{'.$teffect.' displayInLayerSwitcher:false,singleTile:'.$singleTile.',visibility:'.$visivel.',isBaseLayer:'.$ebase.', ferramentas :'.$ferramentas.',link_tema:"'.$link_tema.'"})'; | ||
| 475 | - } | ||
| 476 | - } | ||
| 477 | - } | ||
| 478 | - } | ||
| 479 | - } | ||
| 480 | - else{ | ||
| 481 | - echo $tema." não foi encontrado.<br>"; | ||
| 482 | - } | ||
| 483 | - } | ||
| 484 | - } | ||
| 485 | -} | ||
| 486 | -function nomeRandomicoM($n=10){ | ||
| 487 | - $nomes = ""; | ||
| 488 | - $a = 'azertyuiopqsdfghjklmwxcvbnABCDEFGHIJKLMNOPQRSTUVWXYZ'; | ||
| 489 | - $max = 51; | ||
| 490 | - for($i=0; $i < $n; ++$i) | ||
| 491 | - { | ||
| 492 | - $nomes .= $a{mt_rand(0, $max)}; | ||
| 493 | - } | ||
| 494 | - return $nomes; | ||
| 495 | -} | ||
| 496 | -function ajuda(){ | ||
| 497 | - echo " | 344 | +function ajuda() |
| 345 | +{ | ||
| 346 | + echo " | ||
| 498 | <pre><b> | 347 | <pre><b> |
| 499 | Mashup OpenLayers | 348 | Mashup OpenLayers |
| 500 | Parâmetros: | 349 | Parâmetros: |
| 501 | - restauramapa - id do mapa armazenado no sistema de administracao e que será restaurado para ser aberto novamente (veja em i3geo/admin/html/mapas.html) | ||
| 502 | - opacidade - opacidade (de 0 a 1) aplicada aos temas do tipo poligonal ou raster (default 1) | ||
| 503 | - kml - lista de endereços (url) de um arquivos kml que serão adicionados ao mapa. Separado por ',' | ||
| 504 | - servidor - por default é ../ogc.php o que força o uso do i3geo local. Esse é o programa que será utilizado em conjunto com a lista definida no parâmetro 'temas' | ||
| 505 | - temas - lista com os temas (mapfiles) do i3Geo que serão incluídos no mapa. Pode ser incluído um arquivo mapfile que esteja fora da pasta i3geo/temas. Nesse caso, deve-se definir o caminho completo do arquivo e também o parâmetro &layers | ||
| 506 | - visiveis - lista de temas (mesmos nomes do parâmetro temas) que iniciarão como visíveis no mapa. Se não for definido, todos os temas serão visíveis. | ||
| 507 | - numzoomlevels - número de níveis de zoom, default=12 | ||
| 508 | - minresolution - resolução mínima. Utilizada para definir o primeiro nível de zoom. Default=0.703125 | ||
| 509 | - maxextent - extensão geográfica máxima do mapa (xmin,ymin,xmax,ymax) | ||
| 510 | - mapext - extensão geográfica inicial do mapa (xmin,ymin,xmax,ymax) | ||
| 511 | - largura - lagura do mapa em pixels | ||
| 512 | - altura - altura do mapa em pixels | ||
| 513 | - pontos - lista de coordenadas x e y que serão incluídas como marcas no mapa | ||
| 514 | - marca - nome do arquivo que contém a imagem que será utilizada para mostrar as coordenadas | ||
| 515 | - tiles (true|false) - indica se o modo tile será usado ou não (true por default). O modo tile pode tornar o mashup mais lento em algumas situações. | ||
| 516 | - incluilayergrafico (true|false) - indica se o layer que recebe elementos gráficos será adicionado ou não ao mapa | ||
| 517 | - ativalayerswicther (true|false) - inicia o mapa com a caixa de escolha das camadas (layerSwitcher) aberta ou não. Por default, inicia fechada | ||
| 518 | - ativarodadomouse (true|false) - ativa ou não o zoom com base na roda do mouse (default é true) | ||
| 519 | - legendahtml (true|false) - ativa ou não (default é false) a geração de legenda do tipo HTML no lugar de imagem png. Legendas HTML podem ser modificadas com base em CSS. A legenda é construída com o template i3geo/aplicmap/legendaOgc.html. | ||
| 520 | - desligacache (sim|nao) - desativa o uso do cache de imagens em disco do lado do servidor, forçando a renderização dos tiles de cada camada em cada requisição | ||
| 521 | - nocache (sim) - evita o uso de imagens em cache existentes no navegador do usuário | ||
| 522 | - layerDefault (opcional) - layer que sera utilizado na ferramenta de identificacao. Quando especificado, nao sera mostrada a caixa para a escolha do layer | 350 | + .restauramapa - id do mapa armazenado no sistema de administracao e que será restaurado para ser aberto novamente (veja em i3geo/admin/html/mapas.html) |
| 351 | + .opacidade - opacidade (de 0 a 1) aplicada aos temas do tipo poligonal ou raster (default 1) | ||
| 352 | + .kml - lista de endereços (url) de um arquivos kml que serão adicionados ao mapa. Separado por ',' | ||
| 353 | + .temas - lista com os temas (mapfiles) do i3Geo que serão incluídos no mapa. Pode ser incluído um arquivo mapfile que esteja fora da pasta i3geo/temas. Nesse caso, deve-se definir o caminho completo do arquivo e também o parâmetro &layers | ||
| 354 | + .visiveis - lista de temas (mesmos nomes do parâmetro temas) que iniciarão como visíveis no mapa. Se não for definido, todos os temas serão visíveis. | ||
| 355 | + .numzoomlevels - número de níveis de zoom, default=12 | ||
| 356 | + .maxextent - extensão geográfica máxima do mapa (xmin,ymin,xmax,ymax) | ||
| 357 | + .mapext - extensão geográfica inicial do mapa (xmin,ymin,xmax,ymax) | ||
| 358 | + .largura - lagura do mapa em pixels | ||
| 359 | + .altura - altura do mapa em pixels | ||
| 360 | + .pontos - lista de coordenadas x e y que serão incluídas como marcas no mapa | ||
| 361 | + .marca - nome do arquivo que contém a imagem que será utilizada para mostrar as coordenadas | ||
| 362 | + .tiles (true|false) - indica se o modo tile será usado ou não (true por default). O modo tile pode tornar o mashup mais lento em algumas situações. | ||
| 363 | + .ativarodadomouse (true|false) - ativa ou não o zoom com base na roda do mouse (default é true) | ||
| 523 | 364 | ||
| 524 | - Filtros | 365 | + .Filtros |
| 525 | 366 | ||
| 526 | filtros podem ser adicionados incluindo o parametro da seguinte forma: &map_layer_<nomedotema>_filter= | 367 | filtros podem ser adicionados incluindo o parametro da seguinte forma: &map_layer_<nomedotema>_filter= |
| 527 | 368 | ||
| @@ -531,305 +372,888 @@ function ajuda(){ | @@ -531,305 +372,888 @@ function ajuda(){ | ||
| 531 | 372 | ||
| 532 | no caso de camadas Postgis basta usar map_layer__lbiomashp_filter=cd_legenda='CAATINGA' | 373 | no caso de camadas Postgis basta usar map_layer__lbiomashp_filter=cd_legenda='CAATINGA' |
| 533 | 374 | ||
| 534 | - fundo - lista com os nomes, separados por ',' dos layers que serão usados como fundo para o mapa. Se não for definido, | 375 | + .fundo - lista com os nomes, separados por ',' dos layers que serão usados como fundo para o mapa. Se não for definido, |
| 535 | será usado o default. O primeiro da lista será o fundo ativo. Se na lista de temas de fundo estiver algum | 376 | será usado o default. O primeiro da lista será o fundo ativo. Se na lista de temas de fundo estiver algum |
| 536 | tema incluido com o parametro 'temas', esses serão incluídos como temas de fundo. | 377 | tema incluido com o parametro 'temas', esses serão incluídos como temas de fundo. |
| 537 | Quando for vazio, o ultimo layer sera considerado como o layer de fundo | 378 | Quando for vazio, o ultimo layer sera considerado como o layer de fundo |
| 538 | - Os seguintes fundos podem usados nessa lista: | ||
| 539 | - | ||
| 540 | - e_oce - ESRI Ocean Basemap | ||
| 541 | - e_ims - ESRI Imagery World 2D | ||
| 542 | - e_wsm - ESRI World Street Map | ||
| 543 | - ol_mma - base cartográfica do Brasil | ||
| 544 | - ol_wms - base mundial da Meta Carta | ||
| 545 | - top_wms - toponímia do servidor do MMA usado no mapa de referência | ||
| 546 | - est_wms - estados do Brasil | ||
| 547 | - | ||
| 548 | - controles - lista com os nomes dos controles que serão adicionados ao mapa. Se não for definido, todos os controles serão adicionados | ||
| 549 | - navigation | ||
| 550 | - panzoombar | ||
| 551 | - layerswitcher | ||
| 552 | - scaleline | ||
| 553 | - mouseposition | ||
| 554 | - overviewmap | ||
| 555 | - keyboarddefaults | ||
| 556 | - botoes - lista com os nomes dos botoes que serão adicionados ao mapa. Se não for definido, todos os botões serão adicionados | ||
| 557 | - pan | ||
| 558 | - zoombox | ||
| 559 | - zoomtot | ||
| 560 | - zoomin | ||
| 561 | - zoomout | ||
| 562 | - distancia | ||
| 563 | - area | ||
| 564 | - identifica | ||
| 565 | - ponto | ||
| 566 | - linha | ||
| 567 | - poligono | ||
| 568 | - texto | ||
| 569 | - edita | ||
| 570 | - listag (lista geometrias) | ||
| 571 | - apaga | ||
| 572 | - captura | ||
| 573 | - procura | ||
| 574 | - frente | ||
| 575 | - propriedades | ||
| 576 | - tools | ||
| 577 | - undo | ||
| 578 | - salva | ||
| 579 | - ajuda | ||
| 580 | - fecha | ||
| 581 | - corta | ||
| 582 | - legenda | ||
| 583 | - novaaba | ||
| 584 | - grid | ||
| 585 | - imprimir | 379 | + Os seguintes fundos podem usados nessa lista: (lista completa na variavel i3GEO.Interface.openlayers.LAYERSADICIONAIS que pode ser verificada por meio do console javascript do navegador) |
| 586 | 380 | ||
| 587 | - Para ver a lista de códigos de temas, que podem ser utilizados no parâmetro 'temas', acesse: | ||
| 588 | - <a href='../ogc.php?lista=temas' >lista de temas</a>. Os códigos são mostrados em vermelho. | 381 | + osm, aquarela, toner, tonerlite, layMapQuestAerial |
| 589 | 382 | ||
| 590 | - Exemplo: | ||
| 591 | - | ||
| 592 | - <iframe height='400px' src='http://mapas.mma.gov.br/i3geo/mashups/openlayers.php?temas=bioma&altura=350&largura=350' style='border: 0px solid white;' width='400px'></iframe> | 383 | + .controles - lista com os nomes dos controles que serão adicionados ao mapa. Se não for definido, todos os controles serão adicionados |
| 384 | + navigation | ||
| 385 | + panzoombar | ||
| 386 | + scaleline | ||
| 387 | + mouseposition | ||
| 388 | + overviewmap | ||
| 389 | + keyboarddefaults | ||
| 593 | 390 | ||
| 391 | + .botoes - lista com os nomes dos botoes que serão adicionados ao mapa. Se não for definido, todos os botões serão adicionados | ||
| 392 | + zoombox | ||
| 393 | + zoomtot | ||
| 394 | + zoomanterior | ||
| 395 | + zoomproximo | ||
| 396 | + distancia | ||
| 397 | + area | ||
| 398 | + identifica | ||
| 399 | + ponto | ||
| 400 | + linha | ||
| 401 | + poligono | ||
| 402 | + texto | ||
| 403 | + edita | ||
| 404 | + listag (lista geometrias) | ||
| 405 | + apaga | ||
| 406 | + captura | ||
| 407 | + procura | ||
| 408 | + frente | ||
| 409 | + propriedades | ||
| 410 | + tools | ||
| 411 | + undo | ||
| 412 | + salva | ||
| 413 | + ajuda | ||
| 414 | + fecha | ||
| 415 | + corta | ||
| 416 | + legenda | ||
| 417 | + novaaba | ||
| 418 | + grid | ||
| 419 | + imprimir | ||
| 420 | + marcador | ||
| 421 | + analise | ||
| 422 | + catalogo | ||
| 423 | + camadas | ||
| 594 | "; | 424 | "; |
| 595 | - exit; | 425 | + exit(); |
| 596 | } | 426 | } |
| 597 | ?> | 427 | ?> |
| 598 | -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
| 599 | -<html> | 428 | +<!DOCTYPE html> |
| 429 | +<html lang="pt-br"> | ||
| 600 | <head> | 430 | <head> |
| 431 | +<meta http-equiv="Category" content="i3Geo Mapa interativo MMA geoprocessamento sig mobile"> | ||
| 601 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | 432 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| 602 | -<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| 603 | -<script type="text/javascript" src="openlayers_compacto.js.php"></script> | ||
| 604 | -<?php | ||
| 605 | -//carrega o script para layers do tipo plugin | ||
| 606 | -if(count($temasPluginI3Geo) > 0){ | ||
| 607 | - //echo '<script type="text/javascript" src="../classesjs/classe_plugini3geo.js"></script>'."\n"; | ||
| 608 | - echo '<script type="text/javascript" src="../classesjs/compactados/classe_plugini3geo_compacto.js"></script>'."\n"; | ||
| 609 | - echo '<script type="text/javascript" src="../pacotes/cpaint/cpaint2_compacto.inc.js"></script>'."\n"; | ||
| 610 | -} | ||
| 611 | -?> | ||
| 612 | -<link rel="stylesheet" href="openlayers_compacto.css" type="text/css" /> | 433 | +<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0"> |
| 434 | +<title>i3GEO - OpenLayers</title> | ||
| 435 | +<script src="../pacotes/ol4/ol.js"></script> | ||
| 436 | +<script src="../js/i3geo.js"></script> | ||
| 437 | +<!-- lista com os links que serao mostrados na guia ferramentas --> | ||
| 438 | +<script src="../js/listaDeFerramentas.js"></script> | ||
| 439 | +<!-- configuracoes default tipo pode ser OL (openLayers) ou GM (googlemaps) --> | ||
| 440 | +<script src="../interface/config.php?tipo=OSM"></script> | ||
| 441 | +<script src="../ferramentas/editorol/editorol.js"></script> | ||
| 442 | +<link rel="stylesheet" type="text/css" href="../pacotes/ol4/ol.css"> | ||
| 443 | +<link rel="stylesheet" type="text/css" href="../pacotes/bootstrap/css/bootstrap.min.css"> | ||
| 444 | +<link rel="stylesheet" type="text/css" href="../pacotes/bootstrap-material-design/dist/css/bootstrap-material-design.min.css"> | ||
| 445 | +<!-- <link rel="stylesheet" type="text/css" href="../pacotes/bootstrap-material-design/dist/css/ripples.min.css">--> | ||
| 613 | 446 | ||
| 447 | +<!-- <link rel="stylesheet" type="text/css" href="../pacotes/bootstrap-accessibility-plugin/plugins/js/bootstrap-accessibility.min.js"> --> | ||
| 448 | +<link rel="stylesheet" type="text/css" href="../css/default.css"> | ||
| 614 | <style> | 449 | <style> |
| 615 | -.yui-skin-sam .container-minimiza { | ||
| 616 | - background: transparent | ||
| 617 | - url(../pacotes/yui290/build/assets/skins/sam/sprite.png) no-repeat | ||
| 618 | - scroll 0 -450px; | ||
| 619 | - cursor: pointer; | ||
| 620 | - height: 15px; | ||
| 621 | - position: absolute; | ||
| 622 | - right: 30px; | ||
| 623 | - top: 1px; | ||
| 624 | - width: 25px; | ||
| 625 | - z-index: 2001; | ||
| 626 | - opacity: .8; | ||
| 627 | - filter: alpha(opacity = 80); | 450 | +.ol-attribution.ol-uncollapsible { |
| 451 | + height: 2.1em; | ||
| 452 | + right: 24px; | ||
| 453 | + background: none; | ||
| 454 | + margin-bottom: 15px; | ||
| 628 | } | 455 | } |
| 629 | 456 | ||
| 630 | -.pluginParametrossql { | ||
| 631 | - background-image: url("../imagens/gisicons/settings.png"); | ||
| 632 | - background-size: 14px auto; | ||
| 633 | - cursor: pointer; | ||
| 634 | - position: relative; | ||
| 635 | - top: 3px; | ||
| 636 | - width: 14px; | 457 | +.foraDoMapa+span>span { |
| 458 | + background-color: yellow; | ||
| 637 | } | 459 | } |
| 638 | 460 | ||
| 639 | -.i3GEOiconeTme, .i3GEOiconeStorymap { | ||
| 640 | - background-size: 14px auto; | ||
| 641 | - cursor: pointer; | ||
| 642 | - position: relative; | ||
| 643 | - top: 2px; | ||
| 644 | - width: 14px; | ||
| 645 | - margin-right: 2px; | 461 | +.olControlEditingToolbar1 { |
| 462 | + width: auto; | ||
| 463 | + float: none; | ||
| 464 | + right: 0px; | ||
| 646 | } | 465 | } |
| 647 | 466 | ||
| 648 | -.ajuda_usuario { | ||
| 649 | - background-image: url(../imagens/external.png); | ||
| 650 | - background-position: 0px 0px; | 467 | +.olControlEditingToolbar1 div { |
| 468 | + background-image: url(openlayers.png); | ||
| 651 | background-repeat: no-repeat; | 469 | background-repeat: no-repeat; |
| 652 | - margin-left: 0; | ||
| 653 | - text-decoration: none; | ||
| 654 | - cursor: help; | ||
| 655 | - position: relative; | ||
| 656 | - top: 2px; | ||
| 657 | - font-size: 13px; | 470 | + float: left; |
| 471 | + right: 0px; | ||
| 472 | + height: 29px; | ||
| 473 | + margin: 2px; | ||
| 474 | + width: 29px; | ||
| 475 | + cursor: pointer; | ||
| 476 | + top: 0px; | ||
| 477 | + padding: px; | ||
| 478 | +} | ||
| 479 | + | ||
| 480 | +.ol-i3GEOcontrols { | ||
| 481 | + top: 2.8em; | ||
| 482 | + left: 3.5em; | ||
| 483 | + width: auto; | ||
| 484 | + max-width: 70px; | ||
| 485 | +} | ||
| 486 | + | ||
| 487 | +.ol-mouse-position { | ||
| 488 | + left: 10px; | ||
| 489 | + position: absolute; | ||
| 490 | + bottom: 5px; | ||
| 491 | + top: auto; | ||
| 658 | } | 492 | } |
| 659 | </style> | 493 | </style> |
| 660 | </head> | 494 | </head> |
| 661 | -<body class=" yui-skin-sam"> | ||
| 662 | - <?php | ||
| 663 | - if(isset($largura) && $largura != ""){ | ||
| 664 | - echo '<div id=i3geoMapa style="width:'.$largura.'px;height:'.$altura.'px;"></div>'; | ||
| 665 | - } | ||
| 666 | - else{ | ||
| 667 | - echo '<div id=i3geoMapa style="width:0;height:0"></div>'; | ||
| 668 | - } | 495 | +<!-- As palavras entre {{{}}} sao utilizadas para a traducao. Veja i3geo/js/dicionario.js |
| 496 | + Marque com data-traduzir="true" os elementos que deverao passar pelo tradutor | ||
| 497 | + --> | ||
| 498 | +<body id="i3geo"> | ||
| 499 | + <div style="background: white;<?php echo $estilo;?>"> | ||
| 500 | + <div id="mapai3Geo" style="<?php echo $estilo;?>"></div> | ||
| 669 | 501 | ||
| 670 | - ?> | ||
| 671 | - <div id=i3geoSelTemaAtivo style="height: 15em; z-index: 3000; display: none" class=" yui-skin-sam"></div> | ||
| 672 | - <script> | ||
| 673 | -OpenLayers.ImgPath = "../pacotes/openlayers/img/"; | ||
| 674 | -OpenLayers.Lang.setCode("pt-BR"); | ||
| 675 | -var m = document.getElementById("i3geoMapa"); | ||
| 676 | -if(parseInt(m.style.width,10) === 0){ | ||
| 677 | - var t = i3GEO.util.tamanhoBrowser(); | ||
| 678 | - m.style.width = (t[0]-10)+"px"; | ||
| 679 | - m.style.height = (t[1]-20)+"px"; | ||
| 680 | -} | ||
| 681 | -i3GEO.editorOL.layersIniciais = [<?php | ||
| 682 | - if(isset($objOpenLayers) && $objOpenLayers != "") | ||
| 683 | - {echo implode(",",$objOpenLayers);} | ||
| 684 | - else | ||
| 685 | - {echo "''";} | ||
| 686 | -?>]; | ||
| 687 | -<?php if(isset($botoes)){ | ||
| 688 | - echo "i3GEO.editorOL.botoes = $botoes ;"; | ||
| 689 | -} | ||
| 690 | -?> | ||
| 691 | -i3GEO.editorOL.pontos = [<?php | ||
| 692 | - if(isset($pontos)){ | ||
| 693 | - $pontos = str_replace(" ",",",$pontos); | ||
| 694 | - echo $pontos; | ||
| 695 | - } | ||
| 696 | -?>]; | ||
| 697 | -i3GEO.editorOL.kml = [<?php | ||
| 698 | - if(isset($kml)){ | ||
| 699 | - $kml = str_replace(" ",",",$kml); | ||
| 700 | - $kml = explode(",",$kml); | ||
| 701 | - echo "'".implode("','",$kml)."'"; | ||
| 702 | - } | ||
| 703 | -?>]; | ||
| 704 | -i3GEO.editorOL.marca = "<?php | ||
| 705 | - if(isset($marca)){echo $marca;} | ||
| 706 | - else | ||
| 707 | - {echo "../pacotes/openlayers/img/marker-gold.png";} | ||
| 708 | -?>"; | ||
| 709 | -i3GEO.editorOL.tiles = "<?php | ||
| 710 | - if(isset($tiles)){echo $tiles;} | ||
| 711 | - else | ||
| 712 | - {echo "true";} | ||
| 713 | -?>"; | ||
| 714 | -i3GEO.editorOL.incluilayergrafico = "<?php | ||
| 715 | - if(isset($incluilayergrafico)){echo $incluilayergrafico;} | ||
| 716 | - else | ||
| 717 | - {echo "true";} | ||
| 718 | -?>"; | ||
| 719 | -i3GEO.editorOL.ativalayerswitcher = "<?php | ||
| 720 | - if(isset($ativalayerswitcher)){echo $ativalayerswitcher;} | ||
| 721 | - else | ||
| 722 | - {echo "false";} | ||
| 723 | -?>"; | ||
| 724 | -i3GEO.editorOL.ativarodadomouse = "<?php | ||
| 725 | - if(isset($ativarodadomouse)){echo $ativarodadomouse;} | ||
| 726 | - else | ||
| 727 | - {echo "true";} | ||
| 728 | -?>"; | 502 | + <!-- barra de icones de navegacao --> |
| 503 | + <div class="ol-i3GEOcontrols ol-control" data-traduzir="true"> | ||
| 504 | + <button title="{{{volta}}}" class="<?php echo $objBotoesHtml["zoomanterior"];?>" onclick="i3GEO.navega.extensaoAnterior()" style="float: left;"> | ||
| 505 | + <!--<img style="width:16px;" src="../imagens/oxygen/16x16/draw-triangle1.png">--> | ||
| 506 | + <i class="material-icons">undo</i> | ||
| 507 | + </button> | ||
| 508 | + <button title="{{{avanca}}}" class="<?php echo $objBotoesHtml["zoomproximo"];?>" onclick="i3GEO.navega.extensaoProximo()" style="float: left;"> | ||
| 509 | + <!--<img style="width:16px;" src="../imagens/oxygen/16x16/draw-triangle2.png">--> | ||
| 510 | + <i class="material-icons">redo</i> | ||
| 511 | + </button> | ||
| 512 | + <button title="{{{d2t}}}" class="<?php echo $objBotoesHtml["zoomtot"];?>" onclick="i3GEO.Interface.zoom2ext(i3GEO.parametros.extentTotal)" style="float: left;"> | ||
| 513 | + <!--<img style="width:20px;" src="../imagens/gisicons/projection.png">--> | ||
| 514 | + <i class="material-icons">public</i> | ||
| 515 | + </button> | ||
| 516 | + <button onclick="i3GEO.Interface.zoomli()" class="<?php echo $objBotoesHtml["zoombox"];?>" style="float: left;"> | ||
| 517 | + <!--<img style="width:20px;" src="../imagens/gisicons/zoom-region.png">--> | ||
| 518 | + <i class="material-icons">zoom_in</i> | ||
| 519 | + </button> | ||
| 729 | 520 | ||
| 730 | -i3GEO.editorOL.legendahtml = "<?php | ||
| 731 | - if(isset($legendahtml)){echo $legendahtml;} | ||
| 732 | - else | ||
| 733 | - {echo "true";} | ||
| 734 | -?>"; | 521 | + <button title="{{{graticule}}}" class="<?php echo $objBotoesHtml["grid"];?>" onclick="i3GEO.Interface.grade()" style="float: left;"> |
| 522 | + <!--<img style="width:16px;" src="../imagens/gisicons/graticule.png">--> | ||
| 523 | + <i class="material-icons">grid_on</i> | ||
| 524 | + </button> | ||
| 525 | + <button class="hidden-xs hidden-sm <?php echo $objBotoesHtml["marcador"];?>" title="{{{x79}}}" data-template="../interface/templates/ferramentasSend.html" | ||
| 526 | + onclick="i3GEO.marcador.inicia(this)" style="float: left;"> | ||
| 527 | + <!--<img style="width:20px;" src="../imagens/gisicons/save1.png">--> | ||
| 528 | + <i class="material-icons">bookmark_border</i> | ||
| 529 | + </button> | ||
| 530 | + <div id="barraDeBotoesEditor" class="olControlEditingToolbar1 noprint"></div> | ||
| 531 | + </div> | ||
| 532 | + <!--barra de progresso que e mostrada conforme as camadas sao desenhadas no mapa. Esse elemento deve ter o id="i3GEOprogressoCamadas" --> | ||
| 533 | + <div id="i3GEOprogressoCamadas" class="progress" style="display: block; position: absolute; top: 0px; height: 5px; width: 0%; margin: auto;"> | ||
| 534 | + <div class="progress-bar progress-bar-striped active" role="progressbar" style="width: 100%"></div> | ||
| 535 | + </div> | ||
| 536 | + <!--barra de aguarde id="i3GEObarraAguarde" --> | ||
| 537 | + <div id="i3GEObarraAguarde" class="progress" style="display: block; position: absolute; top: 0px; height: 5px; width: 0%; margin: auto;"> | ||
| 538 | + <div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" style="width: 100%"></div> | ||
| 539 | + </div> | ||
| 540 | + <!-- mensagem de copyright --> | ||
| 541 | + <div id="i3GEOcopyright">i3Geo</div> | ||
| 542 | + <!-- botoes laterais que abrem guias moveis --> | ||
| 543 | + <div id="i3GEOguiaMovel"> | ||
| 544 | + <!-- configuracao para todos os botoes | ||
| 545 | + data-idconteudo - id do DIV que contem o conteudo da guia e que sera mostrado ao ser clicado | ||
| 546 | + --> | ||
| 547 | + <div class="iconesGuiaMovel" data-traduzir="true" | ||
| 548 | + style="right: 0px; border-radius: 4px; padding: 0px; cursor: pointer; position: absolute; top: 5px; width: auto; z-index: 5000; background-color: rgba(255, 255, 255, .4);"> | ||
| 549 | + <!-- ferramentas | ||
| 550 | + data-idLista - id do DIV dentro de idconteudo que sera utilizado para mostrar as "pastas" que abrem o proximo nivel | ||
| 551 | + data-idLinks - id do DIV dentro de idconteudo que sera utilizado para mostrar a lista de links que abre cada ferramenta | ||
| 552 | + data-idMigalha - id do DIV que sera utilizado para mostrar o link de retorno ao nivel anterior | ||
| 553 | + --> | ||
| 554 | + <div class="<?php echo $objBotoesHtml["analise"];?>" data-idconteudo="guia8obj" data-idLinks="listaFerramentasLinks" data-idMigalha="migalhaFerramentas" data-idLista="listaFerramentas" | ||
| 555 | + onclick="i3GEO.guias.ativa('ferramentas',this)"> | ||
| 556 | + <button title="{{{iconeFerramentas}}}" class="btn btn-default iconeGuiaMovel" style="margin: 2px; color: white; box-shadow: none;"> | ||
| 557 | + <i class="material-icons">business_center</i> | ||
| 558 | + </button> | ||
| 559 | + </div> | ||
| 560 | + <!-- temas existentes no mapa | ||
| 561 | + data-idListaDeCamadas - id onde sera incluida a lista de camadas | ||
| 562 | + data-idListaFundo - id onde sera incluida a lista de camadas de fundo (mapa base) | ||
| 563 | + data-verificaAbrangencia - se for uma string, faz a verificacao se a camada esta fora da abrangencia atual do mapa, | ||
| 564 | + inserindo ou nao a string como uma classe CSS. Pode degradar a performance e depende | ||
| 565 | + do metadata existente na camada. Deixe vazio para nao ativar a operacao. | ||
| 566 | + --> | ||
| 567 | + <div class="<?php echo $objBotoesHtml["camadas"];?>" onclick="i3GEO.guias.ativa('temas',this)" data-verificaAbrangencia="" data-idconteudo="guia1obj" data-idListaFundo="listaFundo" | ||
| 568 | + data-idListaDeCamadas="listaTemas" style="margin-top: 3px;"> | ||
| 569 | + <button title="{{{iconeMapa}}}" class="btn btn-default iconeGuiaMovel" style="margin: 2px; color: white; box-shadow: none;"> | ||
| 570 | + <i class="material-icons"><i class="material-icons">visibility</i></i> | ||
| 571 | + </button> | ||
| 572 | + </div> | ||
| 573 | + <!-- catalogo de adicao de temas ao mapa | ||
| 574 | + data-idCatalogo - id do DIV que contem a primeira pagina do catalogo. Esse DIV sera escondido e mostrado conforme o usuario navega pelo catalogo | ||
| 575 | + data-idMenus - id do DIV que recebera a lista de menus cadastrados no sistema de administracao | ||
| 576 | + data-idNavegacao - id do DIV que recebera a lista de opcoes apos o usuario clicar em um item do catalogo principal | ||
| 577 | + data-idMigalha - id do DIV que recebera o link para retorno ao nivel anterior do catalogo | ||
| 735 | 578 | ||
| 736 | -<?php | ||
| 737 | -if(isset($layerDefault) && $layerDefault != ""){ | ||
| 738 | - echo "i3GEO.editorOL.layerDefault = '".$layerDefault."';\n"; | ||
| 739 | -} | ||
| 740 | -if(isset($fundo) && $fundo != ""){ | ||
| 741 | - echo "i3GEO.editorOL.fundo = '".implode(",",$fundo)."';"; | ||
| 742 | -} | 579 | + Variaveis javascript: |
| 580 | + i3GEO.catalogoMenus.IDSMENUS - (array) apenas os menus com idmenu que constem nessa lista serao mostrados. Por default e vazio. | ||
| 581 | + --> | ||
| 582 | + <div class="<?php echo $objBotoesHtml["catalogo"];?>" onclick="i3GEO.guias.ativa('adiciona',this)" data-idconteudo="guia2obj" data-idMigalha="catalogoMigalha" | ||
| 583 | + data-idNavegacao="catalogoNavegacao" data-idCatalogo="catalogoPrincipal" data-idMenus="catalogoMenus" style="margin-top: 3px;"> | ||
| 584 | + <button title="{{{iconeCatalogo}}}" class="btn btn-default iconeGuiaMovel" style="margin: 2px; color: white; box-shadow: none;"> | ||
| 585 | + <i class="material-icons">layers</i> | ||
| 586 | + </button> | ||
| 587 | + </div> | ||
| 588 | + <!-- legenda --> | ||
| 589 | + <div class="<?php echo $objBotoesHtml["legenda"];?>" onclick="i3GEO.guias.ativa('legenda',this)" data-idconteudo="guia4obj" data-idLegenda="legendaHtml" style="margin-top: 3px;"> | ||
| 590 | + <button title="{{{iconeLegenda}}}" class="btn btn-default iconeGuiaMovel" style="margin: 2px; color: white; box-shadow: none;"> | ||
| 591 | + <i class="material-icons">view_list</i> | ||
| 592 | + </button> | ||
| 593 | + </div> | ||
| 594 | + <!-- Busca --> | ||
| 595 | + <div class="<?php echo $objBotoesHtml["procura"];?>" onclick="i3GEO.guias.ativa('buscaRapida',this)" data-idconteudo="guia7obj" style="margin-top: 3px;"> | ||
| 596 | + <button class="btn btn-default iconeGuiaMovel" style="margin: 2px; color: white; box-shadow: none;"> | ||
| 597 | + <i class="material-icons">search</i> | ||
| 598 | + </button> | ||
| 599 | + </div> | ||
| 600 | + <div class="<?php echo $objBotoesHtml["identifica"];?>" onclick="i3GEO.guias.ativa('identificaBalao',this)" style="margin-top: 3px;"> | ||
| 601 | + <button title="{{{iconeBalao}}}" class="btn btn-default iconeGuiaMovel" style="margin: 2px; color: white; box-shadow: none;"> | ||
| 602 | + <i class="material-icons">location_on</i> | ||
| 603 | + </button> | ||
| 604 | + </div> | ||
| 605 | + <!-- A opcao de identificacao esta integrada ao balao de informacoes, mas pode aparecer aqui tambem | ||
| 606 | + <div class="hidden-xs hidden-sm" onclick="i3GEO.guias.ativa('identifica',this)" style="margin-top: 3px;"> | ||
| 607 | + <button title="{{{iconeIdentifica}}}" class="btn btn-default iconeGuiaMovel" style="box-shadow: none;"> | ||
| 608 | + <img src="../imagens/gisicons/pointer-info.png" style="cursor: pointer; padding: 3px;"> | ||
| 609 | + </button> | ||
| 610 | + </div> | ||
| 611 | + --> | ||
| 612 | + </div> | ||
| 613 | + <!-- veja i3GEO.guias.CONFIGURA --> | ||
| 614 | + <!-- Os IDs sao definidos no botao que ativa a guia veja: "i3GEOguiaMovel" --> | ||
| 615 | + <!-- se height nao estiver definido sera utilizada a altura do mapa --> | ||
| 616 | + <div id="i3GEOguiaMovelMolde"> | ||
| 617 | + <div id="i3GEOguiaMovelConteudo"> | ||
| 618 | + <!-- camadas existentes no mapa --> | ||
| 619 | + <div id='guia1obj' data-traduzir="true" style='display: none;'> | ||
| 620 | + <div class="i3GEOfechaGuia" onclick="i3GEO.guias.abreFecha('fecha');"> | ||
| 621 | + <span class="pull-left">{{{iconeMapa}}}</span>X | ||
| 622 | + </div> | ||
| 623 | + <div class="separadorCabecalhoGuias"> </div> | ||
| 624 | + <div class="list-group condensed noprint"> | ||
| 625 | + <label>{{{opcoes}}}</label> <a data-target="#opcoesGuia1" class="btn btn-sm btn-primary pull-right" style="margin-top: 0px; padding-top: 0px; padding-bottom: 0px;" | ||
| 626 | + type="button" data-toggle="collapse"> <span class="caret"></span> | ||
| 627 | + </a> | ||
| 628 | + <div class="text-left collapse" id="opcoesGuia1" style="margin-left: 30px;"> | ||
| 629 | + <p> | ||
| 630 | + <a onclick="i3GEO.arvoreDeCamadas.atualiza(i3GEO.arvoreDeCamadas.CAMADAS,true)" href="javascript:void(0)">Refresh</a> | ||
| 631 | + </p> | ||
| 632 | + <p> | ||
| 633 | + <a onclick="i3GEO.arvoreDeCamadas.aplicaTemas('ligartodos')" href="javascript:void(0)">{{{t3a}}}</a> | ||
| 634 | + </p> | ||
| 635 | + <p> | ||
| 636 | + <a onclick="i3GEO.arvoreDeCamadas.aplicaTemas('desligartodos')" href="javascript:void(0)">{{{t3b}}}</a> | ||
| 637 | + </p> | ||
| 638 | + <p> | ||
| 639 | + <a onclick="i3GEO.arvoreDeCamadas.dialogo.excluir()" href="javascript:void(0)">{{{t12}}}</a> | ||
| 640 | + </p> | ||
| 641 | + <p> | ||
| 642 | + <a onclick="i3GEO.arvoreDeCamadas.dialogo.filtro()" href="javascript:void(0)">{{{t2a}}}</a> | ||
| 643 | + </p> | ||
| 644 | + <p> | ||
| 645 | + <a onclick="i3GEO.mapa.dialogo.opacidade()" href="javascript:void(0)">{{{t20}}}</a> | ||
| 646 | + </p> | ||
| 647 | + <p> | ||
| 648 | + <a onclick="i3GEO.mapa.dialogo.animacao()" href="javascript:void(0)">{{{p21}}}</a> | ||
| 649 | + </p> | ||
| 650 | + <p> | ||
| 651 | + <a onclick="i3GEO.mapa.dialogo.imprimir()" href="javascript:void(0)">{{{d12}}}</a> | ||
| 652 | + </p> | ||
| 653 | + <p> | ||
| 654 | + <a onclick="i3GEO.mapa.limpasel()" href="javascript:void(0)">{{{t4}}}</a> | ||
| 655 | + </p> | ||
| 656 | + </div> | ||
| 657 | + </div> | ||
| 658 | + <hr> | ||
| 659 | + <!-- Esta div acrescenta a lista de de camadas disponíveis no mapa atual --> | ||
| 660 | + <div id="listaTemas" style="overflow: none;" data-template="../interface/templates/camada.html"></div> | ||
| 661 | + <!-- Esta div acrescenta a lista de de camadas de fundo | ||
| 662 | + A lista de camadas de fundo e obtida da variavel i3GEO.Interface.openlayers.LAYERSADICIONAIS | ||
| 663 | + Essa variavel e definida via javascript, e no caso das interfaces padrao do i3Geo, e definida | ||
| 664 | + no programa interface/config.php | ||
| 665 | + --> | ||
| 666 | + <div class="list-group condensed"> | ||
| 667 | + <label>Camadas de fundo</label> <a data-target="#collapseFundo" class="btn btn-sm btn-primary pull-right" style="margin-top: 0px; padding-top: 0px; padding-bottom: 0px;" | ||
| 668 | + type="button" data-toggle="collapse"> <span class="caret"></span> | ||
| 669 | + </a> | ||
| 670 | + <div style="margin-left: 0px;" class="collapse text-left" id="collapseFundo"> | ||
| 671 | + <form> | ||
| 672 | + <div id="listaFundo" class="form-group" data-template="../interface/templates/camadaFundo.html"></div> | ||
| 673 | + </form> | ||
| 674 | + </div> | ||
| 675 | + </div> | ||
| 676 | + </div> | ||
| 677 | + <!-- Catalogo de temas --> | ||
| 678 | + <div id='guia2obj' data-traduzir="true" style='display: none; text-align: left;'> | ||
| 679 | + <div class="i3GEOfechaGuia" onclick="i3GEO.guias.abreFecha('fecha');i3GEO.catalogoMenus.mostraCatalogoPrincipal();"> | ||
| 680 | + <span class="pull-left">{{{iconeCatalogo}}}</span> X | ||
| 681 | + </div> | ||
| 682 | + <div class="separadorCabecalhoGuias"> </div> | ||
| 683 | + <!-- aqui entra a lista de elementos quando uma das opcoes e clicada --> | ||
| 684 | + <div id="catalogoMigalha" data-template="../interface/templates/catalogoMigalha.html"></div> | ||
| 685 | + <div id="catalogoNavegacao"></div> | ||
| 686 | + <!-- Opcoes --> | ||
| 687 | + <div id="catalogoPrincipal"> | ||
| 688 | + <div class="list-group condensed noprint"> | ||
| 689 | + <label>{{{opcoes}}}</label> <a data-target="#opcoesGuia2" class="btn btn-sm btn-primary pull-right" style="margin-top: 0px; padding-top: 0px; padding-bottom: 0px;" | ||
| 690 | + type="button" data-toggle="collapse"> <span class="caret"></span> | ||
| 691 | + </a> | ||
| 692 | + <div class="text-left collapse" id="opcoesGuia2" style="margin-left: 30px;"> | ||
| 693 | + <p> | ||
| 694 | + <a href="javascript:void(0)" onclick="i3GEO.login.dialogo.abreLogin()">Login/Logout</a> | ||
| 695 | + </p> | ||
| 696 | + <p> | ||
| 697 | + <!-- <a href="javascript:void(0)" onclick="i3GEO.arvoreDeTemas.atualiza()">Refresh</a> --> | ||
| 698 | + </p> | ||
| 699 | + <li class="divider"></p> | ||
| 700 | + <p> | ||
| 701 | + <a href="javascript:void(0)" onclick="i3GEO.arvoreDeTemas.dialogo.conectaservico()">{{{a15}}}</a> | ||
| 702 | + </p> | ||
| 703 | + <p> | ||
| 704 | + <a href="javascript:void(0)" onclick="i3GEO.arvoreDeTemas.dialogo.uploadarquivo()">{{{a14}}}</a> | ||
| 705 | + </p> | ||
| 706 | + <p> | ||
| 707 | + <a href="javascript:void(0)" onclick="i3GEO.arvoreDeTemas.dialogo.downloadbase()">{{{a3}}}</a> | ||
| 708 | + </p> | ||
| 709 | + <p> | ||
| 710 | + <a href="javascript:void(0)" onclick="i3GEO.arvoreDeTemas.dialogo.importarwmc()">{{{a3a}}}</a> | ||
| 711 | + </p> | ||
| 712 | + <p> | ||
| 713 | + <!-- <a href="javascript:void(0)" onclick="i3GEO.arvoreDeTemas.dialogo.nuvemTags()">{{{a5a}}}</a> --> | ||
| 714 | + </p> | ||
| 715 | + <p> | ||
| 716 | + <!-- <a href="javascript:void(0)" onclick="i3GEO.arvoreDeTemas.dialogo.carouselTemas()">Miniaturas</a> --> | ||
| 717 | + </p> | ||
| 718 | + <p> | ||
| 719 | + <a href="javascript:void(0)" onclick="i3GEO.arvoreDeTemas.dialogo.buscaInde()">Busca na INDE</a> | ||
| 720 | + </p> | ||
| 721 | + <p> | ||
| 722 | + <a href="javascript:void(0)" onclick="i3GEO.mapa.dialogo.metaestat()">Cartogramas estatisticos</a> | ||
| 723 | + </p> | ||
| 724 | + <p> | ||
| 725 | + <a href="http://localhost/i3geo/kml.php?tipoxml=kml" target="_blank">{{{a13}}}</a> | ||
| 726 | + </p> | ||
| 743 | 727 | ||
| 744 | -if(isset($controles)){ | ||
| 745 | - echo "i3GEO.editorOL.controles = [".implode(",",$objControles)."];"; | ||
| 746 | -} | ||
| 747 | -if(isset($numzoomlevels)){ | ||
| 748 | - echo "i3GEO.editorOL.numzoom = ".$numzoomlevels.";"; | ||
| 749 | -} | ||
| 750 | -if(isset($minresolution)){ | ||
| 751 | - echo "i3GEO.editorOL.minresolution = ".$minresolution.";"; | ||
| 752 | -} | ||
| 753 | -if(isset($maxextent)){ | ||
| 754 | - $maxextent = str_replace(" ",",",$maxextent); | ||
| 755 | - echo "i3GEO.editorOL.maxext = new OpenLayers.Bounds(".$maxextent.");\n"; | ||
| 756 | -} | ||
| 757 | -else{ | ||
| 758 | - echo "i3GEO.editorOL.maxext = new OpenLayers.Bounds(-76.5125927,-39.3925675209,-29.5851853,9.49014852081);\n"; | ||
| 759 | -} | ||
| 760 | -if(isset($mapext)){ | ||
| 761 | - $mapext = str_replace(" ",",",$mapext); | ||
| 762 | - echo "i3GEO.editorOL.mapext = new OpenLayers.Bounds(".$mapext.");\n"; | ||
| 763 | -} | ||
| 764 | -if(empty($fundo)){ | ||
| 765 | - // echo "i3GEO.editorOL.mapa.allOverlays = true;"; | ||
| 766 | -} | ||
| 767 | -?> | ||
| 768 | -i3GEO.Interface = {openlayers:{googleLike:true}}; | ||
| 769 | -i3GEO.editorOL.fundo = "osm"; | ||
| 770 | -//evita que seja mostrada a opcao de salvar figura | ||
| 771 | -i3GEO.editorOL.nomeFuncaoSalvar = ""; | ||
| 772 | -var temp = i3GEO.editorOL.minresolution, | ||
| 773 | - r = [ i3GEO.editorOL.minresolution ]; | ||
| 774 | -for (var j = 0; j < (i3GEO.editorOL.numzoom - 1); j++) { | ||
| 775 | - temp = temp / 2; | ||
| 776 | - r.push(temp); | ||
| 777 | -} | ||
| 778 | -i3GEO.editorOL.incluilayergrafico = true; | ||
| 779 | -i3GEO.editorOL.mapa = new OpenLayers.Map( | ||
| 780 | - 'i3geoMapa', | ||
| 781 | - { | ||
| 782 | - autoUpdateSize: false, | ||
| 783 | - controls:[], | ||
| 784 | - units : 'm', | ||
| 785 | - projection : new OpenLayers.Projection("EPSG:3857"), | ||
| 786 | - displayProjection : new OpenLayers.Projection("EPSG:4326"), | ||
| 787 | - fractionalZoom : false, | ||
| 788 | - resolutions: r, | ||
| 789 | - minResolution: i3GEO.editorOL.minresolution | ||
| 790 | - } | ||
| 791 | -); | ||
| 792 | -if(i3GEO.configura.locaplic === ""){ | ||
| 793 | - i3GEO.configura.locaplic = "../"; | ||
| 794 | -} | ||
| 795 | -//faz a inclusao das camadas que possuem plugins | ||
| 796 | -//veja o codigo PHP abaixo da funcao | ||
| 797 | -//a variavel i3GEO.editorOL.layersIniciais ja contem a entrada para o layer | ||
| 798 | -//mas vazia. Isso e necessario para incluir a camada na ordem correta | ||
| 799 | -function adicionaPluginI3geo(camada,visivel,indice){ | ||
| 800 | - if(!camada.cache){ | ||
| 801 | - camada["cache"] = "NAO"; | ||
| 802 | - } | ||
| 803 | - var n, i, l = i3GEO.pluginI3geo.layerMashup("openlayers",camada,"4326"); | ||
| 804 | - n = l.length; | ||
| 805 | - for(i = 0; i < n; i++){ | ||
| 806 | - if(l[i].displayInLayerSwitcher === true){ | ||
| 807 | - l[i].setVisibility(visivel); | 728 | + </div> |
| 729 | + </div> | ||
| 730 | + <hr> | ||
| 731 | + <!-- busca tema no catalogo | ||
| 732 | + <div class="form-group label-floating"> | ||
| 733 | + <label class="control-label" for="i3GEObuscatema">{{{a1}}}</label> | ||
| 734 | + <div class="input-group"> | ||
| 735 | + <input id="i3GEObuscatema" class="form-control" type="text" value=""> | ||
| 736 | + <span class="input-group-btn"> | ||
| 737 | + <a onclick="i3GEO.arvoreDeTemas.buscaTema2($i('i3GEObuscatema').value);return false;" role="button" type="button" class="btn btn-warning btn-fab btn-fab-max" href="javascript:void(0)"> | ||
| 738 | + <span class="material-icons ">send</span> | ||
| 739 | + </a> | ||
| 740 | + </span> | ||
| 741 | + </div> | ||
| 742 | + </div> | ||
| 743 | + --> | ||
| 744 | + <!-- A lista de menus e uma funcao de i3GEO.guias.CONFIGURA.adiciona | ||
| 745 | + Nessa funcao ficam tambem os parametros: | ||
| 746 | + "idOndeMenus": "catalogoMenus", | ||
| 747 | + "idCatalogoPrincipal": "catalogoPrincipal", | ||
| 748 | + "idCatalogoNavegacao": "catalogoNavegacao", | ||
| 749 | + "idOndeMigalha": "catalogoMigalha" | ||
| 750 | + --> | ||
| 751 | + <div id="catalogoMenus" data-templateDir="../interface/templates/dir.html" data-templateTema="../interface/templates/tema.html"></div> | ||
| 752 | + | ||
| 753 | + <div id="arvoreAdicionaTema"></div> | ||
| 754 | + | ||
| 755 | + <!-- | ||
| 756 | + As funcoes de inicializacao recebem um objeto com parametros. Que por padrao sao: | ||
| 757 | + config: { | ||
| 758 | + 'templateDir': '../interface/templates/dir.html', | ||
| 759 | + 'templateTema': '../interface/templates/tema.html', | ||
| 760 | + 'idCatalogoPrincipal': 'catalogoPrincipal', | ||
| 761 | + 'idCatalogoNavegacao': 'catalogoNavegacao', | ||
| 762 | + 'idOndeMigalha': 'catalogoMigalha' | ||
| 763 | + } | ||
| 764 | + | ||
| 765 | + exemplo: | ||
| 766 | + | ||
| 767 | + onclick="i3GEO.catalogoInde.inicia({'templateDir': '../interface/templates/dir.html','templateTema': '../interface/templates/tema.html','idCatalogoPrincipal':'catalogoPrincipal','idCatalogoNavegacao':'catalogoNavegacao','idOndeMigalha':'catalogoMigalha'})" | ||
| 768 | + --> | ||
| 769 | + | ||
| 770 | + <!-- servicos da INDE brasileira --> | ||
| 771 | + <div class="list-group condensed"> | ||
| 772 | + <div class="row-content text-left"> | ||
| 773 | + <a onclick="i3GEO.catalogoInde.inicia()" role="button" class="btn btn-primary btn-fab btn-fab-max" href="javascript:void(0)"><span class="material-icons ">folder_open</span></a> | ||
| 774 | + <label style="width: 255px; vertical-align: middle;"> <a onclick="i3GEO.catalogoInde.inicia()" role="button" href="javascript:void(0)"> | ||
| 775 | + <h4>INDE-Br</h4> | ||
| 776 | + </a> | ||
| 777 | + <h6>Infraestrutura Nacional de Dados Espaciais do Brasil</h6> | ||
| 778 | + </label> | ||
| 779 | + </div> | ||
| 780 | + </div> | ||
| 781 | + <hr> | ||
| 782 | + <!-- lista de wms cadastrados no sistema de administracao --> | ||
| 783 | + <div class="list-group condensed"> | ||
| 784 | + <div class="row-content text-left"> | ||
| 785 | + <a onclick="i3GEO.catalogoOgc.inicia();return false;" role="button" class="btn btn-primary btn-fab btn-fab-max" href="javascript:void(0)"><span | ||
| 786 | + class="material-icons ">folder_open</span></a> <label style="width: 255px; vertical-align: middle;"> <a onclick="i3GEO.catalogoOgc.inicia()" role="button" | ||
| 787 | + href="javascript:void(0)"> | ||
| 788 | + <h4>OGC-WMS</h4> | ||
| 789 | + </a> | ||
| 790 | + <h6>{{{descOgcWms}}}</h6> | ||
| 791 | + </label> | ||
| 792 | + </div> | ||
| 793 | + </div> | ||
| 794 | + <hr> | ||
| 795 | + <!-- regioes cadastradas no sistema de metadados --> | ||
| 796 | + <div class="list-group condensed"> | ||
| 797 | + <div class="row-content text-left"> | ||
| 798 | + <a onclick="i3GEO.catalogoRegioes.inicia()" role="button" class="btn btn-primary btn-fab btn-fab-max" href="javascript:void(0)"><span class="material-icons ">folder_open</span></a> | ||
| 799 | + <label style="width: 255px; vertical-align: middle;"> <a onclick="i3GEO.catalogoRegioes.inicia()" role="button" href="javascript:void(0)"> | ||
| 800 | + <h4>{{{x87}}}</h4> | ||
| 801 | + </a> | ||
| 802 | + <h6>{{{descLimLoc}}}</h6> | ||
| 803 | + </label> | ||
| 804 | + </div> | ||
| 805 | + </div> | ||
| 806 | + <hr> | ||
| 807 | + <!-- camadas que vem do sistema de metadados estatisticos --> | ||
| 808 | + <div class="list-group condensed"> | ||
| 809 | + <div class="row-content text-left"> | ||
| 810 | + <a onclick="i3GEO.catalogoMetaestat.inicia()" role="button" class="btn btn-primary btn-fab btn-fab-max" href="javascript:void(0)"><span class="material-icons ">folder_open</span></a> | ||
| 811 | + <label style="width: 255px; vertical-align: middle;"> <a onclick="i3GEO.catalogoMetaestat.inicia()" role="button" href="javascript:void(0)"> | ||
| 812 | + <h4>{{{x57}}}</h4> | ||
| 813 | + </a> | ||
| 814 | + <h6>{{{descMeta}}}</h6> | ||
| 815 | + </label> | ||
| 816 | + </div> | ||
| 817 | + </div> | ||
| 818 | + <hr> | ||
| 819 | + <!-- mapas cadastrados no sistema de administracao (nao funcional) | ||
| 820 | + <div class="list-group condensed"><div class="row-content text-left"> | ||
| 821 | + <a onclick="i3GEO.catalogoMapas.inicia({'seletorTemplateDir': '#guia2objTemplateDir','seletorTemplateTema': '#guia2objTemplateTema','idCatalogoPrincipal':'catalogoPrincipal','idCatalogoNavegacao':'catalogoNavegacao','idOndeMigalha':'catalogoMigalha'})" role="button" class="btn btn-primary btn-fab btn-fab-max" href="javascript:void(0)"><span class="material-icons ">folder_open</span></a> | ||
| 822 | + <label style="width: 255px;vertical-align: middle;"> | ||
| 823 | + <a onclick="i3GEO.catalogoMapas.inicia({'seletorTemplateDir': '#guia2objTemplateDir','seletorTemplateTema': '#guia2objTemplateTema','idCatalogoPrincipal':'catalogoPrincipal','idCatalogoNavegacao':'catalogoNavegacao','idOndeMigalha':'catalogoMigalha'})" role="button" href="javascript:void(0)"> | ||
| 824 | + <h4>{{{x90}}}</h4></a> | ||
| 825 | + <h6>{{{descMapas}}}</h6> | ||
| 826 | + </label> | ||
| 827 | + </div></div><hr> | ||
| 828 | + --> | ||
| 829 | + <!-- camadas por estrelas --> | ||
| 830 | + <div class="list-group condensed"> | ||
| 831 | + <div class="row-content text-left"> | ||
| 832 | + <a onclick="i3GEO.catalogoEstrelas.inicia({'valorEstrela':5,'numEstrelas':1})" role="button" class="btn btn-primary btn-fab btn-fab-max" href="javascript:void(0)"><span | ||
| 833 | + class="material-icons ">folder_open</span></a> <label style="width: 255px; vertical-align: middle;"> <a | ||
| 834 | + onclick="i3GEO.catalogoEstrelas.inicia({'valorEstrela':5,'numEstrelas':1})" role="button" href="javascript:void(0)"> | ||
| 835 | + <h4>{{{t46}}}</h4> | ||
| 836 | + </a> | ||
| 837 | + <h6>{{{descEstrelas}}}</h6> | ||
| 838 | + </label> | ||
| 839 | + </div> | ||
| 840 | + </div> | ||
| 841 | + <hr> | ||
| 842 | + <!-- sistemas que adicionam camadas --> | ||
| 843 | + <div class="list-group condensed"> | ||
| 844 | + <div class="row-content text-left"> | ||
| 845 | + <a onclick="i3GEO.catalogoSistemas.inicia()" role="button" class="btn btn-primary btn-fab btn-fab-max" href="javascript:void(0)"><span class="material-icons ">folder_open</span></a> | ||
| 846 | + <label style="width: 255px; vertical-align: middle;"> <a onclick="i3GEO.catalogoSistemas.inicia()" role="button" href="javascript:void(0)"> | ||
| 847 | + <h4>{{{a11}}}</h4> | ||
| 848 | + </a> | ||
| 849 | + <h6>{{{descSistemas}}}</h6> | ||
| 850 | + </label> | ||
| 851 | + </div> | ||
| 852 | + </div> | ||
| 853 | + <hr> | ||
| 854 | + <!-- navegacao em diretorios --> | ||
| 855 | + <div class="list-group condensed"> | ||
| 856 | + <div class="row-content text-left"> | ||
| 857 | + <a onclick="i3GEO.catalogoDir.inicia()" role="button" class="btn btn-primary btn-fab btn-fab-max" href="javascript:void(0)"><span class="material-icons ">folder_open</span></a> | ||
| 858 | + <label style="width: 255px; vertical-align: middle;"> <a onclick="i3GEO.catalogoDir.inicia()" role="button" href="javascript:void(0)"> | ||
| 859 | + <h4>{{{a6}}}</h4> | ||
| 860 | + </a> | ||
| 861 | + <h6>{{{descDir}}}</h6> | ||
| 862 | + </label> | ||
| 863 | + </div> | ||
| 864 | + </div> | ||
| 865 | + <hr> | ||
| 866 | + </div> | ||
| 867 | + </div> | ||
| 868 | + <!-- Legenda --> | ||
| 869 | + <div data-traduzir="true" id='guia4obj' style='display: none; text-align: left'> | ||
| 870 | + <div class="i3GEOfechaGuia" onclick="i3GEO.legenda.off('legendaHtml');i3GEO.guias.abreFecha('fecha');"> | ||
| 871 | + <span class="pull-left">{{{iconeLegenda}}}</span>X | ||
| 872 | + </div> | ||
| 873 | + <div class="separadorCabecalhoGuias"> </div> | ||
| 874 | + <a href='javascript:void(0)' onclick="i3GEO.legenda.inicia({'janela':true})">{{{x11}}}</a> | ||
| 875 | + <div id="legendaHtml" data-template="../interface/templates/legenda.html" data-size="35,25" style='display: none; text-align: left'></div> | ||
| 876 | + </div> | ||
| 877 | + <!-- busca | ||
| 878 | + Funcoes de busca por registros. Pode ser feita nos temas existentes no mapa, em um servico de busca e no google | ||
| 879 | + No botao que dispara a busca, ficam os parametros de configuracao | ||
| 880 | + Esses parametros indicam qual o checkbox que define o tipo de busca, o local onde os dados serao mostrados e o template para formatar o resultado | ||
| 881 | + --> | ||
| 882 | + <div data-traduzir="true" id='guia7obj' style='display: none; text-align: left'> | ||
| 883 | + <div class="i3GEOfechaGuia" onclick="i3GEO.guias.abreFecha('fecha');"> | ||
| 884 | + <span class="pull-left">{{{t23}}}</span> X | ||
| 885 | + </div> | ||
| 886 | + <div class="separadorCabecalhoGuias"> </div> | ||
| 887 | + <form onSubmit="return false;"> | ||
| 888 | + <div class="form-group label-floating"> | ||
| 889 | + <label class="control-label" for="valorBuscaRapida">{{{x36}}}</label> | ||
| 890 | + <div class="input-group"> | ||
| 891 | + <input class="form-control" type="text" value="" name="valorBuscaRapida"> <span class="input-group-btn"> <a onclick="i3GEO.busca.inicia(this);return false;" | ||
| 892 | + data-templateGoogle="../interface/templates/buscaEmTemas.html" data-inputGoogle="[name=google]" data-ondeGoogle=".i3GEOresultadoBuscaGoogle" | ||
| 893 | + data-templateTemasMapa="../interface/templates/buscaEmTemas.html" data-inputTemasMapa="[name=temasMapa]" data-ondeTemasMapa=".i3GEOresultadoBuscaTemasMapa" | ||
| 894 | + data-templateServico="../interface/templates/buscaEmServico.html" data-ondeConteiner="#guia7obj" data-inputOndePalavra="[name=valorBuscaRapida]" | ||
| 895 | + data-inputServicosExternos="[name=servicosExternos]" data-ondeServicosExternos=".i3GEOresultadoBuscaServicos" role="button" type="button" | ||
| 896 | + class="btn btn-warning btn-fab btn-fab-max" href="javascript:void(0)"> <span class="material-icons ">send</span> | ||
| 897 | + </a> | ||
| 898 | + </span> | ||
| 899 | + </div> | ||
| 900 | + </div> | ||
| 901 | + <h4>{{{x37}}}:</h4> | ||
| 902 | + <div class="form-inline" style="width: 100%;"> | ||
| 903 | + <div class="list-group condensed"> | ||
| 904 | + <div class="checkbox text-left"> | ||
| 905 | + <label> <input checked class="noprint" value="on" type="checkbox" value="" name="servicosExternos"> <span class="checkbox-material noprint"><span class="check"></span></span> | ||
| 906 | + {{{x38}}} | ||
| 907 | + </label> | ||
| 908 | + </div> | ||
| 909 | + </div> | ||
| 910 | + <div class="list-group condensed"> | ||
| 911 | + <div class="checkbox text-left"> | ||
| 912 | + <label> <input class="noprint" value="on" type="checkbox" name="temasMapa"> <span class="checkbox-material noprint"><span class="check"></span></span> {{{x39}}} | ||
| 913 | + </label> | ||
| 914 | + </div> | ||
| 915 | + </div> | ||
| 916 | + <!-- Apenas para a interface google maps | ||
| 917 | + <div class="list-group condensed"> | ||
| 918 | + <div class="checkbox text-left"> | ||
| 919 | + <label> | ||
| 920 | + <input class="noprint" value="on" type="checkbox" name="google"> | ||
| 921 | + <span class="checkbox-material noprint"><span class="check"></span></span> Google | ||
| 922 | + </label> | ||
| 923 | + </div> | ||
| 924 | + </div> | ||
| 925 | + --> | ||
| 926 | + </div> | ||
| 927 | + </form> | ||
| 928 | + <hr> | ||
| 929 | + <div class="i3GEOresultadoBuscaServicos"></div> | ||
| 930 | + <div class="i3GEOresultadoBuscaTemasMapa"></div> | ||
| 931 | + <div class="i3GEOresultadoBuscaGoogle"></div> | ||
| 932 | + <div class="alert alert-info" role="alert">{{{x40}}}</div> | ||
| 933 | + </div> | ||
| 934 | + <!-- Ferramentas --> | ||
| 935 | + <div data-traduzir="true" id='guia8obj' style='display: none; text-align: left'> | ||
| 936 | + <div class="i3GEOfechaGuia" onclick="i3GEO.guias.abreFecha('fecha');"> | ||
| 937 | + <span class="pull-left">{{{iconeFerramentas}}}</span> X | ||
| 938 | + </div> | ||
| 939 | + <div class="separadorCabecalhoGuias"> </div> | ||
| 940 | + <div class="form-inline" style="width: 100%;"> | ||
| 941 | + <div class="text-center form-group" style="margin: 4px;"> | ||
| 942 | + <a onclick="i3GEO.guias.abreFecha('fecha');i3GEO.analise.dialogo.area();" role="button" class="btn btn-success btn-fab btn-fab-max" href="javascript:void(0)"> <img | ||
| 943 | + style="margin-top: 4px;" src="../imagens/gisicons/area-measure.png"> | ||
| 944 | + </a> | ||
| 945 | + <h6>{{{d21at}}}</h6> | ||
| 946 | + </div> | ||
| 947 | + <div class="text-center form-group" style="margin: 4px;"> | ||
| 948 | + <a onclick="i3GEO.guias.abreFecha('fecha');i3GEO.analise.dialogo.distancia();" role="button" class="btn btn-success btn-fab btn-fab-max" href="javascript:void(0)"> <img | ||
| 949 | + style="margin-top: 4px;" src="../imagens/gisicons/length-measure.png"> | ||
| 950 | + </a> | ||
| 951 | + <h6>{{{d21t}}}</h6> | ||
| 952 | + </div> | ||
| 953 | + <div class="text-center form-group" style="margin: 4px;"> | ||
| 954 | + <a onclick="i3GEO.guias.abreFecha('fecha');i3GEO.mapa.dialogo.selecao();" role="button" class="btn btn-success btn-fab btn-fab-max" href="javascript:void(0)"> <img | ||
| 955 | + style="margin-top: 4px;" src="../imagens/gisicons/select.png"> | ||
| 956 | + </a> | ||
| 957 | + <h6>{{{d24t}}}</h6> | ||
| 958 | + </div> | ||
| 959 | + <div class="text-center form-group" style="margin: 4px;"> | ||
| 960 | + <a onclick="i3GEO.guias.abreFecha('fecha');i3GEO.mapa.dialogo.geolocal();" role="button" class="btn btn-success btn-fab btn-fab-max" href="javascript:void(0)"> <img | ||
| 961 | + style="margin-top: 4px;" src="../imagens/gisicons/layer-gps.png"> | ||
| 962 | + </a> | ||
| 963 | + <h6>{{{localiza}}}</h6> | ||
| 964 | + </div> | ||
| 965 | + </div> | ||
| 966 | + <div class="clearfix"></div> | ||
| 967 | + <hr> | ||
| 968 | + <div id="migalhaFerramentas" data-template="../interface/templates/ferramentasMigalha.html" style='display: block; text-align: left;'></div> | ||
| 969 | + <div id="listaFerramentasLinks" data-template="../interface/templates/ferramentasLink.html" style='display: block; text-align: left'></div> | ||
| 970 | + <div id="listaFerramentas" data-template="../interface/templates/ferramentasFolder.html" style='display: block; text-align: left'></div> | ||
| 971 | + </div> | ||
| 972 | + </div> | ||
| 973 | + </div> | ||
| 974 | + </div> | ||
| 975 | + </div> | ||
| 976 | + <script> | ||
| 977 | + //desativa os layers de fundo | ||
| 978 | + $.each(i3GEO.Interface.openlayers.LAYERSADICIONAIS, function( index, value ) { | ||
| 979 | + i3GEO.Interface.openlayers.LAYERSADICIONAIS[index].setVisible(false); | ||
| 980 | + //ativa o layer de fundo | ||
| 981 | + if(i3GEO.Interface.openlayers.LAYERSADICIONAIS[index].get("name") == "<?php echo str_replace("e_","",$parurl["fundo"]);?>"){ | ||
| 982 | + i3GEO.Interface.openlayers.LAYERSADICIONAIS[index].setVisible(true); | ||
| 808 | } | 983 | } |
| 809 | - if(l[i] != true){ | ||
| 810 | - i3GEO.editorOL.layersIniciais[indice] = l[i]; | 984 | + }); |
| 985 | + | ||
| 986 | + function adicionaBotoesEditor(){ | ||
| 987 | + i3GEO.editorOL.mapa = i3geoOL; | ||
| 988 | + if (!i3GEO.desenho.layergrafico) { | ||
| 989 | + i3GEO.desenho.openlayers.criaLayerGrafico(); | ||
| 990 | + i3GEO.editorOL.mapa.addLayers([i3GEO.desenho.layergrafico]); | ||
| 811 | } | 991 | } |
| 812 | - } | ||
| 813 | -} | ||
| 814 | -<?php | ||
| 815 | - //camadas plugin | ||
| 816 | - //cria o javascript que faz a inclusao das camadas | ||
| 817 | - //configuradas com plugins do i3geo | ||
| 818 | - //a variavel $temasPluginI3Geo e definida no inicio do PHP | ||
| 819 | - foreach ($temasPluginI3Geo as $t){ | ||
| 820 | - //var_dump($temasPluginI3Geo);exit; | ||
| 821 | - //cria um objeto javascript para iniciar o plugin | ||
| 822 | - $camada = '{"ferramentas":'.$t["ferramentas"].',"tiles":"'.$t["tiles"].'","tema": "'.$t["tema"].'","name":"'.$t["name"].'","plugini3geo":'.$t["plugin"].',"cache":"'.$t["cache"].'","transitioneffect":"'.$t["transitioneffect"].'"}'; | ||
| 823 | - echo "var camada = $camada;\n"; | ||
| 824 | - //echo "i3GEO.pluginI3geo[camada.plugini3geo.plugin].openlayers.inicia(camada,i3GEO.editorOL.mapa);\n"; | ||
| 825 | - $visivel = "false"; | ||
| 826 | - if(in_array($t["name"],$visiveis)){ | ||
| 827 | - $visivel = "true"; | 992 | + if (!i3GEO.editorOL.backup) { |
| 993 | + i3GEO.editorOL.backup = new ol.layer.Vector({ | ||
| 994 | + source : new ol.source.Vector({ | ||
| 995 | + features : new ol.Collection(), | ||
| 996 | + useSpatialIndex : false, | ||
| 997 | + name : "Backup" | ||
| 998 | + }), | ||
| 999 | + visible: false | ||
| 1000 | + }); | ||
| 1001 | + i3GEO.editorOL.backup.setMap(i3geoOL); | ||
| 1002 | + i3GEO.editorOL.backup.getFeatures = function(){ | ||
| 1003 | + return i3GEO.editorOL.backup.getSource().getFeatures(); | ||
| 1004 | + }; | ||
| 828 | } | 1005 | } |
| 829 | - echo "adicionaPluginI3geo(camada,".$visivel.",".$t["posicaoLayer"].");\n"; | ||
| 830 | - } | ||
| 831 | -?> | ||
| 832 | -i3GEO.editorOL.inicia(); | ||
| 833 | -</script> | 1006 | + //i3GEO.editorOL.botoes e definido na criacao do mapa, veja editorButtons |
| 1007 | + i3GEO.editorOL.criaBotoes(i3GEO.editor.botoes,"barraDeBotoesEditor"); | ||
| 1008 | + i3GEO.editorOL.kml = [<?php echo $kml; ?>]; | ||
| 1009 | + i3GEO.editorOL.adicionaKml(); | ||
| 1010 | + i3GEO.editorOL.numzoom = <?php echo $numzoomlevels;?>; | ||
| 1011 | + i3GEO.editorOL.marca = '<?php echo $marca;?>'; | ||
| 1012 | + i3GEO.editorOL.pontos = [<?php echo $pontos;?>]; | ||
| 1013 | + i3GEO.editorOL.adicionaMarcas(); | ||
| 1014 | + }; | ||
| 1015 | + (function() { | ||
| 1016 | + var parametrosMapa = { | ||
| 1017 | + //arquivo mapfile que servira de base para a criacao do mapa. Por default, sao utilizados os arquivos existentes em i3geo/aplicmap (geral1windows, geral1,...) | ||
| 1018 | + //Essa variavel pode ser definida em ms_configura tambem. Se nao estiver definida em nenhum lugar, o i3Geo tentara descobrir o arquivo adequado a ser utilizado. Voce pode utilizar essa opcao para abrir um mapa com as camadas que voce quiser, mas para evitar redundâncias, prefira o uso de &temasa | ||
| 1019 | + mapfilebase: "", | ||
| 1020 | + //extensao geografica do mapa | ||
| 1021 | + //deve ser definida em coordenadas no formato decimos de grau e na projecao geografica na sequencia xmin ymin xmax ymax | ||
| 1022 | + //exemplo [-77,-26,-30,6] | ||
| 1023 | + mapext: <?php echo $mapext;?>, | ||
| 1024 | + //perfil utilizado para restringir os menus de temas mostrando apenas os que correspondem a determinado perfil | ||
| 1025 | + perfil: "", | ||
| 1026 | + //layers que serao adicionados ao mapa. | ||
| 1027 | + //Cada layer corresponde ao nome do mapfile existente na pasta i3geo/temas sem a extensao '.map' | ||
| 1028 | + layers: { | ||
| 1029 | + //array com a lista dos layers que serao adicionados e ligados (visiveis) | ||
| 1030 | + add: <?php echo "['".implode("','",$temas)."']";?>, | ||
| 1031 | + //array com a lista dos layers que serao adicionados mas nao ligados | ||
| 1032 | + on: <?php echo "['".implode("','",$visiveis)."']";?>, | ||
| 1033 | + //array com os layers desligados | ||
| 1034 | + off: <?php echo "['".implode("','",$off)."']";?> | ||
| 1035 | + }, | ||
| 1036 | + //lista de coordenadas x e y que serao adicionadas como pontos no mapa | ||
| 1037 | + points: { | ||
| 1038 | + //array com a lista de coordenadas | ||
| 1039 | + coord: [], | ||
| 1040 | + //titulo da nova camada | ||
| 1041 | + title: "", | ||
| 1042 | + }, | ||
| 1043 | + //lista de coordenadas x e y que serao adicionadas como linhas no mapa | ||
| 1044 | + lines: { | ||
| 1045 | + //array de arrays com a lista de coordenadas de cada linha | ||
| 1046 | + //exemplo [[-54,-12,-50,-12],[-50,-1,-50,-2,-50,-3]] | ||
| 1047 | + coord: [[]], | ||
| 1048 | + //titulo da nova camada | ||
| 1049 | + title:"" | ||
| 1050 | + }, | ||
| 1051 | + //lista de coordenadas x e y que serao adicionadas como poligonos no mapa | ||
| 1052 | + polygons: { | ||
| 1053 | + //array de arrays com a lista de coordenadas de cada poligono. A primeira coordenada deve ser igual a ultima. | ||
| 1054 | + //exemplo [[-50,-1,-48,-2,-50,-3,-50,-1]] | ||
| 1055 | + coord: [[]], | ||
| 1056 | + //titulo da nova camada | ||
| 1057 | + title:"" | ||
| 1058 | + }, | ||
| 1059 | + //insere elementos no mapa com coordenadas definidas em wkt | ||
| 1060 | + wkt: { | ||
| 1061 | + //string no formato wkt | ||
| 1062 | + coord: "", | ||
| 1063 | + //titulo da nova camada | ||
| 1064 | + title: "" | ||
| 1065 | + }, | ||
| 1066 | + //simbolo que sera utilizado para desenhar os elementos inseridos | ||
| 1067 | + symbol: { | ||
| 1068 | + //codigo do simbolo conforme definido em i3geo/symbols | ||
| 1069 | + name: "", | ||
| 1070 | + //em rgb, exemplo "0 255 0" | ||
| 1071 | + color: "", | ||
| 1072 | + //em pixels | ||
| 1073 | + size: "" | ||
| 1074 | + }, | ||
| 1075 | + //arquivo KML que sera incluido no mapa. Valido apenas na interface google maps | ||
| 1076 | + kml: { | ||
| 1077 | + url: "" | ||
| 1078 | + }, | ||
| 1079 | + //endereco de um WMS (sera incluido como uma camada no mapa) | ||
| 1080 | + wms: { | ||
| 1081 | + url: "", | ||
| 1082 | + layer: "", | ||
| 1083 | + style: "", | ||
| 1084 | + title: "", | ||
| 1085 | + srs: "", | ||
| 1086 | + imagetype: "", | ||
| 1087 | + version: "" | ||
| 1088 | + }, | ||
| 1089 | + //filtros que serao aplicados aos layers. Utilize a expressaso conforme definido na documentacao | ||
| 1090 | + //do mapserver, exemplo | ||
| 1091 | + //{layer: "_lbiomashp",expression: "(('[CD_LEGENDA]'='CAATINGA'))"} ou {layer: "_lbiomashp",expression: "cd_legenda='CAATINGA'"} | ||
| 1092 | + filters: <?php echo $filtros;?>, | ||
| 1093 | + //id de um mapa salvo e que sera recuperado | ||
| 1094 | + restoreMapId : <?php echo $restauramapa;?>, | ||
| 1095 | + cacheOff : '<?php echo $DESLIGACACHE;?>' | ||
| 1096 | + }; | ||
| 1097 | + var config = { | ||
| 1098 | + //id do elemento HTML onde o corpo do mapa sera renderizado | ||
| 1099 | + mapBody : "mapai3Geo", | ||
| 1100 | + //tipo de mapa. Pode ser: | ||
| 1101 | + //OL - utiliza o OpenLayers e coordenadas geograficas | ||
| 1102 | + //OSM - utiliza o OpenLayers e o OpenStreetMap como fundo, em projecao semelhante ao GoogleMaps | ||
| 1103 | + //GM - utiliza o GoogleMaps como motor de controle do mapa | ||
| 1104 | + mapType : "OSM", | ||
| 1105 | + //armazena em um cookie a ultima extensao geografica do mapa e utiliza essa extensao quando o mapa for aberto | ||
| 1106 | + saveExtension : false, | ||
| 1107 | + //aplica um filtro de cores apos a renderizacao da imagem de cada camada que compoe o mapa cinza|sepiaclara|sepianormal | ||
| 1108 | + posRenderType : "", | ||
| 1109 | + //Endereco do servidor i3Geo. Utilizado para gerar as requisicoes AJAX | ||
| 1110 | + //Por default e definido como: i3GEO.util.protocolo() + "://" + window.location.host + "/i3geo" | ||
| 1111 | + i3GeoServer : "", | ||
| 1112 | + //opacidade default para camadas que nao sejam do tipo linha ou ponto | ||
| 1113 | + //a opacidade sera aplicada ao objeto HTML e nao ao LAYER original | ||
| 1114 | + //se for vazio, sera utilizado o valor definido no LAYER original | ||
| 1115 | + //Nao se aplica na interface googlemaps | ||
| 1116 | + layerOpacity: <?php echo $opacidade; ?>, | ||
| 1117 | + //Funcao que sera executada apos a inicializacao do mapa | ||
| 1118 | + afterStart : function(){ | ||
| 1119 | + //$('.iconeGuiaMovel').tooltip({animation: false, trigger: "manual", placement: "left"}); | ||
| 1120 | + //$('.iconeGuiaMovel').tooltip('show'); | ||
| 1121 | + $("#i3GEOguiaMovelConteudo").mCustomScrollbar({scrollbarPosition: "outside",theme:"inset-2-dark"}); | ||
| 1122 | + adicionaBotoesEditor(); | ||
| 1123 | + $i("openlayers").style.backgroundColor = "rgb(245,245,245)"; | ||
| 1124 | + }, | ||
| 1125 | + //parametros de configuracao de diferentes componentes do mapa, como o catalogo de temas, balao de info, etc | ||
| 1126 | + components : { | ||
| 1127 | + //define se ao clicar no mapa sera feita a busca de atributos nas camadas existentes no mapa | ||
| 1128 | + info: true, | ||
| 1129 | + //template mustache usado para o balao de info | ||
| 1130 | + //se for vazio, utiliza o default info.html | ||
| 1131 | + infoTemplate: "", | ||
| 1132 | + //define se ao clicar no mapa sera feita a busca de atributos nas camadas existentes no mapa | ||
| 1133 | + info: true, | ||
| 1134 | + //lista com os codigos dos menus que serao considerados na montagem do catalogo de temas | ||
| 1135 | + idsMenus : [], | ||
| 1136 | + //webservice utilizado na opcao de encontrar lugares | ||
| 1137 | + searchService : "http://mapas.mma.gov.br/webservices/geonames.php", | ||
| 1138 | + //webservice wms que faz a apresentacao do lugar encontrado por searchService | ||
| 1139 | + searchWms : "http://mapas.mma.gov.br/webservices/geonameswms.php", | ||
| 1140 | + //posicao do mapa de referencia, em pixels [top,right] | ||
| 1141 | + referenceMapPosition : [4,120], | ||
| 1142 | + //propriedades do balao de informacoes mostrado quando o usuario clica no mapa | ||
| 1143 | + tooltip : { | ||
| 1144 | + //o resultado sera mostrado em uma janela do tipo modal | ||
| 1145 | + modal : false, | ||
| 1146 | + //url que sera utilizada para obter os dados via $.get. Deve estar no mesmo dominio do i3Geo. | ||
| 1147 | + //Ao final da url serao inseridos os parametros &xx=&yy= com valores em decimos de grau | ||
| 1148 | + //use apenas se modal for true | ||
| 1149 | + //exemplo: http://i3geo.saude.gov.br/i3geo/sage_tabelas/odm/odm6.php? | ||
| 1150 | + url: "", | ||
| 1151 | + //template que sera usado para compor o resultado da busca de dados | ||
| 1152 | + //se for vazio, serao utilizadas as outras opcoes | ||
| 1153 | + //se contiver a string {{{url}}} a mesma sera substituida por url | ||
| 1154 | + //exemplo: "<iframe style='width:400px;height:190px;border:0px white solid' src='{{{url}}}'></iframe>" | ||
| 1155 | + templateModal: "", | ||
| 1156 | + //serao mostrados todos os dados ou apenas aqueles definidos na configuracao da camada | ||
| 1157 | + simple: true, | ||
| 1158 | + removeAoAdicionar : true, | ||
| 1159 | + //parametros exclusivos da interface openlayers | ||
| 1160 | + autoPan : true, | ||
| 1161 | + autoPanAnimation : { | ||
| 1162 | + duration : 250 | ||
| 1163 | + }, | ||
| 1164 | + minWidth : '200px', | ||
| 1165 | + //Altura e largura do tooltip (balao) | ||
| 1166 | + toolTipSize : ["100px","200px"] | ||
| 1167 | + }, | ||
| 1168 | + //barra de rolagem - ver plugin jquery https://github.com/malihu/malihu-custom-scrollbar-plugin | ||
| 1169 | + scrollBar: { | ||
| 1170 | + theme: "inset-2", | ||
| 1171 | + axis: "yx", | ||
| 1172 | + scrollbarPosition: "inside", | ||
| 1173 | + scrollButtons:{ enable: true }, | ||
| 1174 | + advanced:{ autoExpandHorizontalScroll: true } | ||
| 1175 | + } | ||
| 1176 | + }, | ||
| 1177 | + //parametros de configuracao das ferramentas que sao acionadas sob demanda | ||
| 1178 | + //ferramentas localizadas em i3geo/ferramentas | ||
| 1179 | + tools : { | ||
| 1180 | + //ferramenta de busca de camadas em um servico CSW | ||
| 1181 | + buscainde : { | ||
| 1182 | + //endereco do servico no padrao CSW | ||
| 1183 | + csw : "http://www.metadados.inde.gov.br/geonetwork/srv/br" | ||
| 1184 | + }, | ||
| 1185 | + //ferramenta de identificacao | ||
| 1186 | + identifica : { | ||
| 1187 | + //resolucao em pixels para busca de elementos | ||
| 1188 | + resolution : 8 | ||
| 1189 | + } | ||
| 1190 | + }, | ||
| 1191 | + //configuracoes especificas para a interface que utiliza o OpenLayers | ||
| 1192 | + openLayers : { | ||
| 1193 | + //utiliza ou nao tiles ao renderizar as camadas do mapa | ||
| 1194 | + //a utilizacao de tiles pode ser definida em cada camada, mas se essa propriedade for true, a definicao das camadas nao serao consideradas | ||
| 1195 | + singleTile : !<?php echo $tiles; ?>, | ||
| 1196 | + //opcoes de inicializacao do mapa conforme definido na API do OpenLayers | ||
| 1197 | + MapOptions : { | ||
| 1198 | + layers : [], | ||
| 1199 | + controls : [<?php echo implode(",",$objControles); ?>], | ||
| 1200 | + loadTilesWhileAnimating : true, | ||
| 1201 | + loadTilesWhileInteracting : true, | ||
| 1202 | + //os objetos devem ser comentados na interface googleMaps | ||
| 1203 | + interactions : [ | ||
| 1204 | + new ol.interaction.DoubleClickZoom(), | ||
| 1205 | + new ol.interaction.KeyboardPan(), | ||
| 1206 | + new ol.interaction.KeyboardZoom(), | ||
| 1207 | + <?php echo $ativarodadomouse;?> | ||
| 1208 | + new ol.interaction.PinchRotate(), | ||
| 1209 | + new ol.interaction.PinchZoom(), | ||
| 1210 | + new ol.interaction.DragZoom(), | ||
| 1211 | + new ol.interaction.DragPan() | ||
| 1212 | + ] | ||
| 1213 | + }, | ||
| 1214 | + //opcoes para o objeto view, que e uma instancia de MapOptions | ||
| 1215 | + ViewOptions : { | ||
| 1216 | + maxZoom : <?php echo $numzoomlevels;?>, | ||
| 1217 | + extent : <?php echo $maxextent;?> | ||
| 1218 | + }, | ||
| 1219 | + //botoes que sao mostrados no editor vetorial | ||
| 1220 | + editorButtons : <?php echo $botoes;?> | ||
| 1221 | + }, | ||
| 1222 | + //configuracoes especificas para a interface GoogleMaps | ||
| 1223 | + googleMaps : { | ||
| 1224 | + //opcoes de inicializacao do mapa conforme definido na API do GoogleMaps | ||
| 1225 | + MapOptions : { | ||
| 1226 | + //estilo que sera utilizado no mapa | ||
| 1227 | + //pode ser um desses: roadmap, satellite, hybrid, terrain, Red, Countries, Night, Blue, Greyscale, No roads, Mixed, Chilled | ||
| 1228 | + //ver i3GEO.Interface.googleMaps.ESTILOS | ||
| 1229 | + mapTypeId : "roadmap", | ||
| 1230 | + scaleControl : true, | ||
| 1231 | + mapTypeControl : true, | ||
| 1232 | + mapTypeControlOptions: { | ||
| 1233 | + //position : google.maps.ControlPosition.LEFT_BOTTOM | ||
| 1234 | + }, | ||
| 1235 | + zoomControl:true, | ||
| 1236 | + zoomControlOptions: { | ||
| 1237 | + //style : google.maps.ZoomControlStyle.SMALL, | ||
| 1238 | + //position : google.maps.ControlPosition.LEFT_CENTER | ||
| 1239 | + }, | ||
| 1240 | + streetViewControl : true, | ||
| 1241 | + streetViewControlOptions: { | ||
| 1242 | + //position : google.maps.ControlPosition.LEFT_CENTER | ||
| 1243 | + } | ||
| 1244 | + } | ||
| 1245 | + } | ||
| 1246 | + }; | ||
| 1247 | + // | ||
| 1248 | + //inicia o mapa | ||
| 1249 | + //Veja tambem config.php | ||
| 1250 | + // | ||
| 1251 | + //O primeiro parametro permite alterar o mapa, inserindo camadas e outras definicoes que afetam o corpo do mapa | ||
| 1252 | + //O segundo parametro inclui configuracoes que afetam o funcionamento da interface que controla a visualizacao do mapa | ||
| 1253 | + // | ||
| 1254 | + i3GEO.init(parametrosMapa,config); | ||
| 1255 | + })(); | ||
| 1256 | + </script> | ||
| 834 | </body> | 1257 | </body> |
| 835 | -</html> | 1258 | + |
| 1259 | +</html> | ||
| 836 | \ No newline at end of file | 1260 | \ No newline at end of file |
| @@ -0,0 +1,835 @@ | @@ -0,0 +1,835 @@ | ||
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * DESLIGACACHE (opcional) {sim|nao} - forca a nao usar o cache de imagens qd | ||
| 4 | + * definido como "sim", do contrário, o uso ou não do cache | ||
| 5 | + * será definido automaticamente | ||
| 6 | + */ | ||
| 7 | +include_once(dirname(__FILE__)."/../ms_configura.php"); | ||
| 8 | +include_once(dirname(__FILE__)."/../classesphp/sani_request.php"); | ||
| 9 | +include_once(dirname(__FILE__)."/../classesphp/carrega_ext.php"); | ||
| 10 | +include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); | ||
| 11 | +//error_reporting(0); | ||
| 12 | +//variaveis utilizadas | ||
| 13 | +$parurl = array_merge($_GET,$_POST); | ||
| 14 | +$desligacache = $parurl["desligacache"]; | ||
| 15 | +$opacidade = $parurl["opacidade"]; | ||
| 16 | +$nocache = $parurl["nocache"]; | ||
| 17 | +$restauramapa = $parurl["restauramapa"]; | ||
| 18 | +$mapext = $parurl["mapext"]; | ||
| 19 | +$temas = $parurl["temas"]; | ||
| 20 | +$layers = $parurl["layers"]; | ||
| 21 | +$layerDefault = $parurl["layerDefault"]; | ||
| 22 | + | ||
| 23 | +$altura = $parurl["altura"]; | ||
| 24 | +$largura = $parurl["largura"]; | ||
| 25 | +$controles = $parurl["controles"]; | ||
| 26 | +$botoes = $parurl["botoes"]; | ||
| 27 | +$fundo = $parurl["fundo"]; | ||
| 28 | +$visiveis = $parurl["visiveis"]; | ||
| 29 | +$servidor = $parurl["servidor"]; | ||
| 30 | +$kml = $parurl["kml"]; | ||
| 31 | +$numzoomlevels = $parurl["numzoomlevels"]; | ||
| 32 | +$minresolution = $parurl["minresolution"]; | ||
| 33 | +$maxextent = $parurl["maxextent"]; | ||
| 34 | + | ||
| 35 | +$pontos = $parurl["pontos"]; | ||
| 36 | +$marca = $parurl["marca"]; | ||
| 37 | +$tiles = $parurl["tiles"]; | ||
| 38 | +$incluilayergrafico = $parurl["incluilayergrafico"]; | ||
| 39 | +$ativalayerswicther = $parurl["ativalayerswicther"]; | ||
| 40 | +$ativarodadomouse = $parurl["ativarodadomouse"]; | ||
| 41 | +$legendahtml = $parurl["legendahtml"]; | ||
| 42 | +$nocache = $parurl["nocache"]; | ||
| 43 | + | ||
| 44 | +//cria as pastas temporarias caso nao existam | ||
| 45 | +if (! file_exists ( $dir_tmp )) { | ||
| 46 | + @mkdir ( $dir_tmp, 0744 ); | ||
| 47 | +} | ||
| 48 | +if (file_exists ( $dir_tmp )) { | ||
| 49 | + if (! file_exists ( $dir_tmp . "/comum" )) { | ||
| 50 | + @mkdir ( $dir_tmp . "/comum", 0744 ); | ||
| 51 | + } | ||
| 52 | + if (! file_exists ( $dir_tmp . "/saiku-datasources" )) { | ||
| 53 | + @mkdir ( $dir_tmp . "/saiku-datasources", 0744 ); | ||
| 54 | + chmod ( $dir_tmp . "/saiku-datasources", 0744 ); | ||
| 55 | + } | ||
| 56 | + if (! file_exists ( $dir_tmp . "/cache" )) { | ||
| 57 | + @mkdir ( $dir_tmp . "/cache", 0744 ); | ||
| 58 | + chmod ( $dir_tmp . "/cache", 0744 ); | ||
| 59 | + } | ||
| 60 | + if (! file_exists ( $dir_tmp . "/cache/googlemaps" )) { | ||
| 61 | + @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 ); | ||
| 62 | + chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); | ||
| 63 | + } | ||
| 64 | +} | ||
| 65 | +if(!empty($desligacache)){ | ||
| 66 | + $DESLIGACACHE = $desligacache; | ||
| 67 | +} | ||
| 68 | +if(empty($opacidade)){ | ||
| 69 | + $opacidade = 1; | ||
| 70 | +} | ||
| 71 | +// | ||
| 72 | +//verifica se em cada camada deve ser inserido um parametro aleatorio para evitar cache de imagem do lado do cliente | ||
| 73 | +// | ||
| 74 | +if($nocache == "sim"){ | ||
| 75 | + $nocache = "a".mt_rand(0, 1000)."&"; | ||
| 76 | +} | ||
| 77 | +else{ | ||
| 78 | + $nocache = ""; | ||
| 79 | +} | ||
| 80 | +//guarda os parametros das camadas que possuem plugins configurados | ||
| 81 | +$temasPluginI3Geo = array(); | ||
| 82 | +// | ||
| 83 | +// recupera um mapa salvo no banco de administracao | ||
| 84 | +// | ||
| 85 | +if(!empty($restauramapa)){ | ||
| 86 | + $xbase = restauraMapaAdmin($restauramapa,$dir_tmp); | ||
| 87 | + validaAcessoTemas($xbase,true); | ||
| 88 | + $m = ms_newMapObj($xbase); | ||
| 89 | + $w = $m->web; | ||
| 90 | + $w->set("imagepath",dirname($w->imagepath)."/"); | ||
| 91 | + $w->set("imageurl",dirname($w->imageurl)."/"); | ||
| 92 | + // apaga algumas camadas | ||
| 93 | + $l = $m->getlayerbyname("rosadosventos"); | ||
| 94 | + if($l != ""){ | ||
| 95 | + $l->set("status",MS_DELETE); | ||
| 96 | + } | ||
| 97 | + $l = $m->getlayerbyname("copyright"); | ||
| 98 | + if($l != ""){ | ||
| 99 | + $l->set("status",MS_DELETE); | ||
| 100 | + } | ||
| 101 | + $m->save($xbase); | ||
| 102 | + $temas = $xbase; | ||
| 103 | + if (!isset($mapext)){ | ||
| 104 | + $mapext = $m->extent->minx." ".$m->extent->miny." ".$m->extent->maxx." ".$m->extent->maxy; | ||
| 105 | + } | ||
| 106 | +} | ||
| 107 | +if(!isset($mapext)){ | ||
| 108 | + $versao = versao(); | ||
| 109 | + $versao = $versao["principal"]; | ||
| 110 | + if(isset($base) && $base != ""){ | ||
| 111 | + if(file_exists($base)){ | ||
| 112 | + $f = $base; | ||
| 113 | + } | ||
| 114 | + else{ | ||
| 115 | + $f = $locaplic."/aplicmap/".$base.".map"; | ||
| 116 | + } | ||
| 117 | + } | ||
| 118 | + else | ||
| 119 | + { | ||
| 120 | + $f = ""; | ||
| 121 | + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ | ||
| 122 | + $f = $locaplic."/aplicmap/geral1windowsv".$versao.".map"; | ||
| 123 | + } | ||
| 124 | + else{ | ||
| 125 | + if($f == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv'.$versao.'.map')){ | ||
| 126 | + $f = "/var/www/i3geo/aplicmap/geral1debianv".$versao.".map"; | ||
| 127 | + } | ||
| 128 | + if($f == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ | ||
| 129 | + $f = "/var/www/html/i3geo/aplicmap/geral1fedorav".$versao.".map"; | ||
| 130 | + } | ||
| 131 | + if($f == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ | ||
| 132 | + $f = "/opt/www/html/i3geo/aplicmap/geral1v".$versao.".map"; | ||
| 133 | + } | ||
| 134 | + if($f == "") | ||
| 135 | + { | ||
| 136 | + $f = $locaplic."/aplicmap/geral1v".$versao.".map"; | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + } | ||
| 140 | + if(@ms_newMapObj($f)){ | ||
| 141 | + $mapae = ms_newMapObj($f); | ||
| 142 | + $c = $mapae->extent; | ||
| 143 | + $mapext = $c->minx.",".$c->miny.",".$c->maxx.",".$c->maxy; | ||
| 144 | + } | ||
| 145 | +} | ||
| 146 | +// | ||
| 147 | +// imprime na tela a ajuda ao usuário | ||
| 148 | +// | ||
| 149 | +if(!isset($temas) && isset($layers)){ | ||
| 150 | + $temas = $layers; | ||
| 151 | +} | ||
| 152 | +if(!isset($temas)){ | ||
| 153 | + ajuda(); | ||
| 154 | +} | ||
| 155 | +// problema na versão 211 do OpenLayers. Tamanho em % não é | ||
| 156 | +// aceito | ||
| 157 | +// if(!isset($largura)) | ||
| 158 | + // {$largura = 500;} | ||
| 159 | +if(isset($largura) && !isset($altura)){ | ||
| 160 | + $altura = $largura; | ||
| 161 | +} | ||
| 162 | +if(isset($altura) && !isset($largura)){ | ||
| 163 | + $largura = $altura; | ||
| 164 | +} | ||
| 165 | +// | ||
| 166 | +// define quais controles serão mostrados no mapa | ||
| 167 | +// | ||
| 168 | +$objControles = array(); | ||
| 169 | +if(isset($controles)){ | ||
| 170 | + $controles = str_replace(" ",",",$controles); | ||
| 171 | + $controles = strtolower($controles); | ||
| 172 | + $controles = explode(",",$controles); | ||
| 173 | + if(in_array("navigation",$controles)){ | ||
| 174 | + $objControles[] = "new OpenLayers.Control.Navigation()"; | ||
| 175 | + } | ||
| 176 | + if(in_array("panzoombar",$controles)){ | ||
| 177 | + $objControles[] = "new OpenLayers.Control.PanZoomBar()"; | ||
| 178 | + } | ||
| 179 | + if(in_array("layerswitcher",$controles)){ | ||
| 180 | + $objControles[] = "new OpenLayers.Control.LayerSwitcher({'ascending':false})"; | ||
| 181 | + } | ||
| 182 | + if(in_array("scaleline",$controles)){ | ||
| 183 | + $objControles[] = "new OpenLayers.Control.ScaleLine()"; | ||
| 184 | + } | ||
| 185 | + if(in_array("mouseposition",$controles)) | ||
| 186 | + { | ||
| 187 | + $objControles[] = "new OpenLayers.Control.MousePosition({'separator':' '})"; | ||
| 188 | + } | ||
| 189 | + if(in_array("overviewmap",$controles)){ | ||
| 190 | + $objControles[] = "new OpenLayers.Control.OverviewMap()"; | ||
| 191 | + } | ||
| 192 | + if(in_array("keyboarddefaults",$controles)){ | ||
| 193 | + $objControles[] = "new OpenLayers.Control.KeyboardDefaults()"; | ||
| 194 | + } | ||
| 195 | +} | ||
| 196 | +// | ||
| 197 | +// define quais botoes serão mostrados no mapa | ||
| 198 | +// | ||
| 199 | +$objBotoes = array(); | ||
| 200 | +if(isset($botoes)){ | ||
| 201 | + $botoes = str_replace(" ",",",$botoes); | ||
| 202 | + $botoes = strtolower($botoes); | ||
| 203 | + $botoes = explode(",",$botoes); | ||
| 204 | + if(in_array("grid",$botoes)){ | ||
| 205 | + $objBotoes[] = "'grid':true"; | ||
| 206 | + } | ||
| 207 | + if(in_array("imprimir",$botoes)){ | ||
| 208 | + $objBotoes[] = "'imprimir':true"; | ||
| 209 | + } | ||
| 210 | + if(in_array("pan",$botoes)){ | ||
| 211 | + $objBotoes[] = "'pan':true"; | ||
| 212 | + } | ||
| 213 | + if(in_array("zoombox",$botoes)){ | ||
| 214 | + $objBotoes[] = "'zoombox':true"; | ||
| 215 | + } | ||
| 216 | + if(in_array("zoomtot",$botoes)){ | ||
| 217 | + $objBotoes[] = "'zoomtot':true"; | ||
| 218 | + } | ||
| 219 | + if(in_array("zoomout",$botoes)){ | ||
| 220 | + $objBotoes[] = "'zoomout':true"; | ||
| 221 | + } | ||
| 222 | + if(in_array("zoomin",$botoes)) | ||
| 223 | + { | ||
| 224 | + $objBotoes[] = "'zoomin':true"; | ||
| 225 | + } | ||
| 226 | + if(in_array("legenda",$botoes)){ | ||
| 227 | + $objBotoes[] = "'legenda':true"; | ||
| 228 | + } | ||
| 229 | + if(in_array("distancia",$botoes)){ | ||
| 230 | + $objBotoes[] = "'distancia':true"; | ||
| 231 | + } | ||
| 232 | + if(in_array("area",$botoes)){ | ||
| 233 | + $objBotoes[] = "'area':true"; | ||
| 234 | + } | ||
| 235 | + if(in_array("identifica",$botoes)){ | ||
| 236 | + $objBotoes[] = "'identifica':true"; | ||
| 237 | + } | ||
| 238 | + if(in_array("linha",$botoes)){ | ||
| 239 | + $objBotoes[] = "'linha':true"; | ||
| 240 | + } | ||
| 241 | + if(in_array("ponto",$botoes)){ | ||
| 242 | + $objBotoes[] = "'ponto':true"; | ||
| 243 | + } | ||
| 244 | + if(in_array("poligono",$botoes)){ | ||
| 245 | + $objBotoes[] = "'poligono':true"; | ||
| 246 | + } | ||
| 247 | + if(in_array("edita",$botoes)){ | ||
| 248 | + $objBotoes[] = "'edita':true"; | ||
| 249 | + } | ||
| 250 | + if(in_array("listag",$botoes)){ | ||
| 251 | + $objBotoes[] = "'listag':true"; | ||
| 252 | + } | ||
| 253 | + if(in_array("corta",$botoes)){ | ||
| 254 | + $objBotoes[] = "'corta':true"; | ||
| 255 | + } | ||
| 256 | + if(in_array("apaga",$botoes)){ | ||
| 257 | + $objBotoes[] = "'apaga':true"; | ||
| 258 | + } | ||
| 259 | + if(in_array("procura",$botoes)){ | ||
| 260 | + $objBotoes[] = "'procura':true"; | ||
| 261 | + } | ||
| 262 | + if(in_array("salva",$botoes)){ | ||
| 263 | + $objBotoes[] = "'salva':true"; | ||
| 264 | + } | ||
| 265 | + if(in_array("ajuda",$botoes)){ | ||
| 266 | + $objBotoes[] = "'ajuda':true"; | ||
| 267 | + } | ||
| 268 | + if(in_array("fecha",$botoes)){ | ||
| 269 | + $objBotoes[] = "'fecha':true"; | ||
| 270 | + } | ||
| 271 | + if(in_array("tools",$botoes)){ | ||
| 272 | + $objBotoes[] = "'tools':true"; | ||
| 273 | + } | ||
| 274 | + if(in_array("undo",$botoes)){ | ||
| 275 | + $objBotoes[] = "'undo':true"; | ||
| 276 | + } | ||
| 277 | + if(in_array("propriedades",$botoes)){ | ||
| 278 | + $objBotoes[] = "'propriedades':true"; | ||
| 279 | + } | ||
| 280 | + if(in_array("frente",$botoes)){ | ||
| 281 | + $objBotoes[] = "'frente':true"; | ||
| 282 | + } | ||
| 283 | + if(in_array("texto",$botoes)){ | ||
| 284 | + $objBotoes[] = "'texto':true"; | ||
| 285 | + } | ||
| 286 | + if(in_array("novaaba",$botoes)){ | ||
| 287 | + $objBotoes[] = "'novaaba':true"; | ||
| 288 | + } | ||
| 289 | + $botoes = "{".implode(",",$objBotoes)."}"; | ||
| 290 | +} | ||
| 291 | + | ||
| 292 | +// | ||
| 293 | +// define a lista de layers do tipo baselayers | ||
| 294 | +// $fundo é um array com a lista dos nomes possíveis ou passados | ||
| 295 | +// pela url | ||
| 296 | +// cada um deve ser definido em openlayers.js.php | ||
| 297 | +// | ||
| 298 | +if(isset($fundo) && $fundo != ""){ | ||
| 299 | + $fundo = str_replace(","," ",$fundo); | ||
| 300 | + $fundo = explode(" ",$fundo); | ||
| 301 | +} | ||
| 302 | +// | ||
| 303 | +// define quais os layers que comporão o mapa | ||
| 304 | +// | ||
| 305 | +//$objOpenLayers guarda a string javascript que sera usada para criar os objetos | ||
| 306 | +//layer do OpenLayers | ||
| 307 | +if(isset($temas)){ | ||
| 308 | + $objOpenLayers = array(); | ||
| 309 | +} | ||
| 310 | +if($temas != ""){ | ||
| 311 | + $temas = str_replace(" ",",",$temas); | ||
| 312 | + // $temas = strtolower($temas); | ||
| 313 | + $temas = explode(",",$temas); | ||
| 314 | + if(!isset($visiveis)){ | ||
| 315 | + $visiveis = $temas; | ||
| 316 | + } | ||
| 317 | + else{ | ||
| 318 | + $visiveis = str_replace(" ",",",$visiveis); | ||
| 319 | + $visiveis = explode(",",$visiveis); | ||
| 320 | + } | ||
| 321 | + $objOpenLayers = array(); | ||
| 322 | + if(!isset($servidor)){ | ||
| 323 | + $servidor = "../ogc.php"; | ||
| 324 | + } | ||
| 325 | + // | ||
| 326 | + //lista de ferramentas | ||
| 327 | + //lista os nomes de metadados que contem os parametros das | ||
| 328 | + //ferramentas customizaveis e que seraco incluidas na propriedade do layer | ||
| 329 | + // | ||
| 330 | + $listaFerramentas = array("tme","storymap","animagif"); | ||
| 331 | + $dadosTemas = pegaDadosAdminKey("SELECT codigo_tema,link_tema FROM __esq__i3geoadmin_temas WHERE codigo_tema IN('".implode($temas,',')."')","__esq__"); | ||
| 332 | + foreach($temas as $tema){ | ||
| 333 | + // | ||
| 334 | + //utilzado para obter os parametros de ferramentas especificas indicadas nos metadados do LAYER | ||
| 335 | + // | ||
| 336 | + $ferramentas = array(); | ||
| 337 | + if(file_exists($locaplic."/temas/".$tema.".gvp")){ | ||
| 338 | + include_once($locaplic."/pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php"); | ||
| 339 | + $gm = new gvsig2mapfile($locaplic."/temas/".$tema.".gvp"); | ||
| 340 | + $gvsigview = $gm->getViewsNames(); | ||
| 341 | + $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$gvsigview[0].'", "'.$servidor.'?'.$nocache.'tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&",{layers:"'.$tema.'",transparent: "true", format: "image/png"},{singleTile:false,visibility:true,isBaseLayer:false, ferramentas :'.$ferramentas.')'; | ||
| 342 | + } | ||
| 343 | + else{ | ||
| 344 | + $nomeMap = ""; | ||
| 345 | + if(file_exists($locaplic."/temas/".$tema.".map")){ | ||
| 346 | + $nomeMap = $locaplic."/temas/".$tema.".map"; | ||
| 347 | + } | ||
| 348 | + else{ | ||
| 349 | + if(file_exists($tema)){ | ||
| 350 | + $nomeMap = $tema; | ||
| 351 | + } | ||
| 352 | + else{ | ||
| 353 | + // acontece caso o mapfile tenha sido gerado na pasta | ||
| 354 | + // temporaria por algum sistema | ||
| 355 | + if(file_exists($dir_tmp."/".$tema.".map")){ | ||
| 356 | + $nomeMap = $dir_tmp."/".$tema.".map"; | ||
| 357 | + } | ||
| 358 | + } | ||
| 359 | + } | ||
| 360 | + if($nomeMap != ""){ | ||
| 361 | + $layersNomes = array(); | ||
| 362 | + $layers = array(); | ||
| 363 | + $maptemp = @ms_newMapObj($nomeMap); | ||
| 364 | + if($maptemp){ | ||
| 365 | + $nlayers = $maptemp->numlayers; | ||
| 366 | + for($i=0;$i<($nlayers);++$i) { | ||
| 367 | + $layern = $maptemp->getLayer($i); | ||
| 368 | + // | ||
| 369 | + //verifica se o layer contem ferramentas parametrizadas | ||
| 370 | + // | ||
| 371 | + foreach($listaFerramentas as $lf){ | ||
| 372 | + $meta = $layern->getmetadata($lf); | ||
| 373 | + if($meta != ""){ | ||
| 374 | + $ferramentas[] = "'".$lf."':".$meta; | ||
| 375 | + } | ||
| 376 | + } | ||
| 377 | + $ferramentas = '{'.implode(",",$ferramentas).'}'; | ||
| 378 | + if($layern->getmetadata("PLUGINI3GEO") != ""){ | ||
| 379 | + //obtem os dados necessarios para iniciar o plugin | ||
| 380 | + //os objetos layer (openLayers) sao criados apenas no final | ||
| 381 | + //do processo, pois necessitam usar javascript e nao apenas PHP | ||
| 382 | + $temasPluginI3Geo[] = array( | ||
| 383 | + "name"=>$layern->name, | ||
| 384 | + "tema"=>$layern->getmetadata("tema"), | ||
| 385 | + "plugin"=>$layern->getmetadata("PLUGINI3GEO"), | ||
| 386 | + "cache"=>strtoupper($layern->getmetadata("cache")), | ||
| 387 | + "transitioneffect"=>strtoupper($layern->getmetadata("transitioneffect")), | ||
| 388 | + "tiles"=>strtoupper($layern->getmetadata("tiles")), | ||
| 389 | + "posicaoLayer"=>count($objOpenLayers), | ||
| 390 | + "ferramentas"=>$ferramentas | ||
| 391 | + ); | ||
| 392 | + $objOpenLayers[] = ""; | ||
| 393 | + } | ||
| 394 | + else{ | ||
| 395 | + $layersNomes[] = $layern->name; | ||
| 396 | + $layers[] = $layern; | ||
| 397 | + } | ||
| 398 | + } | ||
| 399 | + $nomeLayer = implode(",",$layersNomes); | ||
| 400 | + $tituloLayer = $layern->getmetadata("tema"); | ||
| 401 | + $ebase = "false"; | ||
| 402 | + if(isset($fundo) && $fundo != ""){ | ||
| 403 | + if(in_array($tema,$fundo)){ | ||
| 404 | + $ebase = "true"; | ||
| 405 | + } | ||
| 406 | + } | ||
| 407 | + $visivel = "false"; | ||
| 408 | + if(in_array($tema,$visiveis)){ | ||
| 409 | + $visivel = "true"; | ||
| 410 | + } | ||
| 411 | + if(strtolower($DESLIGACACHE) != "sim" && $nlayers == 1 && strtoupper($layern->getmetadata("cache")) == "SIM" && $layern->getmetadata("PLUGINI3GEO") == ""){ | ||
| 412 | + // | ||
| 413 | + //obtem a fonte | ||
| 414 | + // | ||
| 415 | + $link_tema = $dadosTemas[$layern->name]; | ||
| 416 | + $link_tema = $link_tema["link_tema"]; | ||
| 417 | + if($layern->type != 2 && $layern->type != 3){ | ||
| 418 | + $opacidade = 1; | ||
| 419 | + } | ||
| 420 | + // | ||
| 421 | + //verifica se deve aplicar filtro | ||
| 422 | + // | ||
| 423 | + $filtro = $_GET["map_layer_".$layern->name."_filter"]; | ||
| 424 | + if(!empty($filtro)){ | ||
| 425 | + $DESLIGACACHE = "sim"; | ||
| 426 | + $nocache = "map_layer_".$layern->name."_filter=".$filtro."&".$nocache; | ||
| 427 | + } | ||
| 428 | + $teffect = 'transitionEffect: "resize",'; | ||
| 429 | + if(strtoupper($layern->getmetadata("transitioneffect")) == "NAO"){ | ||
| 430 | + $teffect = 'transitionEffect: null,'; | ||
| 431 | + } | ||
| 432 | + // nesse caso o layer e adicionado como TMS | ||
| 433 | + // tms leva os parametros do TMS | ||
| 434 | + //$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.'})'; | ||
| 435 | + $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.',link_tema:"'.$link_tema.'"})'; | ||
| 436 | + | ||
| 437 | + // cria um clone WMS para efeitos de getfeatureinfo | ||
| 438 | + $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.',link_tema:"'.$link_tema.'"})'; | ||
| 439 | + } | ||
| 440 | + else{ | ||
| 441 | + foreach($layers as $l){ | ||
| 442 | + $singleTile = "false"; | ||
| 443 | + if(strtoupper($l->getmetadata("TILES")) == "NAO"){ | ||
| 444 | + $singleTile = "true"; | ||
| 445 | + } | ||
| 446 | + $tituloLayer = $l->getmetadata("tema"); | ||
| 447 | + $nomeLayer = $l->name; | ||
| 448 | + $link_tema = $dadosTemas[$nomeLayer]; | ||
| 449 | + $link_tema = $link_tema["link_tema"]; | ||
| 450 | + $visivel = "false"; | ||
| 451 | + //if($l->status == MS_DEFAULT || in_array($tema,$visiveis)){ | ||
| 452 | + if(in_array($tema,$visiveis)){ | ||
| 453 | + $visivel = "true"; | ||
| 454 | + } | ||
| 455 | + if($l->type != 2 && $l->type != 3){ | ||
| 456 | + $opacidade = 1; | ||
| 457 | + } | ||
| 458 | + // | ||
| 459 | + //verifica se deve aplicar filtro | ||
| 460 | + // | ||
| 461 | + $filtro = $_GET["map_layer_".$l->name."_filter"]; | ||
| 462 | + if(!empty($filtro)){ | ||
| 463 | + $DESLIGACACHE = "sim"; | ||
| 464 | + $nocache = "map_layer_".$l->name."_filter=".$filtro."&".$nocache; | ||
| 465 | + } | ||
| 466 | + $teffect = 'transitionEffect: "resize",'; | ||
| 467 | + if(strtoupper($l->getmetadata("transitioneffect")) == "NAO"){ | ||
| 468 | + $teffect = 'transitionEffect: null,'; | ||
| 469 | + } | ||
| 470 | + if($tituloLayer != ""){ | ||
| 471 | + $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$tituloLayer.'", "'.$servidor.'?'.$nocache.'tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&",{opacity:'.$opacidade.',layers:"'.$nomeLayer.'",transparent: "true", format: "image/png"},{'.$teffect.' singleTile:'.$singleTile.',visibility:'.$visivel.',isBaseLayer:'.$ebase.', ferramentas :'.$ferramentas.',link_tema:"'.$link_tema.'"})'; | ||
| 472 | + } | ||
| 473 | + else{ | ||
| 474 | + $objOpenLayers[] = 'new OpenLayers.Layer.WMS( "'.$tituloLayer.'", "'.$servidor.'?'.$nocache.'tema='.$tema.'&DESLIGACACHE='.$DESLIGACACHE.'&",{opacity:'.$opacidade.',layers:"'.$nomeLayer.'",transparent: "true", format: "image/png"},{'.$teffect.' displayInLayerSwitcher:false,singleTile:'.$singleTile.',visibility:'.$visivel.',isBaseLayer:'.$ebase.', ferramentas :'.$ferramentas.',link_tema:"'.$link_tema.'"})'; | ||
| 475 | + } | ||
| 476 | + } | ||
| 477 | + } | ||
| 478 | + } | ||
| 479 | + } | ||
| 480 | + else{ | ||
| 481 | + echo $tema." não foi encontrado.<br>"; | ||
| 482 | + } | ||
| 483 | + } | ||
| 484 | + } | ||
| 485 | +} | ||
| 486 | +function nomeRandomicoM($n=10){ | ||
| 487 | + $nomes = ""; | ||
| 488 | + $a = 'azertyuiopqsdfghjklmwxcvbnABCDEFGHIJKLMNOPQRSTUVWXYZ'; | ||
| 489 | + $max = 51; | ||
| 490 | + for($i=0; $i < $n; ++$i) | ||
| 491 | + { | ||
| 492 | + $nomes .= $a{mt_rand(0, $max)}; | ||
| 493 | + } | ||
| 494 | + return $nomes; | ||
| 495 | +} | ||
| 496 | +function ajuda(){ | ||
| 497 | + echo " | ||
| 498 | + <pre><b> | ||
| 499 | + Mashup OpenLayers | ||
| 500 | + Parâmetros: | ||
| 501 | + restauramapa - id do mapa armazenado no sistema de administracao e que será restaurado para ser aberto novamente (veja em i3geo/admin/html/mapas.html) | ||
| 502 | + opacidade - opacidade (de 0 a 1) aplicada aos temas do tipo poligonal ou raster (default 1) | ||
| 503 | + kml - lista de endereços (url) de um arquivos kml que serão adicionados ao mapa. Separado por ',' | ||
| 504 | + servidor - por default é ../ogc.php o que força o uso do i3geo local. Esse é o programa que será utilizado em conjunto com a lista definida no parâmetro 'temas' | ||
| 505 | + temas - lista com os temas (mapfiles) do i3Geo que serão incluídos no mapa. Pode ser incluído um arquivo mapfile que esteja fora da pasta i3geo/temas. Nesse caso, deve-se definir o caminho completo do arquivo e também o parâmetro &layers | ||
| 506 | + visiveis - lista de temas (mesmos nomes do parâmetro temas) que iniciarão como visíveis no mapa. Se não for definido, todos os temas serão visíveis. | ||
| 507 | + numzoomlevels - número de níveis de zoom, default=12 | ||
| 508 | + minresolution - resolução mínima. Utilizada para definir o primeiro nível de zoom. Default=0.703125 | ||
| 509 | + maxextent - extensão geográfica máxima do mapa (xmin,ymin,xmax,ymax) | ||
| 510 | + mapext - extensão geográfica inicial do mapa (xmin,ymin,xmax,ymax) | ||
| 511 | + largura - lagura do mapa em pixels | ||
| 512 | + altura - altura do mapa em pixels | ||
| 513 | + pontos - lista de coordenadas x e y que serão incluídas como marcas no mapa | ||
| 514 | + marca - nome do arquivo que contém a imagem que será utilizada para mostrar as coordenadas | ||
| 515 | + tiles (true|false) - indica se o modo tile será usado ou não (true por default). O modo tile pode tornar o mashup mais lento em algumas situações. | ||
| 516 | + incluilayergrafico (true|false) - indica se o layer que recebe elementos gráficos será adicionado ou não ao mapa | ||
| 517 | + ativalayerswicther (true|false) - inicia o mapa com a caixa de escolha das camadas (layerSwitcher) aberta ou não. Por default, inicia fechada | ||
| 518 | + ativarodadomouse (true|false) - ativa ou não o zoom com base na roda do mouse (default é true) | ||
| 519 | + legendahtml (true|false) - ativa ou não (default é false) a geração de legenda do tipo HTML no lugar de imagem png. Legendas HTML podem ser modificadas com base em CSS. A legenda é construída com o template i3geo/aplicmap/legendaOgc.html. | ||
| 520 | + desligacache (sim|nao) - desativa o uso do cache de imagens em disco do lado do servidor, forçando a renderização dos tiles de cada camada em cada requisição | ||
| 521 | + nocache (sim) - evita o uso de imagens em cache existentes no navegador do usuário | ||
| 522 | + layerDefault (opcional) - layer que sera utilizado na ferramenta de identificacao. Quando especificado, nao sera mostrada a caixa para a escolha do layer | ||
| 523 | + | ||
| 524 | + Filtros | ||
| 525 | + | ||
| 526 | + filtros podem ser adicionados incluindo o parametro da seguinte forma: &map_layer_<nomedotema>_filter= | ||
| 527 | + | ||
| 528 | + Exemplo de filtro | ||
| 529 | + | ||
| 530 | + ?map_layer__lbiomashp_filter=(('[CD_LEGENDA]'='CAATINGA')) | ||
| 531 | + | ||
| 532 | + no caso de camadas Postgis basta usar map_layer__lbiomashp_filter=cd_legenda='CAATINGA' | ||
| 533 | + | ||
| 534 | + fundo - lista com os nomes, separados por ',' dos layers que serão usados como fundo para o mapa. Se não for definido, | ||
| 535 | + será usado o default. O primeiro da lista será o fundo ativo. Se na lista de temas de fundo estiver algum | ||
| 536 | + tema incluido com o parametro 'temas', esses serão incluídos como temas de fundo. | ||
| 537 | + Quando for vazio, o ultimo layer sera considerado como o layer de fundo | ||
| 538 | + Os seguintes fundos podem usados nessa lista: | ||
| 539 | + | ||
| 540 | + e_oce - ESRI Ocean Basemap | ||
| 541 | + e_ims - ESRI Imagery World 2D | ||
| 542 | + e_wsm - ESRI World Street Map | ||
| 543 | + ol_mma - base cartográfica do Brasil | ||
| 544 | + ol_wms - base mundial da Meta Carta | ||
| 545 | + top_wms - toponímia do servidor do MMA usado no mapa de referência | ||
| 546 | + est_wms - estados do Brasil | ||
| 547 | + | ||
| 548 | + controles - lista com os nomes dos controles que serão adicionados ao mapa. Se não for definido, todos os controles serão adicionados | ||
| 549 | + navigation | ||
| 550 | + panzoombar | ||
| 551 | + layerswitcher | ||
| 552 | + scaleline | ||
| 553 | + mouseposition | ||
| 554 | + overviewmap | ||
| 555 | + keyboarddefaults | ||
| 556 | + botoes - lista com os nomes dos botoes que serão adicionados ao mapa. Se não for definido, todos os botões serão adicionados | ||
| 557 | + pan | ||
| 558 | + zoombox | ||
| 559 | + zoomtot | ||
| 560 | + zoomin | ||
| 561 | + zoomout | ||
| 562 | + distancia | ||
| 563 | + area | ||
| 564 | + identifica | ||
| 565 | + ponto | ||
| 566 | + linha | ||
| 567 | + poligono | ||
| 568 | + texto | ||
| 569 | + edita | ||
| 570 | + listag (lista geometrias) | ||
| 571 | + apaga | ||
| 572 | + captura | ||
| 573 | + procura | ||
| 574 | + frente | ||
| 575 | + propriedades | ||
| 576 | + tools | ||
| 577 | + undo | ||
| 578 | + salva | ||
| 579 | + ajuda | ||
| 580 | + fecha | ||
| 581 | + corta | ||
| 582 | + legenda | ||
| 583 | + novaaba | ||
| 584 | + grid | ||
| 585 | + imprimir | ||
| 586 | + | ||
| 587 | + Para ver a lista de códigos de temas, que podem ser utilizados no parâmetro 'temas', acesse: | ||
| 588 | + <a href='../ogc.php?lista=temas' >lista de temas</a>. Os códigos são mostrados em vermelho. | ||
| 589 | + | ||
| 590 | + Exemplo: | ||
| 591 | + | ||
| 592 | + <iframe height='400px' src='http://mapas.mma.gov.br/i3geo/mashups/openlayers.php?temas=bioma&altura=350&largura=350' style='border: 0px solid white;' width='400px'></iframe> | ||
| 593 | + | ||
| 594 | + "; | ||
| 595 | + exit; | ||
| 596 | +} | ||
| 597 | +?> | ||
| 598 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
| 599 | +<html> | ||
| 600 | +<head> | ||
| 601 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | ||
| 602 | +<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| 603 | +<script type="text/javascript" src="openlayers_compacto.js.php"></script> | ||
| 604 | +<?php | ||
| 605 | +//carrega o script para layers do tipo plugin | ||
| 606 | +if(count($temasPluginI3Geo) > 0){ | ||
| 607 | + //echo '<script type="text/javascript" src="../classesjs/classe_plugini3geo.js"></script>'."\n"; | ||
| 608 | + echo '<script type="text/javascript" src="../classesjs/compactados/classe_plugini3geo_compacto.js"></script>'."\n"; | ||
| 609 | + echo '<script type="text/javascript" src="../pacotes/cpaint/cpaint2_compacto.inc.js"></script>'."\n"; | ||
| 610 | +} | ||
| 611 | +?> | ||
| 612 | +<link rel="stylesheet" href="openlayers_compacto.css" type="text/css" /> | ||
| 613 | + | ||
| 614 | +<style> | ||
| 615 | +.yui-skin-sam .container-minimiza { | ||
| 616 | + background: transparent | ||
| 617 | + url(../pacotes/yui290/build/assets/skins/sam/sprite.png) no-repeat | ||
| 618 | + scroll 0 -450px; | ||
| 619 | + cursor: pointer; | ||
| 620 | + height: 15px; | ||
| 621 | + position: absolute; | ||
| 622 | + right: 30px; | ||
| 623 | + top: 1px; | ||
| 624 | + width: 25px; | ||
| 625 | + z-index: 2001; | ||
| 626 | + opacity: .8; | ||
| 627 | + filter: alpha(opacity = 80); | ||
| 628 | +} | ||
| 629 | + | ||
| 630 | +.pluginParametrossql { | ||
| 631 | + background-image: url("../imagens/gisicons/settings.png"); | ||
| 632 | + background-size: 14px auto; | ||
| 633 | + cursor: pointer; | ||
| 634 | + position: relative; | ||
| 635 | + top: 3px; | ||
| 636 | + width: 14px; | ||
| 637 | +} | ||
| 638 | + | ||
| 639 | +.i3GEOiconeTme, .i3GEOiconeStorymap { | ||
| 640 | + background-size: 14px auto; | ||
| 641 | + cursor: pointer; | ||
| 642 | + position: relative; | ||
| 643 | + top: 2px; | ||
| 644 | + width: 14px; | ||
| 645 | + margin-right: 2px; | ||
| 646 | +} | ||
| 647 | + | ||
| 648 | +.ajuda_usuario { | ||
| 649 | + background-image: url(../imagens/external.png); | ||
| 650 | + background-position: 0px 0px; | ||
| 651 | + background-repeat: no-repeat; | ||
| 652 | + margin-left: 0; | ||
| 653 | + text-decoration: none; | ||
| 654 | + cursor: help; | ||
| 655 | + position: relative; | ||
| 656 | + top: 2px; | ||
| 657 | + font-size: 13px; | ||
| 658 | +} | ||
| 659 | +</style> | ||
| 660 | +</head> | ||
| 661 | +<body class=" yui-skin-sam"> | ||
| 662 | + <?php | ||
| 663 | + if(isset($largura) && $largura != ""){ | ||
| 664 | + echo '<div id=i3geoMapa style="width:'.$largura.'px;height:'.$altura.'px;"></div>'; | ||
| 665 | + } | ||
| 666 | + else{ | ||
| 667 | + echo '<div id=i3geoMapa style="width:0;height:0"></div>'; | ||
| 668 | + } | ||
| 669 | + | ||
| 670 | + ?> | ||
| 671 | + <div id=i3geoSelTemaAtivo style="height: 15em; z-index: 3000; display: none" class=" yui-skin-sam"></div> | ||
| 672 | + <script> | ||
| 673 | +OpenLayers.ImgPath = "../pacotes/openlayers/img/"; | ||
| 674 | +OpenLayers.Lang.setCode("pt-BR"); | ||
| 675 | +var m = document.getElementById("i3geoMapa"); | ||
| 676 | +if(parseInt(m.style.width,10) === 0){ | ||
| 677 | + var t = i3GEO.util.tamanhoBrowser(); | ||
| 678 | + m.style.width = (t[0]-10)+"px"; | ||
| 679 | + m.style.height = (t[1]-20)+"px"; | ||
| 680 | +} | ||
| 681 | +i3GEO.editorOL.layersIniciais = [<?php | ||
| 682 | + if(isset($objOpenLayers) && $objOpenLayers != "") | ||
| 683 | + {echo implode(",",$objOpenLayers);} | ||
| 684 | + else | ||
| 685 | + {echo "''";} | ||
| 686 | +?>]; | ||
| 687 | +<?php if(isset($botoes)){ | ||
| 688 | + echo "i3GEO.editorOL.botoes = $botoes ;"; | ||
| 689 | +} | ||
| 690 | +?> | ||
| 691 | +i3GEO.editorOL.pontos = [<?php | ||
| 692 | + if(isset($pontos)){ | ||
| 693 | + $pontos = str_replace(" ",",",$pontos); | ||
| 694 | + echo $pontos; | ||
| 695 | + } | ||
| 696 | +?>]; | ||
| 697 | +i3GEO.editorOL.kml = [<?php | ||
| 698 | + if(isset($kml)){ | ||
| 699 | + $kml = str_replace(" ",",",$kml); | ||
| 700 | + $kml = explode(",",$kml); | ||
| 701 | + echo "'".implode("','",$kml)."'"; | ||
| 702 | + } | ||
| 703 | +?>]; | ||
| 704 | +i3GEO.editorOL.marca = "<?php | ||
| 705 | + if(isset($marca)){echo $marca;} | ||
| 706 | + else | ||
| 707 | + {echo "../pacotes/openlayers/img/marker-gold.png";} | ||
| 708 | +?>"; | ||
| 709 | +i3GEO.editorOL.tiles = "<?php | ||
| 710 | + if(isset($tiles)){echo $tiles;} | ||
| 711 | + else | ||
| 712 | + {echo "true";} | ||
| 713 | +?>"; | ||
| 714 | +i3GEO.editorOL.incluilayergrafico = "<?php | ||
| 715 | + if(isset($incluilayergrafico)){echo $incluilayergrafico;} | ||
| 716 | + else | ||
| 717 | + {echo "true";} | ||
| 718 | +?>"; | ||
| 719 | +i3GEO.editorOL.ativalayerswitcher = "<?php | ||
| 720 | + if(isset($ativalayerswitcher)){echo $ativalayerswitcher;} | ||
| 721 | + else | ||
| 722 | + {echo "false";} | ||
| 723 | +?>"; | ||
| 724 | +i3GEO.editorOL.ativarodadomouse = "<?php | ||
| 725 | + if(isset($ativarodadomouse)){echo $ativarodadomouse;} | ||
| 726 | + else | ||
| 727 | + {echo "true";} | ||
| 728 | +?>"; | ||
| 729 | + | ||
| 730 | +i3GEO.editorOL.legendahtml = "<?php | ||
| 731 | + if(isset($legendahtml)){echo $legendahtml;} | ||
| 732 | + else | ||
| 733 | + {echo "true";} | ||
| 734 | +?>"; | ||
| 735 | + | ||
| 736 | +<?php | ||
| 737 | +if(isset($layerDefault) && $layerDefault != ""){ | ||
| 738 | + echo "i3GEO.editorOL.layerDefault = '".$layerDefault."';\n"; | ||
| 739 | +} | ||
| 740 | +if(isset($fundo) && $fundo != ""){ | ||
| 741 | + echo "i3GEO.editorOL.fundo = '".implode(",",$fundo)."';"; | ||
| 742 | +} | ||
| 743 | + | ||
| 744 | +if(isset($controles)){ | ||
| 745 | + echo "i3GEO.editorOL.controles = [".implode(",",$objControles)."];"; | ||
| 746 | +} | ||
| 747 | +if(isset($numzoomlevels)){ | ||
| 748 | + echo "i3GEO.editorOL.numzoom = ".$numzoomlevels.";"; | ||
| 749 | +} | ||
| 750 | +if(isset($minresolution)){ | ||
| 751 | + echo "i3GEO.editorOL.minresolution = ".$minresolution.";"; | ||
| 752 | +} | ||
| 753 | +if(isset($maxextent)){ | ||
| 754 | + $maxextent = str_replace(" ",",",$maxextent); | ||
| 755 | + echo "i3GEO.editorOL.maxext = new OpenLayers.Bounds(".$maxextent.");\n"; | ||
| 756 | +} | ||
| 757 | +else{ | ||
| 758 | + echo "i3GEO.editorOL.maxext = new OpenLayers.Bounds(-76.5125927,-39.3925675209,-29.5851853,9.49014852081);\n"; | ||
| 759 | +} | ||
| 760 | +if(isset($mapext)){ | ||
| 761 | + $mapext = str_replace(" ",",",$mapext); | ||
| 762 | + echo "i3GEO.editorOL.mapext = new OpenLayers.Bounds(".$mapext.");\n"; | ||
| 763 | +} | ||
| 764 | +if(empty($fundo)){ | ||
| 765 | + // echo "i3GEO.editorOL.mapa.allOverlays = true;"; | ||
| 766 | +} | ||
| 767 | +?> | ||
| 768 | +i3GEO.Interface = {openlayers:{googleLike:true}}; | ||
| 769 | +i3GEO.editorOL.fundo = "osm"; | ||
| 770 | +//evita que seja mostrada a opcao de salvar figura | ||
| 771 | +i3GEO.editorOL.nomeFuncaoSalvar = ""; | ||
| 772 | +var temp = i3GEO.editorOL.minresolution, | ||
| 773 | + r = [ i3GEO.editorOL.minresolution ]; | ||
| 774 | +for (var j = 0; j < (i3GEO.editorOL.numzoom - 1); j++) { | ||
| 775 | + temp = temp / 2; | ||
| 776 | + r.push(temp); | ||
| 777 | +} | ||
| 778 | +i3GEO.editorOL.incluilayergrafico = true; | ||
| 779 | +i3GEO.editorOL.mapa = new OpenLayers.Map( | ||
| 780 | + 'i3geoMapa', | ||
| 781 | + { | ||
| 782 | + autoUpdateSize: false, | ||
| 783 | + controls:[], | ||
| 784 | + units : 'm', | ||
| 785 | + projection : new OpenLayers.Projection("EPSG:3857"), | ||
| 786 | + displayProjection : new OpenLayers.Projection("EPSG:4326"), | ||
| 787 | + fractionalZoom : false, | ||
| 788 | + resolutions: r, | ||
| 789 | + minResolution: i3GEO.editorOL.minresolution | ||
| 790 | + } | ||
| 791 | +); | ||
| 792 | +if(i3GEO.configura.locaplic === ""){ | ||
| 793 | + i3GEO.configura.locaplic = "../"; | ||
| 794 | +} | ||
| 795 | +//faz a inclusao das camadas que possuem plugins | ||
| 796 | +//veja o codigo PHP abaixo da funcao | ||
| 797 | +//a variavel i3GEO.editorOL.layersIniciais ja contem a entrada para o layer | ||
| 798 | +//mas vazia. Isso e necessario para incluir a camada na ordem correta | ||
| 799 | +function adicionaPluginI3geo(camada,visivel,indice){ | ||
| 800 | + if(!camada.cache){ | ||
| 801 | + camada["cache"] = "NAO"; | ||
| 802 | + } | ||
| 803 | + var n, i, l = i3GEO.pluginI3geo.layerMashup("openlayers",camada,"4326"); | ||
| 804 | + n = l.length; | ||
| 805 | + for(i = 0; i < n; i++){ | ||
| 806 | + if(l[i].displayInLayerSwitcher === true){ | ||
| 807 | + l[i].setVisibility(visivel); | ||
| 808 | + } | ||
| 809 | + if(l[i] != true){ | ||
| 810 | + i3GEO.editorOL.layersIniciais[indice] = l[i]; | ||
| 811 | + } | ||
| 812 | + } | ||
| 813 | +} | ||
| 814 | +<?php | ||
| 815 | + //camadas plugin | ||
| 816 | + //cria o javascript que faz a inclusao das camadas | ||
| 817 | + //configuradas com plugins do i3geo | ||
| 818 | + //a variavel $temasPluginI3Geo e definida no inicio do PHP | ||
| 819 | + foreach ($temasPluginI3Geo as $t){ | ||
| 820 | + //var_dump($temasPluginI3Geo);exit; | ||
| 821 | + //cria um objeto javascript para iniciar o plugin | ||
| 822 | + $camada = '{"ferramentas":'.$t["ferramentas"].',"tiles":"'.$t["tiles"].'","tema": "'.$t["tema"].'","name":"'.$t["name"].'","plugini3geo":'.$t["plugin"].',"cache":"'.$t["cache"].'","transitioneffect":"'.$t["transitioneffect"].'"}'; | ||
| 823 | + echo "var camada = $camada;\n"; | ||
| 824 | + //echo "i3GEO.pluginI3geo[camada.plugini3geo.plugin].openlayers.inicia(camada,i3GEO.editorOL.mapa);\n"; | ||
| 825 | + $visivel = "false"; | ||
| 826 | + if(in_array($t["name"],$visiveis)){ | ||
| 827 | + $visivel = "true"; | ||
| 828 | + } | ||
| 829 | + echo "adicionaPluginI3geo(camada,".$visivel.",".$t["posicaoLayer"].");\n"; | ||
| 830 | + } | ||
| 831 | +?> | ||
| 832 | +i3GEO.editorOL.inicia(); | ||
| 833 | +</script> | ||
| 834 | +</body> | ||
| 835 | +</html> |