Commit 749cfdae1b092e71aaa73f427474de85704e345b
1 parent
138c467e
Exists in
master
and in
6 other branches
Correção no cálculo de áreas da ferramenta area
Showing
2 changed files
with
6 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')); | ... | ... |
ferramentas/distancia/index.js
... | ... | @@ -248,6 +248,7 @@ i3GEOF.distancia = |
248 | 248 | x2 = temp[2]; |
249 | 249 | y2 = temp[3]; |
250 | 250 | } |
251 | + //console.info(x1+" "+y1+" "+x2+" "+y2) | |
251 | 252 | trecho = i3GEO.calculo.distancia(x1, y1, x2, y2); |
252 | 253 | parcial = i3GEOF.distancia.openlayers.somaDist(); |
253 | 254 | direcao = i3GEO.calculo.direcao(x1, y1, x2, y2); | ... | ... |