Commit 0215f5701d570f76faf8ed5609d5ebac242335ef

Authored by Edmar Moretti
1 parent 5c4a1231

Criação de layers com base no OL3. Inclusão de esquema de tiles wmts.

classesphp/mapa_openlayers.php
... ... @@ -66,6 +66,7 @@ inicializa();
66 66 //calcula a extensao geografica com base no x,y,z
67 67 //nos casos do modo notile, a requisicao e feita como se fosse um wms
68 68 //quando for do tipo tms $_GET["tms"] contem os parametros do tile
  69 +//
69 70 if(isset($_GET["tms"])){
70 71 $_GET["WIDTH"] = 256;
71 72 $_GET["HEIGHT"] = 256;
... ... @@ -82,8 +83,50 @@ if(isset($_GET["tms"])){
82 83 $lat2 = ($y+1) / $n * 180.0 - 90.0;
83 84 $_GET["BBOX"] = $lon1." ".$lat1." ".$lon2." ".$lat2;
84 85 }
85   -$map_fileX = $_SESSION["map_file"];
  86 +//para o caso da versao 3 do OpenLayers
  87 +//excluir?
  88 +if(isset($_GET["X"])){
  89 + $box = explode(",",$_GET["BBOX"]);
  90 + $res = ($box[2] + 180) - ($box[0] + 180);
  91 + $res = $res / 256;
  92 + $z = intval((0.703125 / $res) / 4) + 1;
  93 + $x = floor((($box[0] + 180) / 360) * pow(2, $z));
  94 + $y = floor((1 - log(tan(deg2rad($box[3])) + 1 / cos(deg2rad($box[3]))) / pi()) /2 * pow(2, $z));
  95 +
  96 + $_GET["WIDTH"] = 256;
  97 + $_GET["HEIGHT"] = 256;
  98 + $_GET["tms"] = "/".$_GET["layer"]."/".$z."/".$x."/".$y.".png";
  99 + echo $_GET["BBOX"]." ".$_GET["tms"];exit;
  100 +}
  101 +if(isset($_GET["TileMatrix"])){
  102 + $_GET["WIDTH"] = 256;
  103 + $_GET["HEIGHT"] = 256;
  104 + $z = $_GET["TileMatrix"];
  105 + $x = $_GET["TileCol"];
  106 + $y = $_GET["TileRow"];
  107 + //calcula resolucoes
  108 + $res = array();
  109 + $temp = 0.703125;
  110 + for($i = 0; $i < 40; $i++){
  111 + $res[] = $temp;
  112 + $temp = $temp / 2;
  113 + }
  114 + $_GET["tms"] = "/wmts/".$_GET["layer"]."/".$z."/".$x."/".$y.".png";
  115 +
  116 + $top_left_minx = -180;
  117 + $top_left_maxy = 90;
  118 +
  119 + $x_size = $res[$z - 1] * 256;
  120 + $y_size = $x_size;
  121 +
  122 + $lon1 = $top_left_minx + ($x * $x_size);
  123 + $lat1 = $top_left_maxy - ($y * $y_size) - $y_size;
  124 + $lon2 = $top_left_minx + ($x * $x_size) + $x_size;
  125 + $lat2 = $top_left_maxy - ($y * $y_size);
86 126  
  127 + $_GET["BBOX"] = $lon1." ".$lat1." ".$lon2." ".$lat2;
  128 +}
  129 +$map_fileX = $_SESSION["map_file"];
87 130 //
88 131 //verifica se o request e OGC
89 132 if(!empty($_GET["request"])){
... ...
interface/openlayersdebug.htm
... ... @@ -5,24 +5,23 @@
5 5 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
6 6 <meta name="viewport" content="width=device-width, initial-scale=1">
7 7 <title>i3GEO - OpenLayers</title>
  8 +<script src="../pacotes/ol3/ol-debug.js"></script>
8 9 <script src="../js/i3geonaocompacto.js"></script>
9   -<script src="../pacotes/openlayers/OpenLayers2131.js.php"></script>
10 10 <link rel="stylesheet" type="text/css" href="../css/black.css">
  11 +<link rel="stylesheet" type="text/css" href="../pacotes/ol3/ol.css">
11 12 <style>
12   -.olControlEditingToolbar1 div {
13   - background-image: url(../mashups/openlayers.png);
14   - background-repeat: no-repeat;
15   - float: right;
16   - right: 50px;
17   - height: 29px;
18   - margin: 2px;
19   - width: 29px;
20   - cursor: pointer;
21   - top: 10px;
  13 +.ol-zoom {
  14 + padding-left: 4px;
  15 + padding-right: 4px;
  16 + top: 2em;
  17 +}
  18 +.ol-zoomslider {
  19 + top : 6em;
22 20 }
23 21 </style>
24 22 </head>
25 23 <body id="i3geo" style='margin-left: 7px; background: white;'>
  24 +
26 25 <!-- inclui o nome do usuario logado -->
27 26 <div id="i3GEONomeLogin" style="position: absolute; left: 10px; top: 12px; font-size: 11px; z-index: 50000"></div>
28 27 <table id='mst' summary="" style='display: none;' width=100% cellspacing='0'>
... ... @@ -94,9 +93,9 @@
94 93 </table>
95 94  
96 95 <div id="i3GEOguiaMovel" style="visibility: hidden; position: absolute; display: block; border: 0px solid white; text-align: left; z-index: 2000; background-color: none">
97   - <div style="cursor: pointer; position: absolute; top: 50%; margin-top: -65px; width: 30px; z-index: 5000; left: 18px; background-color: lightgray; border: 1px solid lightgray; border-radius: 5px; opacity: 0.8;box-shadow:-1px 0px 1px 1px rgba(200, 200, 200, 0.81)">
  96 + <div style="cursor: pointer; position: absolute; top: 50%; margin-top: -65px; width: 30px; z-index: 5000; left: 18px; background-color: lightgray; border: 1px solid lightgray; border-radius: 5px; opacity: 0.8; box-shadow: -1px 0px 1px 1px rgba(200, 200, 200, 0.81)">
98 97 <!-- <img src='../imagens/openbars1.png' style="width: 48px; position: absolute; left: -16px; height: 418px; top: -160px;">-->
99   - <div id="iconeGuia_temas" ></div>
  98 + <div id="iconeGuia_temas"></div>
100 99 <div id="iconeGuia_adiciona" style="margin-top: 3px;"></div>
101 100 <div id="iconeGuia_legenda" style="margin-top: 3px;"></div>
102 101 </div>
... ... @@ -111,7 +110,7 @@
111 110 <div id="i3GEOguiaMovelConteudo" style='top: 10px; overflow: auto; display: none; position: absolute; border-color: gray; border-width: 0px 0 0px 0px; left: 0px; height: 0px; background-color: white'>
112 111 <div id='guia1obj' style='display: none;'>
113 112 <!-- Esta div acrescenta a op&ccedil;&atilde;o de busca r&aacute;pida, caso vc queira coloc&aacute;-la em um lugar espec&iacute;fico -->
114   - <div style='left:5px;top:10px;width:150px;' id=buscaRapida ></div>
  113 + <div style='left: 5px; top: 10px; width: 150px;' id=buscaRapida></div>
115 114 <!-- Esta div acrescenta a lista de propriedades do mapa
116 115 <div id=listaPropriedades style='top: 15px;'></div>-->
117 116 <!-- Esta div acrescenta a lista de de camadas do tipo 'baselayers' espec&iacute;ficas da interface Openlayers. Veja tamb&eacute;m a op&ccedil;&atilde;o i3GEO.Interface.openlayers.GADGETS.LayerSwitcher -->
... ... @@ -133,8 +132,7 @@
133 132 </div>
134 133 </div>
135 134 <script>
136   - i3GEO.configura.locaplic = i3GEO.util.protocolo() + "://"
137   - + window.location.host + "/i3geo";
  135 + i3GEO.configura.locaplic = i3GEO.util.protocolo() + "://" + window.location.host + "/i3geo";
138 136 i3GEO.configura.autotamanho = false;
139 137 i3GEO.Interface.ATUAL = "openlayers";
140 138 i3GEO.Interface.IDCORPO = "contemImg";
... ... @@ -143,7 +141,8 @@
143 141 i3GEO.Interface.openlayers.TILES = true;
144 142  
145 143 i3GEO.configura.guardaExtensao = false;
146   - i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.finaliza = 'if($i("omenudataInterface1")){i3GEOoMenuBar.getMenuItem("omenudataInterface1").cfg.setProperty("text", " ");}';
  144 + i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.finaliza =
  145 + 'if($i("omenudataInterface1")){i3GEOoMenuBar.getMenuItem("omenudataInterface1").cfg.setProperty("text", " ");}';
147 146  
148 147 i3GEO.cria();
149 148 i3GEO.configura.mapaRefDisplay = "none";
... ... @@ -151,17 +150,17 @@
151 150 //ajusta o deslocamento da barra de botoes
152 151 i3GEO.barraDeBotoes.OFFSET = 11;
153 152 //ajusta a posicao da barra de botoes no IE
154   - if(navm){
  153 + if (navm) {
155 154 i3GEO.barraDeBotoes.OFFSET = 5;
156 155 }
157   - if(chro){
  156 + if (chro) {
158 157 i3GEO.barraDeBotoes.OFFSET = 15;
159 158 }
160 159  
161 160 i3GEO.configura.oMenuData["submenus"]["janelas"] = [];
162 161 i3GEO.ajuda.ATIVAJANELA = false;
163 162 i3GEO.idioma.IDSELETOR = "seletorIdiomas";
164   -
  163 +
165 164 //i3GEO.arvoreDeTemas.TIPOBOTAO = "radio";
166 165 i3GEO.arvoreDeTemas.OPCOESADICIONAIS.comentarios = true;
167 166 i3GEO.arvoreDeCamadas.VERIFICAABRANGENCIATEMAS = true;
... ... @@ -175,70 +174,87 @@
175 174 if ($i("i3GEOlogoMarca")) {
176 175 $i("i3GEOlogoMarca").style.display = "none";
177 176 }
178   - i3GEO.mapa.insereDobraPagina("googlemaps",
179   - "../imagens/dobragooglemaps.png"
180   - );
  177 + i3GEO.mapa.insereDobraPagina("googlemaps", "../imagens/dobragooglemaps.png");
181 178 };
182 179 //indica se a opcao de navegacao nas pastas do servidor sera ativada
183 180 i3GEO.arvoreDeTemas.OPCOESADICIONAIS.navegacaoDir = true;
184 181 i3GEO.janela.TRANSICAOSUAVE = true;
185 182  
186   - OpenLayers.ImgPath = "../pacotes/openlayers/img/";
187 183 (function() {
188   - var oce = new OpenLayers.Layer.ArcGIS93Rest(
189   - "ESRI Ocean Basemap",
190   - "http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/export",
191   - {
192   - format : "jpeg"
193   - }, {
194   - isBaseLayer : true,
195   - visibility : false
196   - });
197   - var ims = new OpenLayers.Layer.ArcGIS93Rest(
198   - "ESRI Imagery World 2D",
199   - "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export",
200   - {
201   - format : "jpeg"
202   - }, {
203   - isBaseLayer : true,
204   - visibility : false
205   - });
206   - var wsm = new OpenLayers.Layer.ArcGIS93Rest(
207   - "ESRI World Street Map",
208   - "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/export",
209   - {
210   - format : "jpeg"
211   - }, {
212   - isBaseLayer : true,
213   - visibility : false
214   - });
215   - var bra = new OpenLayers.Layer.WMS(
216   - "Base carto MMA",
217   - "http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map",
218   - {
219   - layers : "baseraster",
220   - srs : "EPSG:4618",
221   - format : "image/png",
222   - isBaseLayer : false
223   - }, {
224   - isBaseLayer : true,
225   - visibility : false
226   - });
227   -
228   - var tms = new OpenLayers.Layer.TMS("OSGEO",
229   - "http://tilecache.osgeo.org/wms-c/Basic.py/", {
230   - layername : "basic",
231   - type : "png",
232   - // set if different than the bottom left of map.maxExtent
233   - tileOrigin : new OpenLayers.LonLat(-180, -90),
234   - isBaseLayer : true,
235   - visibility : false
236   - });
237   -
238   - i3GEO.Interface.openlayers.LAYERSADICIONAIS = [ oce, ims, wsm, tms,
239   - bra ];
  184 + var bou = new ol.layer.Tile({
  185 + title : "Relevo",
  186 + visible : true,
  187 + isBaseLayer : true,
  188 + preload : 0,
  189 + name : "bou",
  190 + source : new ol.source.TileWMS({
  191 + url : 'http://demo.boundlessgeo.com/geoserver/wms',
  192 + params : {
  193 + 'LAYERS' : 'ne:NE1_HR_LC_SR_W_DR'
  194 + }
  195 + })
  196 + });
  197 + var oce = new ol.layer.Tile({
  198 + title : "ESRI Ocean Basemap",
  199 + visible : false,
  200 + isBaseLayer : true,
  201 + name : "oce",
  202 + source : new ol.source.TileArcGISRest({
  203 + url : "http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer"
  204 + })
  205 + });
  206 + var ims = new ol.layer.Tile({
  207 + title : "ESRI Imagery World 2D",
  208 + visible : false,
  209 + isBaseLayer : true,
  210 + name : "ims",
  211 + source : new ol.source.TileArcGISRest({
  212 + url : "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer"
  213 + })
  214 + });
  215 + var wsm = new ol.layer.Tile({
  216 + title : "ESRI World Street Map",
  217 + visible : false,
  218 + isBaseLayer : true,
  219 + name : "wsm",
  220 + source : new ol.source.TileArcGISRest({
  221 + url : "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"
  222 + })
  223 + });
  224 + var bra = new ol.layer.Tile({
  225 + title : "Base carto MMA",
  226 + visible : false,
  227 + isBaseLayer : true,
  228 + name : "bra",
  229 + source : new ol.source.TileWMS({
  230 + url : "http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",
  231 + params : {
  232 + 'layers' : "baseraster",
  233 + 'srs' : "EPSG:4326",
  234 + 'format' : "image/png"
  235 + }
  236 + })
  237 + });
  238 + var tms = new ol.layer.Tile({
  239 + title : "OSGEO",
  240 + visible : false,
  241 + isBaseLayer : true,
  242 + name : "tms",
  243 + source : new ol.source.TileWMS({
  244 + url : "http://tilecache.osgeo.org/wms-c/Basic.py/",
  245 + params : {
  246 + 'layers' : "basic",
  247 + 'type' : "png",
  248 + 'srs' : "EPSG:4326",
  249 + 'format' : "image/png",
  250 + 'VERSION' : '1.1.1'
  251 + }
  252 + })
  253 + });
  254 + i3GEO.Interface.openlayers.LAYERSADICIONAIS = [
  255 + bou, oce, ims, wsm, bra, tms
  256 + ];
240 257 })();
241   -
242 258 i3GEO.inicia();
243 259 </script>
244 260 </body>
... ...
js/ini_i3geo.js
... ... @@ -395,9 +395,6 @@ var i3GEO = {
395 395 // usuario clica no mapa
396 396 i3GEO.eventos.cliquePerm.ativoinicial = i3GEO.eventos.cliquePerm.ativo;
397 397 var montaMapa, mashup, tamanho;
398   - if (typeof ("i3GEOmantemCompatibilidade") === 'function') {
399   - i3GEOmantemCompatibilidade();
400   - }
401 398 i3GEO.mapa.aplicaPreferencias();
402 399 montaMapa = function(retorno) {
403 400 try {
... ... @@ -477,9 +474,9 @@ var i3GEO = {
477 474 if (i3GEO.parametros.logado === "nao") {
478 475 i3GEO.login.anulaCookie();
479 476 }
480   - //
  477 +
481 478 i3GEO.arvoreDeCamadas.registaCamadas(retorno.data.temas);
482   - //
  479 +
483 480 if (retorno.data.variaveis.navegacaoDir.toLowerCase() === "sim") {
484 481 i3GEO.arvoreDeTemas.OPCOESADICIONAIS.navegacaoDir = true;
485 482 }
... ...
js/interface.js
... ... @@ -29,16 +29,16 @@
29 29  
30 30 /**
31 31 * Licen&ccedil;a
32   - *
  32 + *
33 33 * GPL2
34   - *
  34 + *
35 35 * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
36   - *
  36 + *
37 37 * Direitos Autorais Reservados (c) 2006 Minist&eacute;rio do Meio Ambiente Brasil Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com
38   - *
  38 + *
39 39 * Este programa &eacute; software livre; voc&ecirc; pode redistribu&iacute;-lo e/ou modific&aacute;-lo sob os termos da Licen&ccedil;a
40 40 * P&uacute;blica Geral GNU conforme publicada pela Free Software Foundation;
41   - *
  41 + *
42 42 * Este programa &eacute; distribu&iacute;do na expectativa de que seja &uacute;til, por&eacute;m, SEM NENHUMA GARANTIA; nem mesmo a
43 43 * garantia impl&iacute;cita de COMERCIABILIDADE OU ADEQUAC&Atilde;O A UMA FINALIDADE ESPEC&Iacute;FICA. Consulte a Licen&ccedil;a
44 44 * P&uacute;blica Geral do GNU para mais detalhes. Voc&ecirc; deve ter recebido uma c&oacute;pia da Licen&ccedil;a P&uacute;blica Geral do
... ... @@ -53,183 +53,183 @@ i3GEO.Interface =
53 53 {
54 54 /**
55 55 * Propriedade: TABLET
56   - *
  56 + *
57 57 * Quando true, s&atilde;o aplicadas configura&ccedil;&otilde;es especiais para uso em tablets.
58   - *
  58 + *
59 59 * Altera o posicionamento da barra de bot&otilde;es e comportamento das guias. Veja o exemplo interface/openlayers_t.htm.
60   - *
  60 + *
61 61 * Tipo:
62   - *
  62 + *
63 63 * {boolean}
64   - *
  64 + *
65 65 * Default:
66   - *
  66 + *
67 67 * false
68 68 */
69 69 TABLET : false,
70 70 /**
71 71 * Propriedade: ALTTABLET
72   - *
  72 + *
73 73 * Nome do arquivo HTML com a interface alternativa utilizada quando o i3Geo detecta o uso de um dispositivo m&oacute;vel
74   - *
  74 + *
75 75 * A detec&ccedil;&atilde;o &eacute; aplicada automaticamente quando essa vari&aacute;vel for definida
76   - *
  76 + *
77 77 * Para n&atilde;o aplicar a detec&ccedil;&atilde;o, use i3GEO.Interface.ALTTABLET = ""
78   - *
  78 + *
79 79 * Tipo:
80   - *
  80 + *
81 81 * {string}
82 82 */
83 83 ALTTABLET : "",
84 84 /**
85 85 * Formato de gera&ccedil;&atilde;o da imagem.
86   - *
  86 + *
87 87 * Os formatos devem estar definidos no mapfile geral1windows.map e geral1.map. A defini&ccedil;&atilde;o dessa vari&aacute;vel
88 88 * n&atilde;o afeta a interface padr&atilde;o, que utiliza a defini&ccedil;&atilde;o que estiver ativa nos mapfiles de
89 89 * inicializa&ccedil;&atilde;o.
90   - *
  90 + *
91 91 * Tipo:
92   - *
  92 + *
93 93 * {MAPSERVER OUTPUTFORMAT}
94   - *
  94 + *
95 95 * Default:
96   - *
  96 + *
97 97 * AGG_Q
98 98 */
99 99 OUTPUTFORMAT : "AGG_Q",
100 100 /**
101 101 * Propriedade: BARRABOTOESTOP
102   - *
  102 + *
103 103 * Distancia da barra de bot&otilde;es em rela&ccedil;&atilde;o ao topo do mapa.
104   - *
  104 + *
105 105 * Tipo:
106   - *
  106 + *
107 107 * {number}
108   - *
  108 + *
109 109 * Default:
110   - *
  110 + *
111 111 * 12
112 112 */
113 113 BARRABOTOESTOP : 12,
114 114 /**
115 115 * Propriedade: BARRABOTOESLEFT
116   - *
  116 + *
117 117 * Distancia da barra de bot&otilde;es em rela&ccedil;&atilde;o ao lado esquerdo do mapa.
118   - *
  118 + *
119 119 * Tipo:
120   - *
  120 + *
121 121 * {number}
122   - *
  122 + *
123 123 * Default:
124   - *
  124 + *
125 125 * 3
126 126 */
127 127 BARRABOTOESLEFT : 3,
128 128 /**
129 129 * Propriedade: BARRADEZOOMRIGHT
130   - *
  130 + *
131 131 * Distancia da barra de bot&otilde;es em rela&ccedil;&atilde;o ao lado direito do mapa.
132   - *
  132 + *
133 133 * Utilizado para ajustar a barra de zoom
134   - *
  134 + *
135 135 * Tipo:
136   - *
  136 + *
137 137 * {number}
138   - *
  138 + *
139 139 * Default
140   - *
  140 + *
141 141 * 50
142 142 */
143 143 BARRADEZOOMRIGHT : 0,
144 144 /**
145 145 * Propriedade: BARRADEZOOMTOP
146   - *
  146 + *
147 147 * Distancia da barra de zoom em rela&ccedil;&atilde;o ao topo do mapa.
148   - *
  148 + *
149 149 * Tipo:
150   - *
  150 + *
151 151 * {number}
152   - *
  152 + *
153 153 * Default:
154   - *
  154 + *
155 155 * 20
156 156 */
157 157 BARRADEZOOMTOP : 20,
158 158 /**
159 159 * Propriedade: BARRADEZOOMLEFT
160   - *
  160 + *
161 161 * Distancia da barra de zoom em rela&ccedil;&atilde;o ao lado esquerdo do mapa.
162   - *
  162 + *
163 163 * Tipo:
164   - *
  164 + *
165 165 * {number}
166   - *
  166 + *
167 167 * Default:
168   - *
  168 + *
169 169 * 10
170 170 */
171 171 BARRADEZOOMLEFT : 10,
172 172 /**
173 173 * Propriedade: ATUAL
174   - *
  174 + *
175 175 * Interface utilizada na cria&ccedil;&atilde;o e controle do mapa.
176   - *
  176 + *
177 177 * Veja como usar nos arquivos de apresenta&ccedil;&atilde;o do mapa existentes no diret&oacute;rio i3geo/interface
178   - *
  178 + *
179 179 * O i3Geo, al&eacute;m da interface pr&oacute;pria, permite o uso de outras APIs para a constru&ccedil;&atilde;o do mapa, como
180 180 * Google Maps ou Openlayers. Essa propriedade define qual interface ser&aacute; usada. N&atilde;o confundir com o nome do HTML que
181 181 * &eacute; utilizado para mostrar o mapa.
182   - *
  182 + *
183 183 * Para definir a interface, utilize
184   - *
  184 + *
185 185 * i3GEO.Interface.ATUAL = "<valor>"
186   - *
  186 + *
187 187 * Tipo:
188   - *
  188 + *
189 189 * {string}
190   - *
  190 + *
191 191 * Valores:
192   - *
  192 + *
193 193 * openlayers|googlemaps|googleearth
194   - *
  194 + *
195 195 * Default:
196   - *
  196 + *
197 197 * openlayers
198 198 */
199 199 ATUAL : "openlayers",
200 200 /**
201 201 * Propriedade: IDCORPO
202   - *
  202 + *
203 203 * ID do elemento HTML que receber&aacute; o corpo do mapa
204   - *
  204 + *
205 205 * Tipo:
206   - *
  206 + *
207 207 * {string}
208   - *
  208 + *
209 209 * Default:
210   - *
  210 + *
211 211 * corpoMapa
212 212 */
213   - IDCORPO : "corpoMapa",
  213 + IDCORPO : "openlayers",
214 214 /**
215 215 * depreciado na versao 6.0
216 216 */
217 217 ATIVAMENUCONTEXTO : false,
218 218 /**
219 219 * Variavel: IDMAPA
220   - *
  220 + *
221 221 * ID do elemento HTML criado para conter o mapa
222   - *
  222 + *
223 223 * Esse elemento normalmente &eacute; criado dentro de IDCORPO dependendo da interface
224 224 */
225 225 IDMAPA : "",
226 226 /**
227 227 * Indica o status atual do mapa.
228   - *
  228 + *
229 229 * &Eacute; utilizado para verificar o status do mapa e bloquear ou n&atilde;o determinadas fun&ccedil;&otilde;es.
230   - *
  230 + *
231 231 * Por exemplo, na interface OpenLayers, identifica se as camadas est&atilde;o sendo atualizadas
232   - *
  232 + *
233 233 * STATUS = { atualizando: new Array(), //guarda os c&oacute;digos dos layers que est&atilde;o sendo redesenhados trocando: false
234 234 * //indica se o mapa est&aacute; na fase de troca de interface }
235 235 */
... ... @@ -287,8 +287,11 @@ i3GEO.Interface =
287 287 i3GEO.Interface.atual2ol.initemp();
288 288 }
289 289 } catch (e) {
290   - i3GEO.util.scriptTag(i3GEO.configura.locaplic + "/pacotes/openlayers/OpenLayers2131.js.php",
291   - "i3GEO.Interface.atual2ol.initemp()", "", false);
  290 + i3GEO.util.scriptTag(
  291 + i3GEO.configura.locaplic + "/pacotes/openlayers/OpenLayers2131.js.php",
  292 + "i3GEO.Interface.atual2ol.initemp()",
  293 + "",
  294 + false);
292 295 }
293 296 },
294 297 initemp : function() {
... ... @@ -310,7 +313,7 @@ i3GEO.Interface =
310 313 },
311 314 /**
312 315 * Function: redesenha
313   - *
  316 + *
314 317 * Aplica o m&eacute;todo redesenha da interface atual. Em alguns casos, a fun&ccedil;&atilde;o de redesenho aplica os mesmos
315 318 * processos da fun&ccedil;&atilde;o de atualizar o mapa. Isso ocorre pq em alguns casos as fun&ccedil;&otilde;es s&atilde;o
316 319 * otimizadas para cada situa&ccedil;&atilde;o
... ... @@ -320,13 +323,13 @@ i3GEO.Interface =
320 323 },
321 324 /**
322 325 * Function: aplicaOpacidade
323   - *
  326 + *
324 327 * Aplica um fator de opacidade a todos os layers do mapa
325   - *
  328 + *
326 329 * Parametro:
327   - *
  330 + *
328 331 * {numerico} - 0 a 1
329   - *
  332 + *
330 333 * {string} - (opcional) se for vazio aplica ao mapa todo
331 334 */
332 335 aplicaOpacidade : function(opacidade, layer) {
... ... @@ -334,7 +337,7 @@ i3GEO.Interface =
334 337 },
335 338 /**
336 339 * Function: atualizaMapa
337   - *
  340 + *
338 341 * Aplica o m&eacute;todo atualizaMapa da interface atual. Em alguns casos, a fun&ccedil;&atilde;o de redesenho aplica os mesmos
339 342 * processos da fun&ccedil;&atilde;o de atualizar o mapa. Isso ocorre pq em alguns casos as fun&ccedil;&otilde;es s&atilde;o
340 343 * otimizadas para cada situa&ccedil;&atilde;o
... ... @@ -350,14 +353,14 @@ i3GEO.Interface =
350 353 },
351 354 /**
352 355 * Function: atualizaTema
353   - *
  356 + *
354 357 * Aplica o m&eacute;todo atualizaTema da interface atual
355   - *
  358 + *
356 359 * Parametros:
357   - *
  360 + *
358 361 * {Objeto} -parametros obtidos da fun&ccedil;&atilde;o PHP de redesenho do mapa. Quando igual a "", &eacute; feita apenas a
359 362 * atualiza&ccedil;&atilde;o da camada, sem que a &aacute;rvore de camadas seja atualizada.
360   - *
  363 + *
361 364 * {string} - c&oacute;digo do tema
362 365 */
363 366 atualizaTema : function(retorno, tema) {
... ... @@ -365,11 +368,11 @@ i3GEO.Interface =
365 368 },
366 369 /**
367 370 * Function: ligaDesliga
368   - *
  371 + *
369 372 * Liga/desliga um tema
370   - *
  373 + *
371 374 * Parametros:
372   - *
  375 + *
373 376 * {object} - objeto do tipo checkbox que foi acionado na arvore de camadas ou objeto que contenha as propriedades value e checked,
374 377 * sendo value o c&oacute;digo do layer
375 378 */
... ... @@ -385,7 +388,7 @@ i3GEO.Interface =
385 388 },
386 389 /**
387 390 * Function: adicionaKml
388   - *
  391 + *
389 392 * Aplica o m&eacute;todo de adi&ccedil;&atilde;o de kml ao mapa conforme a interface atual
390 393 */
391 394 adicionaKml : function() {
... ... @@ -401,13 +404,13 @@ i3GEO.Interface =
401 404 },
402 405 /**
403 406 * Cria ou altera os elementos HTML necess&aacute;rios para a interface
404   - *
  407 + *
405 408 * Essa fun&ccedil;&atilde;o &eacute; executada na inicializa&ccedil;&atilde;o do i3geo
406   - *
  409 + *
407 410 * Parametros:
408   - *
  411 + *
409 412 * {Integer} - largura do corpo do mapa em pixels
410   - *
  413 + *
411 414 * {Integer} - altura do corpo do mapa em pixels
412 415 */
413 416 cria : function(w, h) {
... ... @@ -451,13 +454,13 @@ i3GEO.Interface =
451 454 },
452 455 /**
453 456 * Function: alteraLayers
454   - *
  457 + *
455 458 * Altera todos os layers do mapa modificando um determinado parametro
456   - *
  459 + *
457 460 * Parametros:
458   - *
  461 + *
459 462 * {string} - nome do par&acirc;metro
460   - *
  463 + *
461 464 * {string} - valor a ser atribu&iacute;do
462 465 */
463 466 alteraParametroLayers : function(parametro, valor) {
... ... @@ -479,123 +482,185 @@ i3GEO.Interface =
479 482 },
480 483 /**
481 484 * Section: i3GEO.Interface.OpenLayers
482   - *
  485 + *
483 486 * Interface com motor de navega&ccedil;&atilde;o baseado na API OpenLayers
484   - *
  487 + *
485 488 * Namespace:
486   - *
  489 + *
487 490 * i3GEO.Interface.openlayers
488   - *
  491 + *
489 492 * Utilizado quando
490   - *
  493 + *
491 494 * i3GEO.Interface.ATUAL = "openlayers"
492   - *
  495 + *
493 496 * Cria o objeto i3geoOL que pode receber os m&eacute;todos da API do OpenLayers
494 497 */
495 498 openlayers : {
  499 + // TODO incluir na ferramenta de propriedades
496 500 /**
497 501 * Propriedade: parametrosMap
498   - *
499   - * Permite incluir parametros da API do OpenLayers nao previstos no i3Geo. Veja em
500   - * http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Map-js.html
501   - *
502   - * Exemplo i3GEO.Interface.openlayers.parametrosMap.scales = [50000000, 30000000, 10000000, 5000000];
  502 + *
  503 + * Permite incluir parametros da API do OpenLayers nao previstos no i3Geo
  504 + *
  505 + * Parametros do objeto map do OpenLayers
503 506 */
504 507 parametrosMap : {
505   - controls : [],
506   - resolutions : [
507   - 0.703125,
508   - 0.3515625,
509   - 0.17578125,
510   - 0.087890625,
511   - 0.0439453125,
512   - 0.02197265625,
513   - 0.010986328125,
514   - 0.0054931640625,
515   - 0.00274658203125,
516   - 0.001373291015625,
517   - 0.0006866455078125,
518   - 0.00034332275390625,
519   - 0.000171661376953125,
520   - 0.0000858306884765625,
521   - 0.00004291534423828125,
522   - 0.000021457672119140625,
523   - 0.000010728836059570312,
524   - 0.000005364418029785156,
525   - 0.000002682209014892578
526   - ]
  508 + target : "openlayers",
  509 + layers : [],
  510 + controls : [
  511 + new ol.control.MousePosition({
  512 + projection : "EPSG:4326"
  513 + })
  514 + ],
  515 + loadTilesWhileAnimating : true,
  516 + loadTilesWhileInteracting : true
  517 + },
  518 + // TODO incluir na ferramenta de propriedades
  519 + /**
  520 + * Propriedade: parametrosView
  521 + *
  522 + * Permite incluir parametros da API do OpenLayers nao previstos no i3Geo
  523 + *
  524 + * Parametros do objeto View do OpenLayers
  525 + */
  526 + parametrosView : {
  527 +
527 528 },
528 529 /**
  530 + * Propriedade: interacoes
  531 + *
  532 + * Interacoes default utilizadas no mapa.
  533 + *
  534 + * http://openlayers.org/en/v3.4.0/apidoc/ol.interaction.Interaction.html?unstable=true
  535 + *
  536 + * Parametros do objeto Map.options.interactions do OpenLayers
  537 + *
  538 + * Tipo:
  539 + *
  540 + * {array}
  541 + */
  542 + interacoes : [
  543 + new ol.interaction.DoubleClickZoom(),
  544 + new ol.interaction.KeyboardPan(),
  545 + new ol.interaction.KeyboardZoom(),
  546 + new ol.interaction.MouseWheelZoom(),
  547 + new ol.interaction.PinchRotate(),
  548 + new ol.interaction.PinchZoom(),
  549 + new ol.interaction.DragZoom(),
  550 + // FIXME alt nao funciona
  551 + // new ol.interaction.DragRotateAndZoom({condition : ol.events.condition.altKeyOnly}),
  552 + new ol.interaction.DragPan()
  553 + ],
  554 + /**
529 555 * Propriedade: FUNDOTEMA
530   - *
  556 + *
531 557 * Estilo "background" do nome do tema na &aacute;rvore de camadas enquanto o mesmo est&aacute; sendo carregado.
532   - *
  558 + *
533 559 * Permite destacar o nome do tema que est&aacute; em processo de carregamento
534   - *
  560 + *
535 561 * Tipo:
536   - *
  562 + *
537 563 * {string}
538   - *
  564 + *
539 565 * Default:
540   - *
  566 + *
541 567 * yellow
542 568 */
543 569 FUNDOTEMA : "yellow",
544 570 /**
545 571 * Propriedade: TILES
546   - *
  572 + *
547 573 * Indica se ser&aacute; utilizado o modo de navega&ccedil;&atilde;o em tiles em todas as camadas do mapa
548   - *
  574 + *
549 575 * Ao bloquear o modo tile, o cache de imagens n&atilde;o poder&aacute; ser realizado
550   - *
  576 + *
551 577 * Tipo:
552   - *
  578 + *
553 579 * {boolean}
554   - *
  580 + *
555 581 * Default:
556   - *
  582 + *
557 583 * true
558 584 */
559 585 TILES : true,
560 586 /**
561   - * N&uacute;mero de TILES na &aacute;rea n&atilde;o vis&iacute;vel do mapa
562   - *
563   - * Tipo {integer}
564   - *
565   - * Default {0}
566   - */
567   - BUFFER : 0,
568   - /**
569 587 * Propriedade: GADGETS
570   - *
  588 + *
571 589 * Lista dos controles espec&iacute;ficos da API do OpenLayers que ser&atilde;o inseridos ou n&atilde;o no mapa
572   - *
  590 + *
573 591 * Tipo:
574   - *
  592 + *
575 593 * {object}
576   - *
  594 + *
577 595 * Default:
578   - *
579   - * {PanZoomBar:true,PanZoom: false,LayerSwitcher:true,ScaleLine:true,OverviewMap:false}
  596 + *
  597 + * {ZoomSlider:true,Zoom: false,LayerSwitcher:true,ScaleLine:true,OverviewMap:false}
580 598 */
581 599 GADGETS : {
582   - PanZoomBar : true,
583   - PanZoom : false,
584   - LayerSwitcher : true,
  600 + ZoomSlider : true,
  601 + Zoom : true,
585 602 ScaleLine : true,
586 603 OverviewMap : false
587 604 },
588 605 /**
  606 + * Propriedade: SCALELINE
  607 + *
  608 + * Propriedades da API do OL3 para o controle de barra de escala
  609 + *
  610 + * http://openlayers.org/en/v3.4.0/apidoc/ol.control.ScaleLine.html
  611 + *
  612 + * Tipo:
  613 + *
  614 + * {object}
  615 + *
  616 + * Default: {}
  617 + */
  618 + SCALELINE : {
  619 +
  620 + },
  621 + /**
  622 + * Propriedade: ZOOM
  623 + *
  624 + * Propriedades da API do OL3 para o controle de zoom
  625 + *
  626 + * http://openlayers.org/en/v3.4.0/apidoc/ol.control.Zoom.html
  627 + *
  628 + * Tipo:
  629 + *
  630 + * {object}
  631 + *
  632 + * Default: {}
  633 + */
  634 + ZOOM : {
  635 +
  636 + },
  637 + /**
  638 + * Propriedade: ZOOMSLIDER
  639 + *
  640 + * Propriedades da API do OL3 para o controle de zoomBar
  641 + *
  642 + * http://openlayers.org/en/v3.4.0/apidoc/ol.control.ZoomSlider.html
  643 + *
  644 + * Tipo:
  645 + *
  646 + * {object}
  647 + *
  648 + * Default: {}
  649 + */
  650 + ZOOMSLIDER : {
  651 +
  652 + },
  653 + /**
589 654 * Propriedade: MINEXTENT
590   - *
  655 + *
591 656 * Menor extens&atilde;o geogr&aacute;fica que pode ser mostrada no mapa
592   - *
  657 + *
593 658 * Tipo:
594   - *
  659 + *
595 660 * {array}
596   - *
  661 + *
597 662 * Default:
598   - *
  663 + *
599 664 * [-0.0003, -0.0003, 0.0003, 0.0003]
600 665 */
601 666 MINEXTENT : [
... ... @@ -603,15 +668,15 @@ i3GEO.Interface =
603 668 ],
604 669 /**
605 670 * Propriedade: MAXEXTENT
606   - *
  671 + *
607 672 * Maior extens&atilde;o geogr&aacute;fica que pode ser mostrada no mapa
608   - *
  673 + *
609 674 * Tipo:
610   - *
  675 + *
611 676 * {array}
612   - *
  677 + *
613 678 * Default:
614   - *
  679 + *
615 680 * [-180, -90, 180, 90]
616 681 */
617 682 MAXEXTENT : [
... ... @@ -619,32 +684,32 @@ i3GEO.Interface =
619 684 ],
620 685 /**
621 686 * Propriedades: LAYERSADICIONAIS
622   - *
  687 + *
623 688 * Objetos do tipo LAYER que ser&atilde;o adicionados ap&oacute;s a crioa&ccedil;&atilde;o de todos os layers default.
624   - *
  689 + *
625 690 * Tipo:
626   - *
  691 + *
627 692 * {array}
628   - *
  693 + *
629 694 */
630 695 LAYERSADICIONAIS : [],
631 696 /**
632 697 * Propriedade: LAYERFUNDO
633   - *
  698 + *
634 699 * Nome do layer do tipo baselayer que sera ativado
635 700 */
636 701 LAYERFUNDO : "",
637 702 /**
638 703 * Propriedade: googleLike
639   - *
  704 + *
640 705 * Indica se a proje&ccedil;&atilde;o cartogr&aacute;fica do mapa atual &eacute; a mesma utilizada pela API do Google Maps
641   - *
  706 + *
642 707 * Tipo:
643   - *
  708 + *
644 709 * {boolean}
645   - *
  710 + *
646 711 * Default:
647   - *
  712 + *
648 713 * false
649 714 */
650 715 googleLike : false,
... ... @@ -694,7 +759,7 @@ i3GEO.Interface =
694 759 },
695 760 /**
696 761 * Redesenha o mapa atual
697   - *
  762 + *
698 763 * s&atilde;o criados apenas os layers que ainda n&atilde;o existirem no mapa mas que existem na arvore de camadas
699 764 */
700 765 redesenha : function() {
... ... @@ -707,102 +772,81 @@ i3GEO.Interface =
707 772 },
708 773 /**
709 774 * Cria o mapa do lado do cliente (navegador) Define o que for necessario para a criacao de
710   - *
  775 + *
711 776 * i3geoOL = new OpenLayers.Map()
712 777 */
713 778 cria : function(w, h) {
714 779 var f, ins, temp, j, r, mi = i3GEO.Interface.openlayers.MINEXTENT, ma = i3GEO.Interface.openlayers.MAXEXTENT, i =
715 780 $i(i3GEO.Interface.IDCORPO), bb = i3GEO.barraDeBotoes;
716   - if (typeof (OpenLayers) == 'undefined') {
717   - return;
718   - }
719   - OpenLayers.DOTS_PER_INCH = i3GEO.util.calculaDPI();
720   - // corrige a localiza&ccedil;&atilde;o do script
721   - OpenLayers._getScriptLocation = function() {
722   - return i3GEO.configura.locaplic + "/pacotes/openlayers/";
723   - };
  781 +
724 782 if (i) {
725 783 f = $i("openlayers");
726 784 if (!f) {
727   - // ins = '<div id=openlayers
728   - // style="width:0px;height:0px;text-align:left;background-image:url('
729   - // + i3GEO.configura.locaplic
730   - // + '/imagens/i3geo1bw.jpg)"></div>';
731   - ins = '<div id=openlayers style="width:0px;height:0px;text-align:left;"></div>';
  785 + ins =
  786 + '<div id=openlayers style="display: block;position:relative;top: 0px; left: 0px;width:100%;height:100%;text-align:left;"></div>';
732 787 i.innerHTML = ins;
733 788 }
734 789 f = $i("openlayers");
735   - f.style.width = w + "px";
  790 + f.style.width = "100%";
736 791 f.style.height = h + "px";
737 792 }
738 793 i3GEO.Interface.IDMAPA = "openlayers";
739   - // i3GEO.Interface.openlayers.parametrosMap.controls = [];
740   - i3GEO.Interface.openlayers.parametrosMap.fractionalZoom = false;
741   - if (!i3GEO.Interface.openlayers.parametrosMap.minResolution) {
742   - i3GEO.Interface.openlayers.parametrosMap.minResolution = "auto";
743   - }
744   - if (!i3GEO.Interface.openlayers.parametrosMap.minExtent) {
745   - i3GEO.Interface.openlayers.parametrosMap.minExtent = new OpenLayers.Bounds(mi[0], mi[1], mi[2], mi[3]);
746   - }
747   - if (!i3GEO.Interface.openlayers.parametrosMap.maxResolution) {
748   - i3GEO.Interface.openlayers.parametrosMap.maxResolution = "auto";
  794 +
  795 + /*
  796 + * i3GEO.Interface.openlayers.parametrosMap.fractionalZoom = false; if
  797 + * (!i3GEO.Interface.openlayers.parametrosMap.minResolution) { i3GEO.Interface.openlayers.parametrosMap.minResolution =
  798 + * "auto"; } if (!i3GEO.Interface.openlayers.parametrosMap.minExtent) { i3GEO.Interface.openlayers.parametrosMap.minExtent =
  799 + * new OpenLayers.Bounds(mi[0], mi[1], mi[2], mi[3]); } if (!i3GEO.Interface.openlayers.parametrosMap.maxResolution) {
  800 + * i3GEO.Interface.openlayers.parametrosMap.maxResolution = "auto"; }
  801 + *
  802 + * if (i3GEO.Interface.openlayers.parametrosMap.numZoomLevels) { if (i3GEO.Interface.openlayers.parametrosMap.minResolution ==
  803 + * undefined ) { temp = 0.703125; } else { temp = i3GEO.Interface.openlayers.parametrosMap.minResolution; } r = [ temp ];
  804 + * for (j = 0; j < (i3GEO.Interface.openlayers.parametrosMap.numZoomLevels - 1); j++) { temp = temp / 2; r.push(temp); }
  805 + * i3GEO.Interface.openlayers.parametrosMap.resolutions = r; } if (!i3GEO.Interface.openlayers.parametrosMap.maxExtent) {
  806 + * i3GEO.Interface.openlayers.parametrosMap.maxExtent = new OpenLayers.Bounds(ma[0], ma[1], ma[2], ma[3]); } if
  807 + * (!i3GEO.Interface.openlayers.parametrosMap.allOverlays) { i3GEO.Interface.openlayers.parametrosMap.allOverlays = false; }
  808 + *
  809 + * if (i3GEO.Interface.TABLET === true) { i3GEO.Interface.openlayers.parametrosMap.theme = null;
  810 + * i3GEO.Interface.openlayers.parametrosMap.controls.push(new OpenLayers.Control.Attribution());
  811 + * i3GEO.Interface.openlayers.parametrosMap.controls.push(new OpenLayers.Control.TouchNavigation({ dragPanOptions : {
  812 + * interval : 100, enableKinetic : true } })); i3GEO.Interface.openlayers.parametrosMap.controls.push(new
  813 + * OpenLayers.Control.ZoomPanel()); } else if (i3GEO.parametros.w > 700) { bb.INCLUIBOTAO.zoomli = true; bb.INCLUIBOTAO.pan =
  814 + * true; bb.INCLUIBOTAO.zoomtot = true; }
  815 + */
  816 + if (i3GEO.Interface.openlayers.googleLike === false) {
  817 + i3GEO.Interface.openlayers.parametrosView.projection = "EPSG:4326";
  818 + // precisa disso?
  819 + // i3GEO.Interface.openlayers.parametrosView.extent = ol.proj.get('EPSG:4326').getExtent();
749 820 }
750   - // define as resolucoes
751   - if (i3GEO.Interface.openlayers.parametrosMap.numZoomLevels) {
752   - if (i3GEO.Interface.openlayers.parametrosMap.minResolution == "auto") {
753   - temp = 0.703125;
754   - } else {
755   - temp = i3GEO.Interface.openlayers.parametrosMap.minResolution;
756   - }
757   - r = [
758   - temp
759   - ];
760   - for (j = 0; j < (i3GEO.Interface.openlayers.parametrosMap.numZoomLevels - 1); j++) {
761   - temp = temp / 2;
762   - r.push(temp);
763   - }
764   - i3GEO.Interface.openlayers.parametrosMap.resolutions = r;
765   - }
766   - if (!i3GEO.Interface.openlayers.parametrosMap.maxExtent) {
767   - i3GEO.Interface.openlayers.parametrosMap.maxExtent = new OpenLayers.Bounds(ma[0], ma[1], ma[2], ma[3]);
768   - }
769   - if (!i3GEO.Interface.openlayers.parametrosMap.allOverlays) {
770   - i3GEO.Interface.openlayers.parametrosMap.allOverlays = false;
771   - }
772   - if (i3GEO.Interface.TABLET === true) {
773   - i3GEO.Interface.openlayers.parametrosMap.theme = null;
774   - i3GEO.Interface.openlayers.parametrosMap.controls.push(new OpenLayers.Control.Attribution());
775   - i3GEO.Interface.openlayers.parametrosMap.controls.push(new OpenLayers.Control.TouchNavigation({
776   - dragPanOptions : {
777   - interval : 100,
778   - enableKinetic : true
  821 + i3GEO.Interface.openlayers.parametrosMap.view = new ol.View(i3GEO.Interface.openlayers.parametrosView);
  822 + i3GEO.Interface.openlayers.parametrosMap.interactions = i3GEO.Interface.openlayers.interacoes;
  823 + //
  824 + // cria o objeto mapa
  825 + //
  826 + i3geoOL = new ol.Map(i3GEO.Interface.openlayers.parametrosMap);
  827 + //
  828 + // funcoes utilitarias
  829 + //
  830 + i3geoOL.getLayersByName = function(nome) {
  831 + var res = [], layers = this.getLayers(), n = layers.getLength(), i;
  832 + for (i = 0; i < n; i++) {
  833 + if (layers.item(i).name && layers.item(i).name === nome) {
  834 + res.push(layers.item(i));
779 835 }
780   - }));
781   - i3GEO.Interface.openlayers.parametrosMap.controls.push(new OpenLayers.Control.ZoomPanel());
782   - } else if (i3GEO.parametros.w > 700) {
783   - bb.INCLUIBOTAO.zoomli = true;
784   - bb.INCLUIBOTAO.pan = true;
785   - bb.INCLUIBOTAO.zoomtot = true;
786   - }
787   - if (i3GEO.Interface.openlayers.googleLike === true) {
788   - i3GEO.Interface.openlayers.parametrosMap = {
789   - numZoomLevels : 18,
790   - maxResolution : 156543.0339,
791   - units : 'm',
792   - projection : new OpenLayers.Projection("EPSG:3857"),
793   - displayProjection : new OpenLayers.Projection("EPSG:4326"),
794   - fractionalZoom : false
795   - };
796   - }
797   - i3geoOL = new OpenLayers.Map('openlayers', i3GEO.Interface.openlayers.parametrosMap);
  836 + }
  837 + return res
  838 + };
  839 + i3geoOL.addLayers = function(lista) {
  840 + var n = lista.length, i;
  841 + for (i = 0; i < n; i++) {
  842 + this.addLayer(lista[i]);
  843 + }
  844 + };
798 845 },
799 846 /**
800 847 * Monta o corpo do mapa e os componentes marginais
801 848 */
802 849 inicia : function() {
803   - if (typeof (OpenLayers) == 'undefined') {
804   - return;
805   - }
806 850 //
807 851 // monta o mapa ap&oacute;s receber o resultado da
808 852 // cria&ccedil;&atilde;o do mapfile tempor&aacute;rio
... ... @@ -810,18 +854,26 @@ i3GEO.Interface =
810 854 var montaMapa =
811 855 function() {
812 856 var pz, temp, layers, i, texto, estilo, layersn, openlayers = i3GEO.Interface.openlayers;
813   - i3GEO.util.multiStep([
814   - openlayers.registraEventos, openlayers.zoom2ext
815   - ], [
816   - null, [
817   - i3GEO.parametros.mapexten
818   - ]
819   - ], function() {
820   - });
821   - if (openlayers.GADGETS.PanZoom === true) {
822   - pz = new OpenLayers.Control.PanZoom();
823   - i3geoOL.addControl(pz);
824   - pz.div.style.zIndex = 5000;
  857 + i3geoOL.updateSize();
  858 + // FIXME return
  859 + // openlayers.registraEventos();
  860 + openlayers.zoom2ext(i3GEO.parametros.mapexten);
  861 +
  862 + // corrige o posicionamento da barra de botoes
  863 + $i("openlayers").getElementsByClassName("ol-overlaycontainer-stopevent")[0].style.position = "unset";
  864 +
  865 + // controles de navegacao
  866 + if (openlayers.GADGETS.Zoom === true) {
  867 + pz = new ol.control.Zoom(openlayers.ZOOM);
  868 + pz.setMap(i3geoOL);
  869 + }
  870 + if (openlayers.GADGETS.ZoomSlider === true) {
  871 + pz = new ol.control.ZoomSlider(openlayers.ZOOMSLIDER);
  872 + pz.setMap(i3geoOL);
  873 + }
  874 + if (openlayers.GADGETS.ScaleLine === true) {
  875 + pz = new ol.control.ScaleLine(openlayers.SCALELINE);
  876 + pz.setMap(i3geoOL);
825 877 }
826 878 openlayers.criaLayers();
827 879 //
... ... @@ -874,19 +926,9 @@ i3GEO.Interface =
874 926 i3geoOL.addControl(new OpenLayers.Control.OverviewMap());
875 927 }
876 928  
877   - // i3geoOL.addControl(new
878   - // OpenLayers.Control.KeyboardDefaults());
879   - //
880   - // estes controles ficam invis&iacute;veis e s&atilde;o usados
881   - // quando os &iacute;cones default do i3geo s&atilde;o ativados
882   - //
883 929 if (i3GEO.Interface.TABLET === false) {
884 930 i3GEO.Interface.openlayers.OLpan = new OpenLayers.Control.Navigation();
885   - // @FIXME
886   - // o programa OpenLayers precisou ser modificado pois isso
887   - // nao funciona
888   - // OpenLayers.Handler.MOD_SHIFT =
889   - // OpenLayers.Handler.MOD_CTRL;
  931 +
890 932 i3GEO.Interface.openlayers.OLzoom = new OpenLayers.Control.ZoomBox();
891 933  
892 934 i3GEO.Interface.openlayers.OLpanel = new OpenLayers.Control.Panel();
... ... @@ -932,28 +974,20 @@ i3GEO.Interface =
932 974 }
933 975 }
934 976 };
935   - // corrigido na vers&atilde;o 4.7 do i3geo (n&atilde;o tinha o if)
936 977 if (i3GEO.arvoreDeCamadas.ATIVATEMA === "") {
937 978 i3GEO.arvoreDeCamadas.ATIVATEMA =
938 979 "i3GEO.Interface.ligaDesliga(this);i3GEO.eventos.executaEventos(i3GEO.eventos.ATUALIZAARVORECAMADAS);";
939 980 }
940   - i3GEO.util.multiStep([
941   - i3GEO.coordenadas.mostraCoordenadas,
942   - montaMapa,
943   - i3GEO.gadgets.mostraMenuSuspenso,
944   - i3GEO.ajuda.ativaLetreiro,
945   - i3GEO.idioma.mostraSeletor,
946   - i3GEO.gadgets.mostraEscalaNumerica,
947   - i3GEO.util.arvore,
948   - i3GEO.gadgets.mostraMenuLista
949   - ], [
950   - null, null, null, [
951   - i3GEO.parametros.mensagens
952   - ], null, null, [
953   - "<b>" + $trad("p13") + "</b>", "listaPropriedades", i3GEO.configura.listaDePropriedadesDoMapa
954   - ], null
955   - ], function() {
956   - });
  981 + montaMapa();
  982 + return;
  983 + i3GEO.coordenadas.mostraCoordenadas();
  984 + i3GEO.gadgets.mostraMenuSuspenso();
  985 + i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);
  986 + i3GEO.idioma.mostraSeletor();
  987 + i3GEO.gadgets.mostraEscalaNumerica();
  988 + i3GEO.util.arvore("<b>" + $trad("p13") + "</b>", "listaPropriedades", i3GEO.configura.listaDePropriedadesDoMapa);
  989 + i3GEO.gadgets.mostraMenuLista();
  990 +
957 991 i3GEO.arvoreDeCamadas.cria("", i3GEO.arvoreDeCamadas.CAMADAS, i3GEO.configura.sid, i3GEO.configura.locaplic);
958 992 if (i3GEO.arvoreDeCamadas.MOSTRALISTAKML === true) {
959 993 i3GEO.Interface.openlayers.adicionaListaKml();
... ... @@ -1213,71 +1247,58 @@ i3GEO.Interface =
1213 1247 * Cria os layers conforme os parametros definidos em i3GEO.arvoreDeCamadas.CAMADAS
1214 1248 */
1215 1249 criaLayers : function() {
1216   - var configura = i3GEO.configura, url =
1217   - configura.locaplic + "/classesphp/mapa_openlayers.php?g_sid="
1218   - + i3GEO.configura.sid
1219   - + "&TIPOIMAGEM="
1220   - + configura.tipoimagem, nlayers = i3GEO.arvoreDeCamadas.CAMADAS.length, layer, camada, urllayer, opcoes, i, n, temp =
1221   - $i("i3GEOprogressoDiv"), fundoIsBase = true;
  1250 + var matrixIds, resolutions, size, z, projectionExtent, source, configura = i3GEO.configura, url, nlayers = i3GEO.arvoreDeCamadas.CAMADAS.length, layer, camada, urllayer, opcoes, i, n, temp, fundoIsBase =
  1251 + true;
  1252 +
  1253 + // barra de status
  1254 + temp = $i("i3GEOprogressoDiv");
1222 1255 if (temp) {
1223 1256 i3GEO.Interface.STATUS.atualizando = [];
1224 1257 temp.style.display = "none";
1225 1258 }
  1259 + // url do programa i3Geo que renderiza camada
1226 1260 if (i3GEO.Interface.openlayers.googleLike === true) {
1227   - url =
1228   - configura.locaplic + "/classesphp/mapa_googlemaps.php?g_sid="
1229   - + i3GEO.configura.sid
1230   - + "&TIPOIMAGEM="
1231   - + configura.tipoimagem;
1232   - }
1233   - //
1234   - // verifica se algum layer adicional &eacute; do tipo baselayer. Se
1235   - // for, adiciona o layer fundo, mas n&atilde;o como base
1236   - //
1237   - try {
1238   - temp = i3GEO.Interface.openlayers.LAYERSADICIONAIS;
1239   - n = temp.length;
1240   - for (i = 0; i < n; i++) {
1241   - if (temp[i].isBaseLayer === true && temp[i].visibility === true) {
1242   - fundoIsBase = false;
1243   - }
1244   - }
1245   - } catch (e) {
1246   - }
1247   - // define a cor do fundo do mapa com base em um layer do tipo vector
1248   - // chamado Nenhum
1249   - if (i3geoOL.getLayersByName("Nenhum").length === 0 && fundoIsBase === true) {
1250   - // layer = new OpenLayers.Layer.WMS( "Nenhum",
1251   - // urlfundo,{map_imagetype:i3GEO.Interface.OUTPUTFORMAT},{ratio:
1252   - // 1,singleTile:false,isBaseLayer:true, opacity:
1253   - // 1,visibility:false});
1254   - layer = new OpenLayers.Layer.Vector("Nenhum", {
1255   - displayInLayerSwitcher : true,
1256   - visibility : false,
1257   - isBaseLayer : true,
1258   - singleTile : true
1259   - });
1260   - i3geoOL.addLayer(layer);
1261   - if ($i(i3geoOL.id + "_OpenLayers_ViewPort")) {
1262   - $i(i3geoOL.id + "_OpenLayers_ViewPort").style.backgroundColor = "rgb(" + i3GEO.parametros.cordefundo + ")";
1263   - }
  1261 + url = configura.locaplic + "/classesphp/mapa_googlemaps.php?";
  1262 + projectionExtent = ol.proj.get('EPSG:3857').getExtent();
  1263 + } else {
  1264 + url = configura.locaplic + "/classesphp/mapa_openlayers.php?";
  1265 + projectionExtent = ol.proj.get('EPSG:4326').getExtent();
1264 1266 }
  1267 + url += "g_sid=" + i3GEO.configura.sid + "&TIPOIMAGEM=" + configura.tipoimagem;
  1268 +
  1269 + size = ol.extent.getWidth(projectionExtent) / 256;
  1270 + resolutions = new Array(40);
  1271 + matrixIds = new Array(40);
  1272 + for (z = 0; z < 40; ++z) {
  1273 + // generate resolutions and matrixIds arrays for this WMTS
  1274 + resolutions[z] = size / Math.pow(2, z);
  1275 + matrixIds[z] = z;
  1276 + }
  1277 + // define a cor do fundo do mapa
  1278 + //FIXME mudar a ferramenta que define o fundo
  1279 + $i("openlayers").style.backgroundColor = "rgb(" + i3GEO.parametros.cordefundo + ")";
  1280 +
  1281 + // adiciona as camadas definidas em LAYERSADICIONAIS
  1282 + i3geoOL.addLayers(i3GEO.Interface.openlayers.LAYERSADICIONAIS);
  1283 +
  1284 + // opcoes default utilizadas na adicao da camada
1265 1285 opcoes = {
1266 1286 gutter : 0,
1267 1287 isBaseLayer : false,
1268   - displayInLayerSwitcher : false,
1269 1288 opacity : 1,
1270   - visibility : false,
  1289 + visible : false,
1271 1290 singleTile : !(i3GEO.Interface.openlayers.TILES),
1272   - ratio : 1,
1273   - buffer : i3GEO.Interface.openlayers.BUFFER,
1274   - wrapDateLine : true,
1275   - transitionEffect : "resize",
1276   - eventListeners : {
1277   - "loadstart" : i3GEO.Interface.openlayers.loadStartLayer,
1278   - "loadend" : i3GEO.Interface.openlayers.loadStopLayer
1279   - }
  1291 + tilePixelRatio : 1,
  1292 + preload : Infinity
  1293 + // pode ser 0
1280 1294 };
  1295 + // eventListeners : {
  1296 + // "loadstart" : i3GEO.Interface.openlayers.loadStartLayer,
  1297 + // "loadend" : i3GEO.Interface.openlayers.loadStopLayer
  1298 + // }
  1299 + /*
  1300 + * var key = source.on('change', function() { if (source.getState() == 'ready') { source.unByKey(key); } });
  1301 + */
1281 1302 for (i = nlayers - 1; i >= 0; i--) {
1282 1303 layer = "";
1283 1304 camada = i3GEO.arvoreDeCamadas.CAMADAS[i];
... ... @@ -1306,15 +1327,14 @@ i3GEO.Interface =
1306 1327 // since 6.2), MS_LAYER_QUERY, MS_LAYER_CIRCLE,
1307 1328 // MS_LAYER_TILEINDEX, MS_LAYER_CHART
1308 1329 // temp = camada.type === 0 ? opcoes.gutter = 20 : opcoes.gutter = 0;
1309   - temp =
1310   - camada.transitioneffect === "nao" ? opcoes.transitionEffect = "null" : opcoes.transitionEffect =
1311   - "resize";
  1330 + temp = camada.transitioneffect === "nao" ? opcoes.preload = 0 : opcoes.preload = Infinity;
1312 1331  
1313 1332 //
1314 1333 // layers marcados com o metadata wmstile com valor
1315 1334 // 1 sao inseridos com Layer.TileCache
1316 1335 // i3GEO.Interface.openlayers.googleLike === false
1317 1336 // &&
  1337 + // FIXME testar isso
1318 1338 if (i3GEO.Interface.openlayers.googleLike === false && camada.connectiontype === 7
1319 1339 && camada.wmsurl !== ""
1320 1340 && camada.usasld.toLowerCase() != "sim") {
... ... @@ -1356,34 +1376,45 @@ i3GEO.Interface =
1356 1376 if (camada.tiles === "sim" || camada.cache === "sim" || (camada.cortepixels && camada.cortepixels > 0)) {
1357 1377 opcoes.singleTile = false;
1358 1378 }
  1379 + // FIXME testar isso
1359 1380 if (opcoes.singleTile === true) {
1360 1381 if (i3GEO.Interface.openlayers.googleLike === true) {
1361   - opcoes.projection = new OpenLayers.Projection("EPSG:3857");
  1382 + opcoes.projection = "EPSG:3857";
1362 1383 }
1363 1384 layer = new OpenLayers.Layer.WMS(camada.name, urllayer, {
1364 1385 LAYERS : camada.name,
1365 1386 format : camada.wmsformat,
1366 1387 transparent : true
1367 1388 }, opcoes);
1368   - // layer.url = layer.url + "&SRS=EPSG:3857&CRS=EPSG:3857";
1369   - // layer = new
1370   - // OpenLayers.Layer.TileCache(camada.name,
1371   - // urllayer,{LAYERS:camada.name,map_imagetype:i3GEO.Interface.OUTPUTFORMAT},opcoes);
  1389 +
1372 1390 } else {
  1391 + // FIXME testar isso
1373 1392 if (i3GEO.Interface.openlayers.googleLike === true) {
1374 1393 layer = new OpenLayers.Layer.OSM(camada.name, urllayer + "&Z=${z}&X=${x}&Y=${y}", {
1375 1394 isBaseLayer : false
1376 1395 });
1377 1396 } else {
1378   - layer = new OpenLayers.Layer.TMS(camada.name, urllayer, {
1379   - isBaseLayer : false,
1380   - serviceVersion : "&tms=",
1381   - type : "png",
1382   - layername : camada.name,
1383   - map_imagetype : i3GEO.Interface.OUTPUTFORMAT
1384   - }, opcoes);
  1397 + source = new ol.source.WMTS({
  1398 + url : urllayer,
  1399 + matrixSet : 'EPSG:4326',
  1400 + format : 'image/png',
  1401 + projection : ol.proj.get('EPSG:4326'),
  1402 + tileGrid : new ol.tilegrid.WMTS({
  1403 + origin : ol.extent.getTopLeft(projectionExtent),
  1404 + resolutions : resolutions,
  1405 + matrixIds : matrixIds
  1406 + }),
  1407 + wrapX : true
  1408 + })
  1409 + opcoes.source = source;
  1410 + opcoes.title = camada.tema;
  1411 + opcoes.name = camada.name;
  1412 + opcoes.isBaseLayer = false;
  1413 + opcoes.visible = true;
  1414 + // opcoes.extent = ol.proj.get('EPSG:4326').getExtent();
  1415 + layer = new ol.layer.Tile(opcoes);
  1416 + // console.warn(source.getTileGrid().getOrigin())
1385 1417 }
1386   -
1387 1418 }
1388 1419 }
1389 1420 } catch (e) {
... ... @@ -1391,7 +1422,7 @@ i3GEO.Interface =
1391 1422 }
1392 1423 if (layer && layer != "") {
1393 1424 if (camada.escondido.toLowerCase() === "sim") {
1394   - layer.transitionEffect = "null";
  1425 + layer.preload = 0;
1395 1426 }
1396 1427 i3geoOL.addLayer(layer);
1397 1428 }
... ... @@ -1400,13 +1431,9 @@ i3GEO.Interface =
1400 1431 }
1401 1432 // n&atilde;o use ===
1402 1433 if (layer && layer != "") {
1403   - temp = camada.status == 0 ? layer.setVisibility(false) : layer.setVisibility(true);
  1434 + temp = camada.status == 0 ? layer.setVisible(false) : layer.setVisible(true);
1404 1435 }
1405 1436 }
1406   - try {
1407   - i3geoOL.addLayers(i3GEO.Interface.openlayers.LAYERSADICIONAIS);
1408   - } catch (e) {
1409   - }
1410 1437 // inclui copyright
1411 1438 if (i3GEO.parametros.copyright != "" && !$i("i3GEOcopyright")) {
1412 1439 temp = document.createElement("div");
... ... @@ -1421,6 +1448,7 @@ i3GEO.Interface =
1421 1448 $i(i3GEO.Interface.IDMAPA).appendChild(temp);
1422 1449 }
1423 1450 }
  1451 + //FIXME testar isso
1424 1452 if (i3GEO.Interface.openlayers.LAYERFUNDO != "") {
1425 1453 i3GEO.Interface.openlayers.ativaFundo(i3GEO.Interface.openlayers.LAYERFUNDO);
1426 1454 }
... ... @@ -1684,6 +1712,8 @@ i3GEO.Interface =
1684 1712 * Registra os eventos que capturam o posicionamento do mouse e outros
1685 1713 */
1686 1714 registraEventos : function() {
  1715 + // XXX return
  1716 + return;
1687 1717 // essa variavel guarda a posicao do mapa na tela
1688 1718 // e usada em vercoes com dispositivo touche para melhorar a performance
1689 1719 i3GEOtouchesPosMapa = "";
... ... @@ -1824,11 +1854,14 @@ i3GEO.Interface =
1824 1854 i3GEO.gadgets.atualizaEscalaNumerica(parseInt(escalaAtual, 10));
1825 1855 },
1826 1856 zoom2ext : function(ext) {
1827   - var m, b;
  1857 + var m, v;
1828 1858 ext = i3GEO.util.extGeo2OSM(ext);
1829 1859 m = ext.split(" ");
1830   - b = new OpenLayers.Bounds(m[0], m[1], m[2], m[3]);
1831   - i3geoOL.zoomToExtent(b, true);
  1860 + m = [
  1861 + parseInt(m[0], 10), parseInt(m[1], 10), parseInt(m[2], 10), parseInt(m[3], 10)
  1862 + ];
  1863 + v = i3geoOL.getView();
  1864 + v.fitExtent(m, i3geoOL.getSize());
1832 1865 i3GEO.eventos.cliquePerm.status = true;
1833 1866 },
1834 1867 pan2ponto : function(x, y) {
... ... @@ -1849,32 +1882,32 @@ i3GEO.Interface =
1849 1882 },
1850 1883 /**
1851 1884 * Section: i3GEO.Interface.Googlemaps
1852   - *
  1885 + *
1853 1886 * Interface com motor de navega&ccedil;&atilde;o baseado na API Google Maps
1854   - *
  1887 + *
1855 1888 * Namespace:
1856   - *
  1889 + *
1857 1890 * i3GEO.Interface.googlemaps
1858   - *
  1891 + *
1859 1892 * Utilizado quando
1860   - *
  1893 + *
1861 1894 * i3GEO.Interface.ATUAL = "googlemaps"
1862   - *
  1895 + *
1863 1896 * Cria o objeto i3GeoMap que pode receber os m&eacute;todos da API. Cria tamb&eacute;m o objeto i3GeoMapOverlay do tipo Overlay,
1864 1897 * utilizado para c&aacute;lculos ou para receber elementos gr&aacute;ficos.
1865 1898 */
1866 1899 googlemaps : {
1867 1900 /**
1868 1901 * Propriedade: ESTILOS
1869   - *
  1902 + *
1870 1903 * Estilos que podem ser utilizados com o mapa
1871   - *
  1904 + *
1872 1905 * Para novos estilos, acrescente seu codigo nesse objeto
1873   - *
  1906 + *
1874 1907 * Fonte http://maps-api-tt.appspot.com/apilite/styled/styled.html
1875   - *
  1908 + *
1876 1909 * Tipo:
1877   - *
  1910 + *
1878 1911 * {objeto}
1879 1912 */
1880 1913 ESTILOS : {
... ... @@ -2072,29 +2105,29 @@ i3GEO.Interface =
2072 2105 },
2073 2106 /**
2074 2107 * Propriedade: ESTILOPADRAO
2075   - *
  2108 + *
2076 2109 * Nome do estilo definido em ESTILOS que sera usado como padrao para o mapa. Se for "" sera usado o estilo normal do Google
2077   - *
  2110 + *
2078 2111 * Estilos pre-definidos Red, Countries, Night, Blue, Greyscale, No roads, Mixed, Chilled
2079   - *
  2112 + *
2080 2113 * Tipo:
2081   - *
  2114 + *
2082 2115 * {string}
2083 2116 */
2084 2117 ESTILOPADRAO : "",
2085 2118 /**
2086 2119 * Propriedade: MAPOPTIONS
2087   - *
  2120 + *
2088 2121 * Objeto contendo op&ccedil;&otilde;es que ser&atilde;o utilizadas no construtor do mapa conforme a API do GoogleMaps
2089   - *
  2122 + *
2090 2123 * Exemplo de uso
2091   - *
  2124 + *
2092 2125 * i3GEO.Interface.googlemaps.MAPOPTIONS = {maxZoom:5};
2093   - *
  2126 + *
2094 2127 * https://developers.google.com/maps/documentation/javascript/reference#MapOptions
2095   - *
  2128 + *
2096 2129 * Tipo:
2097   - *
  2130 + *
2098 2131 * {MapOptions}
2099 2132 */
2100 2133 MAPOPTIONS : {
... ... @@ -2105,43 +2138,43 @@ i3GEO.Interface =
2105 2138 },
2106 2139 /**
2107 2140 * Propriedade: OPACIDADE
2108   - *
  2141 + *
2109 2142 * Valor da opacidade das camadas i3geo do mapa
2110   - *
  2143 + *
2111 2144 * Varia de 0 a 1
2112   - *
  2145 + *
2113 2146 * Tipo:
2114   - *
  2147 + *
2115 2148 * {Numeric}
2116   - *
  2149 + *
2117 2150 * Default: 0.8
2118 2151 */
2119 2152 OPACIDADE : 0.8,
2120 2153 /**
2121 2154 * Propriedade: TIPOMAPA
2122   - *
  2155 + *
2123 2156 * Tipo de mapa que ser&aacute; usado como default, conforme constantes definidas na API do Google Maps.
2124   - *
  2157 + *
2125 2158 * Tipo:
2126   - *
  2159 + *
2127 2160 * {string}
2128   - *
  2161 + *
2129 2162 * Valores:
2130   - *
  2163 + *
2131 2164 * satellite|roadmap|hybrid|terrain
2132   - *
  2165 + *
2133 2166 * Default:
2134   - *
  2167 + *
2135 2168 * terrain
2136 2169 */
2137 2170 TIPOMAPA : "terrain",
2138 2171 /**
2139 2172 * Variable: ZOOMSCALE
2140   - *
  2173 + *
2141 2174 * Array com a lista de escalas em cada nivel de zoom utilizado pelo Google
2142   - *
  2175 + *
2143 2176 * Tipo:
2144   - *
  2177 + *
2145 2178 * {array}
2146 2179 */
2147 2180 ZOOMSCALE : [
... ... @@ -2168,17 +2201,17 @@ i3GEO.Interface =
2168 2201 ],
2169 2202 /**
2170 2203 * Parametros adicionais que s&atilde;o inseridos na URL que define cada layer
2171   - *
  2204 + *
2172 2205 * Tipo:
2173   - *
  2206 + *
2174 2207 * {string}
2175 2208 */
2176 2209 PARAMETROSLAYER : "&TIPOIMAGEM=" + i3GEO.configura.tipoimagem,
2177 2210 /**
2178 2211 * String acrescentada a url de cada tile para garantir a remo&ccedil;&atilde;o do cache local
2179   - *
  2212 + *
2180 2213 * Tipo:
2181   - *
  2214 + *
2182 2215 * {string}
2183 2216 */
2184 2217 posfixo : 0,
... ... @@ -2502,8 +2535,8 @@ i3GEO.Interface =
2502 2535 * i3GEO.parametros.w + "&layer=" + nomeLayer + i3GEO.Interface.googlemaps.PARAMETROSLAYER + '&r=' + Math.random(); return
2503 2536 * url+'&nd='+i3GEO.Interface.googlemaps.posfixo; }, tileSize: new google.maps.Size(i3GEO.parametros.w, i3GEO.parametros.h),
2504 2537 * isPng: true, name: nomeLayer, projection : i3GeoMap.getProjection(), b : i3GeoMap.getBounds() });
2505   - *
2506   - *
  2538 + *
  2539 + *
2507 2540 * google.maps.event.addListener(i3GEOTileO, 'tilesloaded', function() { var l =
2508 2541 * i3GEO.Interface.googlemaps.retornaObjetoLayer(nomeLayer); var currentBounds = i3GeoMap.getBounds(); if
2509 2542 * (currentBounds.equals(l.b)) { return; } l.b = currentBounds; });
... ... @@ -2790,22 +2823,22 @@ i3GEO.Interface =
2790 2823 },
2791 2824 /**
2792 2825 * Function: adicionaKml
2793   - *
  2826 + *
2794 2827 * Insere no mapa uma camada KML com base na API do Google Maps
2795   - *
  2828 + *
2796 2829 * As camadas adicionadas s&atilde;o acrescentadas na &aacute;rvore de camadas
2797   - *
  2830 + *
2798 2831 * A lista de nomes dos objetos geoXml criados &eacute; mantida em i3GEO.mapas.GEOXML
2799   - *
  2832 + *
2800 2833 * Parametros:
2801   - *
  2834 + *
2802 2835 * {Boolean} - define se o mapa ser&aacute; deslocado para encaixar o KML
2803   - *
  2836 + *
2804 2837 * {String} - URL do arquivo KML. Se n&atilde;o for definido, a URL ser&aacute; obtida do INPUT com id = i3geo_urlkml (veja
2805 2838 * i3GEO.gadgets.mostraInserirKml)
2806   - *
  2839 + *
2807 2840 * {string} - titulo que aparecer&aacute; na &aacute;rvore. Se n&atilde;o for definido, ser&aacute; calculado aleatoriamente.
2808   - *
  2841 + *
2809 2842 * {boolean} - indica se a camada estar&aacute; ativa ou n&atilde;o. Se n&atilde;o for definido, ser&aacute; considerado como
2810 2843 * true
2811 2844 */
... ... @@ -2853,19 +2886,19 @@ i3GEO.Interface =
2853 2886 },
2854 2887 /**
2855 2888 * Acrescenta na &aacute;rvore de camadas um novo tema no n&oacute; que mostra os arquivos KML inseridos no mapa
2856   - *
  2889 + *
2857 2890 * Os temas s&atilde;o inclu&iacute;dos em um n&oacute; chamado "Google Maps".
2858   - *
  2891 + *
2859 2892 * Para obter esse n&oacute; utilize var node = i3GEO.arvoreDeCamadas.ARVORE.getNodeByProperty("idkml","raiz");
2860   - *
  2893 + *
2861 2894 * Parametros:
2862   - *
  2895 + *
2863 2896 * url {string} - url do arquivo KML
2864   - *
  2897 + *
2865 2898 * nomeOverlay {string} - t&iacute;tulo do tema
2866   - *
  2899 + *
2867 2900 * ativo {boolean} - indica o estado do checkbox
2868   - *
  2901 + *
2869 2902 * id {string} - nome do objeto GGeoXml
2870 2903 */
2871 2904 adicionaNoArvoreGoogle : function(url, nomeOverlay, ativo, id) {
... ... @@ -2947,11 +2980,11 @@ i3GEO.Interface =
2947 2980 },
2948 2981 /**
2949 2982 * Ativa ou desativa uma camada do n&oacute; de layers KML
2950   - *
  2983 + *
2951 2984 * Parametro:
2952   - *
  2985 + *
2953 2986 * obj {object} - objeto do tipo checkbox que foi ativado/desativado
2954   - *
  2987 + *
2955 2988 * url {string} - url do KML
2956 2989 */
2957 2990 ativaDesativaCamadaKml : function(obj, url) {
... ... @@ -2971,51 +3004,51 @@ i3GEO.Interface =
2971 3004 },
2972 3005 /**
2973 3006 * Section: i3GEO.Interface.GoogleEarth
2974   - *
  3007 + *
2975 3008 * Interface com motor de navega&ccedil;&atilde;o baseado na API Google Earth
2976   - *
  3009 + *
2977 3010 * Namespace:
2978   - *
  3011 + *
2979 3012 * i3GEO.Interface.googleearth
2980   - *
  3013 + *
2981 3014 * Utilizado quando
2982   - *
  3015 + *
2983 3016 * i3GEO.Interface.ATUAL = "googleearth"
2984   - *
  3017 + *
2985 3018 * Cria o objeto i3GeoMap que pode receber os m&eacute;todos da API.
2986 3019 */
2987 3020 googleearth : {
2988 3021 /**
2989 3022 * Variable: PARAMETROSLAYER
2990   - *
  3023 + *
2991 3024 * Parametros adicionais que s&atilde;o inseridos na URL que define cada layer
2992   - *
  3025 + *
2993 3026 * Tipo:
2994   - *
  3027 + *
2995 3028 * {string}
2996 3029 */
2997 3030 PARAMETROSLAYER : "&TIPOIMAGEM=" + i3GEO.configura.tipoimagem,
2998 3031 /**
2999 3032 * String acrescentada a url de cada tile para garantir a remo&ccedil;&atilde;o do cache local
3000   - *
  3033 + *
3001 3034 * Tipo:
3002   - *
  3035 + *
3003 3036 * {string}
3004 3037 */
3005 3038 posfixo : "",
3006 3039 /**
3007 3040 * Propriedade: GADGETS
3008   - *
  3041 + *
3009 3042 * Lista dos controles espec&iacute;ficos da API do Google Earth que ser&atilde;o inseridos ou n&atilde;o no mapa
3010   - *
  3043 + *
3011 3044 * Tipo:
3012   - *
  3045 + *
3013 3046 * {object}
3014   - *
  3047 + *
3015 3048 * Default:
3016   - *
  3049 + *
3017 3050 * (start code)
3018   - *
  3051 + *
3019 3052 * i3GEO.Interface.googleearth.GADGETS = { setMouseNavigationEnabled : true, setStatusBarVisibility : true,
3020 3053 * setOverviewMapVisibility : true, setScaleLegendVisibility : true, setAtmosphereVisibility : true, setGridVisibility : false,
3021 3054 * getSun : false, LAYER_BORDERS : true, LAYER_BUILDINGS : false, LAYER_ROADS : false, LAYER_TERRAIN : true } (end)
... ... @@ -3445,22 +3478,22 @@ i3GEO.Interface =
3445 3478 },
3446 3479 /**
3447 3480 * Function: adicionaKml
3448   - *
  3481 + *
3449 3482 * Insere no mapa uma camada KML com base na API do Google Earth
3450   - *
  3483 + *
3451 3484 * As camadas adicionadas s&atilde;o crescentadas na &aacute;rvore de camadas
3452   - *
  3485 + *
3453 3486 * A lista de nomes dos objetos geoXml criados &eacute; mantida em i3GEO.mapas.GEOXML
3454   - *
  3487 + *
3455 3488 * Parametros:
3456   - *
  3489 + *
3457 3490 * {Boolean} - define se o mapa ser&aacute; deslocado para encaixar o KML
3458   - *
  3491 + *
3459 3492 * {String} - URL do arquivo KML. Se n&atilde;o for definido, a URL ser&aacute; obtida do INPUT com id = i3geo_urlkml (veja
3460 3493 * i3GEO.gadgets.mostraInserirKml)
3461   - *
  3494 + *
3462 3495 * {string} - titulo que aparecer&aacute; na &aacute;rvore. Se n&atilde;o for definido, ser&aacute; calculado aleatoriamente.
3463   - *
  3496 + *
3464 3497 * {boolean} - indica se a camada estar&aacute; ativa ou n&atilde;o. Se n&atilde;o for definido, ser&aacute; considerado como
3465 3498 * true
3466 3499 */
... ... @@ -3516,21 +3549,21 @@ i3GEO.Interface =
3516 3549 i3GEO.php.listaRSSwsARRAY(monta, "KML");
3517 3550 },
3518 3551 /**
3519   - *
  3552 + *
3520 3553 * Acrescenta na &aacute;rvore de camadas um novo tema no n&oacute; que mostra os arquivos KML inseridos no mapa
3521   - *
  3554 + *
3522 3555 * Os temas s&atilde;o inclu&iacute;dos em um n&oacute; chamado "Google Earth".
3523   - *
  3556 + *
3524 3557 * Para obter esse n&oacute; utilize var node = i3GEO.arvoreDeCamadas.ARVORE.getNodeByProperty("idkml","raiz");
3525   - *
  3558 + *
3526 3559 * Parametros:
3527   - *
  3560 + *
3528 3561 * url {string} - url do arquivo KML
3529   - *
  3562 + *
3530 3563 * nomeOverlay {string} - t&iacute;tulo do tema
3531   - *
  3564 + *
3532 3565 * ativo {boolean} - indica o estado do checkbox
3533   - *
  3566 + *
3534 3567 * id {string} - nome do objeto GGeoXml
3535 3568 */
3536 3569 adicionaNoArvoreGoogle : function(url, nomeOverlay, ativo, id) {
... ... @@ -3623,11 +3656,11 @@ i3GEO.Interface =
3623 3656 }
3624 3657 },
3625 3658 /**
3626   - *
  3659 + *
3627 3660 * Ativa ou desativa uma camada do n&oacute; de layers KML
3628   - *
  3661 + *
3629 3662 * Parametro:
3630   - *
  3663 + *
3631 3664 * obj {object} - objeto do tipo checkbox que foi ativado/desativado
3632 3665 */
3633 3666 ativaDesativaCamadaKml : function(obj) {
... ...
js/util.js
... ... @@ -2504,15 +2504,15 @@ i3GEO.util =
2504 2504 for (i = 0; i < ns; i++) {
2505 2505 src = scripts[i].getAttribute('src');
2506 2506 if (src) {
2507   - index = src.lastIndexOf("/classesjs/i3geo.js");
  2507 + index = src.lastIndexOf("/js/i3geo.js");
2508 2508 // is it found, at the end of the URL?
2509   - if ((index > -1) && (index + "/classesjs/i3geo.js".length === src.length)) {
2510   - scriptLocation = src.slice(0, -"/classesjs/i3geo.js".length);
  2509 + if ((index > -1) && (index + "/js/i3geo.js".length === src.length)) {
  2510 + scriptLocation = src.slice(0, -"/js/i3geo.js".length);
2511 2511 break;
2512 2512 }
2513   - index = src.lastIndexOf("/classesjs/i3geonaocompacto.js");
2514   - if ((index > -1) && (index + "/classesjs/i3geonaocompacto.js".length === src.length)) {
2515   - scriptLocation = src.slice(0, -"/classesjs/i3geonaocompacto.js".length);
  2513 + index = src.lastIndexOf("/js/i3geonaocompacto.js");
  2514 + if ((index > -1) && (index + "/js/i3geonaocompacto.js".length === src.length)) {
  2515 + scriptLocation = src.slice(0, -"/js/i3geonaocompacto.js".length);
2516 2516 break;
2517 2517 }
2518 2518 }
... ...