Commit 240f4500e264e82cdd81b0484ac219079931fe72
1 parent
aa8e3ba3
Exists in
master
and in
7 other branches
Adicionado o parâmetro mapext no masgup openlayers para oferecer zoom em uma região
Showing
4 changed files
with
24 additions
and
3 deletions
Show diff stats
documentacao/Menu.txt
| ... | ... | @@ -57,12 +57,18 @@ Group: Diagramas { |
| 57 | 57 | Group: Abrir figuras { |
| 58 | 58 | |
| 59 | 59 | Link: MER do banco de dados (../diagramas/mer_banco_de_dados_de_administracao.png) |
| 60 | + Link: Arquitetura (../diagramas/arquitetura.png) | |
| 61 | + Link: Caso de uso geral (../diagramas/caso_de_uso_geral.png) | |
| 62 | + Link: Atividade abrir mapa interativo (../diagramas/atividade_abrir_mapa_interativo.png) | |
| 60 | 63 | } # Group: Abrir figuras |
| 61 | 64 | |
| 62 | 65 | Group: Arquivos originais { |
| 63 | 66 | |
| 64 | 67 | Link: Baixe o software DIA (http://dia-installer.de/) |
| 65 | 68 | Link: MER do banco de dados (../diagramas/mer_banco_de_dados_de_administracao.dia) |
| 69 | + Link: Arquitetura (../diagramas/arquitetura.dia) | |
| 70 | + Link: Caso de uso geral (../diagramas/caso_de_uso_geral.dia) | |
| 71 | + Link: Atividade abrir mapa interativo (../diagramas/atividade_abrir_mapa_interativo.dia) | |
| 66 | 72 | } # Group: Arquivos originais |
| 67 | 73 | |
| 68 | 74 | } # Group: Diagramas | ... | ... |
mashups/index.html
| ... | ... | @@ -26,6 +26,7 @@ body,td |
| 26 | 26 | conter um grande número de funcionalidades.</p> |
| 27 | 27 | <p>Para ver todos os parâmetros: <a href='openlayers.php'>i3geo/mashups/openlayers.php</a></p> |
| 28 | 28 | <p>Exemplo: todas as opções e um tema adicionado <a href='openlayers.php?temas=biomashp&largura=600'>openlayers.php?temas=biomashp&largura=600</a></p> |
| 29 | +<p>Exemplo: zoom para uma região <a href='openlayers.php?temas=biomashp&largura=600&mapext=-68.39967 -12.16172 -62.67402 -5.366808'>openlayers.php?temas=biomashp&largura=600&mapext=-68.39967 -12.16172 -62.67402 -5.366808</a></p> | |
| 29 | 30 | <p>Exemplo: Botões principais e barra de zoom maior <a href='openlayers.php?temas=biomashp&largura=600&botoes=pan,zoombox,zoomtot,distancia,area,identifica&numzoomlevels=10'>openlayers.php?temas=biomashp&largura=600&botoes=pan,zoombox,zoomtot,distancia,area,identifica&numzoomlevels=10</a> |
| 30 | 31 | <p>Exemplo: Inclusão de pontos <a href='openlayers.php?temas=biomashp&largura=600&pontos=-54 -12 -56 -15'>openlayers.php?temas=biomashp&largura=600&pontos=-54 -12 -56 -15</a> |
| 31 | 32 | <p>Exemplo: Camada adicional como fundo <a href='openlayers.php?temas=biomashp&largura=600&fundo=biomashp'>openlayers.php?temas=biomashp&largura=600&fundo=biomashp</a> | ... | ... |
mashups/openlayers.js.php
| ... | ... | @@ -95,7 +95,8 @@ i3GEO.editorOL = { |
| 95 | 95 | new OpenLayers.Control.KeyboardDefaults() |
| 96 | 96 | ], |
| 97 | 97 | numzoom: 12, |
| 98 | - maxext: new OpenLayers.Bounds(-76.5125927,-39.3925675209,-29.5851853,9.49014852081), | |
| 98 | + maxext: "", | |
| 99 | + mapext: new OpenLayers.Bounds(-76.5125927,-39.3925675209,-29.5851853,9.49014852081), | |
| 99 | 100 | mapa: "", |
| 100 | 101 | inicia: function(){ |
| 101 | 102 | var alayers = [], |
| ... | ... | @@ -151,10 +152,14 @@ i3GEO.editorOL = { |
| 151 | 152 | {alert("O objeto i3GEO.editorOL.mapa precisa ser criado com new OpenLayers.Map()");return;} |
| 152 | 153 | if(i3GEO.editorOL.maxext !== ""){ |
| 153 | 154 | i3GEO.editorOL.mapa.setOptions({ |
| 154 | - numZoomLevels: i3GEO.editorOL.numzoom, | |
| 155 | 155 | maxExtent: i3GEO.editorOL.maxext |
| 156 | 156 | }); |
| 157 | 157 | } |
| 158 | + if(i3GEO.editorOL.numzoom !== ""){ | |
| 159 | + i3GEO.editorOL.mapa.setOptions({ | |
| 160 | + numZoomLevels: i3GEO.editorOL.numzoom | |
| 161 | + }); | |
| 162 | + } | |
| 158 | 163 | for(i=0;i<ncontroles;i++){ |
| 159 | 164 | i3GEO.editorOL.mapa.addControl(i3GEO.editorOL.controles[i]); |
| 160 | 165 | } |
| ... | ... | @@ -181,6 +186,8 @@ i3GEO.editorOL = { |
| 181 | 186 | i3GEO.editorOL.adicionaMarcas(); |
| 182 | 187 | if(i3GEO.editorOL.maxext !== "") |
| 183 | 188 | {i3GEO.editorOL.mapa.zoomToMaxExtent();} |
| 189 | + else | |
| 190 | + {i3GEO.editorOL.mapa.zoomToExtent(i3GEO.editorOL.mapext);} | |
| 184 | 191 | i3GEO.editorOL.coordenadas(); |
| 185 | 192 | i3GEO.editorOL.criaJanelaBusca(); |
| 186 | 193 | i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes); | ... | ... |
mashups/openlayers.php
| ... | ... | @@ -150,7 +150,8 @@ Parâmetros: |
| 150 | 150 | 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' |
| 151 | 151 | temas - lista com os temas (mapfiles) do i3Geo que serão incluídos no mapa |
| 152 | 152 | numzoomlevels - número de níveis de zoom, default=6 |
| 153 | - maxextent - extensão geográfica do mapa (xmin,ymin,xmax,ymax) | |
| 153 | + maxextent - extensão geográfica máxima do mapa (xmin,ymin,xmax,ymax) | |
| 154 | + mapext - extensão geográfica inicial do mapa (xmin,ymin,xmax,ymax) | |
| 154 | 155 | largura - lagura do mapa em pixels |
| 155 | 156 | altura - altura do mapa em pixels |
| 156 | 157 | pontos - lista de coordenadas x e y que serão incluídas como marcas no mapa |
| ... | ... | @@ -286,9 +287,15 @@ i3GEO.editorOL.marca = "<?php |
| 286 | 287 | } |
| 287 | 288 | ?> |
| 288 | 289 | <?php if(isset($maxextent)){ |
| 290 | + $maxextent = str_replace(" ",",",$maxextent); | |
| 289 | 291 | echo "i3GEO.editorOL.maxext = new OpenLayers.Bounds(".$maxextent.");"; |
| 290 | 292 | } |
| 291 | 293 | ?> |
| 294 | +<?php if(isset($mapext)){ | |
| 295 | + $mapext = str_replace(" ",",",$mapext); | |
| 296 | + echo "i3GEO.editorOL.mapext = new OpenLayers.Bounds(".$mapext.");"; | |
| 297 | +} | |
| 298 | +?> | |
| 292 | 299 | i3GEO.editorOL.mapa = new OpenLayers.Map('i3geoMapa',{controls:[]}) |
| 293 | 300 | i3GEO.editorOL.inicia(); |
| 294 | 301 | </script> | ... | ... |