Commit 755a761ec7468915febcce5c27eaa93bbfa392d0
1 parent
6e46cd82
Exists in
master
and in
7 other branches
Remoção da ferramenta google, depreciada em função da ferramenta google1
Showing
5 changed files
with
0 additions
and
691 deletions
Show diff stats
ferramentas/googlemaps/dicionario.js
| ... | ... | @@ -1,53 +0,0 @@ |
| 1 | -//+$trad(1,i3GEOF.googlemaps.dicionario)+ | |
| 2 | -i3GEOF.googlemaps.dicionario = { | |
| 3 | - 1 : [ { | |
| 4 | - pt : "", | |
| 5 | - en : "", | |
| 6 | - es : "" | |
| 7 | - } ], | |
| 8 | - 2 : [ { | |
| 9 | - pt : "", | |
| 10 | - en : "", | |
| 11 | - es : "" | |
| 12 | - } ], | |
| 13 | - 3 : [ { | |
| 14 | - pt : "", | |
| 15 | - en : "", | |
| 16 | - es : "" | |
| 17 | - } ], | |
| 18 | - 4 : [ { | |
| 19 | - pt : "", | |
| 20 | - en : "", | |
| 21 | - es : "" | |
| 22 | - } ], | |
| 23 | - 5 : [ { | |
| 24 | - pt : "", | |
| 25 | - en : "", | |
| 26 | - es : "" | |
| 27 | - } ], | |
| 28 | - 6 : [ { | |
| 29 | - pt : "", | |
| 30 | - en : "", | |
| 31 | - es : "" | |
| 32 | - } ], | |
| 33 | - 7 : [ { | |
| 34 | - pt : "", | |
| 35 | - en : "", | |
| 36 | - es : "" | |
| 37 | - } ], | |
| 38 | - 8 : [ { | |
| 39 | - pt : "", | |
| 40 | - en : "", | |
| 41 | - es : "" | |
| 42 | - } ], | |
| 43 | - 9 : [ { | |
| 44 | - pt : "", | |
| 45 | - en : "", | |
| 46 | - es : "" | |
| 47 | - } ], | |
| 48 | - 10 : [ { | |
| 49 | - pt : "", | |
| 50 | - en : "", | |
| 51 | - es : "" | |
| 52 | - } ] | |
| 53 | -}; | |
| 54 | 0 | \ No newline at end of file |
ferramentas/googlemaps/endereco.php
| ... | ... | @@ -1,42 +0,0 @@ |
| 1 | -<?php | |
| 2 | -include(dirname(__FILE__)."/../../ms_configura.php"); | |
| 3 | -include_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
| 4 | -?> | |
| 5 | -<html> | |
| 6 | -<head> | |
| 7 | -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 8 | -<link rel="stylesheet" type="text/css" href="../../css/i3geo_ferramentas6.css"> | |
| 9 | - | |
| 10 | -<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=<?php echo $googleApiKey; ?>"></script> | |
| 11 | -<script type="text/javascript"> | |
| 12 | -function inicializa() | |
| 13 | -{ | |
| 14 | - var p2 = <?php echo $x;?>; | |
| 15 | - var p1 = <?php echo $y;?>; | |
| 16 | - ponto = new GLatLng(p1,p2) | |
| 17 | - geocoder = new GClientGeocoder(); | |
| 18 | - var pt1 = function(response) | |
| 19 | - { | |
| 20 | - if (!response || response.Status.code != 200) { | |
| 21 | - var ins = "Não foi possível encontrar o endereço. Status Code:" + response.Status.code; | |
| 22 | - } else { | |
| 23 | - place = response.Placemark[0]; | |
| 24 | - var ins = '<b>orig latlng:</b>' + response.name + '<br/>' | |
| 25 | - ins += '<b>latlng:</b>' + place.Point.coordinates[0] + "," + place.Point.coordinates[1] + '<br>' | |
| 26 | - ins += '<b>Status Code:</b>' + response.Status.code + '<br>' | |
| 27 | - ins += '<b>Status Request:</b>' + response.Status.request + '<br>' | |
| 28 | - ins += '<b>Address:</b>' + place.address + '<br>' | |
| 29 | - ins += '<b>Accuracy:</b>' + place.AddressDetails.Accuracy + '<br>' | |
| 30 | - ins += '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode; | |
| 31 | - ins += '<br><br>O endereço obtido é aproximado. Mais detalhes em <a href="http://nicogoeminne.googlepages.com/documentation.html" >Google</a>' | |
| 32 | - } | |
| 33 | - document.getElementById("mapa").innerHTML = ins | |
| 34 | - } | |
| 35 | - geocoder.getLocations(ponto, pt1); | |
| 36 | -} | |
| 37 | -</script> | |
| 38 | - </head> | |
| 39 | - <body onload="inicializa()"> | |
| 40 | - <div id="mapa"></div> | |
| 41 | - </body> | |
| 42 | -</html> | |
| 43 | 0 | \ No newline at end of file |
ferramentas/googlemaps/index.htm
| ... | ... | @@ -1,121 +0,0 @@ |
| 1 | -<html> | |
| 2 | -<head> | |
| 3 | -<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 4 | -<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAg9kA9xQlYqK9iBDKaeTpgxSieGwtcPDeiUtRiq7Xa63cyLppcxTVYXnVlPwveOe-sXuXfpBeNpL6pA"> | |
| 5 | -</script> | |
| 6 | -<title></title> | |
| 7 | - </head> | |
| 8 | - <body onunload="GUnload()"> | |
| 9 | - <div id="mapa" style="width: 340px; height: 340px"></div> | |
| 10 | - | |
| 11 | - <script type="text/javascript" > | |
| 12 | - //chave na producao= ABQIAAAAg9kA9xQlYqK9iBDKaeTpgxSieGwtcPDeiUtRiq7Xa63cyLppcxTVYXnVlPwveOe-sXuXfpBeNpL6pA | |
| 13 | - //chave no desenvolvimento = ABQIAAAAg9kA9xQlYqK9iBDKaeTpgxQ_qvn5wqSkbcx9uoqrWGnUcZ7lqhRVzkJwzeDN3nQJheG7FjoxyruBIQ | |
| 14 | - if(window.parent.document.getElementById("boxg")) | |
| 15 | - window.parent.document.getElementById("boxg").style.zIndex = 0 | |
| 16 | - navm = false; // IE | |
| 17 | - navn = false; // netscape | |
| 18 | - var app = navigator.appName.substring(0,1); | |
| 19 | - if (app=='N') navn=true; else navm=true; | |
| 20 | - | |
| 21 | - if(window.parent.objmapa) | |
| 22 | - { | |
| 23 | - docmapa = window.parent.document | |
| 24 | - pol = window.parent.objmapa.extent | |
| 25 | - ret = pol.split(" ") | |
| 26 | - pt1 = (( (ret[0] * -1) - (ret[2] * -1) ) / 2) + ret[0] *1 | |
| 27 | - pt2 = (((ret[1] - ret[3]) / 2)* -1) + ret[1] *1 | |
| 28 | - pt = pt1+","+pt2 | |
| 29 | - } | |
| 30 | - else | |
| 31 | - { | |
| 32 | - pt1 = "-54"; | |
| 33 | - pt2 = "-12"; | |
| 34 | - } | |
| 35 | - map = new GMap2(document.getElementById("mapa")); | |
| 36 | - map.setMapType(G_SATELLITE_MAP); | |
| 37 | - map.addMapType(G_SATELLITE_3D_MAP); | |
| 38 | - map.addControl(new GLargeMapControl()); | |
| 39 | - map.addControl(new GMapTypeControl()); | |
| 40 | - map.setCenter(new GLatLng(pt2,pt1), 11); | |
| 41 | - GEvent.addListener(map, "moveend", function() { | |
| 42 | - ondegoogle(map); | |
| 43 | - }); | |
| 44 | - //var boundaries = new GLatLngBounds(new GLatLng(40.716216,-74.213393), new GLatLng(40.765641,-74.139235)); | |
| 45 | - | |
| 46 | - //wmsmap = new GGroundOverlay(criaWMS(), map.getBounds()); | |
| 47 | - //map.addOverlay(wmsmap); | |
| 48 | - | |
| 49 | - GEvent.addListener(map, "zoomend", function() { | |
| 50 | - ondegoogle(); | |
| 51 | - //map.removeOverlay(wmsmap); | |
| 52 | - //wmsmap = new GGroundOverlay(criaWMS(), map.getBounds()); | |
| 53 | - //map.addOverlay(wmsmap); | |
| 54 | - | |
| 55 | - }); | |
| 56 | - /* | |
| 57 | - GEvent.addListener(map, "dragend", function() { | |
| 58 | - map.removeOverlay(wmsmap); | |
| 59 | - wmsmap = new GGroundOverlay(criaWMS(), map.getBounds()); | |
| 60 | - map.addOverlay(wmsmap); | |
| 61 | - }); | |
| 62 | - */ | |
| 63 | - function moveMapa(bd) | |
| 64 | - { | |
| 65 | - nex = bd.minX+" "+bd.minY+" "+bd.maxX+" "+bd.maxY | |
| 66 | - var p = window.parent.g_locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&ext="+nex | |
| 67 | - var cp = new cpaint(); | |
| 68 | - //cp.set_debug(2) | |
| 69 | - cp.set_response_type("JSON"); | |
| 70 | - cp.call(p,"mudaExtensao",window.parent.ajaxredesenha); | |
| 71 | - //ondegoogle(bd); | |
| 72 | - } | |
| 73 | - function ondegoogle() | |
| 74 | - { | |
| 75 | - if(window.parent.objmapa) | |
| 76 | - { | |
| 77 | - var bd = map.getBounds(); | |
| 78 | - var so = bd.getSouthWest(); | |
| 79 | - var ne = bd.getNorthEast(); | |
| 80 | - var xyMin = window.parent.i3GEO.util.dd2tela(so.lng(),so.lat(),window.parent.document,window.parent.objmapa.extent,window.parent.objmapa.cellsize); | |
| 81 | - var xyMax = window.parent.i3GEO.util.dd2tela(ne.lng(),ne.lat(),window.parent.document,window.parent.objmapa.extent,window.parent.objmapa.cellsize); | |
| 82 | - var box = window.parent.$i("boxg") | |
| 83 | - var w = xyMax[0]-xyMin[0] | |
| 84 | - var h = xyMin[1]-xyMax[1] | |
| 85 | - box.style.display = "block" | |
| 86 | - box.style.width = w + "px" | |
| 87 | - box.style.height = h + "px" | |
| 88 | - box.style.top = xyMax[1]+"px" | |
| 89 | - box.style.left = xyMin[0]+"px" | |
| 90 | - box.style.display="block" | |
| 91 | - } | |
| 92 | - } | |
| 93 | - | |
| 94 | - function panTogoogle() | |
| 95 | - { | |
| 96 | - var b = window.parent.document.getElementById("boxg"); | |
| 97 | - b.style.display="block"; | |
| 98 | - pol = window.parent.objmapa.extent; | |
| 99 | - ret = pol.split(" "); | |
| 100 | - pt1 = (( (ret[0] * -1) - (ret[2] * -1) ) / 2) + ret[0] *1; | |
| 101 | - pt2 = (((ret[1] - ret[3]) / 2)* -1) + ret[1] *1; | |
| 102 | - //map.centerAndZoom(new GLatLng(pt2,pt1),map.getZoom()); | |
| 103 | - //map.setZoom(level) | |
| 104 | - map.panTo(new GLatLng(pt2,pt1)) | |
| 105 | - } | |
| 106 | - function bbox() | |
| 107 | - { | |
| 108 | - var bd = map.getBounds(); | |
| 109 | - var so = bd.getSouthWest(); | |
| 110 | - var ne = bd.getNorthEast(); | |
| 111 | - var bbox = so.lng()+","+so.lat()+","+ne.lng()+","+ne.lat() | |
| 112 | - return (bbox) | |
| 113 | - } | |
| 114 | - function criaWMS() | |
| 115 | - { | |
| 116 | - return("http://mapas.mma.gov.br/i3geo/ogc.php?tema=bioma&width="+parseInt(document.getElementById("map").style.width)+"&height="+parseInt(document.getElementById("map").style.height)+"&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&STYLES=&BGCOLOR=0xFFFFFF&FORMAT=image/png&TRANSPARENT=TRUE&layers=bioma&bbox="+bbox()) | |
| 117 | - } | |
| 118 | - ondegoogle(map); | |
| 119 | - </script> | |
| 120 | - </body> | |
| 121 | -</html> | |
| 122 | 0 | \ No newline at end of file |
ferramentas/googlemaps/index.php
| ... | ... | @@ -1,472 +0,0 @@ |
| 1 | -<?php | |
| 2 | -include(dirname(__FILE__)."/../../ms_configura.php"); | |
| 3 | -?> | |
| 4 | -<html> | |
| 5 | -<head> | |
| 6 | -<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 7 | -<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=<?php echo $googleApiKey; ?>"></script> | |
| 8 | -<script type="text/javascript"> | |
| 9 | -/* | |
| 10 | -Title: Google Maps | |
| 11 | - | |
| 12 | -Abre um mapa, baseado na API do Google Maps, que permite navegar de forma integrada com o mapa principal do i3Geo. | |
| 13 | - | |
| 14 | -O código da API do Google Maps é armazenada em i3geo/ms_configura.php | |
| 15 | - | |
| 16 | -Veja: | |
| 17 | - | |
| 18 | -<i3GEO.navega.google> | |
| 19 | - | |
| 20 | -Arquivo: | |
| 21 | - | |
| 22 | -i3geo/ferramentas/googlemaps/index.php | |
| 23 | - | |
| 24 | -Licenca: | |
| 25 | - | |
| 26 | -GPL2 | |
| 27 | - | |
| 28 | -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 29 | - | |
| 30 | -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 31 | -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | |
| 32 | - | |
| 33 | -Este programa é software livre; você pode redistribuí-lo | |
| 34 | -e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 35 | -GNU conforme publicada pela Free Software Foundation; | |
| 36 | - | |
| 37 | -Este programa é distribuído na expectativa de que seja útil, | |
| 38 | -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 39 | -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 40 | -Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 41 | -Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 42 | -GNU junto com este programa; se não, escreva para a | |
| 43 | -Free Software Foundation, Inc., no endereço | |
| 44 | -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 45 | -*/ | |
| 46 | -/* | |
| 47 | -Function: inicializa | |
| 48 | - | |
| 49 | -Cria o mapa do Google Maps e adiciona os botões especiais do i3Geo. Define os eventos que disparam modificações no mapa | |
| 50 | -principal do i3Geo quando é feita a navegação. | |
| 51 | -*/ | |
| 52 | -function inicializa(){ | |
| 53 | - window.parent.i3GEO.util.criaPin("boxpingoogle",window.parent.i3GEO.configura.locaplic+'/imagens/dot1red.gif',"5px","5px"); | |
| 54 | - var box = window.parent.$i("boxpingoogle"); | |
| 55 | - counterClick = 0 | |
| 56 | - var m = document.getElementById("mapa") | |
| 57 | - if(window.parent.i3GEO){ | |
| 58 | - m.style.width = (window.parent.i3GEO.parametros.w / 2) - 20 + "px"; | |
| 59 | - m.style.height = (window.parent.i3GEO.parametros.h / 2) -20 + "px"; | |
| 60 | - i3geoOverlay = false; | |
| 61 | - if(window.parent.document.getElementById("boxg")) | |
| 62 | - window.parent.document.getElementById("boxg").style.zIndex = 0 | |
| 63 | - navm = false; // IE | |
| 64 | - navn = false; // netscape | |
| 65 | - var app = navigator.appName.substring(0,1); | |
| 66 | - if (app=='N') navn=true; else navm=true; | |
| 67 | - docmapa = window.parent.document | |
| 68 | - pol = window.parent.i3GEO.parametros.mapexten | |
| 69 | - ret = pol.split(" ") | |
| 70 | - pt1 = (( (ret[0] * -1) - (ret[2] * -1) ) / 2) + ret[0] *1 | |
| 71 | - pt2 = (((ret[1] - ret[3]) / 2)* -1) + ret[1] *1 | |
| 72 | - pt = pt1+","+pt2 | |
| 73 | - try{ | |
| 74 | - var coordenadas = window.parent.i3GEO.navega.dialogo.google.coordenadas; | |
| 75 | - } | |
| 76 | - catch(e){} | |
| 77 | - } | |
| 78 | - else{ | |
| 79 | - var pt1 = -54; | |
| 80 | - var pt2 = -12; | |
| 81 | - } | |
| 82 | - map = new GMap2(m); | |
| 83 | - map.setMapType(G_SATELLITE_MAP); | |
| 84 | - map.addMapType(G_SATELLITE_3D_MAP); | |
| 85 | - map.addControl(new GLargeMapControl()); | |
| 86 | - map.addControl(new GMapTypeControl()); | |
| 87 | - map.addControl(new GScaleControl()); | |
| 88 | - map.setCenter(new GLatLng(pt2,pt1), 8); | |
| 89 | - if(coordenadas) | |
| 90 | - {adicionaMarcasMapa(coordenadas);} | |
| 91 | - GEvent.addListener(map, "moveend", function() { | |
| 92 | - ondegoogle(map); | |
| 93 | - }); | |
| 94 | - GEvent.addListener(map, "zoomend", function() { | |
| 95 | - if(window.parent.i3GEO){ | |
| 96 | - ondegoogle(); | |
| 97 | - try{ | |
| 98 | - map.removeOverlay(wmsmap); | |
| 99 | - wmsmap = new GGroundOverlay(criaWMS(), map.getBounds()); | |
| 100 | - map.addOverlay(wmsmap); | |
| 101 | - }catch(x){} | |
| 102 | - } | |
| 103 | - }); | |
| 104 | - GEvent.addListener(map, "dragend", function() { | |
| 105 | - if(window.parent.i3GEO){ | |
| 106 | - ondegoogle(); | |
| 107 | - try{ | |
| 108 | - map.removeOverlay(wmsmap); | |
| 109 | - wmsmap = new GGroundOverlay(criaWMS(), map.getBounds()); | |
| 110 | - map.addOverlay(wmsmap); | |
| 111 | - }catch(x){} | |
| 112 | - } | |
| 113 | - }); | |
| 114 | - GEvent.addListener(map, "mousemove", function(ponto) { | |
| 115 | - var teladms,tela,temp, | |
| 116 | - mapexten = window.parent.i3GEO.parametros.mapexten; | |
| 117 | - teladms = window.parent.i3GEO.calculo.dd2dms(ponto.x,ponto.y); | |
| 118 | - //tela = map.getProjection().fromLatLngToPixel(ponto); | |
| 119 | - window.parent.objposicaocursor = { | |
| 120 | - ddx: ponto.x, | |
| 121 | - ddy: ponto.y, | |
| 122 | - dmsx: teladms[0], | |
| 123 | - dmsy: teladms[1], | |
| 124 | - imgx:0, | |
| 125 | - imgy:0, | |
| 126 | - telax: 0, | |
| 127 | - telay: 0 | |
| 128 | - }; | |
| 129 | - window.parent.i3GEO.eventos.mousemoveMapa(); | |
| 130 | - if(window.parent.i3GEO.Interface.ATUAL === "googleearth") | |
| 131 | - {return;} | |
| 132 | - temp = mapexten.split(" "); | |
| 133 | - if(ponto.x < temp[2] && ponto.y < temp[3]){ | |
| 134 | - xy = window.parent.i3GEO.calculo.dd2tela(ponto.x,ponto.y,window.parent.document.getElementById(window.parent.i3GEO.Interface.IDMAPA),mapexten,window.parent.i3GEO.parametros.pixelsize); | |
| 135 | - box.style.display = "block"; | |
| 136 | - box.style.width = "5px"; | |
| 137 | - box.style.height = "5px"; | |
| 138 | - box.style.top = (parseInt(xy[1],10) + 2.5) +"px"; | |
| 139 | - box.style.left = (parseInt(xy[0],10) - 2.5) +"px"; | |
| 140 | - } | |
| 141 | - }); | |
| 142 | - function botaoI3geo() {} | |
| 143 | - botaoI3geo.prototype = new GControl(); | |
| 144 | - botaoI3geo.prototype.initialize = function(map) { | |
| 145 | - var container = document.createElement("div"); | |
| 146 | - var i3geo = document.createElement("div"); | |
| 147 | - this.setButtonStyle_(i3geo); | |
| 148 | - container.appendChild(i3geo); | |
| 149 | - i3geo.appendChild(document.createTextNode("i3Geo")); | |
| 150 | - GEvent.addDomListener(i3geo, "click", function() { | |
| 151 | - //ativaI3geo(); | |
| 152 | - try | |
| 153 | - {map.removeOverlay(wmsmap);wmsmap = null;} | |
| 154 | - catch(x){ | |
| 155 | - wmsmap = new GGroundOverlay(criaWMS(), map.getBounds()); | |
| 156 | - map.addOverlay(wmsmap); | |
| 157 | - if(typeof(console) !== 'undefined'){console.error(x);} | |
| 158 | - } | |
| 159 | - }); | |
| 160 | - | |
| 161 | - var rota = document.createElement("div"); | |
| 162 | - this.setButtonStyle_(rota); | |
| 163 | - container.appendChild(rota); | |
| 164 | - rota.appendChild(document.createTextNode("Rota")); | |
| 165 | - GEvent.addDomListener(rota, "click", function() { | |
| 166 | - ativaI3geoRota(); | |
| 167 | - }); | |
| 168 | - map.getContainer().appendChild(container); | |
| 169 | - return container; | |
| 170 | - } | |
| 171 | - botaoI3geo.prototype.getDefaultPosition = function() { | |
| 172 | - return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(50, 50)); | |
| 173 | - } | |
| 174 | - botaoI3geo.prototype.setButtonStyle_ = function(button) { | |
| 175 | - button.style.textDecoration = "none"; | |
| 176 | - button.style.color = "black"; | |
| 177 | - button.style.backgroundColor = "white"; | |
| 178 | - button.style.font = "small Arial"; | |
| 179 | - button.style.border = "1px solid black"; | |
| 180 | - button.style.padding = "1px"; | |
| 181 | - button.style.marginBottom = "3px"; | |
| 182 | - button.style.textAlign = "center"; | |
| 183 | - button.style.width = "3em"; | |
| 184 | - button.style.cursor = "pointer"; | |
| 185 | - } | |
| 186 | - if(window.parent.i3GEO){ | |
| 187 | - if(window.parent.i3GEO.parametros.mapfile) | |
| 188 | - map.addControl(new botaoI3geo()); | |
| 189 | - ondegoogle(map); | |
| 190 | - } | |
| 191 | - if(coordenadas) | |
| 192 | - {adicionaMarcasMapa(coordenadas);} | |
| 193 | -} | |
| 194 | -function moveMapa(bd) | |
| 195 | -{ | |
| 196 | - if(!window.parent.i3GEO){return;} | |
| 197 | - nex = bd.minX+" "+bd.minY+" "+bd.maxX+" "+bd.maxY | |
| 198 | - var p = window.parent.i3GEO.locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&ext="+nex | |
| 199 | - var cp = new cpaint(); | |
| 200 | - //cp.set_debug(2) | |
| 201 | - cp.set_response_type("JSON"); | |
| 202 | - cp.call(p,"mudaExtensao",window.parent.i3GEO.atualiza); | |
| 203 | -} | |
| 204 | -/* | |
| 205 | -Function: ondegoogle | |
| 206 | - | |
| 207 | -Mostra, no mapa principal, um retângulo indicando a extensão geográfica do mapa mostrado na janela do GM | |
| 208 | -*/ | |
| 209 | -function ondegoogle() | |
| 210 | -{ | |
| 211 | - if(!window.parent.i3GEO){return;} | |
| 212 | - var bd = map.getBounds(); | |
| 213 | - var so = bd.getSouthWest(); | |
| 214 | - var ne = bd.getNorthEast(); | |
| 215 | - var xyMin = window.parent.i3GEO.calculo.dd2tela(so.lng(),so.lat(),window.parent.document.getElementById(window.parent.i3GEO.Interface.IDMAPA),window.parent.i3GEO.parametros.mapexten,window.parent.i3GEO.parametros.pixelsize); | |
| 216 | - var xyMax = window.parent.i3GEO.calculo.dd2tela(ne.lng(),ne.lat(),window.parent.document.getElementById(window.parent.i3GEO.Interface.IDMAPA),window.parent.i3GEO.parametros.mapexten,window.parent.i3GEO.parametros.pixelsize); | |
| 217 | - | |
| 218 | - var box = window.parent.$i("boxg") | |
| 219 | - var w = xyMax[0]-xyMin[0] | |
| 220 | - var h = xyMin[1]-xyMax[1] | |
| 221 | - box.style.display = "block" | |
| 222 | - box.style.width = w + "px" | |
| 223 | - box.style.height = h+3 + "px" | |
| 224 | - box.style.top = xyMax[1]+"px" | |
| 225 | - box.style.left = xyMin[0]+"px" | |
| 226 | - box.style.display="block" | |
| 227 | -} | |
| 228 | -/* | |
| 229 | -Function: panTogoogle | |
| 230 | - | |
| 231 | -Desloca o mapa principal conforme a extensão geográfica do mapa do GM | |
| 232 | -*/ | |
| 233 | -function panTogoogle() | |
| 234 | -{ | |
| 235 | - if(!window.parent.i3GEO){return;} | |
| 236 | - var b = window.parent.document.getElementById("boxg"); | |
| 237 | - b.style.display="block"; | |
| 238 | - pol = window.parent.i3GEO.parametros.mapexten; | |
| 239 | - ret = pol.split(" "); | |
| 240 | - pt1 = (( (ret[0] * -1) - (ret[2] * -1) ) / 2) + ret[0] *1; | |
| 241 | - pt2 = (((ret[1] - ret[3]) / 2)* -1) + ret[1] *1; | |
| 242 | - map.panTo(new GLatLng(pt2,pt1)) | |
| 243 | - //ondegoogle(); | |
| 244 | -} | |
| 245 | -/* | |
| 246 | -Function: bbox | |
| 247 | - | |
| 248 | -Obtém os valores de extensão geográfica do GM e converte para uma string no formato aceito pelo i3Geo | |
| 249 | - | |
| 250 | -Return: | |
| 251 | - | |
| 252 | -{String} - xmin ymin xmax ymax | |
| 253 | -*/ | |
| 254 | -function bbox() | |
| 255 | -{ | |
| 256 | - var bd = map.getBounds(); | |
| 257 | - var so = bd.getSouthWest(); | |
| 258 | - var ne = bd.getNorthEast(); | |
| 259 | - var bbox = so.lng()+" "+so.lat()+" "+ne.lng()+" "+ne.lat() | |
| 260 | - return (bbox) | |
| 261 | -} | |
| 262 | -/* | |
| 263 | -Function: criaWMS | |
| 264 | - | |
| 265 | -Formata uma URL que transforma o mapa atual do i3Geo em um WMS, possibilitando sua inclusão como uma camada na janela GM. | |
| 266 | - | |
| 267 | -Return: | |
| 268 | - | |
| 269 | -[String} - URL WMS | |
| 270 | -*/ | |
| 271 | -function criaWMS() | |
| 272 | -{ | |
| 273 | - var cgi = window.parent.i3GEO.configura.locaplic+"/classesphp/parse_cgi.php?g_sid="+window.parent.i3GEO.configura.sid | |
| 274 | - var parametros = "&map_size="+parseInt(document.getElementById("mapa").style.width) | |
| 275 | - parametros += ","+parseInt(document.getElementById("mapa").style.height) | |
| 276 | - parametros += "&mapext="+bbox() | |
| 277 | - parametros += "&map_imagecolor=0 0 0&map_transparent=on" | |
| 278 | - return(cgi+parametros) | |
| 279 | -} | |
| 280 | -function criaTile(){ | |
| 281 | - var cgi = window.parent.i3GEO.util.protocolo()+"://"+window.location.host+window.parent.i3GEO.parametros.cgi+"?"; | |
| 282 | - var parametros = "map="+window.parent.i3GEO.parametros.mapfile; | |
| 283 | - parametros += "&map.scalebar=status+off&map_imagecolor=-1 -1 -1&map_transparent=on" | |
| 284 | - parametros += '&mode=tile'; | |
| 285 | - parametros += '&tilemode=gmap'; | |
| 286 | - parametros += '&tile={X}+{Y}+{Z}'; | |
| 287 | - return(cgi+parametros); | |
| 288 | -} | |
| 289 | -function ativaI3geo() | |
| 290 | -{ | |
| 291 | - var i3GEOTile = new GTileLayer(null,0,18,{ | |
| 292 | - tileUrlTemplate:criaTile(), | |
| 293 | - isPng:true, | |
| 294 | - opacity:1 }); | |
| 295 | - i3GEOTileO = new GTileLayerOverlay(i3GEOTile); | |
| 296 | - map.addOverlay(i3GEOTileO); | |
| 297 | -} | |
| 298 | -/* | |
| 299 | -Function: ativaI3geoRota | |
| 300 | - | |
| 301 | -Inicia a função de criação de rotas, solicitando a indicação do primeiro ponto | |
| 302 | -*/ | |
| 303 | -function ativaI3geoRota() | |
| 304 | -{ | |
| 305 | - rotaEvento = GEvent.addListener(map, "click", parametrosRota); | |
| 306 | - i3GEO.janela.tempoMsg("Clique o ponto de origem da rota"); | |
| 307 | - counterClick++; | |
| 308 | -} | |
| 309 | -/* | |
| 310 | -Function: parametrosRota | |
| 311 | - | |
| 312 | -Obtém os parâmetros para criação da rota, inclusive o ponto de destino | |
| 313 | -*/ | |
| 314 | -function parametrosRota(overlay,latlng) | |
| 315 | -{ | |
| 316 | - if(counterClick == 1) | |
| 317 | - { | |
| 318 | - counterClick++; | |
| 319 | - i3GEO.janela.tempoMsg("Clique o ponto de destino da rota"); | |
| 320 | - pontoRota1 = latlng | |
| 321 | - return; | |
| 322 | - } | |
| 323 | - if(counterClick == 2) | |
| 324 | - { | |
| 325 | - cursor("wait"); | |
| 326 | - pontoRota2 = latlng | |
| 327 | - counterClick = 0; | |
| 328 | - GEvent.removeListener(rotaEvento) | |
| 329 | - constroiRota() | |
| 330 | - montaRota(); | |
| 331 | - } | |
| 332 | -} | |
| 333 | -/* | |
| 334 | -Function: constroiRota | |
| 335 | - | |
| 336 | -Cria a rota do ponto de origem ao ponto de destino | |
| 337 | -*/ | |
| 338 | -function constroiRota() | |
| 339 | -{ | |
| 340 | - geocoder = new GClientGeocoder(); | |
| 341 | - var pt2 = function(response) | |
| 342 | - { | |
| 343 | - if (!response || response.Status.code != 200) { | |
| 344 | - i3GEO.janela.tempoMsg("Status Code:" + response.Status.code); | |
| 345 | - cursor("default"); | |
| 346 | - } else { | |
| 347 | - place = response.Placemark[0]; | |
| 348 | - point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]); | |
| 349 | - marker = new GMarker(point); | |
| 350 | - map.addOverlay(marker); | |
| 351 | - endereco2 = place.address; | |
| 352 | - endereco2 = window.prompt("Endereco do final",endereco2) | |
| 353 | - if (endereco2!=null && endereco2!="") | |
| 354 | - { | |
| 355 | - map.addOverlay(marker); | |
| 356 | - montaRota(); | |
| 357 | - } | |
| 358 | - } | |
| 359 | - } | |
| 360 | - | |
| 361 | - var pt1 = function(response) | |
| 362 | - { | |
| 363 | - map.clearOverlays(); | |
| 364 | - if (!response || response.Status.code != 200) { | |
| 365 | - i3GEO.janela.tempoMsg("Status Code:" + response.Status.code); | |
| 366 | - } else { | |
| 367 | - place = response.Placemark[0]; | |
| 368 | - point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]); | |
| 369 | - marker = new GMarker(point); | |
| 370 | - marker.openInfoWindowHtml( | |
| 371 | - '<b>orig latlng:</b>' + response.name + '<br/>' + | |
| 372 | - '<b>latlng:</b>' + place.Point.coordinates[0] + "," + place.Point.coordinates[1] + '<br>' + | |
| 373 | - '<b>Status Code:</b>' + response.Status.code + '<br>' + | |
| 374 | - '<b>Status Request:</b>' + response.Status.request + '<br>' + | |
| 375 | - '<b>Address:</b>' + place.address + '<br>' + | |
| 376 | - '<b>Accuracy:</b>' + place.AddressDetails.Accuracy + '<br>' + | |
| 377 | - '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode); | |
| 378 | - endereco1 = place.address; | |
| 379 | - endereco1 = window.prompt("Endereco do inicio",endereco1) | |
| 380 | - if (endereco1!=null && endereco1!="") | |
| 381 | - { | |
| 382 | - map.addOverlay(marker); | |
| 383 | - geocoder.getLocations(pontoRota2, pt2); | |
| 384 | - } | |
| 385 | - } | |
| 386 | - } | |
| 387 | - //geocoder.getLocations(pontoRota1, pt1); | |
| 388 | -} | |
| 389 | -/* | |
| 390 | -Function: montaRota | |
| 391 | - | |
| 392 | -Inclui o traçado da rota como uma nova camada no mapa principal | |
| 393 | -*/ | |
| 394 | -function montaRota() | |
| 395 | -{ | |
| 396 | - if(!document.getElementById("descrota")) | |
| 397 | - { | |
| 398 | - var descrota = document.createElement("div"); | |
| 399 | - descrota.id = "descrota" | |
| 400 | - document.body.appendChild(descrota); | |
| 401 | - } | |
| 402 | - else | |
| 403 | - { | |
| 404 | - descrota = document.getElementById("descrota") | |
| 405 | - descrota.innerHTML = "" | |
| 406 | - } | |
| 407 | - directions = new GDirections(map, descrota); | |
| 408 | - //directions.load("from: "+endereco1+" to: "+endereco2); | |
| 409 | - directions.load("from: "+pontoRota1.lat()+","+pontoRota1.lng()+" to: "+pontoRota2.lat()+","+pontoRota2.lng()); | |
| 410 | - GEvent.addListener(directions, "load", function() { | |
| 411 | - var linha = directions.getPolyline(); | |
| 412 | - var nvertices = linha.getVertexCount(); | |
| 413 | - pontos = new Array() | |
| 414 | - for(i=0;i<nvertices;i++) | |
| 415 | - { | |
| 416 | - var vertice = linha.getVertex(i); | |
| 417 | - pontos.push(vertice.lng()+" "+vertice.lat()) | |
| 418 | - } | |
| 419 | - function ativanovotema(retorno) | |
| 420 | - { | |
| 421 | - var temaNovo = retorno.data | |
| 422 | - var converteParaLinha = function() | |
| 423 | - { | |
| 424 | - var cp = new cpaint(); | |
| 425 | - cp.set_response_type("JSON"); | |
| 426 | - //cp.set_debug(2) | |
| 427 | - var p = window.parent.i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+window.parent.i3GEO.configura.sid+"&funcao=sphPT2shp¶=linha&tema="+temaNovo; | |
| 428 | - cp.call(p,"sphPT2shp",window.parent.i3GEO.atualiza); | |
| 429 | - cursor("default"); | |
| 430 | - } | |
| 431 | - var p = window.parent.i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+window.parent.i3GEO.configura.sid+"&funcao=insereSHP&tema="+retorno.data; | |
| 432 | - var cp = new cpaint(); | |
| 433 | - //cp.set_debug(2) | |
| 434 | - cp.set_response_type("JSON"); | |
| 435 | - cp.set_transfer_mode('POST'); | |
| 436 | - cp.call(p,"insereSHP",converteParaLinha,"&xy="+pontos.join(" ")); | |
| 437 | - } | |
| 438 | - var cp = new cpaint(); | |
| 439 | - cp.set_response_type("JSON"); | |
| 440 | - cp.set_transfer_mode("POST"); | |
| 441 | - var p = window.parent.i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+window.parent.i3GEO.configura.sid; | |
| 442 | - cp.call(p,"criaSHPvazio",ativanovotema,"&funcao=criashpvazio"); | |
| 443 | - }); | |
| 444 | -} | |
| 445 | -/* | |
| 446 | -Function: adicionaMarcasMapa | |
| 447 | - | |
| 448 | -Adiciona marcas no mapa conforme um array de coordenadas | |
| 449 | - | |
| 450 | -Parametro: | |
| 451 | - | |
| 452 | -coordenadas {array} - array de pares separados por ' ' contendo x e y | |
| 453 | -*/ | |
| 454 | -function adicionaMarcasMapa(coordenadas){ | |
| 455 | - var n = coordenadas.length,i,pt,point,marker; | |
| 456 | - for(i=0;i<n;i++){ | |
| 457 | - pt = coordenadas[i].split(" "); | |
| 458 | - point = new GLatLng(pt[1],pt[0]); | |
| 459 | - marker = new GMarker(point); | |
| 460 | - map.addOverlay(marker); | |
| 461 | - } | |
| 462 | -} | |
| 463 | -function cursor(c){ | |
| 464 | - var d = document.getElementById("mapa"); | |
| 465 | - d.firstChild.style.cursor = c; | |
| 466 | -} | |
| 467 | - </script> | |
| 468 | - </head> | |
| 469 | - <body onload="inicializa()"> | |
| 470 | - <div id="mapa" style="width: 440px; height: 340px"></div> | |
| 471 | - </body> | |
| 472 | -</html> | |
| 473 | 0 | \ No newline at end of file |