Commit 08a5501401a60b277f003308e669a4789a930f14
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 | 196 | coords = geom.getLinearRing(0).getCoordinates(), |
| 197 | 197 | n = coords.length, |
| 198 | 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 | 201 | if(m.numpontos === n-1){ |
| 201 | 202 | //clicou |
| 202 | 203 | m.numpontos = n; |
| ... | ... | @@ -212,6 +213,7 @@ i3GEOF.area = |
| 212 | 213 | modify : function(point,geom) { |
| 213 | 214 | var temp,sourceProj,coordinates,wgs84Sphere, per, area, n, x1, y1, x2, y2, trecho, direcao, |
| 214 | 215 | coord = point.getCoordinates(); |
| 216 | + | |
| 215 | 217 | n = i3GEOF.area.pontos.ypt.length; |
| 216 | 218 | if (n > 1) { |
| 217 | 219 | x1 = i3GEOF.area.pontos.xpt[n - 1]; |
| ... | ... | @@ -243,7 +245,9 @@ i3GEOF.area = |
| 243 | 245 | x1 = temp[0]; |
| 244 | 246 | y1 = temp[1]; |
| 245 | 247 | } |
| 248 | + | |
| 246 | 249 | per += i3GEO.calculo.distancia(x1, y1, x2, y2); |
| 250 | + | |
| 247 | 251 | //getGeodesicArea |
| 248 | 252 | sourceProj = i3geoOL.getView().getProjection(); |
| 249 | 253 | geom = (geom.clone().transform(sourceProj, 'EPSG:4326')); | ... | ... |