Commit 303386b0d639e403dee42699c80cdb3bfa3a1941

Authored by Edmar Moretti
1 parent 24de638f

Alteração na ferramenta de cálculo de área para utilizar a API do OpenLayers nessa interface

Showing 1 changed file with 8 additions and 10 deletions   Show diff stats
classesjs/classe_analise.js
... ... @@ -866,7 +866,8 @@ i3GEO.analise = {
866 866 trecho = 0,
867 867 per = 0,
868 868 direcao = 0,
869   - area = 0;
  869 + area = 0,
  870 + proj = new OpenLayers.Projection("EPSG:4326");
870 871 n = i3GEO.analise.medeArea.pontos.ypt.length;
871 872 if(n > 1){
872 873 x1 = i3GEO.analise.medeArea.pontos.xpt[n-1];
... ... @@ -881,6 +882,7 @@ i3GEO.analise = {
881 882 y1 = temp[1];
882 883 x2 = temp[2];
883 884 y2 = temp[3];
  885 + proj = new OpenLayers.Projection("EPSG:900913");
884 886 }
885 887 trecho = i3GEO.calculo.distancia(x1,y1,x2,y2);
886 888 direcao = i3GEO.calculo.direcao(x1,y1,x2,y2);
... ... @@ -894,13 +896,9 @@ i3GEO.analise = {
894 896 temp = temp.split(" ");
895 897 x1 = temp[0];
896 898 y1 = temp[1];
897   - x2 = temp[2];
898   - y2 = temp[3];
899 899 }
900 900 per += i3GEO.calculo.distancia(x1,y1,x2,y2);
901   - if(n > 2){
902   - area = poligono.geometry.getGeodesicArea();
903   - }
  901 + area = poligono.geometry.getGeodesicArea(proj);
904 902 i3GEO.analise.medeArea.openlayers.mostraParcial(trecho,per,area,direcao);
905 903 }
906 904 },
... ... @@ -909,7 +907,8 @@ i3GEO.analise = {
909 907 //registra os pontos e calcula a distancia
910 908 per = 0,
911 909 trecho = 0,
912   - area = 0;
  910 + area = 0,
  911 + proj = new OpenLayers.Projection("EPSG:4326");
913 912 i3GEO.analise.medeArea.pontos.xpt.push(point.x);
914 913 i3GEO.analise.medeArea.pontos.ypt.push(point.y);
915 914 n = i3GEO.analise.medeArea.pontos.ypt.length;
... ... @@ -926,6 +925,7 @@ i3GEO.analise = {
926 925 y1 = temp[1];
927 926 x2 = temp[2];
928 927 y2 = temp[3];
  928 + proj = new OpenLayers.Projection("EPSG:900913");
929 929 }
930 930 trecho = i3GEO.calculo.distancia(x1,y1,x2,y2);
931 931 i3GEO.analise.medeArea.pontos.dist.push(trecho);
... ... @@ -939,8 +939,6 @@ i3GEO.analise = {
939 939 temp = temp.split(" ");
940 940 x1 = temp[0];
941 941 y1 = temp[1];
942   - x2 = temp[2];
943   - y2 = temp[3];
944 942 }
945 943 per += i3GEO.calculo.distancia(x1,y1,x2,y2);
946 944 //desenha ponto
... ... @@ -966,7 +964,7 @@ i3GEO.analise = {
966 964 );
967 965 i3GEO.desenho.layergrafico.addFeatures([label]);
968 966 if(n > 2){
969   - area = poligono.getGeodesicArea();
  967 + area = poligono.getGeodesicArea(proj);
970 968 }
971 969 }
972 970 i3GEO.analise.medeArea.openlayers.mostraTotal(per,area);
... ...