Commit 08a5501401a60b277f003308e669a4789a930f14

Authored by Edmar Moretti
1 parent 0c3d0751
Exists in master

Correção no cálculo de áreas da ferramenta area

Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
ferramentas/area/index.js
@@ -196,7 +196,8 @@ i3GEOF.area = @@ -196,7 +196,8 @@ i3GEOF.area =
196 coords = geom.getLinearRing(0).getCoordinates(), 196 coords = geom.getLinearRing(0).getCoordinates(),
197 n = coords.length, 197 n = coords.length,
198 m = i3GEOF.area.openlayers; 198 m = i3GEOF.area.openlayers;
199 - ponto = new ol.geom.Point(coords[n-1]); 199 + ponto = new ol.geom.Point(coords[n-2]);
  200 + //console.info(coords)
200 if(m.numpontos === n-1){ 201 if(m.numpontos === n-1){
201 //clicou 202 //clicou
202 m.numpontos = n; 203 m.numpontos = n;
@@ -212,6 +213,7 @@ i3GEOF.area = @@ -212,6 +213,7 @@ i3GEOF.area =
212 modify : function(point,geom) { 213 modify : function(point,geom) {
213 var temp,sourceProj,coordinates,wgs84Sphere, per, area, n, x1, y1, x2, y2, trecho, direcao, 214 var temp,sourceProj,coordinates,wgs84Sphere, per, area, n, x1, y1, x2, y2, trecho, direcao,
214 coord = point.getCoordinates(); 215 coord = point.getCoordinates();
  216 +
215 n = i3GEOF.area.pontos.ypt.length; 217 n = i3GEOF.area.pontos.ypt.length;
216 if (n > 1) { 218 if (n > 1) {
217 x1 = i3GEOF.area.pontos.xpt[n - 1]; 219 x1 = i3GEOF.area.pontos.xpt[n - 1];
@@ -243,7 +245,9 @@ i3GEOF.area = @@ -243,7 +245,9 @@ i3GEOF.area =
243 x1 = temp[0]; 245 x1 = temp[0];
244 y1 = temp[1]; 246 y1 = temp[1];
245 } 247 }
  248 +
246 per += i3GEO.calculo.distancia(x1, y1, x2, y2); 249 per += i3GEO.calculo.distancia(x1, y1, x2, y2);
  250 +
247 //getGeodesicArea 251 //getGeodesicArea
248 sourceProj = i3geoOL.getView().getProjection(); 252 sourceProj = i3geoOL.getView().getProjection();
249 geom = (geom.clone().transform(sourceProj, 'EPSG:4326')); 253 geom = (geom.clone().transform(sourceProj, 'EPSG:4326'));