Commit 057adc9170be2263f9e25ba401c7e2c9510a3169
1 parent
1bd4b2ac
Exists in
master
and in
7 other branches
Modificação do mashup openlayers para passar a utilizar a interface padrão dos mapas
Showing
2 changed files
with
64 additions
and
9 deletions
Show diff stats
mashups/openlayers.php
@@ -11,6 +11,10 @@ include_once (dirname(__FILE__) . "/../classesphp/funcoes_gerais.php"); | @@ -11,6 +11,10 @@ include_once (dirname(__FILE__) . "/../classesphp/funcoes_gerais.php"); | ||
11 | // error_reporting(0); | 11 | // error_reporting(0); |
12 | // variaveis utilizadas | 12 | // variaveis utilizadas |
13 | $parurl = array_merge($_GET, $_POST); | 13 | $parurl = array_merge($_GET, $_POST); |
14 | +if(count($parurl) == 0){ | ||
15 | + ajuda(); | ||
16 | + exit; | ||
17 | +} | ||
14 | if (isset($parurl["opacidade"])) { | 18 | if (isset($parurl["opacidade"])) { |
15 | $opacidade = $parurl["opacidade"] * 1; | 19 | $opacidade = $parurl["opacidade"] * 1; |
16 | } else { | 20 | } else { |
@@ -36,6 +40,18 @@ if(!isset($parurl["visiveis"])){ | @@ -36,6 +40,18 @@ if(!isset($parurl["visiveis"])){ | ||
36 | } | 40 | } |
37 | $visiveis = explode(",", str_replace(" ", ",", $parurl["visiveis"])); | 41 | $visiveis = explode(",", str_replace(" ", ",", $parurl["visiveis"])); |
38 | $off = array_diff($temas, $visiveis); | 42 | $off = array_diff($temas, $visiveis); |
43 | +//filtros | ||
44 | +$filtros = array(); | ||
45 | +foreach($temas as $tema){ | ||
46 | + if(isset($parurl["map_layer_".$tema."_filter"])){ | ||
47 | + $filtros[] = array( | ||
48 | + "layer"=>$tema, | ||
49 | + "expression"=>$parurl["map_layer_".$tema."_filter"] | ||
50 | + ); | ||
51 | + } | ||
52 | +} | ||
53 | +$filtros = json_encode($filtros); | ||
54 | + | ||
39 | $estilo = ""; | 55 | $estilo = ""; |
40 | if (isset($parurl["altura"])) { | 56 | if (isset($parurl["altura"])) { |
41 | $estilo .= ";height:" . $parurl["altura"] . "px"; | 57 | $estilo .= ";height:" . $parurl["altura"] . "px"; |
@@ -69,6 +85,11 @@ if (isset($controles)) { | @@ -69,6 +85,11 @@ if (isset($controles)) { | ||
69 | if (in_array("overviewmap", $controles)) { | 85 | if (in_array("overviewmap", $controles)) { |
70 | $objControles[] = "new ol.control.OverviewMap()"; | 86 | $objControles[] = "new ol.control.OverviewMap()"; |
71 | } | 87 | } |
88 | +} else { | ||
89 | + $objControles[] = "new ol.control.Zoom()"; | ||
90 | + $objControles[] = "new ol.control.ZoomSlider()"; | ||
91 | + $objControles[] = "new ol.control.ScaleLine()"; | ||
92 | + $objControles[] = "new ol.control.MousePosition({coordinateFormat : function(c){return ol.coordinate.toStringHDMS(c);}})"; | ||
72 | } | 93 | } |
73 | $botoes = $parurl["botoes"]; | 94 | $botoes = $parurl["botoes"]; |
74 | // | 95 | // |
@@ -214,7 +235,36 @@ if (isset($botoes)) { | @@ -214,7 +235,36 @@ if (isset($botoes)) { | ||
214 | } | 235 | } |
215 | $botoes = "{" . implode(",", $objBotoes) . "}"; | 236 | $botoes = "{" . implode(",", $objBotoes) . "}"; |
216 | } else { | 237 | } else { |
217 | - $botoes = "{}"; | 238 | + $objBotoes[] = "'imprimir':true"; |
239 | + $objBotoesHtml["zoombox"] = ""; | ||
240 | + $objBotoesHtml["analise"] = ""; | ||
241 | + $objBotoesHtml["camadas"] = ""; | ||
242 | + $objBotoesHtml["catalogo"] = ""; | ||
243 | + $objBotoesHtml["legenda"] = ""; | ||
244 | + $objBotoesHtml["procura"] = ""; | ||
245 | + $objBotoesHtml["identifica"] = ""; | ||
246 | + $objBotoesHtml["zoomtot"] = ""; | ||
247 | + $objBotoesHtml["zoomanterior"] = ""; | ||
248 | + $objBotoesHtml["zoomproximo"] = ""; | ||
249 | + $objBotoesHtml["grid"] = ""; | ||
250 | + $objBotoesHtml["marcador"] = ""; | ||
251 | + $objBotoes[] = "'distancia':true"; | ||
252 | + $objBotoes[] = "'area':true"; | ||
253 | + $objBotoes[] = "'linha':true"; | ||
254 | + $objBotoes[] = "'ponto':true"; | ||
255 | + $objBotoes[] = "'poligono':true"; | ||
256 | + $objBotoes[] = "'edita':true"; | ||
257 | + $objBotoes[] = "'listag':true"; | ||
258 | + $objBotoes[] = "'corta':true"; | ||
259 | + $objBotoes[] = "'apaga':true"; | ||
260 | + $objBotoes[] = "'salva':true"; | ||
261 | + $objBotoes[] = "'tools':true"; | ||
262 | + $objBotoes[] = "'undo':true"; | ||
263 | + $objBotoes[] = "'propriedades':true"; | ||
264 | + $objBotoes[] = "'frente':true"; | ||
265 | + | ||
266 | + $botoes = "{" . implode(",", $objBotoes) . "}"; | ||
267 | + | ||
218 | } | 268 | } |
219 | if (isset($parurl["kml"])) { | 269 | if (isset($parurl["kml"])) { |
220 | $kml = $parurl["kml"]; | 270 | $kml = $parurl["kml"]; |
@@ -255,11 +305,11 @@ if(isset($parurl["tiles"])){ | @@ -255,11 +305,11 @@ if(isset($parurl["tiles"])){ | ||
255 | else{ | 305 | else{ |
256 | $tiles = "true"; | 306 | $tiles = "true"; |
257 | } | 307 | } |
258 | -if(isset($parurl["ativarodadomouse"]) && $parurl["ativarodadomouse"] == "true"){ | ||
259 | - $ativarodadomouse = "new ol.interaction.MouseWheelZoom(),"; | 308 | +if(isset($parurl["ativarodadomouse"]) && $parurl["ativarodadomouse"] == "false"){ |
309 | + $ativarodadomouse = ""; | ||
260 | } | 310 | } |
261 | else{ | 311 | else{ |
262 | - $ativarodadomouse = ""; | 312 | + $ativarodadomouse = "new ol.interaction.MouseWheelZoom(),"; |
263 | } | 313 | } |
264 | $legendahtml = $parurl["legendahtml"]; | 314 | $legendahtml = $parurl["legendahtml"]; |
265 | $layerDefault = $parurl["layerDefault"]; | 315 | $layerDefault = $parurl["layerDefault"]; |
@@ -435,6 +485,13 @@ function ajuda() | @@ -435,6 +485,13 @@ function ajuda() | ||
435 | width: auto; | 485 | width: auto; |
436 | max-width: 70px; | 486 | max-width: 70px; |
437 | } | 487 | } |
488 | + | ||
489 | +.ol-mouse-position { | ||
490 | + left: 10px; | ||
491 | + position: absolute; | ||
492 | + bottom: 5px; | ||
493 | + top: auto; | ||
494 | +} | ||
438 | </style> | 495 | </style> |
439 | </head> | 496 | </head> |
440 | <!-- As palavras entre {{{}}} sao utilizadas para a traducao. Veja i3geo/js/dicionario.js | 497 | <!-- As palavras entre {{{}}} sao utilizadas para a traducao. Veja i3geo/js/dicionario.js |
@@ -1034,10 +1091,7 @@ function ajuda() | @@ -1034,10 +1091,7 @@ function ajuda() | ||
1034 | //filtros que serao aplicados aos layers. Utilize a expressaso conforme definido na documentacao | 1091 | //filtros que serao aplicados aos layers. Utilize a expressaso conforme definido na documentacao |
1035 | //do mapserver, exemplo | 1092 | //do mapserver, exemplo |
1036 | //{layer: "_lbiomashp",expression: "(('[CD_LEGENDA]'='CAATINGA'))"} ou {layer: "_lbiomashp",expression: "cd_legenda='CAATINGA'"} | 1093 | //{layer: "_lbiomashp",expression: "(('[CD_LEGENDA]'='CAATINGA'))"} ou {layer: "_lbiomashp",expression: "cd_legenda='CAATINGA'"} |
1037 | - filters: [{ | ||
1038 | - layer: "", | ||
1039 | - expression: "" | ||
1040 | - }], | 1094 | + filters: <?php echo $filtros;?>, |
1041 | //id de um mapa salvo e que sera recuperado | 1095 | //id de um mapa salvo e que sera recuperado |
1042 | restoreMapId : <?php echo $restauramapa;?>, | 1096 | restoreMapId : <?php echo $restauramapa;?>, |
1043 | cacheOff : '<?php echo $DESLIGACACHE;?>' | 1097 | cacheOff : '<?php echo $DESLIGACACHE;?>' |
@@ -1068,6 +1122,7 @@ function ajuda() | @@ -1068,6 +1122,7 @@ function ajuda() | ||
1068 | //$('.iconeGuiaMovel').tooltip('show'); | 1122 | //$('.iconeGuiaMovel').tooltip('show'); |
1069 | $("#i3GEOguiaMovelConteudo").mCustomScrollbar({scrollbarPosition: "outside",theme:"inset-2-dark"}); | 1123 | $("#i3GEOguiaMovelConteudo").mCustomScrollbar({scrollbarPosition: "outside",theme:"inset-2-dark"}); |
1070 | adicionaBotoesEditor(); | 1124 | adicionaBotoesEditor(); |
1125 | + $i("openlayers").style.backgroundColor = "rgb(255,255,255)"; | ||
1071 | }, | 1126 | }, |
1072 | //parametros de configuracao de diferentes componentes do mapa, como o catalogo de temas, balao de info, etc | 1127 | //parametros de configuracao de diferentes componentes do mapa, como o catalogo de temas, balao de info, etc |
1073 | components : { | 1128 | components : { |
ogc.php
@@ -488,7 +488,7 @@ if(!empty($_GET["restauramapa"])){ | @@ -488,7 +488,7 @@ if(!empty($_GET["restauramapa"])){ | ||
488 | //para operar como o Geoserver, abre o openlayers | 488 | //para operar como o Geoserver, abre o openlayers |
489 | // | 489 | // |
490 | if(isset($format) && strtolower($format) == "application/openlayers"){ | 490 | if(isset($format) && strtolower($format) == "application/openlayers"){ |
491 | - $urln = dirname($_SERVER["PHP_SELF"])."/mashups/openlayers.php?layers=".$layers."&mapext=".$bbox."&botoes=pan,zoombox,zoomtot,identifica,legenda"; | 491 | + $urln = dirname($_SERVER["PHP_SELF"])."/mashups/openlayers.php?layers=".$layers."&mapext=".$bbox."&botoes=pan,zoombox,zoomtot,identifica,legenda&ativarodadomouse=true"; |
492 | //caso exista o openlayers3 | 492 | //caso exista o openlayers3 |
493 | //if(file_exists(dirname(__FILE__)."/mashups/openlayers3.php")){ | 493 | //if(file_exists(dirname(__FILE__)."/mashups/openlayers3.php")){ |
494 | // $urln = dirname($_SERVER["PHP_SELF"])."/mashups/openlayers3.php?layers=".$layers."&mapext=".$bbox."&botoes=pan,zoombox,zoomtot,identifica,legenda"; | 494 | // $urln = dirname($_SERVER["PHP_SELF"])."/mashups/openlayers3.php?layers=".$layers."&mapext=".$bbox."&botoes=pan,zoombox,zoomtot,identifica,legenda"; |