gis-common 1.1.20 → 1.1.22

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.
@@ -229,24 +229,24 @@ __webpack_require__.d(__webpack_exports__, "DevicePixelRatio", function() { retu
229
229
  });
230
230
  // CONCATENATED MODULE: ./src/constant/ErrorTypeConstant.js
231
231
  /* harmony default export */ var ErrorTypeConstant = ({
232
- LOGIN_EXPIRED: "登录信息过期,请重新登录",
233
- CROSS_ERROR: "跨域访问",
234
- UNEXIST_RESOURCE: "资源不存在",
235
- TIMEOUT: "请求超时",
236
- INTERNAL_ERROR: "内部错误",
237
- NETWORK_ERROR: "请求失败,请检查网络是否已连接",
238
- PROCESS_FAIL: "处理失败",
239
- AUTH_VERIFY_ERROR: "权限验证失败",
240
- NO_DATA_FOUND: "未找到数据",
241
- DUPLICATE_INSTANCE: "实例为单例模式,不允许重复构建",
242
- COORDINATE_ERROR: "坐标验证失败",
243
- JSON_PARSE_ERROR: "JSON解析失败,格式有误",
244
- JSON_VALUE_ERROR: "JSON无此键",
245
- PARAMETER_ERROR: "参数验证失败",
246
- PARAMETER_ERROR_ARRAY: "参数格式验证失败:必须是数组",
247
- PARAMETER_ERROR_STRING: "参数格式验证失败:必须是字符",
248
- PARAMETER_ERROR_FUNCTION: "参数格式验证失败:必须是函数",
249
- PARAMETER_ERROR_LACK: "参数缺失项"
232
+ LOGIN_EXPIRED: '登录信息过期,请重新登录',
233
+ CROSS_ERROR: '跨域访问',
234
+ UNEXIST_RESOURCE: '资源不存在',
235
+ TIMEOUT: '请求超时',
236
+ INTERNAL_ERROR: '内部错误',
237
+ NETWORK_ERROR: '请求失败,请检查网络是否已连接',
238
+ PROCESS_FAIL: '处理失败',
239
+ AUTH_VERIFY_ERROR: '权限验证失败',
240
+ NO_DATA_FOUND: '未找到数据',
241
+ DUPLICATE_INSTANCE: '实例为单例模式,不允许重复构建',
242
+ COORDINATE_ERROR: '坐标验证失败',
243
+ JSON_PARSE_ERROR: 'JSON解析失败,格式有误',
244
+ JSON_VALUE_ERROR: 'JSON无此键',
245
+ PARAMETER_ERROR: '参数验证失败',
246
+ PARAMETER_ERROR_ARRAY: '参数格式验证失败:必须是数组',
247
+ PARAMETER_ERROR_STRING: '参数格式验证失败:必须是字符',
248
+ PARAMETER_ERROR_FUNCTION: '参数格式验证失败:必须是函数',
249
+ PARAMETER_ERROR_LACK: '参数缺失'
250
250
  });
251
251
  // CONCATENATED MODULE: ./src/constant/LayerType.js
252
252
  /* harmony default export */ var LayerType = ({
@@ -513,6 +513,15 @@ var MeasureMode = {
513
513
  }
514
514
  return value;
515
515
  });
516
+ },
517
+ deleteEmptyProperty: function deleteEmptyProperty(d) {
518
+ var _this = this;
519
+
520
+ return Object.fromEntries(Object.keys(d).filter(function (d) {
521
+ return !_this.isEmpty(d[d]);
522
+ }).map(function (i) {
523
+ return [i, d[i]];
524
+ }));
516
525
  }
517
526
  });
518
527
  // CONCATENATED MODULE: ./src/utils/ArrayUtils.js
