فهرست منبع

more decimal places for extent coords

kunickyd 3 سال پیش
والد
کامیت
d46d18c693
1فایلهای تغییر یافته به همراه2 افزوده شده و 3 حذف شده
  1. 2 3
      src/app/bc-info/bc-info.component.ts

+ 2 - 3
src/app/bc-info/bc-info.component.ts

@@ -106,8 +106,7 @@ export class BcInfoComponent implements HsPanelComponent, OnInit {
 
       this.buyInProgress = true;
 
-      let transformedExtent = transformExtent(this.extent, this.mapService.getMap().getView().getProjection(), "EPSG:4326");
-      console.log(transformedExtent);
+      let transformedExtent = transformExtent(this.extent, this.mapService.getMap().getView().getProjection(), "EPSG:4326");      
       transformedExtent = this.roundExtentCoords(transformedExtent);
       //console.log(transformedExtent);
 
@@ -167,7 +166,7 @@ export class BcInfoComponent implements HsPanelComponent, OnInit {
     let roundedExtent: number[] = new Array<number>(4);
 
     for (let i = 0; i !== extent.length; i++) {
-      roundedExtent[i] = this.roundTwoDecimalPlaces(extent[i]);
+      roundedExtent[i] = Math.round((extent[i] + Number.EPSILON) * 1000000) / 1000000;
     }
 
     return roundedExtent;