Commit 6abab9f2907c381b55d3fd3775f4d6d4f1e10ccf
1 parent
dbe23a46
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
119 additions
and
188 deletions
Show diff stats
ferramentas/editorol/editorol.js
| ... | ... | @@ -80,92 +80,6 @@ i3GEO.editorOL = |
| 80 | 80 | map : i3geoOL |
| 81 | 81 | }), |
| 82 | 82 | nomeFuncaoSalvar : "i3GEO.editorOL.salvaGeo()", |
| 83 | - //substituir por i3GEO.Interface.openlayers.fundoDefault() | |
| 84 | - /* | |
| 85 | - e_oce : new ol.layer.Tile( | |
| 86 | - { | |
| 87 | - title : "ESRI Ocean Basemap", | |
| 88 | - visible : false, | |
| 89 | - isBaseLayer : true, | |
| 90 | - name : "oce", | |
| 91 | - source : new ol.source.TileArcGISRest( | |
| 92 | - { | |
| 93 | - url : "http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer", | |
| 94 | - attributions : [ | |
| 95 | - new ol.Attribution( | |
| 96 | - { | |
| 97 | - html : 'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer">ArcGIS</a>' | |
| 98 | - }) | |
| 99 | - ] | |
| 100 | - }) | |
| 101 | - }), | |
| 102 | - e_ims : new ol.layer.Tile( | |
| 103 | - { | |
| 104 | - title : "ESRI Imagery World 2D", | |
| 105 | - visible : false, | |
| 106 | - isBaseLayer : true, | |
| 107 | - name : "ims", | |
| 108 | - source : new ol.source.TileArcGISRest( | |
| 109 | - { | |
| 110 | - url : "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer", | |
| 111 | - attributions : [ | |
| 112 | - new ol.Attribution( | |
| 113 | - { | |
| 114 | - html : 'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer">ArcGIS</a>' | |
| 115 | - }) | |
| 116 | - ] | |
| 117 | - }) | |
| 118 | - }), | |
| 119 | - e_wsm : new ol.layer.Tile( | |
| 120 | - { | |
| 121 | - title : "ESRI World Street Map", | |
| 122 | - visible : false, | |
| 123 | - isBaseLayer : true, | |
| 124 | - name : "wsm", | |
| 125 | - source : new ol.source.TileArcGISRest( | |
| 126 | - { | |
| 127 | - url : "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer", | |
| 128 | - attributions : [ | |
| 129 | - new ol.Attribution( | |
| 130 | - { | |
| 131 | - html : 'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer">ArcGIS</a>' | |
| 132 | - }) | |
| 133 | - ] | |
| 134 | - }) | |
| 135 | - }), | |
| 136 | - ol_mma : new ol.layer.Tile({ | |
| 137 | - title : "Base carto MMA", | |
| 138 | - visible : false, | |
| 139 | - isBaseLayer : true, | |
| 140 | - name : "bra", | |
| 141 | - source : new ol.source.TileWMS({ | |
| 142 | - url : "http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&", | |
| 143 | - params : { | |
| 144 | - 'layers' : "baseraster", | |
| 145 | - 'srs' : "EPSG:4326", | |
| 146 | - 'format' : "image/png" | |
| 147 | - } | |
| 148 | - }) | |
| 149 | - }), | |
| 150 | - ol_wms : new ol.layer.Tile( | |
| 151 | - { | |
| 152 | - title : "ESRI World Street Map", | |
| 153 | - visible : false, | |
| 154 | - isBaseLayer : true, | |
| 155 | - name : "wsm", | |
| 156 | - source : new ol.source.TileArcGISRest( | |
| 157 | - { | |
| 158 | - url : "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer", | |
| 159 | - attributions : [ | |
| 160 | - new ol.Attribution( | |
| 161 | - { | |
| 162 | - html : 'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer">ArcGIS</a>' | |
| 163 | - }) | |
| 164 | - ] | |
| 165 | - }) | |
| 166 | - }), | |
| 167 | - fundo : "e_ims,e_wsm,ol_mma,ol_wms,top_wms", | |
| 168 | - */ | |
| 169 | 83 | kml : [], |
| 170 | 84 | layersIniciais : [], |
| 171 | 85 | //essa configuracao dos botoes afeta apenas o mashup |
| ... | ... | @@ -468,39 +382,38 @@ i3GEO.editorOL = |
| 468 | 382 | ins += "<br>" + $trad("t23") + ":<br><input type=text size=20 id=i3GEOOLpalavraBusca >"; |
| 469 | 383 | ins += "<br><br><input type=button value='" + $trad("t23") + "' id='i3GEOOLbotaoBusca' ></div>"; |
| 470 | 384 | ins += "<br>'" + $trad("result") + "':<br><span id=i3GEOOLcomboresultado ></span>"; |
| 471 | - try { | |
| 472 | - YAHOO.namespace("procura.container"); | |
| 473 | - YAHOO.procura.container.panel = new YAHOO.widget.Panel("panelprocura", { | |
| 474 | - zIndex : 2000, | |
| 475 | - iframe : false, | |
| 476 | - width : "250px", | |
| 477 | - visible : false, | |
| 478 | - draggable : true, | |
| 479 | - close : true | |
| 480 | - }); | |
| 481 | - YAHOO.procura.container.panel.setHeader("Encontre no mapa"); | |
| 482 | - YAHOO.procura.container.panel.setBody(ins); | |
| 483 | - YAHOO.procura.container.panel.setFooter(""); | |
| 484 | - YAHOO.procura.container.panel.render(document.body); | |
| 485 | - YAHOO.procura.container.panel.center(); | |
| 486 | 385 | |
| 487 | - document.getElementById("i3GEOOLbotaoBusca").onclick = | |
| 488 | - function() { | |
| 489 | - var layer = i3GEO.editorOL.layerAtivo(), item = document.getElementById("i3GEOOLbuscaItem").value, palavra = | |
| 490 | - document.getElementById("i3GEOOLpalavraBusca").value; | |
| 491 | - if (item === "" || palavra === "") { | |
| 492 | - alert("Escolha o item e o texto de busca"); | |
| 493 | - return; | |
| 494 | - } | |
| 495 | - i3GEO.editorOL.busca(layer, item, palavra, "i3GEOOLcomboresultado"); | |
| 496 | - }; | |
| 497 | - document.getElementById("i3GEOOLlistaTemasBusca").onchange = function() { | |
| 498 | - i3GEO.editorOL.ativaTema(this.value); | |
| 499 | - document.getElementById("i3GEOOLcomboitens").innerHTML = "..."; | |
| 500 | - i3GEO.editorOL.listaItens(i3GEO.editorOL.layerAtivo(), "i3GEOOLcomboitens", "i3GEOOLbuscaItem"); | |
| 386 | + YAHOO.namespace("procura.container"); | |
| 387 | + YAHOO.procura.container.panel = new YAHOO.widget.Panel("panelprocura", { | |
| 388 | + zIndex : 2000, | |
| 389 | + iframe : false, | |
| 390 | + width : "250px", | |
| 391 | + visible : false, | |
| 392 | + draggable : true, | |
| 393 | + close : true | |
| 394 | + }); | |
| 395 | + YAHOO.procura.container.panel.setHeader("Encontre no mapa"); | |
| 396 | + YAHOO.procura.container.panel.setBody(ins); | |
| 397 | + YAHOO.procura.container.panel.setFooter(""); | |
| 398 | + YAHOO.procura.container.panel.render(document.body); | |
| 399 | + YAHOO.procura.container.panel.center(); | |
| 400 | + | |
| 401 | + document.getElementById("i3GEOOLbotaoBusca").onclick = | |
| 402 | + function() { | |
| 403 | + var layer = i3GEO.editorOL.layerAtivo(), item = document.getElementById("i3GEOOLbuscaItem").value, palavra = | |
| 404 | + document.getElementById("i3GEOOLpalavraBusca").value; | |
| 405 | + if (item === "" || palavra === "") { | |
| 406 | + alert("Escolha o item e o texto de busca"); | |
| 407 | + return; | |
| 408 | + } | |
| 409 | + i3GEO.editorOL.busca(layer, item, palavra, "i3GEOOLcomboresultado"); | |
| 501 | 410 | }; |
| 502 | - } catch (e) { | |
| 503 | - } | |
| 411 | + document.getElementById("i3GEOOLlistaTemasBusca").onchange = function() { | |
| 412 | + i3GEO.editorOL.ativaTema(this.value); | |
| 413 | + document.getElementById("i3GEOOLcomboitens").innerHTML = "..."; | |
| 414 | + i3GEO.editorOL.listaItens(i3GEO.editorOL.layerAtivo(), "i3GEOOLcomboitens", "i3GEOOLbuscaItem"); | |
| 415 | + }; | |
| 416 | + | |
| 504 | 417 | }, |
| 505 | 418 | criaComboTemas : function() { |
| 506 | 419 | var layers = i3GEO.editorOL.layersLigados(), nlayers = layers.length, i, nometema = "", combo = |
| ... | ... | @@ -719,9 +632,6 @@ i3GEO.editorOL = |
| 719 | 632 | } catch (e) { |
| 720 | 633 | } |
| 721 | 634 | } |
| 722 | - // var w = window.open(); | |
| 723 | - // w.document.write(ins); | |
| 724 | - // w.document.close(); | |
| 725 | 635 | if (!document.getElementById("panellegendaeditorOL")) { |
| 726 | 636 | YAHOO.namespace("legendaeditorOL.container"); |
| 727 | 637 | YAHOO.legendaeditorOL.container.panel = new YAHOO.widget.Panel("panellegendaeditorOL", { |
| ... | ... | @@ -903,8 +813,6 @@ i3GEO.editorOL = |
| 903 | 813 | alert("Funcao nao disponivel. Defina o nome da funcao em i3GEO.editorOL.nomeFuncaoSalvar "); |
| 904 | 814 | }, |
| 905 | 815 | salvaGeo : function() { |
| 906 | - // i3GEO.editorOL.testeSalvar(); | |
| 907 | - // return; | |
| 908 | 816 | var geos = i3GEO.desenho.layergrafico.selectedFeatures, n = geos.length, funcaoOK = |
| 909 | 817 | function() { |
| 910 | 818 | // verifica se a geometria contem o atributo que indica a coluna ou codigo unico |
| ... | ... | @@ -981,95 +889,120 @@ i3GEO.editorOL = |
| 981 | 889 | } |
| 982 | 890 | i3GEO.editorOL.interacoes = []; |
| 983 | 891 | }, |
| 892 | + botaoProcura : function(){ | |
| 893 | + var temp = document.createElement("div"); | |
| 894 | + temp.className = "editorOLprocuraItemInactive olButton"; | |
| 895 | + temp.title = $trad("t23"); | |
| 896 | + temp.onclick = function(){ | |
| 897 | + i3GEO.editorOL.criaJanelaBusca(); | |
| 898 | + YAHOO.procura.container.panel.show(); | |
| 899 | + }; | |
| 900 | + return temp; | |
| 901 | + }, | |
| 902 | + botaoPan : function(){ | |
| 903 | + var temp = document.createElement("div"); | |
| 904 | + temp.className = "editorOLpanItemInactive olButton"; | |
| 905 | + temp.title = "pan"; | |
| 906 | + temp.onclick = function(){ | |
| 907 | + i3GEO.editorOL.marcaBotao("editorOLpan"); | |
| 908 | + }; | |
| 909 | + return temp; | |
| 910 | + }, | |
| 911 | + botaoZoombox : function(){ | |
| 912 | + var temp = document.createElement("div"); | |
| 913 | + temp.className = "editorOLzoomboxItemInactive olButton"; | |
| 914 | + temp.title = "zoombox"; | |
| 915 | + temp.onclick = function(){ | |
| 916 | + i3GEO.barraDeBotoes.defBotao("zoomli").funcaoonclick; | |
| 917 | + }; | |
| 918 | + return temp; | |
| 919 | + }, | |
| 920 | + botaoZoomTot : function(){ | |
| 921 | + var temp = document.createElement("div"); | |
| 922 | + temp.className = "editorOLzoomtotItemInactive olButton"; | |
| 923 | + temp.title = $trad("d2t"); | |
| 924 | + temp.onclick = function(){ | |
| 925 | + if (i3GEO.editorOL.mapext && i3GEO.editorOL.mapext != "") { | |
| 926 | + i3GEO.Interface.openlayers.zoom2ext(i3GEO.editorOL.mapext.join(" ")); | |
| 927 | + } else { | |
| 928 | + i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.extentTotal); | |
| 929 | + } | |
| 930 | + }; | |
| 931 | + return temp; | |
| 932 | + }, | |
| 933 | + botaoZoomIn : function(){ | |
| 934 | + var temp = document.createElement("div"); | |
| 935 | + temp.className = "editorOLzoominItemInactive olButton"; | |
| 936 | + temp.title = $trad("d5t"); | |
| 937 | + temp.onclick = function(){ | |
| 938 | + var v = i3GEO.editorOL.mapa.getView(); | |
| 939 | + v.setZoom(v.getZoom() + 1); | |
| 940 | + }; | |
| 941 | + return temp; | |
| 942 | + }, | |
| 943 | + botaoZoomOut : function(){ | |
| 944 | + var temp = document.createElement("div"); | |
| 945 | + temp.className = "editorOLzoomoutItemInactive olButton"; | |
| 946 | + temp.title = $trad("d5t"); | |
| 947 | + temp.onclick = function(){ | |
| 948 | + var v = i3GEO.editorOL.mapa.getView(); | |
| 949 | + v.setZoom(v.getZoom() - 1); | |
| 950 | + }; | |
| 951 | + return temp; | |
| 952 | + }, | |
| 953 | + botaoLegenda : function(){ | |
| 954 | + var temp = document.createElement("div"); | |
| 955 | + temp.className = "editorOLlegendaItemInactive olButton"; | |
| 956 | + temp.title = $trad("p3"); | |
| 957 | + temp.onclick = function(){ | |
| 958 | + i3GEO.editorOL.mostraLegenda(); | |
| 959 | + }; | |
| 960 | + return temp; | |
| 961 | + }, | |
| 962 | + botaoDistancia : function(){ | |
| 963 | + temp = document.createElement("div"); | |
| 964 | + temp.className = "editorOLdistanciaItemInactive olButton"; | |
| 965 | + temp.title = $trad("d21t"); | |
| 966 | + temp.onclick = function(){ | |
| 967 | + i3GEO.editorOL.marcaBotao("editorOLdistancia"); | |
| 968 | + i3GEO.barraDeBotoes.defBotao("mede").funcaoonclick; | |
| 969 | + }; | |
| 970 | + return temp; | |
| 971 | + }, | |
| 984 | 972 | criaBotoes : function(botoes) { |
| 985 | 973 | if($i("i3GEObarraEdicao")){ |
| 986 | 974 | $i("i3GEObarraEdicao").style.display = "block"; |
| 987 | 975 | return; |
| 988 | 976 | } |
| 989 | 977 | var temp; |
| 990 | - //cria o painel onde entrarão os icones | |
| 978 | + //cria o painel onde entrarao os icones | |
| 991 | 979 | i3GEOpanelEditor = document.createElement("div"); |
| 992 | 980 | i3GEOpanelEditor.id = "i3GEObarraEdicao"; |
| 993 | 981 | i3GEOpanelEditor.className = "olControlEditingToolbar1 noprint"; |
| 994 | 982 | //cria os icones |
| 995 | 983 | if (botoes.procura === true) { |
| 996 | - temp = document.createElement("div"); | |
| 997 | - temp.className = "editorOLprocuraItemInactive olButton"; | |
| 998 | - temp.title = $trad("t23"); | |
| 999 | - temp.onclick = function(){ | |
| 1000 | - YAHOO.procura.container.panel.show(); | |
| 1001 | - }; | |
| 1002 | - i3GEOpanelEditor.appendChild(temp); | |
| 984 | + i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoProcura()); | |
| 1003 | 985 | } |
| 1004 | 986 | if (botoes.pan === true) { |
| 1005 | - temp = document.createElement("div"); | |
| 1006 | - temp.className = "editorOLpanItemInactive olButton"; | |
| 1007 | - temp.title = "pan"; | |
| 1008 | - temp.onclick = function(){ | |
| 1009 | - i3GEO.editorOL.marcaBotao("editorOLpan"); | |
| 1010 | - }; | |
| 1011 | - i3GEOpanelEditor.appendChild(temp); | |
| 987 | + i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPan()); | |
| 1012 | 988 | } |
| 1013 | 989 | if (botoes.zoombox === true) { |
| 1014 | - temp = document.createElement("div"); | |
| 1015 | - temp.className = "editorOLzoomboxItemInactive olButton"; | |
| 1016 | - temp.title = "zoombox"; | |
| 1017 | - temp.onclick = function(){ | |
| 1018 | - i3GEO.barraDeBotoes.defBotao("zoomli").funcaoonclick; | |
| 1019 | - }; | |
| 1020 | - i3GEOpanelEditor.appendChild(temp); | |
| 990 | + i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomBox()); | |
| 1021 | 991 | } |
| 1022 | 992 | if (botoes.zoomtot === true) { |
| 1023 | - temp = document.createElement("div"); | |
| 1024 | - temp.className = "editorOLzoomtotItemInactive olButton"; | |
| 1025 | - temp.title = $trad("d2t"); | |
| 1026 | - temp.onclick = function(){ | |
| 1027 | - if (i3GEO.editorOL.mapext && i3GEO.editorOL.mapext != "") { | |
| 1028 | - i3GEO.Interface.openlayers.zoom2ext(i3GEO.editorOL.mapext.join(" ")); | |
| 1029 | - } else { | |
| 1030 | - i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.extentTotal); | |
| 1031 | - } | |
| 1032 | - }; | |
| 1033 | - i3GEOpanelEditor.appendChild(temp); | |
| 993 | + i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomTot()); | |
| 1034 | 994 | } |
| 1035 | 995 | if (botoes.zoomin === true) { |
| 1036 | - temp = document.createElement("div"); | |
| 1037 | - temp.className = "editorOLzoominItemInactive olButton"; | |
| 1038 | - temp.title = $trad("d5t"); | |
| 1039 | - temp.onclick = function(){ | |
| 1040 | - var v = i3GEO.editorOL.mapa.getView(); | |
| 1041 | - v.setZoom(v.getZoom() + 1); | |
| 1042 | - }; | |
| 1043 | - i3GEOpanelEditor.appendChild(temp); | |
| 996 | + i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomIn()); | |
| 1044 | 997 | } |
| 1045 | 998 | if (botoes.zoomout === true) { |
| 1046 | - temp = document.createElement("div"); | |
| 1047 | - temp.className = "editorOLzoomoutItemInactive olButton"; | |
| 1048 | - temp.title = $trad("d5t"); | |
| 1049 | - temp.onclick = function(){ | |
| 1050 | - var v = i3GEO.editorOL.mapa.getView(); | |
| 1051 | - v.setZoom(v.getZoom() - 1); | |
| 1052 | - }; | |
| 1053 | - i3GEOpanelEditor.appendChild(temp); | |
| 999 | + i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomOut()); | |
| 1054 | 1000 | } |
| 1055 | 1001 | if (botoes.legenda === true) { |
| 1056 | - temp = document.createElement("div"); | |
| 1057 | - temp.className = "editorOLlegendaItemInactive olButton"; | |
| 1058 | - temp.title = $trad("p3"); | |
| 1059 | - temp.onclick = function(){ | |
| 1060 | - i3GEO.editorOL.mostraLegenda(); | |
| 1061 | - }; | |
| 1062 | - i3GEOpanelEditor.appendChild(temp); | |
| 1002 | + i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoLegenda()); | |
| 1063 | 1003 | } |
| 1064 | 1004 | if (botoes.distancia === true) { |
| 1065 | - temp = document.createElement("div"); | |
| 1066 | - temp.className = "editorOLdistanciaItemInactive olButton"; | |
| 1067 | - temp.title = $trad("d21t"); | |
| 1068 | - temp.onclick = function(){ | |
| 1069 | - i3GEO.editorOL.marcaBotao("editorOLdistancia"); | |
| 1070 | - i3GEO.barraDeBotoes.defBotao("mede").funcaoonclick; | |
| 1071 | - }; | |
| 1072 | - i3GEOpanelEditor.appendChild(temp); | |
| 1005 | + i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoDistancia()); | |
| 1073 | 1006 | } |
| 1074 | 1007 | if (botoes.area === true) { |
| 1075 | 1008 | temp = document.createElement("div"); |
| ... | ... | @@ -1427,7 +1360,6 @@ i3GEO.editorOL = |
| 1427 | 1360 | if (retorno != "" && retorno.data && retorno.data != "") { |
| 1428 | 1361 | i3GEO.janela.fechaAguarde("i3GEO.cortador"); |
| 1429 | 1362 | c.setGeometry(format.readGeometry(retorno.data)); |
| 1430 | - //i3GEO.editorOL.substituiFeaturesSel(retorno.data); | |
| 1431 | 1363 | if (document.getElementById("panellistagEditor")) { |
| 1432 | 1364 | i3GEO.editorOL.listaGeometrias(); |
| 1433 | 1365 | } |
| ... | ... | @@ -1570,7 +1502,6 @@ i3GEO.editorOL = |
| 1570 | 1502 | + "&X=" + xy[0] + "&Y=" + xy[1]; |
| 1571 | 1503 | cpJSON.call(p, "foo", retorno, ""); |
| 1572 | 1504 | } |
| 1573 | - //i3GEO.editorOL.marcaBotao(); | |
| 1574 | 1505 | }); |
| 1575 | 1506 | i3geoOL.addInteraction(draw); |
| 1576 | 1507 | }; | ... | ... |