gis-common 1.1.19 → 1.1.21
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.
- package/dist/resource.min.js +57 -46
- package/package.json +1 -1
package/dist/resource.min.js
CHANGED
|
@@ -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:
|
|
244
|
-
JSON_VALUE_ERROR:
|
|
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 = ({
|
|
@@ -484,12 +484,14 @@ var MeasureMode = {
|
|
|
484
484
|
}
|
|
485
485
|
});
|
|
486
486
|
},
|
|
487
|
-
loadStyle: function loadStyle() {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
487
|
+
loadStyle: function loadStyle(urls) {
|
|
488
|
+
urls.forEach(function (url) {
|
|
489
|
+
var css = document.createElement('link');
|
|
490
|
+
css.href = url;
|
|
491
|
+
css.rel = 'stylesheet';
|
|
492
|
+
css.type = 'text/css';
|
|
493
|
+
document.head.appendChild(css);
|
|
494
|
+
});
|
|
493
495
|
},
|
|
494
496
|
|
|
495
497
|
/**
|
|
@@ -652,8 +654,8 @@ Array.prototype.clear = function () {
|
|
|
652
654
|
for (var i = 0; i < args.length; i++) {
|
|
653
655
|
var str = args[i];
|
|
654
656
|
if (str) {
|
|
655
|
-
var s = str.replace(/#|\//g,
|
|
656
|
-
var arr = s.split(
|
|
657
|
+
var s = str.replace(/#|\//g, '');
|
|
658
|
+
var arr = s.split('?');
|
|
657
659
|
if (arr.length > 1) {
|
|
658
660
|
for (var _i = 1; _i < arr.length; _i++) {
|
|
659
661
|
var res = void 0;
|
|
@@ -668,26 +670,35 @@ Array.prototype.clear = function () {
|
|
|
668
670
|
},
|
|
669
671
|
getExplorer: function getExplorer() {
|
|
670
672
|
var explorer = window.navigator.userAgent;
|
|
671
|
-
if (explorer.indexOf(
|
|
672
|
-
return
|
|
673
|
+
if (explorer.indexOf('MSIE') >= 0) {
|
|
674
|
+
return 'IE';
|
|
673
675
|
}
|
|
674
|
-
if (!!window.ActiveXObject ||
|
|
676
|
+
if (!!window.ActiveXObject || 'ActiveXObject' in window) {
|
|
675
677
|
// IE
|
|
676
|
-
return
|
|
677
|
-
} else if (explorer.indexOf(
|
|
678
|
+
return 'IE';
|
|
679
|
+
} else if (explorer.indexOf('Firefox') >= 0) {
|
|
678
680
|
// Firefox
|
|
679
|
-
return
|
|
680
|
-
} else if (explorer.indexOf(
|
|
681
|
+
return 'Firefox';
|
|
682
|
+
} else if (explorer.indexOf('Chrome') >= 0) {
|
|
681
683
|
// Chrome
|
|
682
|
-
return
|
|
683
|
-
} else if (explorer.indexOf(
|
|
684
|
+
return 'Chrome';
|
|
685
|
+
} else if (explorer.indexOf('Opera') >= 0) {
|
|
684
686
|
// Opera
|
|
685
|
-
return
|
|
686
|
-
} else if (explorer.indexOf(
|
|
687
|
+
return 'Opera';
|
|
688
|
+
} else if (explorer.indexOf('Safari') >= 0) {
|
|
687
689
|
// Safari
|
|
688
|
-
return
|
|
690
|
+
return 'Safari';
|
|
689
691
|
}
|
|
690
692
|
},
|
|
693
|
+
detectOS: function detectOS() {
|
|
694
|
+
var os_type = '';
|
|
695
|
+
var windows = navigator.userAgent.indexOf('Windows', 0) != -1 ? 1 : 0;
|
|
696
|
+
var mac = navigator.userAgent.indexOf('mac', 0) != -1 ? 1 : 0;
|
|
697
|
+
var linux = navigator.userAgent.indexOf('Linux', 0) != -1 ? 1 : 0;
|
|
698
|
+
var unix = navigator.userAgent.indexOf('X11', 0) != -1 ? 1 : 0;
|
|
699
|
+
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';
|
|
700
|
+
return os_type;
|
|
701
|
+
},
|
|
691
702
|
switchFullScreen: function switchFullScreen(status) {
|
|
692
703
|
if (status) {
|
|
693
704
|
var element = document.documentElement;
|
|
@@ -719,16 +730,16 @@ Array.prototype.clear = function () {
|
|
|
719
730
|
refreshScale: function refreshScale() {
|
|
720
731
|
var baseWidth = document.documentElement.clientWidth;
|
|
721
732
|
var baseHeight = document.documentElement.clientHeight;
|
|
722
|
-
var appStyle = document.getElementById(
|
|
733
|
+
var appStyle = document.getElementById('app').style;
|
|
723
734
|
var realRatio = baseWidth / baseHeight;
|
|
724
735
|
var designRatio = 16 / 9;
|
|
725
736
|
var scaleRate = baseWidth / 1920;
|
|
726
737
|
if (realRatio > designRatio) {
|
|
727
738
|
scaleRate = baseHeight / 1080;
|
|
728
739
|
}
|
|
729
|
-
appStyle.transformOrigin =
|
|
730
|
-
appStyle.transform =
|
|
731
|
-
appStyle.width = baseWidth / scaleRate +
|
|
740
|
+
appStyle.transformOrigin = 'left top';
|
|
741
|
+
appStyle.transform = 'scale(' + scaleRate + ') translateX(-49.99%)';
|
|
742
|
+
appStyle.width = baseWidth / scaleRate + 'px';
|
|
732
743
|
},
|
|
733
744
|
|
|
734
745
|
/**
|
|
@@ -736,8 +747,8 @@ Array.prototype.clear = function () {
|
|
|
736
747
|
*/
|
|
737
748
|
getHtmlFontSize: function getHtmlFontSize() {
|
|
738
749
|
var htmlwidth = document.documentElement.clientWidth || document.body.clientWidth;
|
|
739
|
-
var htmlDom = document.querySelector(
|
|
740
|
-
htmlDom.style.fontSize = htmlwidth / 192 +
|
|
750
|
+
var htmlDom = document.querySelector('html');
|
|
751
|
+
htmlDom.style.fontSize = htmlwidth / 192 + 'px';
|
|
741
752
|
}
|
|
742
753
|
});
|
|
743
754
|
// CONCATENATED MODULE: ./src/utils/Cookie.js
|
|
@@ -1209,8 +1220,8 @@ function splitWords(str) {
|
|
|
1209
1220
|
var a = parseFloat(value);
|
|
1210
1221
|
var degree = parseInt(a);
|
|
1211
1222
|
var min = parseInt((a - degree) * 60);
|
|
1212
|
-
var sec =
|
|
1213
|
-
return degree + '°' + min + '′' + sec + '″';
|
|
1223
|
+
var sec = (a - degree) * 3600 - min * 60;
|
|
1224
|
+
return degree + '°' + min + '′' + sec.toFixed(2) + '″';
|
|
1214
1225
|
}
|
|
1215
1226
|
if (lng && lat) {
|
|
1216
1227
|
res = format(lng) + ',' + format(lat);
|