@@ -654,8 +663,8 @@ Array.prototype.clear = function () {
654
663
  for (var i = 0; i < args.length; i++) {
655
664
  var str = args[i];
656
665
  if (str) {
657
- var s = str.replace(/#|\//g, "");
658
- var arr = s.split("?");
666
+ var s = str.replace(/#|\//g, '');
667
+ var arr = s.split('?');
659
668
  if (arr.length > 1) {
660
669
  for (var _i = 1; _i < arr.length; _i++) {
661
670
  var res = void 0;
@@ -670,26 +679,35 @@ Array.prototype.clear = function () {
670
679
  },
671
680
  getExplorer: function getExplorer() {
672
681
  var explorer = window.navigator.userAgent;
673
- if (explorer.indexOf("MSIE") >= 0) {
674
- return "IE";
682
+ if (explorer.indexOf('MSIE') >= 0) {
683
+ return 'IE';
675
684
  }
676
- if (!!window.ActiveXObject || "ActiveXObject" in window) {
685
+ if (!!window.ActiveXObject || 'ActiveXObject' in window) {
677
686
  // IE
678
- return "IE";
679
- } else if (explorer.indexOf("Firefox") >= 0) {
687
+ return 'IE';
688
+ } else if (explorer.indexOf('Firefox') >= 0) {
680
689
  // Firefox
681
- return "Firefox";
682
- } else if (explorer.indexOf("Chrome") >= 0) {
690
+ return 'Firefox';
691
+ } else if (explorer.indexOf('Chrome') >= 0) {
683
692
  // Chrome
684
- return "Chrome";
685
- } else if (explorer.indexOf("Opera") >= 0) {
693
+ return 'Chrome';
694
+ } else if (explorer.indexOf('Opera') >= 0) {
686
695
  // Opera
687
- return "Opera";
688
- } else if (explorer.indexOf("Safari") >= 0) {
696
+ return 'Opera';
697
+ } else if (explorer.indexOf('Safari') >= 0) {
689
698
  // Safari
690
- return "Safari";
699
+ return 'Safari';
691
700
  }
692
701
  },
702
+ detectOS: function detectOS() {
703
+ var os_type = '';
704
+ var windows = navigator.userAgent.indexOf('Windows', 0) != -1 ? 1 : 0;
705
+ var mac = navigator.userAgent.indexOf('mac', 0) != -1 ? 1 : 0;
706
+ var linux = navigator.userAgent.indexOf('Linux', 0) != -1 ? 1 : 0;
707
+ var unix = navigator.userAgent.indexOf('X11', 0) != -1 ? 1 : 0;
708
+ if (windows) os_type = 'MS Windows';else if (mac) os_type = 'Apple mac';else if (linux) os_type = 'Linux';else if (unix) os_type = 'Unix';
709
+ return os_type;
710
+ },
693
711
  switchFullScreen: function switchFullScreen(status) {
694
712
  if (status) {
695
713
  var element = document.documentElement;
@@ -721,16 +739,16 @@ Array.prototype.clear = function () {
721
739
  refreshScale: function refreshScale() {
722
740
  var baseWidth = document.documentElement.clientWidth;
723
741
  var baseHeight = document.documentElement.clientHeight;
724
- var appStyle = document.getElementById("app").style;
742
+ var appStyle = document.getElementById('app').style;
725
743
  var realRatio = baseWidth / baseHeight;
726
744
  var designRatio = 16 / 9;
727
745
  var scaleRate = baseWidth / 1920;
728
746
  if (realRatio > designRatio) {
729
747
  scaleRate = baseHeight / 1080;
730
748
  }
731
- appStyle.transformOrigin = "left top";
732
- appStyle.transform = "scale(" + scaleRate + ") translateX(-49.99%)";
733
- appStyle.width = baseWidth / scaleRate + "px";
749
+ appStyle.transformOrigin = 'left top';
750
+ appStyle.transform = 'scale(' + scaleRate + ') translateX(-49.99%)';
751
+ appStyle.width = baseWidth / scaleRate + 'px';
734
752
  },
735
753
 
736
754
  /**
@@ -738,8 +756,8 @@ Array.prototype.clear = function () {
738
756
  */
739
757
  getHtmlFontSize: function getHtmlFontSize() {
740
758
  var htmlwidth = document.documentElement.clientWidth || document.body.clientWidth;
741
- var htmlDom = document.querySelector("html");
742
- htmlDom.style.fontSize = htmlwidth / 192 + "px";
759
+ var htmlDom = document.querySelector('html');
760
+ htmlDom.style.fontSize = htmlwidth / 192 + 'px';
743
761
  }
744
762
  });
745
763
  // CONCATENATED MODULE: ./src/utils/Cookie.js
@@ -1211,8 +1229,8 @@ function splitWords(str) {
1211
1229
  var a = parseFloat(value);
1212
1230
  var degree = parseInt(a);
1213
1231
  var min = parseInt((a - degree) * 60);
1214
- var sec = parseFloat((a - degree) * 3600 - min * 60);
1215
- return degree + '°' + min + '′' + sec + '″';
1232
+ var sec = (a - degree) * 3600 - min * 60;
1233
+ return degree + '°' + min + '′' + sec.toFixed(2) + '″';
1216
1234
  }
1217
1235
  if (lng && lat) {
1218
1236
  res = format(lng) + ',' + format(lat);
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.20",
5
+ "version": "1.1.22",
6
6
  "author": "Guo.Yan <luv02@vip.qq.com>",
7
7
  "license": "MIT",
8
8
  "private": false,