gis-common 1.1.25 → 1.1.27

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.
@@ -526,7 +526,7 @@ var MeasureMode = {
526
526
  deepAssign: function deepAssign() {
527
527
  var len = arguments.length,
528
528
  target = arguments[0];
529
- if (!this.getDataType(target) === 'Object') {
529
+ if (this.getDataType(target) !== 'Object') {
530
530
  target = {};
531
531
  }
532
532
  for (var i = 1; i < len; i++) {
@@ -545,6 +545,24 @@ var MeasureMode = {
545
545
  }
546
546
  }
547
547
  return target;
548
+ },
549
+ handleCopyValue: function handleCopyValue(text) {
550
+ if (!navigator.clipboard && window.isSecureContext) {
551
+ return navigator.clipboard.writeText(text);
552
+ } else {
553
+ var textArea = document.createElement('textarea');
554
+ textArea.style.position = 'fixed';
555
+ textArea.style.top = textArea.style.left = '-100vh';
556
+ textArea.style.opacity = '0';
557
+ textArea.value = text;
558
+ document.body.appendChild(textArea);
559
+ textArea.focus();
560
+ textArea.select();
561
+ return new Promise(function (resolve, reject) {
562
+ document.execCommand('copy') ? resolve() : reject(new Error('copy failed'));
563
+ textArea.remove();
564
+ });
565
+ }
548
566
  }
549
567
  });
550
568
  // CONCATENATED MODULE: ./src/utils/ArrayUtils.js
@@ -1446,6 +1464,19 @@ function splitWords(str) {
1446
1464
  lat: MathUtils.toDegrees(lat),
1447
1465
  lng: MathUtils.toDegrees(lon)
1448
1466
  };
1467
+ },
1468
+ mercatorTolonlat: function mercatorTolonlat(x, y) {
1469
+ var lon = x / 20037508.34 * 180;
1470
+ var lat = y / 20037508.34 * 180;
1471
+ y = 180 / Math.PI * (2 * Math.atan(Math.exp(y * Math.PI / 180)) - Math.PI / 2);
1472
+ return { lon: lon, lat: lat };
1473
+ },
1474
+ lonlatToMercator: function lonlatToMercator(lon, lat) {
1475
+ var x = lon * 20037508.34 / 180;
1476
+ var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
1477
+
1478
+ y = y * 20037508.34 / 180;
1479
+ return { x: x, y: y };
1449
1480
  }
1450
1481
  });
1451
1482
  // CONCATENATED MODULE: ./src/utils/FileUtils.js
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.25",
5
+ "version": "1.1.27",
6
6
  "author": "Guo.Yan <luv02@vip.qq.com>",
7
7
  "license": "MIT",
8
8
  "private": false,