gis-common 1.1.9 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -828,8 +828,8 @@ Array.prototype.clear = function () {
828
828
  var y = gcjLat;
829
829
  var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * this.XPI);
830
830
  var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * this.XPI);
831
- bdLon = z * Math.cos(theta) + 0.0065;
832
- bdLat = z * Math.sin(theta) + 0.006;
831
+ var bdLon = z * Math.cos(theta) + 0.0065;
832
+ var bdLat = z * Math.sin(theta) + 0.006;
833
833
  return { lat: bdLat, lon: bdLon };
834
834
  },
835
835
 
@@ -850,16 +850,7 @@ Array.prototype.clear = function () {
850
850
  var x = wgsLon * 20037508.34 / 180.0;
851
851
  var y = Math.log(Math.tan((90.0 + wgsLat) * this.PI / 360.0)) / (this.PI / 180.0);
852
852
  y = y * 20037508.34 / 180.0;
853
- return { lat: y, lon: x
854
- /*
855
- if ((Math.abs(wgsLon) > 180 || Math.abs(wgsLat) > 90))
856
- return null;
857
- var x = 6378137.0 * wgsLon * 0.017453292519943295;
858
- var a = wgsLat * 0.017453292519943295;
859
- var y = 3189068.5 * Math.log((1.0 + Math.sin(a)) / (1.0 - Math.sin(a)));
860
- return {'lat' : y, 'lon' : x};
861
- // */
862
- };
853
+ return { lat: y, lon: x };
863
854
  },
864
855
 
865
856
  // Web mercator to WGS-84
@@ -868,18 +859,7 @@ Array.prototype.clear = function () {
868
859
  var x = mercatorLon / 20037508.34 * 180.0;
869
860
  var y = mercatorLat / 20037508.34 * 180.0;
870
861
  y = 180 / this.PI * (2 * Math.atan(Math.exp(y * this.PI / 180.0)) - this.PI / 2);
871
- return { lat: y, lon: x
872
- /*
873
- if (Math.abs(mercatorLon) < 180 && Math.abs(mercatorLat) < 90)
874
- return null;
875
- if ((Math.abs(mercatorLon) > 20037508.3427892) || (Math.abs(mercatorLat) > 20037508.3427892))
876
- return null;
877
- var a = mercatorLon / 6378137.0 * 57.295779513082323;
878
- var x = a - (Math.floor(((a + 180.0) / 360.0)) * 360.0);
879
- var y = (1.5707963267948966 - (2.0 * Math.atan(Math.exp((-1.0 * mercatorLat) / 6378137.0)))) * 57.295779513082323;
880
- return {'lat' : y, 'lon' : x};
881
- // */
882
- };
862
+ return { lat: y, lon: x };
883
863
  },
884
864
 
885
865
  // two point's distance
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "gis-common",
3
3
  "description": "gis-common",
4
4
  "main": "dist/resource.min.js",
5
- "version": "1.1.9",
5
+ "version": "1.1.10",
6
6
  "author": "Guo.Yan <luv02@vip.qq.com>",
7
7
  "license": "MIT",
8
8
  "private": false,