@supermapgis/vue-iclient-leaflet 11.2.1 → 11.3.0
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/iclient-leaflet-vue.css +23 -9
- package/dist/iclient-leaflet-vue.js +21689 -44354
- package/dist/iclient-leaflet-vue.min.css +2 -2
- package/dist/iclient-leaflet-vue.min.js +39 -293
- package/lib/_assets/iconfont/icon-sm-components.css +21 -7
- package/lib/_assets/iconfont/icon-sm-components.ttf +0 -0
- package/lib/_assets/iconfont/icon-sm-components.woff +0 -0
- package/lib/_assets/iconfont/icon-sm-components.woff2 +0 -0
- package/lib/_lang/en.js +20 -8
- package/lib/_lang/index.js +18 -18
- package/lib/_lang/zh.js +20 -8
- package/lib/_mixin/AntdRender.js +15 -17
- package/lib/_mixin/Card.js +10 -11
- package/lib/_mixin/GridLayer.js +4 -4
- package/lib/_mixin/Layer.js +4 -4
- package/lib/_mixin/Options.js +2 -2
- package/lib/_mixin/Popper.js +2 -2
- package/lib/_mixin/Theme.js +13 -15
- package/lib/_mixin/ThirdService.js +15 -16
- package/lib/_mixin/TileLayer.js +4 -4
- package/lib/_mixin/Timer.js +8 -9
- package/lib/_mixin/VmUpdater.js +10 -11
- package/lib/_mixin/map-events.js +8 -9
- package/lib/_mixin/map-getter.js +13 -14
- package/lib/_types/AddressMatchParameter.js +2 -2
- package/lib/_types/GeoJSONParamter.js +2 -2
- package/lib/_types/RestDataParameter.js +5 -6
- package/lib/_types/RestMapParameter.js +5 -6
- package/lib/_types/RestParameter.js +2 -2
- package/lib/_types/event/BaseTypes.js +2 -2
- package/lib/_types/event/Event.js +4 -4
- package/lib/_types/event/Events.js +10 -10
- package/lib/_types/event/Pixel.js +2 -2
- package/lib/_types/event/Util.js +2 -2
- package/lib/_types/iPortalDataParameter.js +3 -2
- package/lib/_types/iServerBaseParameter.js +3 -2
- package/lib/_types/iServerDataParameter.js +5 -6
- package/lib/_types/iServerMapParameter.js +5 -6
- package/lib/_types/index.js +18 -18
- package/lib/_types/map-event.js +6 -6
- package/lib/_utils/EchartsDataService.js +24 -24
- package/lib/_utils/RestService.js +1345 -1149
- package/lib/_utils/epsg-define.js +45 -34
- package/lib/_utils/get-features.js +23 -10
- package/lib/_utils/global-event.js +6 -6
- package/lib/_utils/iPortalDataService.js +1368 -1147
- package/lib/_utils/iServerRestService.js +1518 -1269
- package/lib/_utils/props-binder.js +2 -2
- package/lib/_utils/statistics.js +8 -17
- package/lib/_utils/style/color/colorPalette.js +4 -4
- package/lib/_utils/style/color/serialColors.js +8 -8
- package/lib/_utils/style/theme/chart.js +1343 -1146
- package/lib/_utils/style/theme/set-theme.js +10 -10
- package/lib/_utils/style/theme/theme.json +6 -6
- package/lib/_utils/util.js +12 -12
- package/lib/_utils/vue-types/utils.js +2 -2
- package/lib/attribute-panel/style/attribute-panel.css +1 -0
- package/lib/attribute-panel/style/css.js +7 -0
- package/lib/attribute-panel/style/index.js +7 -0
- package/lib/avatar/index.js +25 -25
- package/lib/border/index.js +77 -77
- package/lib/breadcrumb/index.js +47 -41
- package/lib/button/index.js +53 -50
- package/lib/card/index.js +47 -41
- package/lib/chart/index.js +1437 -1238
- package/lib/checkbox/index.js +36 -33
- package/lib/collapse/index.js +39 -36
- package/lib/collapse-card/index.js +71 -76
- package/lib/color-picker/index.js +48 -49
- package/lib/date-picker/index.js +107 -95
- package/lib/dropdown/index.js +27 -27
- package/lib/empty/index.js +27 -27
- package/lib/icon/index.js +25 -25
- package/lib/identify/index.js +58 -59
- package/lib/iframe/index.js +31 -31
- package/lib/image/index.js +226 -42
- package/lib/image/style/image.css +1 -1
- package/lib/index.js +4 -4
- package/lib/indicator/index.js +70 -67
- package/lib/init.js +8 -8
- package/lib/input/index.js +150 -135
- package/lib/input-number/index.js +100 -97
- package/lib/layout/index.js +72 -60
- package/lib/liquid-fill/index.js +73 -73
- package/lib/marker/index.js +43 -44
- package/lib/menu/index.js +47 -41
- package/lib/message/index.js +3 -3
- package/lib/message/style/message.css +1 -1
- package/lib/modal/index.js +67 -67
- package/lib/modal/style/modal.css +1 -1
- package/lib/notification/index.js +6 -6
- package/lib/notification/style/notification.css +1 -1
- package/lib/pagination/index.js +34 -34
- package/lib/popup/index.js +45 -46
- package/lib/progress/index.js +440 -440
- package/lib/radio/index.js +48 -42
- package/lib/select/index.js +47 -41
- package/lib/slider/index.js +27 -27
- package/lib/slideshow/index.js +103 -160
- package/lib/spin/index.js +30 -30
- package/lib/steps/index.js +35 -32
- package/lib/switch/index.js +25 -25
- package/lib/table/index.js +50 -44
- package/lib/table/style/table.css +1 -1
- package/lib/table-popup/index.js +43 -37
- package/lib/table-popup/style/table-popup.css +1 -1
- package/lib/tabs/index.js +35 -32
- package/lib/text/index.js +39 -39
- package/lib/tile-layer/index.js +35 -36
- package/lib/time-line/index.js +41 -43
- package/lib/time-picker/index.js +27 -27
- package/lib/time-range/index.js +53 -55
- package/lib/time-slider/index.js +73 -75
- package/lib/time-text/index.js +31 -31
- package/lib/tooltip/index.js +25 -25
- package/lib/tooltip/style/tooltip.css +1 -0
- package/lib/transfer/index.js +27 -27
- package/lib/tree/index.js +48 -42
- package/lib/tree-select/index.js +37 -34
- package/lib/video-player/index.js +98 -97
- package/lib/video-player/style/video-player.css +1 -1
- package/lib/web-map/index.js +2336 -103
- package/package.json +2 -4
- package/src/common/_assets/iconfont/icon-sm-components.css +21 -7
- package/src/common/_assets/iconfont/icon-sm-components.ttf +0 -0
- package/src/common/_assets/iconfont/icon-sm-components.woff +0 -0
- package/src/common/_assets/iconfont/icon-sm-components.woff2 +0 -0
- package/src/common/_lang/en.js +19 -8
- package/src/common/_lang/zh.js +18 -6
- package/src/common/_mixin/Card.ts +1 -1
- package/src/common/_types/iPortalDataParameter.js +1 -0
- package/src/common/_types/iServerBaseParameter.ts +3 -0
- package/src/common/_utils/epsg-define.js +32 -27
- package/src/common/_utils/get-features.js +13 -2
- package/src/common/_utils/iPortalDataService.js +14 -3
- package/src/common/_utils/iServerRestService.js +144 -78
- package/src/common/_utils/statistics.js +6 -14
- package/src/common/_utils/style/theme/theme.json +6 -6
- package/src/common/attribute-panel/AttributePanel.vue +58 -0
- package/src/common/attribute-panel/__test__/AttributePanel.spec.js +39 -0
- package/src/common/attribute-panel/index.js +9 -0
- package/src/common/attribute-panel/style/attribute-panel.scss +35 -0
- package/src/common/attribute-panel/style/index.js +4 -0
- package/src/common/collapse-card/style/collapse-card.scss +2 -2
- package/src/common/iframe/Iframe.vue +1 -1
- package/src/common/image/Image.vue +68 -6
- package/src/common/image/style/image.scss +32 -0
- package/src/common/message/style/message.scss +1 -0
- package/src/common/modal/style/modal.scss +36 -0
- package/src/common/notification/style/notification.scss +9 -0
- package/src/common/slideshow/Slideshow.vue +42 -95
- package/src/common/slideshow/Swiper.js +1 -1
- package/src/common/table/style/table.scss +36 -0
- package/src/common/table-popup/TablePopup.vue +5 -0
- package/src/common/tooltip/style/tooltip.scss +3 -0
- package/src/common/video-player/style/video-player.scss +1 -1
- package/src/leaflet/entrys.json +0 -2
- package/src/leaflet/package.json +2 -4
- package/src/leaflet/web-map/WebMap.vue +4 -4
- package/src/leaflet/web-map/WebMapViewModel.ts +64 -17
- package/static/libs/iclient-common/iclient-common-webmapv2base.js +2 -0
- package/static/libs/iclient-common/iclient-common.js +1 -1
- package/static/libs/iclient-leaflet/iclient-leaflet.min.js +5 -1738
- package/lib/_assets/iconfont/icon-sm-components.eot +0 -0
- package/lib/_assets/iconfont/icon-sm-components.svg +0 -197
- package/lib/_mixin/WebMapBase.js +0 -3467
- package/lib/_utils/WebMapService.js +0 -1607
- package/src/common/_assets/iconfont/icon-sm-components.eot +0 -0
- package/src/common/_assets/iconfont/icon-sm-components.svg +0 -197
- package/src/common/_utils/WebMapService.ts +0 -1292
- package/src/common/web-map/WebMapBase.ts +0 -1178
- package/src/common/web-map/config/MunicipalCenter.json +0 -1
- package/src/common/web-map/config/ProvinceCenter.json +0 -1
package/lib/_mixin/WebMapBase.js
DELETED
|
@@ -1,3467 +0,0 @@
|
|
|
1
|
-
module.exports =
|
|
2
|
-
/******/ (function(modules) { // webpackBootstrap
|
|
3
|
-
/******/ // The module cache
|
|
4
|
-
/******/ var installedModules = {};
|
|
5
|
-
/******/
|
|
6
|
-
/******/ // The require function
|
|
7
|
-
/******/ function __webpack_require__(moduleId) {
|
|
8
|
-
/******/
|
|
9
|
-
/******/ // Check if module is in cache
|
|
10
|
-
/******/ if(installedModules[moduleId]) {
|
|
11
|
-
/******/ return installedModules[moduleId].exports;
|
|
12
|
-
/******/ }
|
|
13
|
-
/******/ // Create a new module (and put it into the cache)
|
|
14
|
-
/******/ var module = installedModules[moduleId] = {
|
|
15
|
-
/******/ i: moduleId,
|
|
16
|
-
/******/ l: false,
|
|
17
|
-
/******/ exports: {}
|
|
18
|
-
/******/ };
|
|
19
|
-
/******/
|
|
20
|
-
/******/ // Execute the module function
|
|
21
|
-
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
-
/******/
|
|
23
|
-
/******/ // Flag the module as loaded
|
|
24
|
-
/******/ module.l = true;
|
|
25
|
-
/******/
|
|
26
|
-
/******/ // Return the exports of the module
|
|
27
|
-
/******/ return module.exports;
|
|
28
|
-
/******/ }
|
|
29
|
-
/******/
|
|
30
|
-
/******/
|
|
31
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
-
/******/ __webpack_require__.m = modules;
|
|
33
|
-
/******/
|
|
34
|
-
/******/ // expose the module cache
|
|
35
|
-
/******/ __webpack_require__.c = installedModules;
|
|
36
|
-
/******/
|
|
37
|
-
/******/ // define getter function for harmony exports
|
|
38
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
-
/******/ }
|
|
42
|
-
/******/ };
|
|
43
|
-
/******/
|
|
44
|
-
/******/ // define __esModule on exports
|
|
45
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
-
/******/ }
|
|
49
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
-
/******/ };
|
|
51
|
-
/******/
|
|
52
|
-
/******/ // create a fake namespace object
|
|
53
|
-
/******/ // mode & 1: value is a module id, require it
|
|
54
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
-
/******/ // mode & 4: return value when already ns object
|
|
56
|
-
/******/ // mode & 8|1: behave like require
|
|
57
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
-
/******/ if(mode & 8) return value;
|
|
60
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
-
/******/ var ns = Object.create(null);
|
|
62
|
-
/******/ __webpack_require__.r(ns);
|
|
63
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "lib/leaflet/";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = 520);
|
|
86
|
-
/******/ })
|
|
87
|
-
/************************************************************************/
|
|
88
|
-
/******/ ({
|
|
89
|
-
|
|
90
|
-
/***/ 0:
|
|
91
|
-
/***/ (function(module, exports) {
|
|
92
|
-
|
|
93
|
-
module.exports = require("@babel/runtime/helpers/interopRequireDefault");
|
|
94
|
-
|
|
95
|
-
/***/ }),
|
|
96
|
-
|
|
97
|
-
/***/ 10:
|
|
98
|
-
/***/ (function(module, exports) {
|
|
99
|
-
|
|
100
|
-
module.exports = require("vue");
|
|
101
|
-
|
|
102
|
-
/***/ }),
|
|
103
|
-
|
|
104
|
-
/***/ 13:
|
|
105
|
-
/***/ (function(module, exports) {
|
|
106
|
-
|
|
107
|
-
module.exports = require("@supermapgis/vue-iclient-leaflet/lib/_lang/index.js");
|
|
108
|
-
|
|
109
|
-
/***/ }),
|
|
110
|
-
|
|
111
|
-
/***/ 19:
|
|
112
|
-
/***/ (function(module, exports) {
|
|
113
|
-
|
|
114
|
-
module.exports = require("@supermapgis/vue-iclient-leaflet/lib/_types/event/Events.js");
|
|
115
|
-
|
|
116
|
-
/***/ }),
|
|
117
|
-
|
|
118
|
-
/***/ 24:
|
|
119
|
-
/***/ (function(module, exports) {
|
|
120
|
-
|
|
121
|
-
module.exports = require("@turf/center");
|
|
122
|
-
|
|
123
|
-
/***/ }),
|
|
124
|
-
|
|
125
|
-
/***/ 248:
|
|
126
|
-
/***/ (function(module, exports) {
|
|
127
|
-
|
|
128
|
-
module.exports = require("@supermapgis/vue-iclient-leaflet/static/libs/geostats/geostats");
|
|
129
|
-
|
|
130
|
-
/***/ }),
|
|
131
|
-
|
|
132
|
-
/***/ 25:
|
|
133
|
-
/***/ (function(module, exports) {
|
|
134
|
-
|
|
135
|
-
module.exports = require("tinycolor2");
|
|
136
|
-
|
|
137
|
-
/***/ }),
|
|
138
|
-
|
|
139
|
-
/***/ 251:
|
|
140
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
141
|
-
|
|
142
|
-
"use strict";
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
var _interopRequireDefault = __webpack_require__(0);
|
|
146
|
-
|
|
147
|
-
Object.defineProperty(exports, "__esModule", {
|
|
148
|
-
value: true
|
|
149
|
-
});
|
|
150
|
-
exports.default = void 0;
|
|
151
|
-
|
|
152
|
-
var _regenerator = _interopRequireDefault(__webpack_require__(43));
|
|
153
|
-
|
|
154
|
-
var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(6));
|
|
155
|
-
|
|
156
|
-
var _Events2 = __webpack_require__(19);
|
|
157
|
-
|
|
158
|
-
var _util = __webpack_require__(9);
|
|
159
|
-
|
|
160
|
-
var _statistics = __webpack_require__(38);
|
|
161
|
-
|
|
162
|
-
var convert = _interopRequireWildcard(__webpack_require__(252));
|
|
163
|
-
|
|
164
|
-
var _lodash = _interopRequireDefault(__webpack_require__(59));
|
|
165
|
-
|
|
166
|
-
var _lodash2 = _interopRequireDefault(__webpack_require__(253));
|
|
167
|
-
|
|
168
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
169
|
-
|
|
170
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
171
|
-
|
|
172
|
-
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
173
|
-
function adopt(value) {
|
|
174
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
175
|
-
resolve(value);
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
180
|
-
function fulfilled(value) {
|
|
181
|
-
try {
|
|
182
|
-
step(generator.next(value));
|
|
183
|
-
} catch (e) {
|
|
184
|
-
reject(e);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function rejected(value) {
|
|
189
|
-
try {
|
|
190
|
-
step(generator["throw"](value));
|
|
191
|
-
} catch (e) {
|
|
192
|
-
reject(e);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function step(result) {
|
|
197
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
201
|
-
});
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
var DEFAULT_WELLKNOWNSCALESET = ['GoogleCRS84Quad', 'GoogleMapsCompatible', 'urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible', 'urn:ogc:def:wkss:OGC:1.0:GoogleCRS84Quad'];
|
|
205
|
-
var MB_SCALEDENOMINATOR_3857 = [559082264.0287178, 279541132.0143589, 139770566.00717944, 69885283.00358972, 34942641.50179486, 17471320.75089743, 8735660.375448715, 4367830.1877243575, 2183915.0938621787, 1091957.5469310894, 545978.7734655447, 272989.38673277234, 136494.69336638617, 68247.34668319309, 34123.67334159654, 17061.83667079827, 8530.918335399136, 4265.459167699568, 2132.729583849784, 1066.364791924892, 533.182395962446, 266.591197981223, 133.2955989906115];
|
|
206
|
-
var MB_SCALEDENOMINATOR_4326 = [559082264.0287176, 279541132.0143588, 139770566.0071794, 69885283.0035897, 34942641.50179485, 17471320.750897426, 8735660.375448713, 4367830.187724357, 2183915.0938621783, 1091957.5469310891, 545978.7734655446, 272989.3867327723, 136494.69336638614, 68247.34668319307, 34123.673341596535, 17061.836670798268, 8530.918335399134, 4265.459167699567, 2132.7295838497835, 1066.3647919248917, 533.1823959624459, 266.59119798122293, 133.29559899061147];
|
|
207
|
-
|
|
208
|
-
var WebMapService = exports.default = /*#__PURE__*/function (_Events) {
|
|
209
|
-
(0, _inheritsLoose2.default)(WebMapService, _Events);
|
|
210
|
-
|
|
211
|
-
function WebMapService(mapId, options) {
|
|
212
|
-
var _this;
|
|
213
|
-
|
|
214
|
-
if (options === void 0) {
|
|
215
|
-
options = {};
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
_this = _Events.call(this) || this;
|
|
219
|
-
_this.proxyOptions = {
|
|
220
|
-
data: 'apps/viewer/getUrlResource.json?url=',
|
|
221
|
-
image: 'apps/viewer/getUrlResource.png?url='
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
if (typeof mapId === 'string' || typeof mapId === 'number') {
|
|
225
|
-
_this.mapId = mapId;
|
|
226
|
-
} else if (mapId !== null && typeof mapId === 'object') {
|
|
227
|
-
_this.mapInfo = mapId;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
_this.serverUrl = options.serverUrl || 'https://www.supermapol.com';
|
|
231
|
-
_this.accessToken = options.accessToken;
|
|
232
|
-
_this.accessKey = options.accessKey;
|
|
233
|
-
_this.tiandituKey = options.tiandituKey || '';
|
|
234
|
-
_this.withCredentials = options.withCredentials || false;
|
|
235
|
-
_this.excludePortalProxyUrl = options.excludePortalProxyUrl;
|
|
236
|
-
_this.iportalServiceProxyUrl = options.iportalServiceProxyUrlPrefix;
|
|
237
|
-
_this.proxy = options.proxy;
|
|
238
|
-
return _this;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
var _proto = WebMapService.prototype;
|
|
242
|
-
|
|
243
|
-
_proto.setMapId = function setMapId(mapId) {
|
|
244
|
-
if (typeof mapId === 'string' || typeof mapId === 'number') {
|
|
245
|
-
this.mapId = mapId;
|
|
246
|
-
this.mapInfo = null;
|
|
247
|
-
} else if (mapId !== null && typeof mapId === 'object') {
|
|
248
|
-
this.mapInfo = mapId;
|
|
249
|
-
this.mapId = '';
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
_proto.setServerUrl = function setServerUrl(serverUrl) {
|
|
254
|
-
this.serverUrl = serverUrl;
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
_proto.setWithCredentials = function setWithCredentials(withCredentials) {
|
|
258
|
-
this.withCredentials = withCredentials;
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
_proto.setProxy = function setProxy(proxy) {
|
|
262
|
-
this.proxy = proxy;
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
_proto.handleServerUrl = function handleServerUrl(serverUrl) {
|
|
266
|
-
var urlArr = serverUrl.split('');
|
|
267
|
-
|
|
268
|
-
if (urlArr[urlArr.length - 1] !== '/') {
|
|
269
|
-
serverUrl += '/';
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
this.serverUrl = serverUrl;
|
|
273
|
-
return serverUrl;
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
_proto.getMapInfo = function getMapInfo() {
|
|
277
|
-
var _this2 = this;
|
|
278
|
-
|
|
279
|
-
if (!this.mapId && this.mapInfo) {
|
|
280
|
-
return new Promise(function (resolve) {
|
|
281
|
-
resolve(_this2.mapInfo);
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
var mapUrl = this._handleMapUrl();
|
|
286
|
-
|
|
287
|
-
return new Promise(function (resolve, reject) {
|
|
288
|
-
return __awaiter(_this2, void 0, void 0, /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
289
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
290
|
-
while (1) switch (_context.prev = _context.next) {
|
|
291
|
-
case 0:
|
|
292
|
-
_context.prev = 0;
|
|
293
|
-
_context.next = 3;
|
|
294
|
-
return this.getiPortalServiceProxy();
|
|
295
|
-
|
|
296
|
-
case 3:
|
|
297
|
-
SuperMap.FetchRequest.get(mapUrl, null, {
|
|
298
|
-
withCredentials: this.withCredentials
|
|
299
|
-
}).then(function (response) {
|
|
300
|
-
return response.json();
|
|
301
|
-
}).then(function (mapInfo) {
|
|
302
|
-
if (mapInfo && mapInfo.succeed === false) {
|
|
303
|
-
var error = {
|
|
304
|
-
message: mapInfo && mapInfo.error && mapInfo.error.errorMsg
|
|
305
|
-
};
|
|
306
|
-
reject(error);
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
mapInfo.mapParams = {
|
|
311
|
-
title: mapInfo.title,
|
|
312
|
-
description: mapInfo.description
|
|
313
|
-
};
|
|
314
|
-
resolve(mapInfo);
|
|
315
|
-
}).catch(function (error) {
|
|
316
|
-
reject(error);
|
|
317
|
-
});
|
|
318
|
-
_context.next = 9;
|
|
319
|
-
break;
|
|
320
|
-
|
|
321
|
-
case 6:
|
|
322
|
-
_context.prev = 6;
|
|
323
|
-
_context.t0 = _context["catch"](0);
|
|
324
|
-
reject(_context.t0);
|
|
325
|
-
|
|
326
|
-
case 9:
|
|
327
|
-
case "end":
|
|
328
|
-
return _context.stop();
|
|
329
|
-
}
|
|
330
|
-
}, _callee, this, [[0, 6]]);
|
|
331
|
-
}));
|
|
332
|
-
});
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
_proto.getiPortalServiceProxy = function getiPortalServiceProxy() {
|
|
336
|
-
var _this3 = this;
|
|
337
|
-
|
|
338
|
-
return new Promise(function (resolve, reject) {
|
|
339
|
-
SuperMap.FetchRequest.get(_this3.serverUrl + "web/config/portal.json", {
|
|
340
|
-
scope: ['serviceProxy']
|
|
341
|
-
}).then(function (response) {
|
|
342
|
-
return response.json();
|
|
343
|
-
}).then(function (serviceProxyInfo) {
|
|
344
|
-
if (!serviceProxyInfo || !serviceProxyInfo.serviceProxy) {
|
|
345
|
-
reject('serviceProxyFailed');
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
var serviceProxy = serviceProxyInfo.serviceProxy;
|
|
350
|
-
|
|
351
|
-
if (serviceProxy.enable) {
|
|
352
|
-
if (serviceProxy.proxyServerRootUrl) {
|
|
353
|
-
_this3.iportalServiceProxyUrl = serviceProxy.proxyServerRootUrl;
|
|
354
|
-
} else if (serviceProxy.port && serviceProxy.rootUrlPostfix) {
|
|
355
|
-
_this3.iportalServiceProxyUrl = serviceProxy.port + "/" + serviceProxy.rootUrlPostfix;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
if (_this3.serverUrl.indexOf(_this3.iportalServiceProxyUrl) > -1) {
|
|
359
|
-
_this3.iportalServiceProxyUrl = '';
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
resolve(serviceProxy);
|
|
364
|
-
}).catch(function (error) {
|
|
365
|
-
reject(error);
|
|
366
|
-
});
|
|
367
|
-
});
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
_proto.getLayerFeatures = function getLayerFeatures(type, layer, baseProjection) {
|
|
371
|
-
var pro;
|
|
372
|
-
|
|
373
|
-
switch (type) {
|
|
374
|
-
case 'hosted':
|
|
375
|
-
pro = this._getFeaturesFromHosted(layer, baseProjection);
|
|
376
|
-
break;
|
|
377
|
-
|
|
378
|
-
case 'rest_data':
|
|
379
|
-
pro = this._getFeaturesFromRestData(layer, baseProjection);
|
|
380
|
-
break;
|
|
381
|
-
|
|
382
|
-
case 'rest_map':
|
|
383
|
-
pro = this._getFeaturesFromRestMap(layer);
|
|
384
|
-
break;
|
|
385
|
-
|
|
386
|
-
case 'dataflow':
|
|
387
|
-
pro = this._getFeaturesFromDataflow(layer);
|
|
388
|
-
break;
|
|
389
|
-
|
|
390
|
-
case 'user_data':
|
|
391
|
-
pro = this._getFeaturesFromUserData(layer);
|
|
392
|
-
break;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
return pro;
|
|
396
|
-
};
|
|
397
|
-
|
|
398
|
-
_proto.getWmsInfo = function getWmsInfo(layerInfo) {
|
|
399
|
-
var _this4 = this;
|
|
400
|
-
|
|
401
|
-
return new Promise(function (resolve) {
|
|
402
|
-
var proxy = _this4.handleProxy();
|
|
403
|
-
|
|
404
|
-
var serviceUrl = SuperMap.Util.urlAppend(layerInfo.url, 'REQUEST=GetCapabilities&SERVICE=WMS');
|
|
405
|
-
SuperMap.FetchRequest.get(serviceUrl, null, {
|
|
406
|
-
withCredentials: _this4.handleWithCredentials(proxy, layerInfo.url, false),
|
|
407
|
-
withoutFormatSuffix: true,
|
|
408
|
-
proxy: proxy
|
|
409
|
-
}).then(function (response) {
|
|
410
|
-
return response.text();
|
|
411
|
-
}).then(function (capabilitiesText) {
|
|
412
|
-
var converts = convert || window.convert;
|
|
413
|
-
var capabilities = JSON.parse(converts.xml2json(capabilitiesText, {
|
|
414
|
-
compact: true,
|
|
415
|
-
spaces: 4
|
|
416
|
-
}));
|
|
417
|
-
var wmsCapabilities = capabilities.WMT_MS_Capabilities || capabilities.WMS_Capabilities;
|
|
418
|
-
resolve({
|
|
419
|
-
version: wmsCapabilities['_attributes']['version']
|
|
420
|
-
});
|
|
421
|
-
});
|
|
422
|
-
});
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
_proto.getMapBoxStyle = function getMapBoxStyle(styleURL) {
|
|
426
|
-
return new Promise(function (resolve, reject) {
|
|
427
|
-
SuperMap.FetchRequest.get(styleURL).then(function (response) {
|
|
428
|
-
return response.json();
|
|
429
|
-
}).then(function (styleJSON) {
|
|
430
|
-
resolve(styleJSON);
|
|
431
|
-
}).catch(function (error) {
|
|
432
|
-
reject(error);
|
|
433
|
-
});
|
|
434
|
-
});
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
_proto.getWmtsInfo = function getWmtsInfo(layerInfo, mapCRS) {
|
|
438
|
-
var _this5 = this;
|
|
439
|
-
|
|
440
|
-
return new Promise(function (resolve, reject) {
|
|
441
|
-
var isMatched = false;
|
|
442
|
-
var matchMaxZoom = 22;
|
|
443
|
-
var matchMinZoom = 0;
|
|
444
|
-
var style = '';
|
|
445
|
-
var bounds;
|
|
446
|
-
var restResourceURL = '';
|
|
447
|
-
var kvpResourceUrl = '';
|
|
448
|
-
|
|
449
|
-
var proxy = _this5.handleProxy();
|
|
450
|
-
|
|
451
|
-
var serviceUrl = SuperMap.Util.urlAppend(layerInfo.url, 'REQUEST=GetCapabilities&SERVICE=WMTS&VERSION=1.0.0');
|
|
452
|
-
serviceUrl = _this5.handleParentRes(serviceUrl);
|
|
453
|
-
SuperMap.FetchRequest.get(serviceUrl, null, {
|
|
454
|
-
withCredentials: _this5.handleWithCredentials(proxy, layerInfo.url, false),
|
|
455
|
-
withoutFormatSuffix: true,
|
|
456
|
-
proxy: proxy
|
|
457
|
-
}).then(function (response) {
|
|
458
|
-
return response.text();
|
|
459
|
-
}).then(function (capabilitiesText) {
|
|
460
|
-
var converts = convert || window.convert;
|
|
461
|
-
var capabilities = JSON.parse(converts.xml2json(capabilitiesText, {
|
|
462
|
-
compact: true,
|
|
463
|
-
spaces: 4,
|
|
464
|
-
alwaysArray: ['Layer', 'TileMatrixSet', 'ows:Operation', 'ows:Get', 'ResourceURL', 'Style']
|
|
465
|
-
})).Capabilities;
|
|
466
|
-
var content = capabilities.Contents;
|
|
467
|
-
var metaData = capabilities['ows:OperationsMetadata'];
|
|
468
|
-
|
|
469
|
-
if (metaData) {
|
|
470
|
-
var operations = metaData['ows:Operation'];
|
|
471
|
-
|
|
472
|
-
if (!Array.isArray(operations)) {
|
|
473
|
-
operations = [operations];
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
var operation = operations.find(function (item) {
|
|
477
|
-
return item._attributes.name === 'GetTile';
|
|
478
|
-
});
|
|
479
|
-
|
|
480
|
-
if (operation) {
|
|
481
|
-
var getConstraints = operation['ows:DCP']['ows:HTTP']['ows:Get'];
|
|
482
|
-
|
|
483
|
-
if (!Array.isArray(getConstraints)) {
|
|
484
|
-
getConstraints = [getConstraints];
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
var getConstraint = getConstraints.find(function (item) {
|
|
488
|
-
return item['ows:Constraint']['ows:AllowedValues']['ows:Value']['_text'] === 'KVP';
|
|
489
|
-
});
|
|
490
|
-
|
|
491
|
-
if (getConstraint) {
|
|
492
|
-
kvpResourceUrl = getConstraint['_attributes']['xlink:href'];
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
var tileMatrixSet = content.TileMatrixSet;
|
|
498
|
-
|
|
499
|
-
for (var i = 0; i < tileMatrixSet.length; i++) {
|
|
500
|
-
if (tileMatrixSet[i]['ows:Identifier'] && tileMatrixSet[i]['ows:Identifier']['_text'] === layerInfo.tileMatrixSet) {
|
|
501
|
-
if (tileMatrixSet[i]['WellKnownScaleSet'] && DEFAULT_WELLKNOWNSCALESET.includes(tileMatrixSet[i]['WellKnownScaleSet']['_text'])) {
|
|
502
|
-
isMatched = true;
|
|
503
|
-
} else {
|
|
504
|
-
var matchedScaleDenominator = {};
|
|
505
|
-
var defaultCRSScaleDenominators = mapCRS === 'EPSG:3857' ? MB_SCALEDENOMINATOR_3857 : MB_SCALEDENOMINATOR_4326;
|
|
506
|
-
var defaultCRSTopLeftCorner = mapCRS === 'EPSG:3857' ? [-2.0037508342789248e7, 2.0037508342789087e7] : [-180, 90];
|
|
507
|
-
|
|
508
|
-
for (var j = 0; j < tileMatrixSet[i].TileMatrix.length; j++) {
|
|
509
|
-
var tileMatrix = tileMatrixSet[i].TileMatrix[j];
|
|
510
|
-
var identifier = tileMatrix['ows:Identifier']['_text'];
|
|
511
|
-
var topLeftCorner = [].concat(tileMatrix['TopLeftCorner']['_text'].split(' '));
|
|
512
|
-
|
|
513
|
-
if ((!(0, _util.numberEqual)(topLeftCorner[0], defaultCRSTopLeftCorner[0]) || !(0, _util.numberEqual)(topLeftCorner[1], defaultCRSTopLeftCorner[1])) && (!(0, _util.numberEqual)(topLeftCorner[0], defaultCRSTopLeftCorner[1]) || !(0, _util.numberEqual)(topLeftCorner[1], defaultCRSTopLeftCorner[0]))) {
|
|
514
|
-
break;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
var defaultScaleDenominator = defaultCRSScaleDenominators[+identifier];
|
|
518
|
-
|
|
519
|
-
if (!defaultScaleDenominator) {
|
|
520
|
-
break;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
var scaleDenominator = parseFloat(tileMatrixSet[i].TileMatrix[j]['ScaleDenominator']['_text']);
|
|
524
|
-
|
|
525
|
-
if ((0, _util.numberEqual)(defaultScaleDenominator, scaleDenominator)) {
|
|
526
|
-
matchedScaleDenominator[+identifier] = scaleDenominator;
|
|
527
|
-
} else {
|
|
528
|
-
if (Object.keys(matchedScaleDenominator).length > 0) {
|
|
529
|
-
break;
|
|
530
|
-
} else {
|
|
531
|
-
continue;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
var zooms = Object.keys(matchedScaleDenominator).map(function (element) {
|
|
537
|
-
return +element;
|
|
538
|
-
});
|
|
539
|
-
matchMaxZoom = (0, _lodash.default)(zooms);
|
|
540
|
-
matchMinZoom = (0, _lodash2.default)(zooms);
|
|
541
|
-
|
|
542
|
-
if (zooms.length !== 0) {
|
|
543
|
-
isMatched = true;
|
|
544
|
-
} else {
|
|
545
|
-
throw Error('TileMatrixSetNotSuppport');
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
break;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
var layer = content.Layer.find(function (item) {
|
|
554
|
-
return item['ows:Identifier']['_text'] === layerInfo.layer;
|
|
555
|
-
});
|
|
556
|
-
|
|
557
|
-
if (layer) {
|
|
558
|
-
var styles = layer.Style;
|
|
559
|
-
|
|
560
|
-
if (Array.isArray(layer.Style)) {
|
|
561
|
-
style = styles[0]['ows:Identifier'] ? styles[0]['ows:Identifier']['_text'] : '';
|
|
562
|
-
} else {
|
|
563
|
-
style = styles['ows:Identifier'] ? styles['ows:Identifier']['_text'] : '';
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
if (layer['ows:WGS84BoundingBox']) {
|
|
567
|
-
var lowerCorner = layer['ows:WGS84BoundingBox']['ows:LowerCorner']['_text'].split(' ');
|
|
568
|
-
var upperCorner = layer['ows:WGS84BoundingBox']['ows:UpperCorner']['_text'].split(' ');
|
|
569
|
-
bounds = [parseFloat(lowerCorner[0]), parseFloat(lowerCorner[1]), parseFloat(upperCorner[0]), parseFloat(upperCorner[1])];
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
var resourceUrls = layer.ResourceURL;
|
|
573
|
-
|
|
574
|
-
if (!Array.isArray(resourceUrls)) {
|
|
575
|
-
resourceUrls = [resourceUrls];
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
var resourceUrl = resourceUrls.find(function (item) {
|
|
579
|
-
return item._attributes.resourceType === 'tile';
|
|
580
|
-
});
|
|
581
|
-
|
|
582
|
-
if (resourceUrl) {
|
|
583
|
-
restResourceURL = resourceUrl._attributes.template;
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
resolve({
|
|
588
|
-
isMatched: isMatched,
|
|
589
|
-
matchMaxZoom: matchMaxZoom,
|
|
590
|
-
matchMinZoom: matchMinZoom,
|
|
591
|
-
style: style,
|
|
592
|
-
bounds: bounds,
|
|
593
|
-
restResourceURL: restResourceURL,
|
|
594
|
-
kvpResourceUrl: kvpResourceUrl
|
|
595
|
-
});
|
|
596
|
-
}).catch(function (error) {
|
|
597
|
-
reject(error);
|
|
598
|
-
});
|
|
599
|
-
});
|
|
600
|
-
};
|
|
601
|
-
|
|
602
|
-
_proto._getFeaturesFromHosted = function _getFeaturesFromHosted(layer, baseProjection) {
|
|
603
|
-
var dataSource = layer.dataSource,
|
|
604
|
-
layerType = layer.layerType;
|
|
605
|
-
var serverId = dataSource ? dataSource.serverId : layer.serverId;
|
|
606
|
-
|
|
607
|
-
if (!serverId) {
|
|
608
|
-
return new Promise(function (resolve) {
|
|
609
|
-
resolve({
|
|
610
|
-
type: 'noServerId'
|
|
611
|
-
});
|
|
612
|
-
});
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
var getDataFromIportal = layerType === 'MARKER' || dataSource && (!dataSource.accessType || dataSource.accessType === 'DIRECT');
|
|
616
|
-
|
|
617
|
-
if (getDataFromIportal) {
|
|
618
|
-
return this._getDataFromIportal(serverId, layer);
|
|
619
|
-
} else {
|
|
620
|
-
return this._getDataFromHosted({
|
|
621
|
-
layer: layer,
|
|
622
|
-
serverId: serverId,
|
|
623
|
-
baseProjection: baseProjection
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
};
|
|
627
|
-
|
|
628
|
-
_proto._getFeaturesFromRestData = function _getFeaturesFromRestData(layer, baseProjection) {
|
|
629
|
-
var _this6 = this;
|
|
630
|
-
|
|
631
|
-
var features;
|
|
632
|
-
var dataSource = layer.dataSource;
|
|
633
|
-
return new Promise(function (resolve, reject) {
|
|
634
|
-
_this6._getFeatureBySQL(dataSource.url, [decodeURIComponent(dataSource.dataSourceName) || layer.name], function (result) {
|
|
635
|
-
features = _this6.parseGeoJsonData2Feature({
|
|
636
|
-
allDatas: {
|
|
637
|
-
features: result.result.features.features
|
|
638
|
-
}
|
|
639
|
-
});
|
|
640
|
-
resolve({
|
|
641
|
-
type: 'feature',
|
|
642
|
-
features: features
|
|
643
|
-
});
|
|
644
|
-
}, function (err) {
|
|
645
|
-
reject(err);
|
|
646
|
-
}, baseProjection);
|
|
647
|
-
});
|
|
648
|
-
};
|
|
649
|
-
|
|
650
|
-
_proto._getFeaturesFromRestMap = function _getFeaturesFromRestMap(layer) {
|
|
651
|
-
var _this7 = this;
|
|
652
|
-
|
|
653
|
-
return new Promise(function (resolve, reject) {
|
|
654
|
-
_this7._queryFeatureBySQL(layer.dataSource.url, layer.dataSource.layerName, function (result) {
|
|
655
|
-
var recordsets = result && result.result.recordsets;
|
|
656
|
-
var recordset = recordsets && recordsets[0];
|
|
657
|
-
var attributes = recordset.fields;
|
|
658
|
-
|
|
659
|
-
if (recordset && attributes) {
|
|
660
|
-
var fileterAttrs = [];
|
|
661
|
-
|
|
662
|
-
for (var i in attributes) {
|
|
663
|
-
var value = attributes[i];
|
|
664
|
-
|
|
665
|
-
if (value.indexOf('Sm') !== 0 || value === 'SmID') {
|
|
666
|
-
fileterAttrs.push(value);
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
_this7._getFeatures(fileterAttrs, layer, function (features) {
|
|
671
|
-
resolve({
|
|
672
|
-
type: 'feature',
|
|
673
|
-
features: features
|
|
674
|
-
});
|
|
675
|
-
}, function (err) {
|
|
676
|
-
reject(err);
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
}, function (err) {
|
|
680
|
-
reject(err);
|
|
681
|
-
}, 'smid=1');
|
|
682
|
-
});
|
|
683
|
-
};
|
|
684
|
-
|
|
685
|
-
_proto._getFeaturesFromUserData = function _getFeaturesFromUserData(layer) {
|
|
686
|
-
var _this8 = this;
|
|
687
|
-
|
|
688
|
-
var dataSource = layer.dataSource;
|
|
689
|
-
return new Promise(function (resolve, reject) {
|
|
690
|
-
var proxy = _this8.handleProxy();
|
|
691
|
-
|
|
692
|
-
var serviceUrl = _this8.handleParentRes(dataSource.url);
|
|
693
|
-
|
|
694
|
-
SuperMap.FetchRequest.get(serviceUrl, null, {
|
|
695
|
-
withCredentials: _this8.handleWithCredentials(proxy, serviceUrl, _this8.withCredentials),
|
|
696
|
-
proxy: proxy,
|
|
697
|
-
withoutFormatSuffix: true
|
|
698
|
-
}).then(function (response) {
|
|
699
|
-
return response.json();
|
|
700
|
-
}).then(function (data) {
|
|
701
|
-
var features;
|
|
702
|
-
|
|
703
|
-
if (data && data instanceof Object && data.type === 'FeatureCollection') {
|
|
704
|
-
features = data.features;
|
|
705
|
-
} else {
|
|
706
|
-
features = data;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
features = _this8.parseGeoJsonData2Feature({
|
|
710
|
-
allDatas: {
|
|
711
|
-
features: features
|
|
712
|
-
}
|
|
713
|
-
});
|
|
714
|
-
resolve({
|
|
715
|
-
type: 'feature',
|
|
716
|
-
features: features
|
|
717
|
-
});
|
|
718
|
-
}).catch(function (err) {
|
|
719
|
-
reject(err);
|
|
720
|
-
});
|
|
721
|
-
});
|
|
722
|
-
};
|
|
723
|
-
|
|
724
|
-
_proto._queryFeatureBySQL = function _queryFeatureBySQL(url, layerName, _processCompleted, processFaild, attributeFilter, fields, epsgCode, startRecord, recordLength, onlyAttribute) {
|
|
725
|
-
var queryBySQLParams = this._getQueryFeaturesParam(layerName, attributeFilter, fields, epsgCode, startRecord, recordLength, onlyAttribute);
|
|
726
|
-
|
|
727
|
-
var proxy = this.handleProxy();
|
|
728
|
-
var serviceUrl = this.handleParentRes(url);
|
|
729
|
-
var queryBySQLService = new SuperMap.QueryBySQLService(serviceUrl, {
|
|
730
|
-
proxy: proxy,
|
|
731
|
-
withCredentials: this.handleWithCredentials(proxy, url, false),
|
|
732
|
-
eventListeners: {
|
|
733
|
-
processCompleted: function processCompleted(data) {
|
|
734
|
-
_processCompleted && _processCompleted(data);
|
|
735
|
-
},
|
|
736
|
-
processFailed: function processFailed(data) {
|
|
737
|
-
processFaild && processFaild(data);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
});
|
|
741
|
-
queryBySQLService.processAsync(queryBySQLParams);
|
|
742
|
-
};
|
|
743
|
-
|
|
744
|
-
_proto._getFeatures = function _getFeatures(fields, layerInfo, resolve, reject) {
|
|
745
|
-
var _this9 = this;
|
|
746
|
-
|
|
747
|
-
var source = layerInfo.dataSource;
|
|
748
|
-
|
|
749
|
-
this._queryFeatureBySQL(source.url, source.layerName, function (result) {
|
|
750
|
-
var recordsets = result.result.recordsets[0];
|
|
751
|
-
var features = recordsets.features.features;
|
|
752
|
-
|
|
753
|
-
var featuresObj = _this9.parseGeoJsonData2Feature({
|
|
754
|
-
allDatas: {
|
|
755
|
-
features: features
|
|
756
|
-
}
|
|
757
|
-
});
|
|
758
|
-
|
|
759
|
-
resolve(featuresObj);
|
|
760
|
-
}, function (err) {
|
|
761
|
-
reject(err);
|
|
762
|
-
}, null, fields);
|
|
763
|
-
};
|
|
764
|
-
|
|
765
|
-
_proto._getQueryFeaturesParam = function _getQueryFeaturesParam(layerName, attributeFilter, fields, epsgCode, startRecord, recordLength, onlyAttribute) {
|
|
766
|
-
var queryParam = new SuperMap.FilterParameter({
|
|
767
|
-
name: layerName,
|
|
768
|
-
attributeFilter: attributeFilter
|
|
769
|
-
});
|
|
770
|
-
|
|
771
|
-
if (fields) {
|
|
772
|
-
queryParam.fields = fields;
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
var params = {
|
|
776
|
-
queryParams: [queryParam]
|
|
777
|
-
};
|
|
778
|
-
|
|
779
|
-
if (onlyAttribute) {
|
|
780
|
-
params.queryOption = SuperMap.QueryOption.ATTRIBUTE;
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
startRecord && (params.startRecord = startRecord);
|
|
784
|
-
recordLength && (params.expectCount = recordLength);
|
|
785
|
-
|
|
786
|
-
if (epsgCode) {
|
|
787
|
-
params.prjCoordSys = {
|
|
788
|
-
epsgCode: epsgCode
|
|
789
|
-
};
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
var queryBySQLParams = new SuperMap.QueryBySQLParameters(params);
|
|
793
|
-
return queryBySQLParams;
|
|
794
|
-
};
|
|
795
|
-
|
|
796
|
-
_proto._getFeaturesFromDataflow = function _getFeaturesFromDataflow(layer) {
|
|
797
|
-
var _this10 = this;
|
|
798
|
-
|
|
799
|
-
return new Promise(function (resolve, reject) {
|
|
800
|
-
_this10._getDataflowInfo(layer, function () {
|
|
801
|
-
resolve({
|
|
802
|
-
type: 'dataflow'
|
|
803
|
-
});
|
|
804
|
-
}, function (e) {
|
|
805
|
-
reject(e);
|
|
806
|
-
});
|
|
807
|
-
});
|
|
808
|
-
};
|
|
809
|
-
|
|
810
|
-
_proto._getDataflowInfo = function _getDataflowInfo(layerInfo, success, faild) {
|
|
811
|
-
var url = layerInfo.url;
|
|
812
|
-
var token;
|
|
813
|
-
var requestUrl = url + ".json";
|
|
814
|
-
|
|
815
|
-
if (layerInfo.credential && layerInfo.credential.token) {
|
|
816
|
-
token = layerInfo.credential.token;
|
|
817
|
-
requestUrl += "?token=" + token;
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
var proxy = this.handleProxy();
|
|
821
|
-
requestUrl = this.handleParentRes(requestUrl);
|
|
822
|
-
SuperMap.FetchRequest.get(requestUrl, null, {
|
|
823
|
-
proxy: proxy,
|
|
824
|
-
withCredentials: this.handleWithCredentials(proxy, requestUrl, false)
|
|
825
|
-
}).then(function (response) {
|
|
826
|
-
return response.json();
|
|
827
|
-
}).then(function (result) {
|
|
828
|
-
if (!result) {
|
|
829
|
-
faild();
|
|
830
|
-
return;
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
if (result.featureMetaData) {
|
|
834
|
-
layerInfo.featureType = result.featureMetaData.featureType.toUpperCase();
|
|
835
|
-
layerInfo.dataSource = {
|
|
836
|
-
dataTypes: {}
|
|
837
|
-
};
|
|
838
|
-
|
|
839
|
-
if (result.featureMetaData.fieldInfos && result.featureMetaData.fieldInfos.length > 0) {
|
|
840
|
-
result.featureMetaData.fieldInfos.forEach(function (data) {
|
|
841
|
-
var name = data.name.trim();
|
|
842
|
-
|
|
843
|
-
if (data.type === 'TEXT') {
|
|
844
|
-
layerInfo.dataSource.dataTypes[name] = 'STRING';
|
|
845
|
-
} else if (['DOUBLE', 'INT', 'FLOAT', 'LONG', 'SHORT'].includes(data.type)) {
|
|
846
|
-
layerInfo.dataSource.dataTypes[name] = 'NUMBER';
|
|
847
|
-
} else {
|
|
848
|
-
layerInfo.dataSource.dataTypes[name] = 'UNKNOWN';
|
|
849
|
-
}
|
|
850
|
-
});
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
layerInfo.wsUrl = result.urls[0].url;
|
|
855
|
-
layerInfo.name = result.urls[0].url.split('iserver/services/')[1].split('/dataflow')[0];
|
|
856
|
-
success();
|
|
857
|
-
}).catch(function () {
|
|
858
|
-
faild();
|
|
859
|
-
});
|
|
860
|
-
};
|
|
861
|
-
|
|
862
|
-
_proto.getDatasourceType = function getDatasourceType(layer) {
|
|
863
|
-
var dataSource = layer.dataSource,
|
|
864
|
-
layerType = layer.layerType;
|
|
865
|
-
|
|
866
|
-
if (dataSource && dataSource.type === 'SAMPLE_DATA') {
|
|
867
|
-
return dataSource.type;
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
var type;
|
|
871
|
-
var isHosted = dataSource && dataSource.serverId || layerType === 'MARKER' || layerType === 'HOSTED_TILE';
|
|
872
|
-
var isTile = layerType === 'SUPERMAP_REST' || layerType === 'TILE' || layerType === 'WMS' || layerType === 'WMTS' || layerType === 'MAPBOXSTYLE';
|
|
873
|
-
|
|
874
|
-
if (isHosted) {
|
|
875
|
-
type = 'hosted';
|
|
876
|
-
} else if (isTile) {
|
|
877
|
-
type = 'tile';
|
|
878
|
-
} else if (dataSource && dataSource.type === 'REST_DATA') {
|
|
879
|
-
type = 'rest_data';
|
|
880
|
-
} else if (dataSource && dataSource.type === 'REST_MAP' && dataSource.url) {
|
|
881
|
-
type = 'rest_map';
|
|
882
|
-
} else if (layerType === 'DATAFLOW_POINT_TRACK' || layerType === 'DATAFLOW_HEAT') {
|
|
883
|
-
type = 'dataflow';
|
|
884
|
-
} else if (dataSource && dataSource.type === 'USER_DATA') {
|
|
885
|
-
type = 'user_data';
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
return type;
|
|
889
|
-
};
|
|
890
|
-
|
|
891
|
-
_proto.getFeatureProperties = function getFeatureProperties(features) {
|
|
892
|
-
var properties = [];
|
|
893
|
-
|
|
894
|
-
if (features && features.length) {
|
|
895
|
-
features.forEach(function (feature) {
|
|
896
|
-
var property = feature.properties;
|
|
897
|
-
property && properties.push(property);
|
|
898
|
-
});
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
return properties;
|
|
902
|
-
};
|
|
903
|
-
|
|
904
|
-
_proto.parseGeoJsonData2Feature = function parseGeoJsonData2Feature(metaData) {
|
|
905
|
-
var allFeatures = metaData.allDatas.features;
|
|
906
|
-
var features = [];
|
|
907
|
-
|
|
908
|
-
for (var i = 0, len = allFeatures.length; i < len; i++) {
|
|
909
|
-
var feature = allFeatures[i];
|
|
910
|
-
var coordinate = feature.geometry.coordinates;
|
|
911
|
-
|
|
912
|
-
if (allFeatures[i].geometry.type === 'Point') {
|
|
913
|
-
if (allFeatures[i].properties) {
|
|
914
|
-
allFeatures[i].properties.lon = coordinate[0];
|
|
915
|
-
allFeatures[i].properties.lat = coordinate[1];
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
feature.properties['index'] = i + '';
|
|
920
|
-
features.push(feature);
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
return features;
|
|
924
|
-
};
|
|
925
|
-
|
|
926
|
-
_proto._getDataFromIportal = function _getDataFromIportal(serverId, layerInfo) {
|
|
927
|
-
var _this11 = this;
|
|
928
|
-
|
|
929
|
-
var features;
|
|
930
|
-
var url = this.serverUrl + "web/datas/" + serverId + "/content.json?pageSize=9999999¤tPage=1";
|
|
931
|
-
|
|
932
|
-
if (this.accessToken) {
|
|
933
|
-
url = url + "&" + this.accessKey + "=" + this.accessToken;
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
return new Promise(function (resolve, reject) {
|
|
937
|
-
url = _this11.handleParentRes(url);
|
|
938
|
-
|
|
939
|
-
var proxy = _this11.handleProxy();
|
|
940
|
-
|
|
941
|
-
SuperMap.FetchRequest.get(url, null, {
|
|
942
|
-
withCredentials: _this11.handleWithCredentials(proxy, url, _this11.withCredentials),
|
|
943
|
-
proxy: proxy
|
|
944
|
-
}).then(function (response) {
|
|
945
|
-
return response.json();
|
|
946
|
-
}).then(function (data) {
|
|
947
|
-
return __awaiter(_this11, void 0, void 0, /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
948
|
-
var _layerInfo$dataSource, divisionType, divisionField, geojson;
|
|
949
|
-
|
|
950
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
951
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
952
|
-
case 0:
|
|
953
|
-
if (data.succeed === false) {
|
|
954
|
-
reject(data.error);
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
if (!(data && data.type)) {
|
|
958
|
-
_context2.next = 22;
|
|
959
|
-
break;
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
if (!(data.type === 'JSON' || data.type === 'GEOJSON')) {
|
|
963
|
-
_context2.next = 7;
|
|
964
|
-
break;
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
data.content = JSON.parse(data.content.trim());
|
|
968
|
-
features = this._formatGeoJSON(data.content);
|
|
969
|
-
_context2.next = 21;
|
|
970
|
-
break;
|
|
971
|
-
|
|
972
|
-
case 7:
|
|
973
|
-
if (!(data.type === 'EXCEL' || data.type === 'CSV')) {
|
|
974
|
-
_context2.next = 20;
|
|
975
|
-
break;
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
if (!(layerInfo.dataSource && layerInfo.dataSource.administrativeInfo)) {
|
|
979
|
-
_context2.next = 17;
|
|
980
|
-
break;
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
data.content.rows.unshift(data.content.colTitles);
|
|
984
|
-
_layerInfo$dataSource = layerInfo.dataSource.administrativeInfo, divisionType = _layerInfo$dataSource.divisionType, divisionField = _layerInfo$dataSource.divisionField;
|
|
985
|
-
_context2.next = 13;
|
|
986
|
-
return this._excelData2FeatureByDivision(data.content, divisionType, divisionField);
|
|
987
|
-
|
|
988
|
-
case 13:
|
|
989
|
-
geojson = _context2.sent;
|
|
990
|
-
features = this._formatGeoJSON(geojson);
|
|
991
|
-
_context2.next = 18;
|
|
992
|
-
break;
|
|
993
|
-
|
|
994
|
-
case 17:
|
|
995
|
-
features = this._excelData2Feature(data.content, layerInfo && layerInfo.xyField || {});
|
|
996
|
-
|
|
997
|
-
case 18:
|
|
998
|
-
_context2.next = 21;
|
|
999
|
-
break;
|
|
1000
|
-
|
|
1001
|
-
case 20:
|
|
1002
|
-
if (data.type === 'SHP') {
|
|
1003
|
-
data.content = JSON.parse(data.content.trim());
|
|
1004
|
-
features = this._formatGeoJSON(data.content.layers[0]);
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
case 21:
|
|
1008
|
-
resolve({
|
|
1009
|
-
type: 'feature',
|
|
1010
|
-
features: features
|
|
1011
|
-
});
|
|
1012
|
-
|
|
1013
|
-
case 22:
|
|
1014
|
-
case "end":
|
|
1015
|
-
return _context2.stop();
|
|
1016
|
-
}
|
|
1017
|
-
}, _callee2, this);
|
|
1018
|
-
}));
|
|
1019
|
-
}).catch(function (error) {
|
|
1020
|
-
reject(error);
|
|
1021
|
-
});
|
|
1022
|
-
});
|
|
1023
|
-
};
|
|
1024
|
-
|
|
1025
|
-
_proto._getDataFromHosted = function _getDataFromHosted(_ref) {
|
|
1026
|
-
var _this12 = this;
|
|
1027
|
-
|
|
1028
|
-
var layer = _ref.layer,
|
|
1029
|
-
serverId = _ref.serverId,
|
|
1030
|
-
baseProjection = _ref.baseProjection;
|
|
1031
|
-
var isMapService = layer.layerType === 'HOSTED_TILE';
|
|
1032
|
-
return new Promise(function (resolve, reject) {
|
|
1033
|
-
_this12._checkUploadToRelationship(serverId).then(function (result) {
|
|
1034
|
-
if (result && result.length > 0) {
|
|
1035
|
-
var datasetName = result[0].name;
|
|
1036
|
-
var featureType = result[0].type.toUpperCase();
|
|
1037
|
-
|
|
1038
|
-
_this12._getDataService(serverId, datasetName).then(function (data) {
|
|
1039
|
-
var dataItemServices = data.dataItemServices;
|
|
1040
|
-
|
|
1041
|
-
if (dataItemServices.length === 0) {
|
|
1042
|
-
reject('noDataServices');
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
var param = {
|
|
1046
|
-
layer: layer,
|
|
1047
|
-
dataItemServices: dataItemServices,
|
|
1048
|
-
datasetName: datasetName,
|
|
1049
|
-
featureType: featureType,
|
|
1050
|
-
resolve: resolve,
|
|
1051
|
-
reject: reject,
|
|
1052
|
-
baseProjection: baseProjection
|
|
1053
|
-
};
|
|
1054
|
-
|
|
1055
|
-
if (isMapService) {
|
|
1056
|
-
var dataService = dataItemServices.filter(function (info) {
|
|
1057
|
-
return info && info.serviceType === 'RESTDATA';
|
|
1058
|
-
})[0];
|
|
1059
|
-
|
|
1060
|
-
_this12._isMvt(dataService.address, datasetName, baseProjection).then(function (info) {
|
|
1061
|
-
_this12._getServiceInfoFromLayer(param, info);
|
|
1062
|
-
}).catch(function () {
|
|
1063
|
-
_this12._getServiceInfoFromLayer(param);
|
|
1064
|
-
});
|
|
1065
|
-
} else {
|
|
1066
|
-
_this12._getServiceInfoFromLayer(param);
|
|
1067
|
-
}
|
|
1068
|
-
});
|
|
1069
|
-
} else {
|
|
1070
|
-
reject('resultIsEmpty');
|
|
1071
|
-
}
|
|
1072
|
-
}).catch(function (error) {
|
|
1073
|
-
reject(error);
|
|
1074
|
-
});
|
|
1075
|
-
});
|
|
1076
|
-
};
|
|
1077
|
-
|
|
1078
|
-
_proto._isMvt = function _isMvt(serviceUrl, datasetName, baseProjection) {
|
|
1079
|
-
return this._getDatasetsInfo(serviceUrl, datasetName).then(function (info) {
|
|
1080
|
-
if (info.epsgCode == baseProjection.split('EPSG:')[1]) {
|
|
1081
|
-
return SuperMap.FetchRequest.get(info.url + "/tilefeature.mvt").then(function (response) {
|
|
1082
|
-
return response.json();
|
|
1083
|
-
}).then(function (result) {
|
|
1084
|
-
info.isMvt = result.error && result.error.code === 400;
|
|
1085
|
-
return info;
|
|
1086
|
-
}).catch(function () {
|
|
1087
|
-
return info;
|
|
1088
|
-
});
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
return info;
|
|
1092
|
-
});
|
|
1093
|
-
};
|
|
1094
|
-
|
|
1095
|
-
_proto._getServiceInfoFromLayer = function _getServiceInfoFromLayer(_ref2, info) {
|
|
1096
|
-
var _this13 = this;
|
|
1097
|
-
|
|
1098
|
-
var layer = _ref2.layer,
|
|
1099
|
-
dataItemServices = _ref2.dataItemServices,
|
|
1100
|
-
datasetName = _ref2.datasetName,
|
|
1101
|
-
featureType = _ref2.featureType,
|
|
1102
|
-
resolve = _ref2.resolve,
|
|
1103
|
-
reject = _ref2.reject,
|
|
1104
|
-
baseProjection = _ref2.baseProjection;
|
|
1105
|
-
var isMapService = info ? !info.isMvt : layer.layerType === 'HOSTED_TILE';
|
|
1106
|
-
var isAdded = false;
|
|
1107
|
-
dataItemServices.forEach(function (service) {
|
|
1108
|
-
if (isAdded) {
|
|
1109
|
-
return;
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
if (service && isMapService && service.serviceType === 'RESTMAP') {
|
|
1113
|
-
isAdded = true;
|
|
1114
|
-
|
|
1115
|
-
_this13._getTileLayerInfo(service.address, baseProjection).then(function (restMaps) {
|
|
1116
|
-
resolve({
|
|
1117
|
-
type: 'restMap',
|
|
1118
|
-
restMaps: restMaps
|
|
1119
|
-
});
|
|
1120
|
-
});
|
|
1121
|
-
} else if (service && !isMapService && service.serviceType === 'RESTDATA') {
|
|
1122
|
-
if (info && info.isMvt) {
|
|
1123
|
-
resolve({
|
|
1124
|
-
type: 'mvt',
|
|
1125
|
-
info: info,
|
|
1126
|
-
featureType: featureType
|
|
1127
|
-
});
|
|
1128
|
-
} else {
|
|
1129
|
-
isAdded = true;
|
|
1130
|
-
|
|
1131
|
-
_this13._getDatasources(service.address).then(function (datasourceName) {
|
|
1132
|
-
layer.dataSource.dataSourceName = datasourceName + ':' + datasetName;
|
|
1133
|
-
layer.dataSource.url = service.address + "/data";
|
|
1134
|
-
|
|
1135
|
-
_this13._getFeatureBySQL(layer.dataSource.url, [layer.dataSource.dataSourceName || layer.name], function (result) {
|
|
1136
|
-
var features = _this13.parseGeoJsonData2Feature({
|
|
1137
|
-
allDatas: {
|
|
1138
|
-
features: result.result.features.features
|
|
1139
|
-
}
|
|
1140
|
-
});
|
|
1141
|
-
|
|
1142
|
-
resolve({
|
|
1143
|
-
type: 'feature',
|
|
1144
|
-
features: features
|
|
1145
|
-
});
|
|
1146
|
-
}, function (err) {
|
|
1147
|
-
reject(err);
|
|
1148
|
-
});
|
|
1149
|
-
}, function (err) {
|
|
1150
|
-
reject(err);
|
|
1151
|
-
});
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
}, this);
|
|
1155
|
-
|
|
1156
|
-
if (!isAdded) {
|
|
1157
|
-
reject('noService');
|
|
1158
|
-
}
|
|
1159
|
-
};
|
|
1160
|
-
|
|
1161
|
-
_proto._getDatasetsInfo = function _getDatasetsInfo(serviceUrl, datasetName) {
|
|
1162
|
-
var _this14 = this;
|
|
1163
|
-
|
|
1164
|
-
return this._getDatasources(serviceUrl).then(function (datasourceName) {
|
|
1165
|
-
var url = serviceUrl + "/data/datasources/" + datasourceName + "/datasets/" + datasetName;
|
|
1166
|
-
|
|
1167
|
-
var proxy = _this14.handleProxy();
|
|
1168
|
-
|
|
1169
|
-
url = _this14.handleParentRes(url);
|
|
1170
|
-
return SuperMap.FetchRequest.get(url, null, {
|
|
1171
|
-
withCredentials: _this14.handleWithCredentials(proxy, url, false),
|
|
1172
|
-
proxy: proxy
|
|
1173
|
-
}).then(function (response) {
|
|
1174
|
-
return response.json();
|
|
1175
|
-
}).then(function (datasetsInfo) {
|
|
1176
|
-
return {
|
|
1177
|
-
epsgCode: datasetsInfo.datasetInfo.prjCoordSys.epsgCode,
|
|
1178
|
-
bounds: datasetsInfo.datasetInfo.bounds,
|
|
1179
|
-
datasourceName: datasourceName,
|
|
1180
|
-
datasetName: datasetName,
|
|
1181
|
-
url: url
|
|
1182
|
-
};
|
|
1183
|
-
});
|
|
1184
|
-
});
|
|
1185
|
-
};
|
|
1186
|
-
|
|
1187
|
-
_proto._getDatasources = function _getDatasources(url) {
|
|
1188
|
-
var proxy = this.handleProxy();
|
|
1189
|
-
var serviceUrl = url + "/data/datasources.json";
|
|
1190
|
-
serviceUrl = this.handleParentRes(serviceUrl);
|
|
1191
|
-
return SuperMap.FetchRequest.get(serviceUrl, null, {
|
|
1192
|
-
withCredentials: this.handleWithCredentials(proxy, serviceUrl, false),
|
|
1193
|
-
proxy: proxy
|
|
1194
|
-
}).then(function (response) {
|
|
1195
|
-
return response.json();
|
|
1196
|
-
}).then(function (datasource) {
|
|
1197
|
-
if (datasource.code === 401) {
|
|
1198
|
-
throw Error(datasource.errorMsg);
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
var datasourceNames = datasource.datasourceNames;
|
|
1202
|
-
return datasourceNames[0];
|
|
1203
|
-
});
|
|
1204
|
-
};
|
|
1205
|
-
|
|
1206
|
-
_proto._getDataService = function _getDataService(fileId, datasetName) {
|
|
1207
|
-
var proxy = this.handleProxy();
|
|
1208
|
-
var serviceUrl = this.serverUrl + "web/datas/" + fileId + ".json";
|
|
1209
|
-
serviceUrl = this.handleParentRes(serviceUrl);
|
|
1210
|
-
return SuperMap.FetchRequest.get(serviceUrl, null, {
|
|
1211
|
-
withCredentials: this.handleWithCredentials(proxy, serviceUrl, this.withCredentials),
|
|
1212
|
-
proxy: proxy
|
|
1213
|
-
}).then(function (response) {
|
|
1214
|
-
return response.json();
|
|
1215
|
-
}).then(function (result) {
|
|
1216
|
-
result.fileId = fileId;
|
|
1217
|
-
result.datasetName = datasetName;
|
|
1218
|
-
return result;
|
|
1219
|
-
});
|
|
1220
|
-
};
|
|
1221
|
-
|
|
1222
|
-
_proto._checkUploadToRelationship = function _checkUploadToRelationship(fileId) {
|
|
1223
|
-
var proxy = this.handleProxy();
|
|
1224
|
-
var serviceUrl = this.serverUrl + "web/datas/" + fileId + "/datasets.json";
|
|
1225
|
-
serviceUrl = this.handleParentRes(serviceUrl);
|
|
1226
|
-
return SuperMap.FetchRequest.get(serviceUrl, null, {
|
|
1227
|
-
withCredentials: this.handleWithCredentials(proxy, serviceUrl, this.withCredentials),
|
|
1228
|
-
proxy: proxy
|
|
1229
|
-
}).then(function (response) {
|
|
1230
|
-
return response.json();
|
|
1231
|
-
}).then(function (result) {
|
|
1232
|
-
return result;
|
|
1233
|
-
});
|
|
1234
|
-
};
|
|
1235
|
-
|
|
1236
|
-
_proto._handleMapUrl = function _handleMapUrl() {
|
|
1237
|
-
var mapUrl = this.serverUrl + 'web/maps/' + this.mapId + '/map';
|
|
1238
|
-
|
|
1239
|
-
if (this.accessToken || this.accessKey) {
|
|
1240
|
-
mapUrl += true ? 'token=' + this.accessToken : undefined;
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
var filter = 'getUrlResource.json?url=';
|
|
1244
|
-
|
|
1245
|
-
if (this.excludePortalProxyUrl && this.serverUrl.indexOf(filter) > -1) {
|
|
1246
|
-
var urlArray = this.serverUrl.split(filter);
|
|
1247
|
-
|
|
1248
|
-
if (urlArray.length > 1) {
|
|
1249
|
-
mapUrl = urlArray[0] + filter + this.serverUrl + 'web/maps/' + this.mapId + '/map.json';
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
mapUrl = mapUrl.indexOf('.json') === -1 ? mapUrl + ".json" : mapUrl;
|
|
1254
|
-
return mapUrl;
|
|
1255
|
-
};
|
|
1256
|
-
|
|
1257
|
-
_proto.handleProxy = function handleProxy(type) {
|
|
1258
|
-
if (!this.proxy) {
|
|
1259
|
-
return null;
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
var proxySuffix = this.proxyOptions[type || 'data'];
|
|
1263
|
-
var proxy = this.serverUrl + proxySuffix;
|
|
1264
|
-
|
|
1265
|
-
if (typeof this.proxy === 'string') {
|
|
1266
|
-
proxy = this.proxy;
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
return proxy;
|
|
1270
|
-
};
|
|
1271
|
-
|
|
1272
|
-
_proto.handleWithCredentials = function handleWithCredentials(proxyUrl, serviceUrl, defaultValue) {
|
|
1273
|
-
if (defaultValue === void 0) {
|
|
1274
|
-
defaultValue = this.withCredentials;
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
if (serviceUrl === null || serviceUrl === void 0 ? void 0 : serviceUrl.includes('https://www.supermapol.com')) {
|
|
1278
|
-
return '';
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
if (proxyUrl && proxyUrl.startsWith(this.serverUrl) && (!serviceUrl || serviceUrl.startsWith(proxyUrl))) {
|
|
1282
|
-
return true;
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
if (serviceUrl && this.iportalServiceProxyUrl && serviceUrl.indexOf(this.iportalServiceProxyUrl) >= 0) {
|
|
1286
|
-
return true;
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
return defaultValue;
|
|
1290
|
-
};
|
|
1291
|
-
|
|
1292
|
-
_proto.isIportalResourceUrl = function isIportalResourceUrl(serviceUrl) {
|
|
1293
|
-
return serviceUrl.startsWith(this.serverUrl) || this.iportalServiceProxyUrl && serviceUrl.indexOf(this.iportalServiceProxyUrl) >= 0;
|
|
1294
|
-
};
|
|
1295
|
-
|
|
1296
|
-
_proto.handleParentRes = function handleParentRes(url, parentResId, parentResType) {
|
|
1297
|
-
if (parentResId === void 0) {
|
|
1298
|
-
parentResId = this.mapId;
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
if (parentResType === void 0) {
|
|
1302
|
-
parentResType = 'MAP';
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
if (!this.isIportalResourceUrl(url)) {
|
|
1306
|
-
return url;
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
return (0, _util.urlAppend)(url, "parentResType=" + parentResType + "&parentResId=" + parentResId);
|
|
1310
|
-
};
|
|
1311
|
-
|
|
1312
|
-
_proto._formatGeoJSON = function _formatGeoJSON(data) {
|
|
1313
|
-
var features = data.features;
|
|
1314
|
-
features.forEach(function (row, index) {
|
|
1315
|
-
row.properties['index'] = index;
|
|
1316
|
-
});
|
|
1317
|
-
return features;
|
|
1318
|
-
};
|
|
1319
|
-
|
|
1320
|
-
_proto._excelData2Feature = function _excelData2Feature(dataContent, xyField) {
|
|
1321
|
-
if (xyField === void 0) {
|
|
1322
|
-
xyField = {};
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
var fieldCaptions = dataContent.colTitles;
|
|
1326
|
-
var xfieldIndex = fieldCaptions.indexOf(xyField.xField);
|
|
1327
|
-
var yfieldIndex = fieldCaptions.indexOf(xyField.yField);
|
|
1328
|
-
|
|
1329
|
-
if (yfieldIndex < 0 || xfieldIndex < 0) {
|
|
1330
|
-
for (var i = 0, len = fieldCaptions.length; i < len; i++) {
|
|
1331
|
-
if ((0, _util.isXField)(fieldCaptions[i])) {
|
|
1332
|
-
xfieldIndex = i;
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
if ((0, _util.isYField)(fieldCaptions[i])) {
|
|
1336
|
-
yfieldIndex = i;
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
var features = [];
|
|
1342
|
-
|
|
1343
|
-
for (var _i = 0, _len = dataContent.rows.length; _i < _len; _i++) {
|
|
1344
|
-
var row = dataContent.rows[_i];
|
|
1345
|
-
var x = Number(row[xfieldIndex]);
|
|
1346
|
-
var y = Number(row[yfieldIndex]);
|
|
1347
|
-
|
|
1348
|
-
if (isNaN(x) || isNaN(y)) {
|
|
1349
|
-
continue;
|
|
1350
|
-
}
|
|
1351
|
-
|
|
1352
|
-
var attributes = {};
|
|
1353
|
-
|
|
1354
|
-
for (var index = 0; index < dataContent.colTitles.length; index++) {
|
|
1355
|
-
var element = dataContent.colTitles[index].trim();
|
|
1356
|
-
attributes[element] = dataContent.rows[_i][index];
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
attributes['index'] = _i + '';
|
|
1360
|
-
var feature = {
|
|
1361
|
-
type: 'Feature',
|
|
1362
|
-
geometry: {
|
|
1363
|
-
type: 'Point',
|
|
1364
|
-
coordinates: [x, y]
|
|
1365
|
-
},
|
|
1366
|
-
properties: attributes
|
|
1367
|
-
};
|
|
1368
|
-
features.push(feature);
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
return features;
|
|
1372
|
-
};
|
|
1373
|
-
|
|
1374
|
-
_proto._excelData2FeatureByDivision = function _excelData2FeatureByDivision(content, divisionType, divisionField) {
|
|
1375
|
-
var _this15 = this;
|
|
1376
|
-
|
|
1377
|
-
var dataName = ['城市', 'City'].includes(divisionType) ? 'MunicipalData' : 'ProvinceData';
|
|
1378
|
-
|
|
1379
|
-
if (window[dataName] && window[dataName].features) {
|
|
1380
|
-
return new Promise(function (resolve) {
|
|
1381
|
-
resolve(_this15._combineFeature(content, window[dataName], divisionField));
|
|
1382
|
-
});
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
var dataFileName = ['城市', 'City'].includes(divisionType) ? 'MunicipalData.js' : 'ProvincialData.js';
|
|
1386
|
-
var proxy = this.handleProxy();
|
|
1387
|
-
var dataUrl = this.serverUrl + "apps/dataviz/libs/administrative_data/" + dataFileName;
|
|
1388
|
-
return SuperMap.FetchRequest.get(dataUrl, null, {
|
|
1389
|
-
withCredentials: false,
|
|
1390
|
-
proxy: proxy,
|
|
1391
|
-
withoutFormatSuffix: true
|
|
1392
|
-
}).then(function (response) {
|
|
1393
|
-
return response.text();
|
|
1394
|
-
}).then(function (result) {
|
|
1395
|
-
new Function(result)();
|
|
1396
|
-
return _this15._combineFeature(content, window[dataName], divisionField);
|
|
1397
|
-
});
|
|
1398
|
-
};
|
|
1399
|
-
|
|
1400
|
-
_proto._combineFeature = function _combineFeature(properties, geoData, divisionField) {
|
|
1401
|
-
var _this16 = this;
|
|
1402
|
-
|
|
1403
|
-
var geojson = {
|
|
1404
|
-
type: 'FeatureCollection',
|
|
1405
|
-
features: []
|
|
1406
|
-
};
|
|
1407
|
-
|
|
1408
|
-
if (properties.length < 2) {
|
|
1409
|
-
return geojson;
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
var titles = properties.colTitles;
|
|
1413
|
-
var rows = properties.rows;
|
|
1414
|
-
var fieldIndex = titles.findIndex(function (title) {
|
|
1415
|
-
return title === divisionField;
|
|
1416
|
-
});
|
|
1417
|
-
rows.forEach(function (row) {
|
|
1418
|
-
var feature = geoData.features.find(function (item) {
|
|
1419
|
-
return _this16._isMatchAdministrativeName(item.properties.Name, row[fieldIndex]);
|
|
1420
|
-
});
|
|
1421
|
-
|
|
1422
|
-
if (feature) {
|
|
1423
|
-
var province = feature.properties.Province;
|
|
1424
|
-
var combineFeature = {
|
|
1425
|
-
properties: {},
|
|
1426
|
-
geometry: feature.geometry,
|
|
1427
|
-
type: 'Feature'
|
|
1428
|
-
};
|
|
1429
|
-
row.forEach(function (item, idx) {
|
|
1430
|
-
combineFeature.properties[titles[idx]] = item;
|
|
1431
|
-
});
|
|
1432
|
-
|
|
1433
|
-
if (province) {
|
|
1434
|
-
combineFeature.properties.Province = province;
|
|
1435
|
-
}
|
|
1436
|
-
|
|
1437
|
-
geojson.features.push(combineFeature);
|
|
1438
|
-
}
|
|
1439
|
-
});
|
|
1440
|
-
return geojson;
|
|
1441
|
-
};
|
|
1442
|
-
|
|
1443
|
-
_proto._isMatchAdministrativeName = function _isMatchAdministrativeName(featureName, fieldName) {
|
|
1444
|
-
if (featureName && typeof fieldName === 'string' && fieldName.constructor === String) {
|
|
1445
|
-
var shortName = featureName.trim().substr(0, 2);
|
|
1446
|
-
|
|
1447
|
-
if (shortName === '张家') {
|
|
1448
|
-
shortName = featureName.trim().substr(0, 3);
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
if (shortName === '阿拉') {
|
|
1452
|
-
shortName = featureName.trim().substr(0, 3);
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
return !!fieldName.match(new RegExp(shortName));
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
|
-
return false;
|
|
1459
|
-
};
|
|
1460
|
-
|
|
1461
|
-
_proto._getTileLayerInfo = function _getTileLayerInfo(url, baseProjection) {
|
|
1462
|
-
var _this17 = this;
|
|
1463
|
-
|
|
1464
|
-
var proxy = this.handleProxy();
|
|
1465
|
-
var epsgCode = baseProjection.split('EPSG:')[1];
|
|
1466
|
-
var serviceUrl = url + "/maps.json";
|
|
1467
|
-
serviceUrl = this.handleParentRes(serviceUrl);
|
|
1468
|
-
return SuperMap.FetchRequest.get(serviceUrl, null, {
|
|
1469
|
-
withCredentials: this.handleWithCredentials(proxy, serviceUrl, this.withCredentials),
|
|
1470
|
-
proxy: proxy
|
|
1471
|
-
}).then(function (response) {
|
|
1472
|
-
return response.json();
|
|
1473
|
-
}).then(function (mapInfo) {
|
|
1474
|
-
var promises = [];
|
|
1475
|
-
|
|
1476
|
-
if (mapInfo) {
|
|
1477
|
-
mapInfo.forEach(function (info) {
|
|
1478
|
-
var promise = SuperMap.FetchRequest.get(info.path + ".json?prjCoordSys=" + JSON.stringify({
|
|
1479
|
-
epsgCode: epsgCode
|
|
1480
|
-
}), null, {
|
|
1481
|
-
withCredentials: _this17.withCredentials,
|
|
1482
|
-
proxy: proxy
|
|
1483
|
-
}).then(function (response) {
|
|
1484
|
-
return response.json();
|
|
1485
|
-
}).then(function (restMapInfo) {
|
|
1486
|
-
restMapInfo.url = info.path;
|
|
1487
|
-
return restMapInfo;
|
|
1488
|
-
});
|
|
1489
|
-
promises.push(promise);
|
|
1490
|
-
});
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1493
|
-
return Promise.all(promises).then(function (allRestMaps) {
|
|
1494
|
-
return allRestMaps;
|
|
1495
|
-
});
|
|
1496
|
-
});
|
|
1497
|
-
};
|
|
1498
|
-
|
|
1499
|
-
_proto._getFeatureBySQL = function _getFeatureBySQL(url, datasetNames, _processCompleted2, processFaild, baseProjection) {
|
|
1500
|
-
var getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams;
|
|
1501
|
-
getFeatureParam = new SuperMap.FilterParameter({
|
|
1502
|
-
name: datasetNames.join().replace(':', '@'),
|
|
1503
|
-
attributeFilter: null
|
|
1504
|
-
});
|
|
1505
|
-
getFeatureBySQLParams = new SuperMap.GetFeaturesBySQLParameters({
|
|
1506
|
-
queryParameter: getFeatureParam,
|
|
1507
|
-
datasetNames: datasetNames,
|
|
1508
|
-
fromIndex: 0,
|
|
1509
|
-
toIndex: -1,
|
|
1510
|
-
maxFeatures: -1,
|
|
1511
|
-
returnContent: true
|
|
1512
|
-
});
|
|
1513
|
-
|
|
1514
|
-
if (baseProjection) {
|
|
1515
|
-
if (baseProjection === 'EPSG:3857' || baseProjection === 'EPSG:-1000') {
|
|
1516
|
-
getFeatureBySQLParams.targetEpsgCode = 4326;
|
|
1517
|
-
} else {
|
|
1518
|
-
getFeatureBySQLParams.targetEpsgCode = +baseProjection.split(':')[1];
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
|
|
1522
|
-
var proxy = this.handleProxy();
|
|
1523
|
-
var options = {
|
|
1524
|
-
proxy: proxy,
|
|
1525
|
-
withCredentials: this.handleWithCredentials(proxy, url, false),
|
|
1526
|
-
eventListeners: {
|
|
1527
|
-
processCompleted: function processCompleted(getFeaturesEventArgs) {
|
|
1528
|
-
var result = getFeaturesEventArgs.result;
|
|
1529
|
-
|
|
1530
|
-
if (result && result.datasetInfos) {
|
|
1531
|
-
var fields = [];
|
|
1532
|
-
var fieldCaptions = [];
|
|
1533
|
-
var fieldTypes = [];
|
|
1534
|
-
var fieldInfos = result.datasetInfos[0].fieldInfos;
|
|
1535
|
-
fieldInfos.forEach(function (fieldInfo) {
|
|
1536
|
-
if (fieldInfo.name) {
|
|
1537
|
-
fields.push(fieldInfo.name.toUpperCase());
|
|
1538
|
-
fieldCaptions.push(fieldInfo.caption.toUpperCase());
|
|
1539
|
-
fieldTypes.push(fieldInfo.type);
|
|
1540
|
-
}
|
|
1541
|
-
});
|
|
1542
|
-
var data = (0, _statistics.statisticsFeatures)(result.features.features, fields, fieldCaptions, fieldTypes);
|
|
1543
|
-
getFeaturesEventArgs.result.features.features = data.features;
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
_processCompleted2 && _processCompleted2(getFeaturesEventArgs);
|
|
1547
|
-
},
|
|
1548
|
-
processFailed: function processFailed(e) {
|
|
1549
|
-
processFaild && processFaild(e);
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
};
|
|
1553
|
-
var serviceUrl = this.handleParentRes(url);
|
|
1554
|
-
getFeatureBySQLService = new SuperMap.GetFeaturesBySQLService(serviceUrl, options);
|
|
1555
|
-
getFeatureBySQLService.processAsync(getFeatureBySQLParams);
|
|
1556
|
-
};
|
|
1557
|
-
|
|
1558
|
-
_proto.getEpsgCodeInfo = function getEpsgCodeInfo(epsgCode, iPortalUrl) {
|
|
1559
|
-
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
1560
|
-
var url, codeUrl, wkt;
|
|
1561
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
1562
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
1563
|
-
case 0:
|
|
1564
|
-
url = iPortalUrl.slice(-1) === '/' ? iPortalUrl : iPortalUrl + "/";
|
|
1565
|
-
codeUrl = url + "epsgcodes/" + epsgCode + ".json";
|
|
1566
|
-
_context3.next = 4;
|
|
1567
|
-
return SuperMap.FetchRequest.get(codeUrl, null).then(function (response) {
|
|
1568
|
-
return response.json();
|
|
1569
|
-
}).then(function (epsgcodeInfo) {
|
|
1570
|
-
return epsgcodeInfo.wkt;
|
|
1571
|
-
}).catch(function (err) {
|
|
1572
|
-
console.error(err);
|
|
1573
|
-
return undefined;
|
|
1574
|
-
});
|
|
1575
|
-
|
|
1576
|
-
case 4:
|
|
1577
|
-
wkt = _context3.sent;
|
|
1578
|
-
return _context3.abrupt("return", wkt);
|
|
1579
|
-
|
|
1580
|
-
case 6:
|
|
1581
|
-
case "end":
|
|
1582
|
-
return _context3.stop();
|
|
1583
|
-
}
|
|
1584
|
-
}, _callee3);
|
|
1585
|
-
}));
|
|
1586
|
-
};
|
|
1587
|
-
|
|
1588
|
-
return WebMapService;
|
|
1589
|
-
}(_Events2.Events);
|
|
1590
|
-
|
|
1591
|
-
/***/ }),
|
|
1592
|
-
|
|
1593
|
-
/***/ 252:
|
|
1594
|
-
/***/ (function(module, exports) {
|
|
1595
|
-
|
|
1596
|
-
module.exports = require("xml-js");
|
|
1597
|
-
|
|
1598
|
-
/***/ }),
|
|
1599
|
-
|
|
1600
|
-
/***/ 253:
|
|
1601
|
-
/***/ (function(module, exports) {
|
|
1602
|
-
|
|
1603
|
-
module.exports = require("lodash.min");
|
|
1604
|
-
|
|
1605
|
-
/***/ }),
|
|
1606
|
-
|
|
1607
|
-
/***/ 254:
|
|
1608
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1609
|
-
|
|
1610
|
-
"use strict";
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
var _interopRequireDefault = __webpack_require__(0);
|
|
1614
|
-
|
|
1615
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1616
|
-
value: true
|
|
1617
|
-
});
|
|
1618
|
-
exports.default = void 0;
|
|
1619
|
-
exports.getProjection = getProjection;
|
|
1620
|
-
exports.registerProjection = registerProjection;
|
|
1621
|
-
exports.toEpsgCode = toEpsgCode;
|
|
1622
|
-
|
|
1623
|
-
var _vue = _interopRequireDefault(__webpack_require__(10));
|
|
1624
|
-
|
|
1625
|
-
var _util = __webpack_require__(9);
|
|
1626
|
-
|
|
1627
|
-
var EpsgDefine = new _vue.default({
|
|
1628
|
-
epsgCodes: {
|
|
1629
|
-
'EPSG:3857': 'PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]',
|
|
1630
|
-
'EPSG:4326': 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],AXIS["Easting", "EAST"],AXIS["Northing", "NORTH"],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]',
|
|
1631
|
-
'EPSG:4490': 'GEOGCS["China Geodetic Coordinate System 2000", DATUM["China 2000", SPHEROID["CGCS2000", 6378137.0, 298.257222101, AUTHORITY["EPSG","1024"]], AUTHORITY["EPSG","1043"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic latitude", NORTH], AXIS["Geodetic longitude", EAST], AUTHORITY["EPSG","4490"]]'
|
|
1632
|
-
},
|
|
1633
|
-
registerProjection: function registerProjection(epsgKey, epsgValue) {
|
|
1634
|
-
if ((0, _util.getDataType)(arguments[0]) === '[object Object]' && arguments.length === 1) {
|
|
1635
|
-
this.epsgCodes = Object.assign({}, this.epsgCodes, arguments[0]);
|
|
1636
|
-
} else if (epsgKey && epsgValue) {
|
|
1637
|
-
this.epsgCodes[epsgKey] = epsgValue;
|
|
1638
|
-
}
|
|
1639
|
-
},
|
|
1640
|
-
getProjection: function getProjection(epsgKey) {
|
|
1641
|
-
return this.epsgCodes[epsgKey];
|
|
1642
|
-
},
|
|
1643
|
-
getAllProjections: function getAllProjections() {
|
|
1644
|
-
return this.epsgCodes;
|
|
1645
|
-
}
|
|
1646
|
-
});
|
|
1647
|
-
|
|
1648
|
-
var _default = exports.default = EpsgDefine;
|
|
1649
|
-
|
|
1650
|
-
function registerProjection(epsgKey, epsgValue) {
|
|
1651
|
-
return EpsgDefine.$options.registerProjection(epsgKey, epsgValue);
|
|
1652
|
-
}
|
|
1653
|
-
|
|
1654
|
-
function getProjection(epsgKey) {
|
|
1655
|
-
return EpsgDefine.$options.getProjection(epsgKey);
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
function toEpsgCode(wkt) {
|
|
1659
|
-
if (typeof wkt !== 'string') {
|
|
1660
|
-
return '';
|
|
1661
|
-
} else if (wkt.indexOf('EPSG') === 0) {
|
|
1662
|
-
return wkt;
|
|
1663
|
-
} else {
|
|
1664
|
-
var lastAuthority = wkt.lastIndexOf('AUTHORITY') + 10;
|
|
1665
|
-
var endString = wkt.indexOf(']', lastAuthority) - 1;
|
|
1666
|
-
|
|
1667
|
-
if (lastAuthority > 0 && endString > 0) {
|
|
1668
|
-
return "EPSG:" + wkt.substring(lastAuthority, endString).split(',')[1].substr(1);
|
|
1669
|
-
} else {
|
|
1670
|
-
return '';
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1674
|
-
|
|
1675
|
-
/***/ }),
|
|
1676
|
-
|
|
1677
|
-
/***/ 38:
|
|
1678
|
-
/***/ (function(module, exports) {
|
|
1679
|
-
|
|
1680
|
-
module.exports = require("@supermapgis/vue-iclient-leaflet/lib/_utils/statistics.js");
|
|
1681
|
-
|
|
1682
|
-
/***/ }),
|
|
1683
|
-
|
|
1684
|
-
/***/ 43:
|
|
1685
|
-
/***/ (function(module, exports) {
|
|
1686
|
-
|
|
1687
|
-
module.exports = require("@babel/runtime/regenerator");
|
|
1688
|
-
|
|
1689
|
-
/***/ }),
|
|
1690
|
-
|
|
1691
|
-
/***/ 44:
|
|
1692
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1693
|
-
|
|
1694
|
-
"use strict";
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
var _interopRequireDefault = __webpack_require__(0);
|
|
1698
|
-
|
|
1699
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1700
|
-
value: true
|
|
1701
|
-
});
|
|
1702
|
-
exports.clearNumberComma = clearNumberComma;
|
|
1703
|
-
exports.filterInvalidData = filterInvalidData;
|
|
1704
|
-
exports.formatFontSize = formatFontSize;
|
|
1705
|
-
exports.getColorWithOpacity = getColorWithOpacity;
|
|
1706
|
-
exports.getDarkenColor = getDarkenColor;
|
|
1707
|
-
exports.getDataType = getDataType;
|
|
1708
|
-
exports.getDateTime = getDateTime;
|
|
1709
|
-
exports.getDerivedColorsByTextColor = getDerivedColorsByTextColor;
|
|
1710
|
-
exports.getFeatureCenter = getFeatureCenter;
|
|
1711
|
-
exports.getValueCaseInsensitive = getValueCaseInsensitive;
|
|
1712
|
-
exports.handleDataParentRes = handleDataParentRes;
|
|
1713
|
-
exports.handleWithCredentials = handleWithCredentials;
|
|
1714
|
-
exports.hexToRgba = hexToRgba;
|
|
1715
|
-
exports.isDate = isDate;
|
|
1716
|
-
exports.isMatchUrl = isMatchUrl;
|
|
1717
|
-
exports.isNumber = isNumber;
|
|
1718
|
-
exports.isTransparent = isTransparent;
|
|
1719
|
-
exports.isXField = isXField;
|
|
1720
|
-
exports.isYField = isYField;
|
|
1721
|
-
exports.numberEqual = numberEqual;
|
|
1722
|
-
exports.objectWithoutProperties = objectWithoutProperties;
|
|
1723
|
-
exports.parseUrl = parseUrl;
|
|
1724
|
-
exports.reservedDecimal = reservedDecimal;
|
|
1725
|
-
exports.setPopupArrowStyle = setPopupArrowStyle;
|
|
1726
|
-
exports.statisticFunctions = void 0;
|
|
1727
|
-
exports.strip = strip;
|
|
1728
|
-
exports.urlAppend = urlAppend;
|
|
1729
|
-
|
|
1730
|
-
var _index = __webpack_require__(13);
|
|
1731
|
-
|
|
1732
|
-
var _colorcolor = _interopRequireDefault(__webpack_require__(45));
|
|
1733
|
-
|
|
1734
|
-
var _center = _interopRequireDefault(__webpack_require__(24));
|
|
1735
|
-
|
|
1736
|
-
var _omit = _interopRequireDefault(__webpack_require__(46));
|
|
1737
|
-
|
|
1738
|
-
var _tinycolor = _interopRequireDefault(__webpack_require__(25));
|
|
1739
|
-
|
|
1740
|
-
var _simpleStatistics = __webpack_require__(47);
|
|
1741
|
-
|
|
1742
|
-
// 获取当前时间返回置顶格式
|
|
1743
|
-
function getDateTime(timeType) {
|
|
1744
|
-
return (0, _index.geti18n)().d(new Date(), timeType.replace(/\+/g, '_'));
|
|
1745
|
-
} // hex -> rgba
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
function hexToRgba(hex, opacity) {
|
|
1749
|
-
return 'rgba(' + parseInt('0x' + hex.slice(1, 3)) + ',' + parseInt('0x' + hex.slice(3, 5)) + ',' + parseInt('0x' + hex.slice(5, 7)) + ',' + opacity + ')';
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
function formatFontSize(fontSize) {
|
|
1753
|
-
return typeof fontSize === 'number' ? fontSize + 'px' : fontSize;
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
function isTransparent(color) {
|
|
1757
|
-
var rgba = (0, _colorcolor.default)(color, 'rgba');
|
|
1758
|
-
return +rgba.match(/(\d(\.\d+)?)+/g)[3] === 0;
|
|
1759
|
-
} // 保留指定位数的小数
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
function reservedDecimal(val, precise) {
|
|
1763
|
-
return Number(val).toFixed(precise);
|
|
1764
|
-
} // 清除数字(字符串型的)的逗号
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
function clearNumberComma(num) {
|
|
1768
|
-
if (num.replace) {
|
|
1769
|
-
num = num.replace(/,/g, '');
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
return num;
|
|
1773
|
-
}
|
|
1774
|
-
/**
|
|
1775
|
-
* 判断是否地理X坐标
|
|
1776
|
-
* @param data
|
|
1777
|
-
*/
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
function isXField(data) {
|
|
1781
|
-
var lowerdata = data.toLowerCase();
|
|
1782
|
-
return lowerdata === 'x' || lowerdata === 'smx' || lowerdata === 'jd' || lowerdata === '经度' || lowerdata === '东经' || lowerdata === 'longitude' || lowerdata === 'lot' || lowerdata === 'lon' || lowerdata === 'long' || lowerdata === 'lng' || lowerdata === 'x坐标';
|
|
1783
|
-
}
|
|
1784
|
-
/**
|
|
1785
|
-
* 判断是否地理Y坐标
|
|
1786
|
-
* @param data
|
|
1787
|
-
*/
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
function isYField(data) {
|
|
1791
|
-
var lowerdata = data.toLowerCase();
|
|
1792
|
-
return lowerdata === 'y' || lowerdata === 'smy' || lowerdata === 'wd' || lowerdata === '纬度' || lowerdata === '北纬' || lowerdata === 'latitude' || lowerdata === 'lat' || lowerdata === 'y坐标';
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
|
-
function getColorWithOpacity(color, opacity, isStack) {
|
|
1796
|
-
if (isStack === void 0) {
|
|
1797
|
-
isStack = true;
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
if (!color) {
|
|
1801
|
-
return color;
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
var originColor = (0, _tinycolor.default)(color);
|
|
1805
|
-
var originOpacity = originColor.getAlpha();
|
|
1806
|
-
|
|
1807
|
-
if (isStack) {
|
|
1808
|
-
originColor.setAlpha(originOpacity * opacity);
|
|
1809
|
-
} else {
|
|
1810
|
-
originColor.setAlpha(opacity);
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
var nextColor = originColor.toRgbString();
|
|
1814
|
-
return nextColor;
|
|
1815
|
-
}
|
|
1816
|
-
|
|
1817
|
-
function getDerivedColorsByTextColor(textColor, opacity) {
|
|
1818
|
-
if (!textColor) {
|
|
1819
|
-
return textColor;
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
if (textColor.includes('var')) {
|
|
1823
|
-
return "var(--alpha" + opacity * 100 + ")";
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
var baseTextColorOpacity = 0.65;
|
|
1827
|
-
var originTextColor = (0, _tinycolor.default)(textColor);
|
|
1828
|
-
var originOpacity = originTextColor.getAlpha();
|
|
1829
|
-
originTextColor.setAlpha(originOpacity * opacity / baseTextColorOpacity);
|
|
1830
|
-
var derivedColor = originTextColor.toRgbString();
|
|
1831
|
-
return derivedColor;
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
function parseUrl(url) {
|
|
1835
|
-
var urlRe = /^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;
|
|
1836
|
-
return url.match(urlRe);
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
|
-
function getDataType(data) {
|
|
1840
|
-
return Object.prototype.toString.call(data);
|
|
1841
|
-
} // 判断输入的地址是否符合地址格式
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
function isMatchUrl(str) {
|
|
1845
|
-
var reg = new RegExp('(https?|http|file|ftp)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]');
|
|
1846
|
-
return reg.test(str);
|
|
1847
|
-
} // 判断是否为日期
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
function isDate(data) {
|
|
1851
|
-
var reg = /((^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(10|12|0?[13578])([-\/\._])(3[01]|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(11|0?[469])([-\/\._])(30|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(0?2)([-\/\._])(2[0-8]|1[0-9]|0?[1-9])$)|(^([2468][048]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([3579][26]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][13579][26])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][13579][26])([-\/\._])(0?2)([-\/\._])(29)$))/gi;
|
|
1852
|
-
return reg.test(data);
|
|
1853
|
-
} // 判断是否为数值
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
function isNumber(data) {
|
|
1857
|
-
var mdata = Number(data);
|
|
1858
|
-
|
|
1859
|
-
if (mdata === 0) {
|
|
1860
|
-
return true;
|
|
1861
|
-
}
|
|
1862
|
-
|
|
1863
|
-
return !isNaN(mdata);
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
|
-
function getFeatureCenter(feature) {
|
|
1867
|
-
var coordinates = ((feature || {}).geometry || {}).coordinates;
|
|
1868
|
-
var hasCoordinates = coordinates && !!coordinates.length;
|
|
1869
|
-
|
|
1870
|
-
if (!hasCoordinates) {
|
|
1871
|
-
return;
|
|
1872
|
-
}
|
|
1873
|
-
|
|
1874
|
-
var featureType = feature.geometry.type;
|
|
1875
|
-
var center;
|
|
1876
|
-
|
|
1877
|
-
if (featureType === 'LineString') {
|
|
1878
|
-
center = coordinates[parseInt(coordinates.length / 2)];
|
|
1879
|
-
} else if (featureType === 'MultiLineString') {
|
|
1880
|
-
var coord = coordinates[parseInt(coordinates.length / 2)];
|
|
1881
|
-
center = coord[parseInt(coord.length / 2)];
|
|
1882
|
-
} else {
|
|
1883
|
-
center = (0, _center.default)(feature).geometry.coordinates;
|
|
1884
|
-
}
|
|
1885
|
-
|
|
1886
|
-
return center;
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
function getValueCaseInsensitive(properties, searchKey) {
|
|
1890
|
-
var isObj = getDataType(properties) === '[object Object]';
|
|
1891
|
-
|
|
1892
|
-
if (!searchKey || !isObj) {
|
|
1893
|
-
return '';
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
|
-
var lowerSearchKey = searchKey.toLocaleLowerCase();
|
|
1897
|
-
|
|
1898
|
-
for (var key in properties) {
|
|
1899
|
-
if (key.toLocaleLowerCase() === lowerSearchKey) {
|
|
1900
|
-
return properties[key];
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1904
|
-
return '';
|
|
1905
|
-
}
|
|
1906
|
-
|
|
1907
|
-
function filterInvalidData(datasetOptions, features) {
|
|
1908
|
-
var xFields = datasetOptions.map(function (item) {
|
|
1909
|
-
return item.xField;
|
|
1910
|
-
});
|
|
1911
|
-
var yFields = datasetOptions.map(function (item) {
|
|
1912
|
-
return item.yField;
|
|
1913
|
-
});
|
|
1914
|
-
var nextFeatures = features.filter(function (feature) {
|
|
1915
|
-
var matchXField = xFields.find(function (item) {
|
|
1916
|
-
return Object.prototype.hasOwnProperty.call(feature.properties, item);
|
|
1917
|
-
});
|
|
1918
|
-
var matchYField = yFields.find(function (item) {
|
|
1919
|
-
return ![undefined, null, ''].includes(feature.properties[item]);
|
|
1920
|
-
});
|
|
1921
|
-
return !!(matchXField && matchYField);
|
|
1922
|
-
});
|
|
1923
|
-
return nextFeatures;
|
|
1924
|
-
}
|
|
1925
|
-
|
|
1926
|
-
function handleWithCredentials(url, iportalServiceProxyUrl, defaultValue) {
|
|
1927
|
-
if (defaultValue === void 0) {
|
|
1928
|
-
defaultValue = false;
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
if (!iportalServiceProxyUrl) {
|
|
1932
|
-
return defaultValue;
|
|
1933
|
-
}
|
|
1934
|
-
|
|
1935
|
-
return url.indexOf(iportalServiceProxyUrl) >= 0 || defaultValue;
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
function handleDataParentRes(url, parentResId, parentResType) {
|
|
1939
|
-
if (parentResType === void 0) {
|
|
1940
|
-
parentResType = 'DATA';
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1943
|
-
if (!parentResId) {
|
|
1944
|
-
return url;
|
|
1945
|
-
}
|
|
1946
|
-
|
|
1947
|
-
return urlAppend(url, "parentResType=" + parentResType + "&parentResId=" + parentResId);
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
|
-
function urlAppend(url, paramStr) {
|
|
1951
|
-
var newUrl = url;
|
|
1952
|
-
|
|
1953
|
-
if (paramStr) {
|
|
1954
|
-
if (paramStr.indexOf('?') === 0) {
|
|
1955
|
-
paramStr = paramStr.substring(1);
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
var parts = (url + ' ').split(/[?&]/);
|
|
1959
|
-
newUrl += parts.pop() === ' ' ? paramStr : parts.length ? '&' + paramStr : '?' + paramStr;
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
return newUrl;
|
|
1963
|
-
}
|
|
1964
|
-
|
|
1965
|
-
function objectWithoutProperties(obj, omitKeys) {
|
|
1966
|
-
if (omitKeys === void 0) {
|
|
1967
|
-
omitKeys = [];
|
|
1968
|
-
}
|
|
1969
|
-
|
|
1970
|
-
return (0, _omit.default)(obj, omitKeys);
|
|
1971
|
-
}
|
|
1972
|
-
|
|
1973
|
-
function getDarkenColor(color, amount) {
|
|
1974
|
-
return (0, _tinycolor.default)(color).darken(amount).toString();
|
|
1975
|
-
}
|
|
1976
|
-
|
|
1977
|
-
var ARROW_POSITION_MAP = {
|
|
1978
|
-
top: 'Bottom',
|
|
1979
|
-
bottom: 'Top',
|
|
1980
|
-
left: 'Right',
|
|
1981
|
-
right: 'Left'
|
|
1982
|
-
};
|
|
1983
|
-
|
|
1984
|
-
function setPopupArrowStyle(color) {
|
|
1985
|
-
var popup = document.querySelectorAll('.sm-mapboxgl-tabel-popup');
|
|
1986
|
-
|
|
1987
|
-
if (popup) {
|
|
1988
|
-
popup.forEach(function (item) {
|
|
1989
|
-
var position = item.className.replace(/.+mapboxgl-popup-anchor-([a-z]+)/, '$1');
|
|
1990
|
-
|
|
1991
|
-
if (ARROW_POSITION_MAP[position]) {
|
|
1992
|
-
var popupArrow = item.querySelector('.mapboxgl-popup-tip');
|
|
1993
|
-
|
|
1994
|
-
if (popupArrow) {
|
|
1995
|
-
popupArrow.style["border" + ARROW_POSITION_MAP[position] + "Color"] = color;
|
|
1996
|
-
}
|
|
1997
|
-
}
|
|
1998
|
-
});
|
|
1999
|
-
}
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
function strip(num, precision) {
|
|
2003
|
-
if (precision === void 0) {
|
|
2004
|
-
precision = 12;
|
|
2005
|
-
}
|
|
2006
|
-
|
|
2007
|
-
if (typeof num === 'number') {
|
|
2008
|
-
return +parseFloat(num.toPrecision(precision));
|
|
2009
|
-
}
|
|
2010
|
-
}
|
|
2011
|
-
|
|
2012
|
-
function numberEqual(num1, num2, precision) {
|
|
2013
|
-
if (precision === void 0) {
|
|
2014
|
-
precision = 10E-6;
|
|
2015
|
-
}
|
|
2016
|
-
|
|
2017
|
-
return Math.abs(+num1 - +num2) <= precision;
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
var statisticFunctions = exports.statisticFunctions = {
|
|
2021
|
-
min: _simpleStatistics.min,
|
|
2022
|
-
max: _simpleStatistics.max,
|
|
2023
|
-
mean: _simpleStatistics.mean,
|
|
2024
|
-
sum: _simpleStatistics.sum,
|
|
2025
|
-
mode: _simpleStatistics.mode,
|
|
2026
|
-
median: _simpleStatistics.median,
|
|
2027
|
-
variance: _simpleStatistics.variance,
|
|
2028
|
-
standardDeviation: _simpleStatistics.standardDeviation,
|
|
2029
|
-
count: function count(fieldValues) {
|
|
2030
|
-
return fieldValues.length;
|
|
2031
|
-
}
|
|
2032
|
-
};
|
|
2033
|
-
|
|
2034
|
-
/***/ }),
|
|
2035
|
-
|
|
2036
|
-
/***/ 45:
|
|
2037
|
-
/***/ (function(module, exports) {
|
|
2038
|
-
|
|
2039
|
-
module.exports = require("colorcolor");
|
|
2040
|
-
|
|
2041
|
-
/***/ }),
|
|
2042
|
-
|
|
2043
|
-
/***/ 46:
|
|
2044
|
-
/***/ (function(module, exports) {
|
|
2045
|
-
|
|
2046
|
-
module.exports = require("omit.js");
|
|
2047
|
-
|
|
2048
|
-
/***/ }),
|
|
2049
|
-
|
|
2050
|
-
/***/ 47:
|
|
2051
|
-
/***/ (function(module, exports) {
|
|
2052
|
-
|
|
2053
|
-
module.exports = require("simple-statistics");
|
|
2054
|
-
|
|
2055
|
-
/***/ }),
|
|
2056
|
-
|
|
2057
|
-
/***/ 520:
|
|
2058
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
2059
|
-
|
|
2060
|
-
"use strict";
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
var _interopRequireDefault = __webpack_require__(0);
|
|
2064
|
-
|
|
2065
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2066
|
-
value: true
|
|
2067
|
-
});
|
|
2068
|
-
exports.default = void 0;
|
|
2069
|
-
|
|
2070
|
-
var _regenerator = _interopRequireDefault(__webpack_require__(43));
|
|
2071
|
-
|
|
2072
|
-
var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(6));
|
|
2073
|
-
|
|
2074
|
-
var _Events2 = __webpack_require__(19);
|
|
2075
|
-
|
|
2076
|
-
var _MunicipalCenter = _interopRequireDefault(__webpack_require__(521));
|
|
2077
|
-
|
|
2078
|
-
var _ProvinceCenter = _interopRequireDefault(__webpack_require__(522));
|
|
2079
|
-
|
|
2080
|
-
__webpack_require__(248);
|
|
2081
|
-
|
|
2082
|
-
__webpack_require__(523);
|
|
2083
|
-
|
|
2084
|
-
var _lodash = _interopRequireDefault(__webpack_require__(524));
|
|
2085
|
-
|
|
2086
|
-
var _canvg = _interopRequireDefault(__webpack_require__(525));
|
|
2087
|
-
|
|
2088
|
-
var _WebMapService = _interopRequireDefault(__webpack_require__(251));
|
|
2089
|
-
|
|
2090
|
-
var _util = __webpack_require__(44);
|
|
2091
|
-
|
|
2092
|
-
var _epsgDefine = __webpack_require__(254);
|
|
2093
|
-
|
|
2094
|
-
var _meta = __webpack_require__(526);
|
|
2095
|
-
|
|
2096
|
-
var _lodash2 = _interopRequireDefault(__webpack_require__(527));
|
|
2097
|
-
|
|
2098
|
-
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
2099
|
-
function adopt(value) {
|
|
2100
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
2101
|
-
resolve(value);
|
|
2102
|
-
});
|
|
2103
|
-
}
|
|
2104
|
-
|
|
2105
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2106
|
-
function fulfilled(value) {
|
|
2107
|
-
try {
|
|
2108
|
-
step(generator.next(value));
|
|
2109
|
-
} catch (e) {
|
|
2110
|
-
reject(e);
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
|
|
2114
|
-
function rejected(value) {
|
|
2115
|
-
try {
|
|
2116
|
-
step(generator["throw"](value));
|
|
2117
|
-
} catch (e) {
|
|
2118
|
-
reject(e);
|
|
2119
|
-
}
|
|
2120
|
-
}
|
|
2121
|
-
|
|
2122
|
-
function step(result) {
|
|
2123
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
2124
|
-
}
|
|
2125
|
-
|
|
2126
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2127
|
-
});
|
|
2128
|
-
};
|
|
2129
|
-
|
|
2130
|
-
var MAX_MIGRATION_ANIMATION_COUNT = 1000;
|
|
2131
|
-
|
|
2132
|
-
var WebMapBase = exports.default = /*#__PURE__*/function (_Events) {
|
|
2133
|
-
(0, _inheritsLoose2.default)(WebMapBase, _Events);
|
|
2134
|
-
|
|
2135
|
-
function WebMapBase(id, options, mapOptions) {
|
|
2136
|
-
var _this;
|
|
2137
|
-
|
|
2138
|
-
_this = _Events.call(this) || this;
|
|
2139
|
-
_this.echartslayer = [];
|
|
2140
|
-
_this._layers = [];
|
|
2141
|
-
_this.canvgsV = [];
|
|
2142
|
-
_this.serverUrl = options.serverUrl || 'https://www.supermapol.com';
|
|
2143
|
-
_this.accessToken = options.accessToken;
|
|
2144
|
-
_this.accessKey = options.accessKey;
|
|
2145
|
-
_this.tiandituKey = options.tiandituKey || '';
|
|
2146
|
-
_this.googleMapsAPIKey = options.googleMapsAPIKey || '';
|
|
2147
|
-
_this.bingMapsKey = options.bingMapsKey || '';
|
|
2148
|
-
_this.googleMapsLanguage = options.googleMapsLanguage || 'zh-CN';
|
|
2149
|
-
_this.withCredentials = options.withCredentials || false;
|
|
2150
|
-
_this.proxy = options.proxy;
|
|
2151
|
-
_this.target = options.target || 'map';
|
|
2152
|
-
_this.excludePortalProxyUrl = options.excludePortalProxyUrl;
|
|
2153
|
-
_this.isSuperMapOnline = options.isSuperMapOnline;
|
|
2154
|
-
_this.ignoreBaseProjection = options.ignoreBaseProjection;
|
|
2155
|
-
_this.echartslayer = [];
|
|
2156
|
-
_this.webMapService = new _WebMapService.default(id, options);
|
|
2157
|
-
_this.mapOptions = mapOptions;
|
|
2158
|
-
_this.eventTypes = ['getmapinfofailed', 'crsnotsupport', 'getlayerdatasourcefailed', 'addlayerssucceeded', 'notsupportmvt', 'notsupportbaidumap', 'projectionIsNotMatch', 'beforeremovemap', 'mapinitialized'];
|
|
2159
|
-
_this.mapId = id;
|
|
2160
|
-
return _this;
|
|
2161
|
-
}
|
|
2162
|
-
|
|
2163
|
-
var _proto = WebMapBase.prototype;
|
|
2164
|
-
|
|
2165
|
-
_proto.echartsLayerResize = function echartsLayerResize() {
|
|
2166
|
-
this.echartslayer.forEach(function (echartslayer) {
|
|
2167
|
-
echartslayer.chart.resize();
|
|
2168
|
-
});
|
|
2169
|
-
};
|
|
2170
|
-
|
|
2171
|
-
_proto.setMapId = function setMapId(mapId) {
|
|
2172
|
-
var _this2 = this;
|
|
2173
|
-
|
|
2174
|
-
if (typeof mapId === 'string' || typeof mapId === 'number') {
|
|
2175
|
-
this.mapId = mapId;
|
|
2176
|
-
this.webMapInfo = null;
|
|
2177
|
-
} else if (mapId !== null && typeof mapId === 'object') {
|
|
2178
|
-
this.webMapInfo = mapId;
|
|
2179
|
-
}
|
|
2180
|
-
|
|
2181
|
-
this.webMapService.setMapId(mapId);
|
|
2182
|
-
|
|
2183
|
-
if (!mapId) {
|
|
2184
|
-
return;
|
|
2185
|
-
}
|
|
2186
|
-
|
|
2187
|
-
setTimeout(function () {
|
|
2188
|
-
_this2._initWebMap();
|
|
2189
|
-
}, 0);
|
|
2190
|
-
};
|
|
2191
|
-
|
|
2192
|
-
_proto.setServerUrl = function setServerUrl(serverUrl) {
|
|
2193
|
-
this.serverUrl = serverUrl;
|
|
2194
|
-
this.webMapService.setServerUrl(serverUrl);
|
|
2195
|
-
};
|
|
2196
|
-
|
|
2197
|
-
_proto.setWithCredentials = function setWithCredentials(withCredentials) {
|
|
2198
|
-
this.withCredentials = withCredentials;
|
|
2199
|
-
this.webMapService.setWithCredentials(withCredentials);
|
|
2200
|
-
};
|
|
2201
|
-
|
|
2202
|
-
_proto.setProxy = function setProxy(proxy) {
|
|
2203
|
-
this.proxy = proxy;
|
|
2204
|
-
this.webMapService.setProxy(proxy);
|
|
2205
|
-
};
|
|
2206
|
-
|
|
2207
|
-
_proto.setZoom = function setZoom(zoom) {
|
|
2208
|
-
if (this.map) {
|
|
2209
|
-
this.mapOptions.zoom = zoom;
|
|
2210
|
-
|
|
2211
|
-
if (zoom !== +this.map.getZoom().toFixed(2)) {
|
|
2212
|
-
(zoom || zoom === 0) && this.map.setZoom(zoom, {
|
|
2213
|
-
from: 'setZoom'
|
|
2214
|
-
});
|
|
2215
|
-
}
|
|
2216
|
-
}
|
|
2217
|
-
};
|
|
2218
|
-
|
|
2219
|
-
_proto.setMaxBounds = function setMaxBounds(maxBounds) {
|
|
2220
|
-
if (this.map) {
|
|
2221
|
-
this.mapOptions.maxBounds = maxBounds;
|
|
2222
|
-
maxBounds && this.map.setMaxBounds(maxBounds);
|
|
2223
|
-
}
|
|
2224
|
-
};
|
|
2225
|
-
|
|
2226
|
-
_proto.setMinZoom = function setMinZoom(minZoom) {
|
|
2227
|
-
if (this.map) {
|
|
2228
|
-
this.mapOptions.minZoom = minZoom;
|
|
2229
|
-
(minZoom || minZoom === 0) && this.map.setMinZoom(minZoom);
|
|
2230
|
-
}
|
|
2231
|
-
};
|
|
2232
|
-
|
|
2233
|
-
_proto.setMaxZoom = function setMaxZoom(maxZoom) {
|
|
2234
|
-
if (this.map) {
|
|
2235
|
-
this.mapOptions.maxZoom = maxZoom;
|
|
2236
|
-
(maxZoom || maxZoom === 0) && this.map.setMaxZoom(maxZoom);
|
|
2237
|
-
}
|
|
2238
|
-
};
|
|
2239
|
-
|
|
2240
|
-
_proto.initWebMap = function initWebMap() {
|
|
2241
|
-
this.clean();
|
|
2242
|
-
this.serverUrl = this.serverUrl && this.webMapService.handleServerUrl(this.serverUrl);
|
|
2243
|
-
|
|
2244
|
-
if (this.webMapInfo) {
|
|
2245
|
-
var mapInfo = this.webMapInfo;
|
|
2246
|
-
mapInfo.mapParams = {
|
|
2247
|
-
title: this.webMapInfo.title,
|
|
2248
|
-
description: this.webMapInfo.description
|
|
2249
|
-
};
|
|
2250
|
-
this.mapParams = mapInfo.mapParams;
|
|
2251
|
-
|
|
2252
|
-
this._getMapInfo(mapInfo);
|
|
2253
|
-
|
|
2254
|
-
return;
|
|
2255
|
-
} else if (!this.mapId || !this.serverUrl) {
|
|
2256
|
-
this._createMap();
|
|
2257
|
-
|
|
2258
|
-
return;
|
|
2259
|
-
}
|
|
2260
|
-
|
|
2261
|
-
this._taskID = new Date();
|
|
2262
|
-
this.getMapInfo(this._taskID);
|
|
2263
|
-
};
|
|
2264
|
-
|
|
2265
|
-
_proto.getMapInfo = function getMapInfo(_taskID) {
|
|
2266
|
-
var _this3 = this;
|
|
2267
|
-
|
|
2268
|
-
this.serverUrl = this.serverUrl && this.webMapService.handleServerUrl(this.serverUrl);
|
|
2269
|
-
this.webMapService.getMapInfo().then(function (mapInfo) {
|
|
2270
|
-
if (_this3._taskID !== _taskID) {
|
|
2271
|
-
return;
|
|
2272
|
-
}
|
|
2273
|
-
|
|
2274
|
-
_this3.mapParams = mapInfo.mapParams;
|
|
2275
|
-
|
|
2276
|
-
_this3._getMapInfo(mapInfo, _taskID);
|
|
2277
|
-
}, function (error) {
|
|
2278
|
-
throw error;
|
|
2279
|
-
}).catch(function (error) {
|
|
2280
|
-
_this3.triggerEvent('getmapinfofailed', {
|
|
2281
|
-
error: error
|
|
2282
|
-
});
|
|
2283
|
-
|
|
2284
|
-
console.log(error);
|
|
2285
|
-
});
|
|
2286
|
-
};
|
|
2287
|
-
|
|
2288
|
-
_proto.getBaseLayerType = function getBaseLayerType(layerInfo) {
|
|
2289
|
-
var layerType = layerInfo.layerType;
|
|
2290
|
-
|
|
2291
|
-
if (layerType.indexOf('TIANDITU_VEC') > -1 || layerType.indexOf('TIANDITU_IMG') > -1 || layerType.indexOf('TIANDITU_TER') > -1) {
|
|
2292
|
-
layerType = 'TIANDITU';
|
|
2293
|
-
}
|
|
2294
|
-
|
|
2295
|
-
switch (layerType) {
|
|
2296
|
-
case 'TILE':
|
|
2297
|
-
case 'SUPERMAP_REST':
|
|
2298
|
-
return 'TILE';
|
|
2299
|
-
|
|
2300
|
-
case 'CLOUD':
|
|
2301
|
-
case 'CLOUD_BLACK':
|
|
2302
|
-
return 'CLOUD';
|
|
2303
|
-
|
|
2304
|
-
case 'OSM':
|
|
2305
|
-
case 'JAPAN_ORT':
|
|
2306
|
-
case 'JAPAN_RELIEF':
|
|
2307
|
-
case 'JAPAN_PALE':
|
|
2308
|
-
case 'JAPAN_STD':
|
|
2309
|
-
case 'GOOGLE_CN':
|
|
2310
|
-
case 'GOOGLE':
|
|
2311
|
-
return 'XYZ';
|
|
2312
|
-
|
|
2313
|
-
default:
|
|
2314
|
-
return layerType;
|
|
2315
|
-
}
|
|
2316
|
-
};
|
|
2317
|
-
|
|
2318
|
-
_proto.getMapurls = function getMapurls(mapurl) {
|
|
2319
|
-
if (mapurl === void 0) {
|
|
2320
|
-
mapurl = {};
|
|
2321
|
-
}
|
|
2322
|
-
|
|
2323
|
-
var mapUrls = {
|
|
2324
|
-
CLOUD: mapurl.CLOUD || 'http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}',
|
|
2325
|
-
CLOUD_BLACK: mapurl.CLOUD_BLACK || 'http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}',
|
|
2326
|
-
OSM: mapurl.OSM || 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
2327
|
-
GOOGLE: 'https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i540264686!3m12!2s{googleMapsLanguage}!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0&key={googleMapsAPIKey}',
|
|
2328
|
-
GOOGLE_CN: 'https://mt{0-3}.google.com/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}',
|
|
2329
|
-
JAPAN_STD: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
|
|
2330
|
-
JAPAN_PALE: 'https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png',
|
|
2331
|
-
JAPAN_RELIEF: 'https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png',
|
|
2332
|
-
JAPAN_ORT: 'https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg'
|
|
2333
|
-
};
|
|
2334
|
-
return mapUrls;
|
|
2335
|
-
};
|
|
2336
|
-
|
|
2337
|
-
_proto.getLayerFeatures = function getLayerFeatures(layer, _taskID, type) {
|
|
2338
|
-
var _this4 = this;
|
|
2339
|
-
|
|
2340
|
-
var getLayerFunc = this.webMapService.getLayerFeatures(type, layer, this.baseProjection);
|
|
2341
|
-
getLayerFunc && getLayerFunc.then(function (result) {
|
|
2342
|
-
return __awaiter(_this4, void 0, void 0, /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
2343
|
-
var epsgWKT;
|
|
2344
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
2345
|
-
while (1) switch (_context.prev = _context.next) {
|
|
2346
|
-
case 0:
|
|
2347
|
-
if (!(this.mapId && this._taskID !== _taskID)) {
|
|
2348
|
-
_context.next = 2;
|
|
2349
|
-
break;
|
|
2350
|
-
}
|
|
2351
|
-
|
|
2352
|
-
return _context.abrupt("return");
|
|
2353
|
-
|
|
2354
|
-
case 2:
|
|
2355
|
-
if (!(result && layer.projection)) {
|
|
2356
|
-
_context.next = 8;
|
|
2357
|
-
break;
|
|
2358
|
-
}
|
|
2359
|
-
|
|
2360
|
-
if ((0, _epsgDefine.getProjection)(layer.projection)) {
|
|
2361
|
-
_context.next = 8;
|
|
2362
|
-
break;
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
|
-
_context.next = 6;
|
|
2366
|
-
return this.webMapService.getEpsgCodeInfo(layer.projection.split(':')[1], this.serverUrl);
|
|
2367
|
-
|
|
2368
|
-
case 6:
|
|
2369
|
-
epsgWKT = _context.sent;
|
|
2370
|
-
|
|
2371
|
-
if (epsgWKT) {
|
|
2372
|
-
(0, _epsgDefine.registerProjection)(layer.projection, epsgWKT);
|
|
2373
|
-
}
|
|
2374
|
-
|
|
2375
|
-
case 8:
|
|
2376
|
-
this._getLayerFeaturesSucceeded(result, layer);
|
|
2377
|
-
|
|
2378
|
-
case 9:
|
|
2379
|
-
case "end":
|
|
2380
|
-
return _context.stop();
|
|
2381
|
-
}
|
|
2382
|
-
}, _callee, this);
|
|
2383
|
-
}));
|
|
2384
|
-
}, function (error) {
|
|
2385
|
-
throw new Error(error);
|
|
2386
|
-
}).catch(function (error) {
|
|
2387
|
-
_this4._addLayerSucceeded();
|
|
2388
|
-
|
|
2389
|
-
_this4.triggerEvent('getlayerdatasourcefailed', {
|
|
2390
|
-
error: error,
|
|
2391
|
-
layer: layer,
|
|
2392
|
-
map: _this4.map
|
|
2393
|
-
});
|
|
2394
|
-
|
|
2395
|
-
console.log(error);
|
|
2396
|
-
});
|
|
2397
|
-
};
|
|
2398
|
-
|
|
2399
|
-
_proto.setFeatureInfo = function setFeatureInfo(feature) {
|
|
2400
|
-
var featureInfo;
|
|
2401
|
-
var info = feature.dv_v5_markerInfo;
|
|
2402
|
-
|
|
2403
|
-
if (info && info.dataViz_title) {
|
|
2404
|
-
featureInfo = info;
|
|
2405
|
-
} else {
|
|
2406
|
-
return info;
|
|
2407
|
-
}
|
|
2408
|
-
|
|
2409
|
-
var properties = feature.properties;
|
|
2410
|
-
|
|
2411
|
-
for (var key in featureInfo) {
|
|
2412
|
-
if (properties[key]) {
|
|
2413
|
-
featureInfo[key] = properties[key];
|
|
2414
|
-
delete properties[key];
|
|
2415
|
-
}
|
|
2416
|
-
}
|
|
2417
|
-
|
|
2418
|
-
return featureInfo;
|
|
2419
|
-
};
|
|
2420
|
-
|
|
2421
|
-
_proto.getRankStyleGroup = function getRankStyleGroup(themeField, features, parameters) {
|
|
2422
|
-
var values = [];
|
|
2423
|
-
var segements = [];
|
|
2424
|
-
var style = parameters.style;
|
|
2425
|
-
var themeSetting = parameters.themeSetting;
|
|
2426
|
-
var segmentMethod = themeSetting.segmentMethod;
|
|
2427
|
-
var segmentCount = themeSetting.segmentCount;
|
|
2428
|
-
var customSettings = themeSetting.customSettings;
|
|
2429
|
-
var minR = parameters.themeSetting.minRadius;
|
|
2430
|
-
var maxR = parameters.themeSetting.maxRadius;
|
|
2431
|
-
var colors = themeSetting.colors;
|
|
2432
|
-
var fillColor = style.fillColor;
|
|
2433
|
-
features.forEach(function (feature) {
|
|
2434
|
-
var properties = feature.properties;
|
|
2435
|
-
var value = properties[themeField];
|
|
2436
|
-
|
|
2437
|
-
if (value == null || value === '' || !(0, _lodash.default)(+value)) {
|
|
2438
|
-
return;
|
|
2439
|
-
}
|
|
2440
|
-
|
|
2441
|
-
values.push(Number(value));
|
|
2442
|
-
});
|
|
2443
|
-
|
|
2444
|
-
try {
|
|
2445
|
-
segements = SuperMap.ArrayStatistic.getArraySegments(values, segmentMethod, segmentCount);
|
|
2446
|
-
} catch (error) {
|
|
2447
|
-
console.log(error);
|
|
2448
|
-
}
|
|
2449
|
-
|
|
2450
|
-
for (var i = 0; i < segmentCount; i++) {
|
|
2451
|
-
if (i in customSettings) {
|
|
2452
|
-
var startValue = customSettings[i].segment.start;
|
|
2453
|
-
var endValue = customSettings[i].segment.end;
|
|
2454
|
-
startValue != null && (segements[i] = startValue);
|
|
2455
|
-
endValue != null && (segements[i + 1] = endValue);
|
|
2456
|
-
}
|
|
2457
|
-
}
|
|
2458
|
-
|
|
2459
|
-
var styleGroup = [];
|
|
2460
|
-
|
|
2461
|
-
if (segements && segements.length) {
|
|
2462
|
-
var len = segements.length;
|
|
2463
|
-
var incrementR = (maxR - minR) / (len - 1);
|
|
2464
|
-
var start;
|
|
2465
|
-
var end;
|
|
2466
|
-
var radius = Number(((maxR + minR) / 2).toFixed(2));
|
|
2467
|
-
var color = '';
|
|
2468
|
-
var rangeColors = colors ? SuperMap.ColorsPickerUtil.getGradientColors(colors, len, 'RANGE') : [];
|
|
2469
|
-
|
|
2470
|
-
for (var _i = 0; _i < len - 1; _i++) {
|
|
2471
|
-
start = Number(segements[_i].toFixed(2));
|
|
2472
|
-
end = Number(segements[_i + 1].toFixed(2));
|
|
2473
|
-
radius = start === end ? radius : minR + Math.round(incrementR * _i);
|
|
2474
|
-
end = _i === len - 2 ? end + 0.01 : end;
|
|
2475
|
-
radius = customSettings[_i] && customSettings[_i].radius ? customSettings[_i].radius : radius;
|
|
2476
|
-
style.radius = radius;
|
|
2477
|
-
|
|
2478
|
-
if (colors && colors.length > 0) {
|
|
2479
|
-
color = customSettings[_i] && customSettings[_i].color ? customSettings[_i].color : rangeColors[_i] || fillColor;
|
|
2480
|
-
style.fillColor = color;
|
|
2481
|
-
}
|
|
2482
|
-
|
|
2483
|
-
styleGroup.push({
|
|
2484
|
-
radius: radius,
|
|
2485
|
-
color: color,
|
|
2486
|
-
start: start,
|
|
2487
|
-
end: end,
|
|
2488
|
-
style: style
|
|
2489
|
-
});
|
|
2490
|
-
}
|
|
2491
|
-
|
|
2492
|
-
return styleGroup;
|
|
2493
|
-
} else {
|
|
2494
|
-
return false;
|
|
2495
|
-
}
|
|
2496
|
-
};
|
|
2497
|
-
|
|
2498
|
-
_proto.createRankStyleSource = function createRankStyleSource(parameters, features) {
|
|
2499
|
-
var themeSetting = parameters.themeSetting;
|
|
2500
|
-
var themeField = themeSetting.themeField;
|
|
2501
|
-
var styleGroups = this.getRankStyleGroup(themeField, features, parameters);
|
|
2502
|
-
return styleGroups ? {
|
|
2503
|
-
parameters: parameters,
|
|
2504
|
-
styleGroups: styleGroups
|
|
2505
|
-
} : false;
|
|
2506
|
-
};
|
|
2507
|
-
|
|
2508
|
-
_proto.isMatchAdministrativeName = function isMatchAdministrativeName(featureName, fieldName) {
|
|
2509
|
-
var isString = typeof fieldName === 'string' && fieldName.constructor === String;
|
|
2510
|
-
|
|
2511
|
-
if (isString) {
|
|
2512
|
-
var shortName = featureName.substr(0, 2);
|
|
2513
|
-
|
|
2514
|
-
if (shortName === '张家') {
|
|
2515
|
-
shortName = featureName.substr(0, 3);
|
|
2516
|
-
}
|
|
2517
|
-
|
|
2518
|
-
return !!fieldName.match(new RegExp(shortName));
|
|
2519
|
-
}
|
|
2520
|
-
|
|
2521
|
-
return false;
|
|
2522
|
-
};
|
|
2523
|
-
|
|
2524
|
-
_proto.getRestMapLayerInfo = function getRestMapLayerInfo(restMapInfo, layer) {
|
|
2525
|
-
var bounds = restMapInfo.bounds,
|
|
2526
|
-
coordUnit = restMapInfo.coordUnit,
|
|
2527
|
-
visibleScales = restMapInfo.visibleScales,
|
|
2528
|
-
url = restMapInfo.url;
|
|
2529
|
-
layer.layerType = 'TILE';
|
|
2530
|
-
layer.orginEpsgCode = this.baseProjection;
|
|
2531
|
-
layer.units = coordUnit && coordUnit.toLowerCase();
|
|
2532
|
-
layer.extent = [bounds.left, bounds.bottom, bounds.right, bounds.top];
|
|
2533
|
-
layer.visibleScales = visibleScales;
|
|
2534
|
-
layer.url = url;
|
|
2535
|
-
layer.sourceType = 'TILE';
|
|
2536
|
-
return layer;
|
|
2537
|
-
};
|
|
2538
|
-
|
|
2539
|
-
_proto.handleLayerFeatures = function handleLayerFeatures(features, layerInfo) {
|
|
2540
|
-
var layerType = layerInfo.layerType,
|
|
2541
|
-
style = layerInfo.style,
|
|
2542
|
-
themeSetting = layerInfo.themeSetting,
|
|
2543
|
-
filterCondition = layerInfo.filterCondition;
|
|
2544
|
-
|
|
2545
|
-
if ((style || themeSetting) && filterCondition) {
|
|
2546
|
-
if (layerType !== 'RANGE' && layerType !== 'UNIQUE' && layerType !== 'RANK_SYMBOL') {
|
|
2547
|
-
features = this.getFilterFeatures(filterCondition, features);
|
|
2548
|
-
}
|
|
2549
|
-
}
|
|
2550
|
-
|
|
2551
|
-
return features;
|
|
2552
|
-
};
|
|
2553
|
-
|
|
2554
|
-
_proto.mergeFeatures = function mergeFeatures(layerId, features, mergeByField) {
|
|
2555
|
-
if (!(features instanceof Array)) {
|
|
2556
|
-
return features;
|
|
2557
|
-
}
|
|
2558
|
-
|
|
2559
|
-
features = features.map(function (feature, index) {
|
|
2560
|
-
if (!Object.prototype.hasOwnProperty.call(feature.properties, 'index')) {
|
|
2561
|
-
feature.properties.index = index;
|
|
2562
|
-
}
|
|
2563
|
-
|
|
2564
|
-
return feature;
|
|
2565
|
-
});
|
|
2566
|
-
|
|
2567
|
-
if (!features.length || !mergeByField && features[0].geometry) {
|
|
2568
|
-
return features;
|
|
2569
|
-
}
|
|
2570
|
-
|
|
2571
|
-
var source = this.map.getSource(layerId);
|
|
2572
|
-
|
|
2573
|
-
if ((!source || !source._data.features) && features[0].geometry) {
|
|
2574
|
-
return features;
|
|
2575
|
-
}
|
|
2576
|
-
|
|
2577
|
-
var prevFeatures = source && source._data && source._data.features;
|
|
2578
|
-
var nextFeatures = [];
|
|
2579
|
-
|
|
2580
|
-
if (!mergeByField && prevFeatures) {
|
|
2581
|
-
return prevFeatures;
|
|
2582
|
-
}
|
|
2583
|
-
|
|
2584
|
-
features.forEach(function (feature) {
|
|
2585
|
-
var prevFeature = prevFeatures.find(function (item) {
|
|
2586
|
-
if (isNaN(+item.properties[mergeByField]) && isNaN(+feature.properties[mergeByField])) {
|
|
2587
|
-
return JSON.stringify(item.properties[mergeByField] || '') === JSON.stringify(feature.properties[mergeByField] || '');
|
|
2588
|
-
} else {
|
|
2589
|
-
return +item.properties[mergeByField] === +feature.properties[mergeByField];
|
|
2590
|
-
}
|
|
2591
|
-
});
|
|
2592
|
-
|
|
2593
|
-
if (prevFeature) {
|
|
2594
|
-
nextFeatures.push(Object.assign(Object.assign({}, prevFeature), feature));
|
|
2595
|
-
} else if (feature.geometry) {
|
|
2596
|
-
nextFeatures.push(feature);
|
|
2597
|
-
}
|
|
2598
|
-
});
|
|
2599
|
-
return nextFeatures;
|
|
2600
|
-
};
|
|
2601
|
-
|
|
2602
|
-
_proto.getFilterFeatures = function getFilterFeatures(filterCondition, allFeatures) {
|
|
2603
|
-
if (!filterCondition) {
|
|
2604
|
-
return allFeatures;
|
|
2605
|
-
}
|
|
2606
|
-
|
|
2607
|
-
var condition = this.replaceFilterCharacter(filterCondition);
|
|
2608
|
-
var filterFeatures = [];
|
|
2609
|
-
|
|
2610
|
-
for (var i = 0; i < allFeatures.length; i++) {
|
|
2611
|
-
var feature = allFeatures[i];
|
|
2612
|
-
var filterResult = void 0;
|
|
2613
|
-
var properties = feature.properties;
|
|
2614
|
-
|
|
2615
|
-
try {
|
|
2616
|
-
condition = this.parseCondition(condition, Object.keys(properties));
|
|
2617
|
-
var filterFeature = this.parseConditionFeature(properties);
|
|
2618
|
-
var sql = 'select * from json where (' + condition + ')';
|
|
2619
|
-
filterResult = window.jsonsql.query(sql, {
|
|
2620
|
-
attributes: filterFeature
|
|
2621
|
-
});
|
|
2622
|
-
} catch (err) {
|
|
2623
|
-
continue;
|
|
2624
|
-
}
|
|
2625
|
-
|
|
2626
|
-
if (filterResult && filterResult.length > 0) {
|
|
2627
|
-
filterFeatures.push(feature);
|
|
2628
|
-
}
|
|
2629
|
-
}
|
|
2630
|
-
|
|
2631
|
-
return filterFeatures;
|
|
2632
|
-
};
|
|
2633
|
-
|
|
2634
|
-
_proto.replaceFilterCharacter = function replaceFilterCharacter(filterString) {
|
|
2635
|
-
filterString = filterString.replace(/=/g, '==').replace(/AND|and/g, '&&').replace(/or|OR/g, '||').replace(/<==/g, '<=').replace(/>==/g, '>=');
|
|
2636
|
-
return filterString;
|
|
2637
|
-
};
|
|
2638
|
-
|
|
2639
|
-
_proto.getParseSpecialCharacter = function getParseSpecialCharacter() {
|
|
2640
|
-
var directory = ['(', ')', '(', ')', ',', ','];
|
|
2641
|
-
var res = {};
|
|
2642
|
-
directory.forEach(function (item, index) {
|
|
2643
|
-
res[item] = "$" + index;
|
|
2644
|
-
});
|
|
2645
|
-
return res;
|
|
2646
|
-
};
|
|
2647
|
-
|
|
2648
|
-
_proto.parseSpecialCharacter = function parseSpecialCharacter(str) {
|
|
2649
|
-
var directory = this.getParseSpecialCharacter();
|
|
2650
|
-
|
|
2651
|
-
for (var key in directory) {
|
|
2652
|
-
var replaceValue = directory[key];
|
|
2653
|
-
var pattern = new RegExp("\\" + key, 'g');
|
|
2654
|
-
|
|
2655
|
-
while (pattern.test(str)) {
|
|
2656
|
-
str = str.replace(pattern, replaceValue);
|
|
2657
|
-
}
|
|
2658
|
-
}
|
|
2659
|
-
|
|
2660
|
-
return str;
|
|
2661
|
-
};
|
|
2662
|
-
|
|
2663
|
-
_proto.parseCondition = function parseCondition(filterCondition, keys) {
|
|
2664
|
-
var _this5 = this;
|
|
2665
|
-
|
|
2666
|
-
var str = filterCondition.replace(/&|\||>|<|=|!/g, ' ');
|
|
2667
|
-
var arr = str.split(' ').filter(function (item) {
|
|
2668
|
-
return item;
|
|
2669
|
-
});
|
|
2670
|
-
var result = filterCondition;
|
|
2671
|
-
arr.forEach(function (item) {
|
|
2672
|
-
var key = keys.find(function (val) {
|
|
2673
|
-
return val === item;
|
|
2674
|
-
});
|
|
2675
|
-
|
|
2676
|
-
if (_this5.startsWithNumber(item) && key) {
|
|
2677
|
-
result = result.replace(key, '$' + key);
|
|
2678
|
-
}
|
|
2679
|
-
|
|
2680
|
-
if (key) {
|
|
2681
|
-
var res = _this5.parseSpecialCharacter(key);
|
|
2682
|
-
|
|
2683
|
-
result = result.replace(key, res);
|
|
2684
|
-
}
|
|
2685
|
-
});
|
|
2686
|
-
return result;
|
|
2687
|
-
};
|
|
2688
|
-
|
|
2689
|
-
_proto.parseConditionFeature = function parseConditionFeature(feature) {
|
|
2690
|
-
var copyValue = {};
|
|
2691
|
-
|
|
2692
|
-
for (var key in feature) {
|
|
2693
|
-
var copyKey = key;
|
|
2694
|
-
|
|
2695
|
-
if (this.startsWithNumber(key)) {
|
|
2696
|
-
copyKey = '$' + key;
|
|
2697
|
-
}
|
|
2698
|
-
|
|
2699
|
-
copyKey = this.parseSpecialCharacter(copyKey);
|
|
2700
|
-
copyValue[copyKey] = feature[key];
|
|
2701
|
-
}
|
|
2702
|
-
|
|
2703
|
-
return copyValue;
|
|
2704
|
-
};
|
|
2705
|
-
|
|
2706
|
-
_proto.startsWithNumber = function startsWithNumber(str) {
|
|
2707
|
-
return /^\d/.test(str);
|
|
2708
|
-
};
|
|
2709
|
-
|
|
2710
|
-
_proto.getEchartsLayerOptions = function getEchartsLayerOptions(layerInfo, features, coordinateSystem) {
|
|
2711
|
-
var properties = this.webMapService.getFeatureProperties(features);
|
|
2712
|
-
|
|
2713
|
-
var lineData = this._createLinesData(layerInfo, properties);
|
|
2714
|
-
|
|
2715
|
-
var pointData = this._createPointsData(lineData, layerInfo, properties);
|
|
2716
|
-
|
|
2717
|
-
var options = this._createOptions(layerInfo, lineData, pointData, coordinateSystem);
|
|
2718
|
-
|
|
2719
|
-
return options;
|
|
2720
|
-
};
|
|
2721
|
-
|
|
2722
|
-
_proto.getDashStyle = function getDashStyle(str, strokeWidth, type) {
|
|
2723
|
-
if (strokeWidth === void 0) {
|
|
2724
|
-
strokeWidth = 1;
|
|
2725
|
-
}
|
|
2726
|
-
|
|
2727
|
-
if (type === void 0) {
|
|
2728
|
-
type = 'array';
|
|
2729
|
-
}
|
|
2730
|
-
|
|
2731
|
-
if (!str) {
|
|
2732
|
-
return type === 'array' ? [] : '';
|
|
2733
|
-
}
|
|
2734
|
-
|
|
2735
|
-
var w = strokeWidth;
|
|
2736
|
-
var dashArr;
|
|
2737
|
-
|
|
2738
|
-
switch (str) {
|
|
2739
|
-
case 'solid':
|
|
2740
|
-
dashArr = [];
|
|
2741
|
-
break;
|
|
2742
|
-
|
|
2743
|
-
case 'dot':
|
|
2744
|
-
dashArr = [1, 4 * w];
|
|
2745
|
-
break;
|
|
2746
|
-
|
|
2747
|
-
case 'dash':
|
|
2748
|
-
dashArr = [4 * w, 4 * w];
|
|
2749
|
-
break;
|
|
2750
|
-
|
|
2751
|
-
case 'dashrailway':
|
|
2752
|
-
dashArr = [8 * w, 12 * w];
|
|
2753
|
-
break;
|
|
2754
|
-
|
|
2755
|
-
case 'dashdot':
|
|
2756
|
-
dashArr = [4 * w, 4 * w, 1 * w, 4 * w];
|
|
2757
|
-
break;
|
|
2758
|
-
|
|
2759
|
-
case 'longdash':
|
|
2760
|
-
dashArr = [8 * w, 4 * w];
|
|
2761
|
-
break;
|
|
2762
|
-
|
|
2763
|
-
case 'longdashdot':
|
|
2764
|
-
dashArr = [8 * w, 4 * w, 1, 4 * w];
|
|
2765
|
-
break;
|
|
2766
|
-
|
|
2767
|
-
default:
|
|
2768
|
-
if (SuperMap.Util.isArray(str)) {
|
|
2769
|
-
dashArr = str;
|
|
2770
|
-
}
|
|
2771
|
-
|
|
2772
|
-
str = SuperMap.String.trim(str).replace(/\s+/g, ',');
|
|
2773
|
-
dashArr = str.replace(/\[|\]/gi, '').split(',');
|
|
2774
|
-
break;
|
|
2775
|
-
}
|
|
2776
|
-
|
|
2777
|
-
dashArr = type === 'array' ? dashArr : dashArr.join(',');
|
|
2778
|
-
return dashArr;
|
|
2779
|
-
};
|
|
2780
|
-
|
|
2781
|
-
_proto.getCanvasFromSVG = function getCanvasFromSVG(svgUrl, divDom, callBack) {
|
|
2782
|
-
var _this6 = this;
|
|
2783
|
-
|
|
2784
|
-
var _a;
|
|
2785
|
-
|
|
2786
|
-
var canvas = document.createElement('canvas');
|
|
2787
|
-
canvas.id = "dataviz-canvas-" + new Date().getTime();
|
|
2788
|
-
canvas.style.display = 'none';
|
|
2789
|
-
divDom.appendChild(canvas);
|
|
2790
|
-
|
|
2791
|
-
if (svgUrl) {
|
|
2792
|
-
var canvgs = ((_a = window.canvg) === null || _a === void 0 ? void 0 : _a.default) ? window.canvg.default : _canvg.default;
|
|
2793
|
-
var ctx = canvas.getContext('2d');
|
|
2794
|
-
canvgs.from(ctx, svgUrl, {
|
|
2795
|
-
ignoreMouse: true,
|
|
2796
|
-
ignoreAnimation: true,
|
|
2797
|
-
forceRedraw: function forceRedraw() {
|
|
2798
|
-
return false;
|
|
2799
|
-
}
|
|
2800
|
-
}).then(function (v) {
|
|
2801
|
-
v.start();
|
|
2802
|
-
|
|
2803
|
-
_this6.canvgsV.push(v);
|
|
2804
|
-
|
|
2805
|
-
if (canvas.width > 300 || canvas.height > 300) {
|
|
2806
|
-
return;
|
|
2807
|
-
}
|
|
2808
|
-
|
|
2809
|
-
callBack(canvas);
|
|
2810
|
-
});
|
|
2811
|
-
} else {
|
|
2812
|
-
callBack(canvas);
|
|
2813
|
-
}
|
|
2814
|
-
};
|
|
2815
|
-
|
|
2816
|
-
_proto.stopCanvg = function stopCanvg() {
|
|
2817
|
-
this.canvgsV.forEach(function (v) {
|
|
2818
|
-
return v.stop();
|
|
2819
|
-
});
|
|
2820
|
-
this.canvgsV = [];
|
|
2821
|
-
};
|
|
2822
|
-
|
|
2823
|
-
_proto.getRangeStyleGroup = function getRangeStyleGroup(layerInfo, features) {
|
|
2824
|
-
var featureType = layerInfo.featureType,
|
|
2825
|
-
style = layerInfo.style,
|
|
2826
|
-
themeSetting = layerInfo.themeSetting;
|
|
2827
|
-
var customSettings = themeSetting.customSettings,
|
|
2828
|
-
themeField = themeSetting.themeField,
|
|
2829
|
-
segmentCount = themeSetting.segmentCount,
|
|
2830
|
-
segmentMethod = themeSetting.segmentMethod,
|
|
2831
|
-
colors = themeSetting.colors;
|
|
2832
|
-
var values = [];
|
|
2833
|
-
var attributes;
|
|
2834
|
-
features.forEach(function (feature) {
|
|
2835
|
-
attributes = feature.properties;
|
|
2836
|
-
|
|
2837
|
-
if (attributes) {
|
|
2838
|
-
var val = attributes[themeField];
|
|
2839
|
-
(val || val === 0) && (0, _lodash.default)(+val) && values.push(parseFloat(val));
|
|
2840
|
-
}
|
|
2841
|
-
}, this);
|
|
2842
|
-
var segements = values && values.length && SuperMap.ArrayStatistic.getArraySegments(values, segmentMethod, segmentCount);
|
|
2843
|
-
|
|
2844
|
-
if (segements) {
|
|
2845
|
-
var itemNum = segmentCount;
|
|
2846
|
-
|
|
2847
|
-
if (attributes && segements[0] === segements[attributes.length - 1]) {
|
|
2848
|
-
itemNum = 1;
|
|
2849
|
-
segements.length = 2;
|
|
2850
|
-
}
|
|
2851
|
-
|
|
2852
|
-
for (var i = 0; i < segements.length; i++) {
|
|
2853
|
-
var value = segements[i];
|
|
2854
|
-
value = i === 0 ? Math.floor(value * 100) / 100 : Math.ceil(value * 100) / 100 + 0.1;
|
|
2855
|
-
segements[i] = Number(value.toFixed(2));
|
|
2856
|
-
}
|
|
2857
|
-
|
|
2858
|
-
var curentColors = colors;
|
|
2859
|
-
curentColors = SuperMap.ColorsPickerUtil.getGradientColors(curentColors, itemNum, 'RANGE');
|
|
2860
|
-
|
|
2861
|
-
for (var index = 0; index < itemNum; index++) {
|
|
2862
|
-
if (index in customSettings) {
|
|
2863
|
-
if (customSettings[index].segment.start) {
|
|
2864
|
-
segements[index] = customSettings[index].segment.start;
|
|
2865
|
-
}
|
|
2866
|
-
|
|
2867
|
-
if (customSettings[index].segment.end) {
|
|
2868
|
-
segements[index + 1] = customSettings[index].segment.end;
|
|
2869
|
-
}
|
|
2870
|
-
}
|
|
2871
|
-
}
|
|
2872
|
-
|
|
2873
|
-
var styleGroups = [];
|
|
2874
|
-
|
|
2875
|
-
for (var _i2 = 0; _i2 < itemNum; _i2++) {
|
|
2876
|
-
var color = curentColors[_i2];
|
|
2877
|
-
|
|
2878
|
-
if (_i2 in customSettings) {
|
|
2879
|
-
if (customSettings[_i2].color) {
|
|
2880
|
-
color = customSettings[_i2].color;
|
|
2881
|
-
}
|
|
2882
|
-
}
|
|
2883
|
-
|
|
2884
|
-
if (featureType === 'LINE') {
|
|
2885
|
-
style.strokeColor = color;
|
|
2886
|
-
} else {
|
|
2887
|
-
style.fillColor = color;
|
|
2888
|
-
}
|
|
2889
|
-
|
|
2890
|
-
var start = segements[_i2];
|
|
2891
|
-
var end = segements[_i2 + 1];
|
|
2892
|
-
var styleObj = JSON.parse(JSON.stringify(style));
|
|
2893
|
-
styleGroups.push({
|
|
2894
|
-
style: styleObj,
|
|
2895
|
-
color: color,
|
|
2896
|
-
start: start,
|
|
2897
|
-
end: end
|
|
2898
|
-
});
|
|
2899
|
-
}
|
|
2900
|
-
|
|
2901
|
-
return styleGroups;
|
|
2902
|
-
}
|
|
2903
|
-
};
|
|
2904
|
-
|
|
2905
|
-
_proto.getCustomSettingColors = function getCustomSettingColors(customSettings, featureType) {
|
|
2906
|
-
var keys = Object.keys(customSettings);
|
|
2907
|
-
var colors = [];
|
|
2908
|
-
keys.forEach(function (key) {
|
|
2909
|
-
if (featureType === 'LINE') {
|
|
2910
|
-
colors.push(customSettings[key].strokeColor);
|
|
2911
|
-
} else {
|
|
2912
|
-
colors.push(customSettings[key].fillColor);
|
|
2913
|
-
}
|
|
2914
|
-
});
|
|
2915
|
-
return colors;
|
|
2916
|
-
};
|
|
2917
|
-
|
|
2918
|
-
_proto.getUniqueStyleGroup = function getUniqueStyleGroup(parameters, features) {
|
|
2919
|
-
var featureType = parameters.featureType,
|
|
2920
|
-
style = parameters.style,
|
|
2921
|
-
themeSetting = parameters.themeSetting;
|
|
2922
|
-
var colors = themeSetting.colors,
|
|
2923
|
-
customSettings = themeSetting.customSettings;
|
|
2924
|
-
var themeField = themeSetting.themeField;
|
|
2925
|
-
var featurePropertie = features && features[0] && features[0].properties || {};
|
|
2926
|
-
Object.keys(featurePropertie).forEach(function (key) {
|
|
2927
|
-
key.toLocaleUpperCase() === themeField.toLocaleUpperCase() && (themeField = key);
|
|
2928
|
-
});
|
|
2929
|
-
var names = [];
|
|
2930
|
-
|
|
2931
|
-
for (var i in features) {
|
|
2932
|
-
var properties = features[i].properties;
|
|
2933
|
-
var name = properties[themeField];
|
|
2934
|
-
var isSaved = false;
|
|
2935
|
-
|
|
2936
|
-
for (var j in names) {
|
|
2937
|
-
if (names[j] === name) {
|
|
2938
|
-
isSaved = true;
|
|
2939
|
-
break;
|
|
2940
|
-
}
|
|
2941
|
-
}
|
|
2942
|
-
|
|
2943
|
-
if (!isSaved) {
|
|
2944
|
-
names.push(name);
|
|
2945
|
-
}
|
|
2946
|
-
}
|
|
2947
|
-
|
|
2948
|
-
var curentColors = colors;
|
|
2949
|
-
curentColors = SuperMap.ColorsPickerUtil.getGradientColors(curentColors, names.length);
|
|
2950
|
-
var usedColors = this.getCustomSettingColors(customSettings, featureType).map(function (item) {
|
|
2951
|
-
return item && item.toLowerCase();
|
|
2952
|
-
});
|
|
2953
|
-
var allColors = SuperMap.ColorsPickerUtil.getGradientColors(colors, names.length + Object.keys(customSettings).length).map(function (item) {
|
|
2954
|
-
return item.toLowerCase();
|
|
2955
|
-
});
|
|
2956
|
-
var newColors = (0, _lodash2.default)(allColors, usedColors);
|
|
2957
|
-
var styleGroup = [];
|
|
2958
|
-
names.forEach(function (name, index) {
|
|
2959
|
-
var color = curentColors[index];
|
|
2960
|
-
var itemStyle = Object.assign({}, style);
|
|
2961
|
-
var customStyle = customSettings[name];
|
|
2962
|
-
|
|
2963
|
-
if (typeof customStyle === 'object') {
|
|
2964
|
-
itemStyle = Object.assign(itemStyle, customStyle);
|
|
2965
|
-
color = itemStyle.fillColor || itemStyle.strokeColor;
|
|
2966
|
-
} else {
|
|
2967
|
-
if (typeof customStyle === 'string') {
|
|
2968
|
-
color = customSettings[name];
|
|
2969
|
-
}
|
|
2970
|
-
|
|
2971
|
-
if (!customStyle) {
|
|
2972
|
-
color = newColors.shift();
|
|
2973
|
-
}
|
|
2974
|
-
|
|
2975
|
-
if (featureType === 'LINE') {
|
|
2976
|
-
itemStyle.strokeColor = color;
|
|
2977
|
-
} else {
|
|
2978
|
-
itemStyle.fillColor = color;
|
|
2979
|
-
}
|
|
2980
|
-
}
|
|
2981
|
-
|
|
2982
|
-
styleGroup.push({
|
|
2983
|
-
color: color,
|
|
2984
|
-
style: itemStyle,
|
|
2985
|
-
value: name,
|
|
2986
|
-
themeField: themeField
|
|
2987
|
-
});
|
|
2988
|
-
}, this);
|
|
2989
|
-
return styleGroup;
|
|
2990
|
-
};
|
|
2991
|
-
|
|
2992
|
-
_proto.transformFeatures = function transformFeatures(features) {
|
|
2993
|
-
var _this7 = this;
|
|
2994
|
-
|
|
2995
|
-
features && features.forEach(function (feature, index) {
|
|
2996
|
-
var coordinates = feature.geometry && feature.geometry.coordinates;
|
|
2997
|
-
|
|
2998
|
-
if (!coordinates || coordinates.length === 0) {
|
|
2999
|
-
return;
|
|
3000
|
-
}
|
|
3001
|
-
|
|
3002
|
-
(0, _meta.coordEach)(feature, function (coordinates) {
|
|
3003
|
-
var transCoordinates = _this7._unproject(coordinates);
|
|
3004
|
-
|
|
3005
|
-
coordinates[0] = transCoordinates[0];
|
|
3006
|
-
coordinates[1] = transCoordinates[1];
|
|
3007
|
-
});
|
|
3008
|
-
features[index] = feature;
|
|
3009
|
-
});
|
|
3010
|
-
return features;
|
|
3011
|
-
};
|
|
3012
|
-
|
|
3013
|
-
_proto._drawTextRectAndGetSize = function _drawTextRectAndGetSize(_ref) {
|
|
3014
|
-
var context = _ref.context,
|
|
3015
|
-
style = _ref.style,
|
|
3016
|
-
textArray = _ref.textArray,
|
|
3017
|
-
lineHeight = _ref.lineHeight,
|
|
3018
|
-
doublePadding = _ref.doublePadding,
|
|
3019
|
-
canvas = _ref.canvas;
|
|
3020
|
-
var backgroundFill = style.backgroundFill;
|
|
3021
|
-
var maxWidth = style.maxWidth - doublePadding;
|
|
3022
|
-
var width = 0;
|
|
3023
|
-
var height = 0;
|
|
3024
|
-
var lineCount = 0;
|
|
3025
|
-
var lineWidths = [];
|
|
3026
|
-
textArray.forEach(function (arrText) {
|
|
3027
|
-
var line = '';
|
|
3028
|
-
var isOverMax = false;
|
|
3029
|
-
lineCount++;
|
|
3030
|
-
|
|
3031
|
-
for (var n = 0; n < arrText.length; n++) {
|
|
3032
|
-
var textLine = line + arrText[n];
|
|
3033
|
-
var metrics = context.measureText(textLine);
|
|
3034
|
-
var textWidth = metrics.width;
|
|
3035
|
-
|
|
3036
|
-
if (textWidth > maxWidth && n > 0 || arrText[n] === '\n') {
|
|
3037
|
-
line = arrText[n];
|
|
3038
|
-
lineCount++;
|
|
3039
|
-
isOverMax = true;
|
|
3040
|
-
} else {
|
|
3041
|
-
line = textLine;
|
|
3042
|
-
width = textWidth;
|
|
3043
|
-
}
|
|
3044
|
-
}
|
|
3045
|
-
|
|
3046
|
-
if (isOverMax) {
|
|
3047
|
-
lineWidths.push(maxWidth);
|
|
3048
|
-
} else {
|
|
3049
|
-
lineWidths.push(width);
|
|
3050
|
-
}
|
|
3051
|
-
}, this);
|
|
3052
|
-
|
|
3053
|
-
for (var i = 0; i < lineWidths.length; i++) {
|
|
3054
|
-
var lineW = lineWidths[i];
|
|
3055
|
-
|
|
3056
|
-
if (lineW >= maxWidth) {
|
|
3057
|
-
width = maxWidth;
|
|
3058
|
-
break;
|
|
3059
|
-
} else if (lineW > width) {
|
|
3060
|
-
width = lineW;
|
|
3061
|
-
}
|
|
3062
|
-
}
|
|
3063
|
-
|
|
3064
|
-
width += doublePadding;
|
|
3065
|
-
height = lineCount * lineHeight + doublePadding - 6;
|
|
3066
|
-
canvas.width = width;
|
|
3067
|
-
canvas.height = height;
|
|
3068
|
-
context.fillStyle = backgroundFill;
|
|
3069
|
-
context.fillRect(0, 0, width, height);
|
|
3070
|
-
context.lineWidth = style.borderWidth;
|
|
3071
|
-
context.strokeStyle = style.borderColor;
|
|
3072
|
-
context.strokeRect(0, 0, width, height);
|
|
3073
|
-
return {
|
|
3074
|
-
width: width,
|
|
3075
|
-
height: height
|
|
3076
|
-
};
|
|
3077
|
-
};
|
|
3078
|
-
|
|
3079
|
-
_proto._drawTextWithCanvas = function _drawTextWithCanvas(_ref2) {
|
|
3080
|
-
var context = _ref2.context,
|
|
3081
|
-
canvas = _ref2.canvas,
|
|
3082
|
-
style = _ref2.style;
|
|
3083
|
-
var padding = 8;
|
|
3084
|
-
var doublePadding = padding * 2;
|
|
3085
|
-
var lineHeight = Number(style.font.replace(/[^0-9]/ig, '')) + 3;
|
|
3086
|
-
var textArray = style.text.split('\r\n');
|
|
3087
|
-
context.font = style.font;
|
|
3088
|
-
|
|
3089
|
-
var size = this._drawTextRectAndGetSize({
|
|
3090
|
-
context: context,
|
|
3091
|
-
style: style,
|
|
3092
|
-
textArray: textArray,
|
|
3093
|
-
lineHeight: lineHeight,
|
|
3094
|
-
doublePadding: doublePadding,
|
|
3095
|
-
canvas: canvas
|
|
3096
|
-
});
|
|
3097
|
-
|
|
3098
|
-
var positionY = padding;
|
|
3099
|
-
textArray.forEach(function (text, i) {
|
|
3100
|
-
if (i !== 0) {
|
|
3101
|
-
positionY = positionY + lineHeight;
|
|
3102
|
-
}
|
|
3103
|
-
|
|
3104
|
-
context.font = style.font;
|
|
3105
|
-
var textAlign = style.textAlign;
|
|
3106
|
-
var x;
|
|
3107
|
-
var width = size.width - doublePadding;
|
|
3108
|
-
|
|
3109
|
-
switch (textAlign) {
|
|
3110
|
-
case 'center':
|
|
3111
|
-
x = width / 2;
|
|
3112
|
-
break;
|
|
3113
|
-
|
|
3114
|
-
case 'right':
|
|
3115
|
-
x = width;
|
|
3116
|
-
break;
|
|
3117
|
-
|
|
3118
|
-
default:
|
|
3119
|
-
x = 8;
|
|
3120
|
-
break;
|
|
3121
|
-
}
|
|
3122
|
-
|
|
3123
|
-
var arrText = text.split('');
|
|
3124
|
-
var line = '';
|
|
3125
|
-
var fillColor = style.fillColor;
|
|
3126
|
-
var maxWidth = style.maxWidth - doublePadding;
|
|
3127
|
-
|
|
3128
|
-
for (var n = 0; n < arrText.length; n++) {
|
|
3129
|
-
var testLine = line + arrText[n];
|
|
3130
|
-
var metrics = context.measureText(testLine);
|
|
3131
|
-
var testWidth = metrics.width;
|
|
3132
|
-
|
|
3133
|
-
if (testWidth > maxWidth && n > 0 || arrText[n] === '\n') {
|
|
3134
|
-
context.fillStyle = fillColor;
|
|
3135
|
-
context.textAlign = textAlign;
|
|
3136
|
-
context.textBaseline = 'top';
|
|
3137
|
-
context.fillText(line, x, positionY);
|
|
3138
|
-
line = arrText[n];
|
|
3139
|
-
positionY += lineHeight;
|
|
3140
|
-
} else {
|
|
3141
|
-
line = testLine;
|
|
3142
|
-
}
|
|
3143
|
-
}
|
|
3144
|
-
|
|
3145
|
-
context.fillStyle = fillColor;
|
|
3146
|
-
context.textAlign = textAlign;
|
|
3147
|
-
context.textBaseline = 'top';
|
|
3148
|
-
context.fillText(line, x, positionY);
|
|
3149
|
-
}, this);
|
|
3150
|
-
};
|
|
3151
|
-
|
|
3152
|
-
_proto.handleSvgColor = function handleSvgColor(style, canvas) {
|
|
3153
|
-
var fillColor = style.fillColor,
|
|
3154
|
-
fillOpacity = style.fillOpacity,
|
|
3155
|
-
strokeColor = style.strokeColor,
|
|
3156
|
-
strokeOpacity = style.strokeOpacity,
|
|
3157
|
-
strokeWidth = style.strokeWidth;
|
|
3158
|
-
var context = canvas.getContext('2d');
|
|
3159
|
-
|
|
3160
|
-
if (style.text) {
|
|
3161
|
-
this._drawTextWithCanvas({
|
|
3162
|
-
context: context,
|
|
3163
|
-
canvas: canvas,
|
|
3164
|
-
style: style
|
|
3165
|
-
});
|
|
3166
|
-
|
|
3167
|
-
return;
|
|
3168
|
-
}
|
|
3169
|
-
|
|
3170
|
-
if (fillColor) {
|
|
3171
|
-
context.fillStyle = (0, _util.getColorWithOpacity)(fillColor, fillOpacity);
|
|
3172
|
-
context.fill();
|
|
3173
|
-
}
|
|
3174
|
-
|
|
3175
|
-
if (strokeColor || strokeWidth) {
|
|
3176
|
-
context.strokeStyle = (0, _util.getColorWithOpacity)(strokeColor, strokeOpacity);
|
|
3177
|
-
context.lineWidth = strokeWidth;
|
|
3178
|
-
context.stroke();
|
|
3179
|
-
}
|
|
3180
|
-
};
|
|
3181
|
-
|
|
3182
|
-
_proto._createLinesData = function _createLinesData(layerInfo, properties) {
|
|
3183
|
-
var _this8 = this;
|
|
3184
|
-
|
|
3185
|
-
var data = [];
|
|
3186
|
-
|
|
3187
|
-
if (properties && properties.length) {
|
|
3188
|
-
var from = layerInfo.from;
|
|
3189
|
-
var to = layerInfo.to;
|
|
3190
|
-
var fromCoord;
|
|
3191
|
-
var toCoord;
|
|
3192
|
-
|
|
3193
|
-
if (from.type === 'XY_FIELD' && from.xField && from.yField && to.xField && to.yField) {
|
|
3194
|
-
properties.forEach(function (property) {
|
|
3195
|
-
var fromX = property[from.xField];
|
|
3196
|
-
var fromY = property[from.yField];
|
|
3197
|
-
var toX = property[to.xField];
|
|
3198
|
-
var toY = property[to.yField];
|
|
3199
|
-
|
|
3200
|
-
if (!fromX || !fromY || !toX || !toY) {
|
|
3201
|
-
return;
|
|
3202
|
-
}
|
|
3203
|
-
|
|
3204
|
-
fromCoord = [property[from.xField], property[from.yField]];
|
|
3205
|
-
toCoord = [property[to.xField], property[to.yField]];
|
|
3206
|
-
data.push({
|
|
3207
|
-
coords: [fromCoord, toCoord]
|
|
3208
|
-
});
|
|
3209
|
-
});
|
|
3210
|
-
} else if (from.type === 'PLACE_FIELD' && from.field && to.field) {
|
|
3211
|
-
var centerDatas = _ProvinceCenter.default.concat(_MunicipalCenter.default);
|
|
3212
|
-
|
|
3213
|
-
properties.forEach(function (property) {
|
|
3214
|
-
var fromField = property[from.field];
|
|
3215
|
-
var toField = property[to.field];
|
|
3216
|
-
fromCoord = centerDatas.find(function (item) {
|
|
3217
|
-
return _this8.isMatchAdministrativeName(item.name, fromField);
|
|
3218
|
-
});
|
|
3219
|
-
toCoord = centerDatas.find(function (item) {
|
|
3220
|
-
return _this8.isMatchAdministrativeName(item.name, toField);
|
|
3221
|
-
});
|
|
3222
|
-
|
|
3223
|
-
if (!fromCoord || !toCoord) {
|
|
3224
|
-
return;
|
|
3225
|
-
}
|
|
3226
|
-
|
|
3227
|
-
data.push({
|
|
3228
|
-
coords: [fromCoord.coord, toCoord.coord]
|
|
3229
|
-
});
|
|
3230
|
-
});
|
|
3231
|
-
}
|
|
3232
|
-
}
|
|
3233
|
-
|
|
3234
|
-
return data;
|
|
3235
|
-
};
|
|
3236
|
-
|
|
3237
|
-
_proto._createPointsData = function _createPointsData(lineData, layerInfo, properties) {
|
|
3238
|
-
var data = [];
|
|
3239
|
-
var labelSetting = layerInfo.labelSetting;
|
|
3240
|
-
|
|
3241
|
-
if (!labelSetting.show || !lineData.length) {
|
|
3242
|
-
return data;
|
|
3243
|
-
}
|
|
3244
|
-
|
|
3245
|
-
var fromData = [];
|
|
3246
|
-
var toData = [];
|
|
3247
|
-
lineData.forEach(function (item, idx) {
|
|
3248
|
-
var coords = item.coords;
|
|
3249
|
-
var fromCoord = coords[0];
|
|
3250
|
-
var toCoord = coords[1];
|
|
3251
|
-
var fromProperty = properties[idx][labelSetting.from];
|
|
3252
|
-
var toProperty = properties[idx][labelSetting.to];
|
|
3253
|
-
var f = fromData.find(function (d) {
|
|
3254
|
-
return d.value[0] === fromCoord[0] && d.value[1] === fromCoord[1];
|
|
3255
|
-
});
|
|
3256
|
-
!f && fromData.push({
|
|
3257
|
-
name: fromProperty,
|
|
3258
|
-
value: fromCoord
|
|
3259
|
-
});
|
|
3260
|
-
var t = toData.find(function (d) {
|
|
3261
|
-
return d.value[0] === toCoord[0] && d.value[1] === toCoord[1];
|
|
3262
|
-
});
|
|
3263
|
-
!t && toData.push({
|
|
3264
|
-
name: toProperty,
|
|
3265
|
-
value: toCoord
|
|
3266
|
-
});
|
|
3267
|
-
});
|
|
3268
|
-
data = fromData.concat(toData);
|
|
3269
|
-
return data;
|
|
3270
|
-
};
|
|
3271
|
-
|
|
3272
|
-
_proto._createOptions = function _createOptions(layerInfo, lineData, pointData, coordinateSystem) {
|
|
3273
|
-
var series;
|
|
3274
|
-
|
|
3275
|
-
var lineSeries = this._createLineSeries(layerInfo, lineData, coordinateSystem);
|
|
3276
|
-
|
|
3277
|
-
if (pointData && pointData.length) {
|
|
3278
|
-
var pointSeries = this._createPointSeries(layerInfo, pointData, coordinateSystem);
|
|
3279
|
-
|
|
3280
|
-
series = lineSeries.concat(pointSeries);
|
|
3281
|
-
} else {
|
|
3282
|
-
series = lineSeries.slice();
|
|
3283
|
-
}
|
|
3284
|
-
|
|
3285
|
-
return {
|
|
3286
|
-
series: series
|
|
3287
|
-
};
|
|
3288
|
-
};
|
|
3289
|
-
|
|
3290
|
-
_proto._createPointSeries = function _createPointSeries(layerInfo, pointData, coordinateSystem) {
|
|
3291
|
-
var lineSetting = layerInfo.lineSetting;
|
|
3292
|
-
var animationSetting = layerInfo.animationSetting;
|
|
3293
|
-
var labelSetting = layerInfo.labelSetting;
|
|
3294
|
-
var pointSeries = [{
|
|
3295
|
-
name: 'point-series',
|
|
3296
|
-
coordinateSystem: coordinateSystem,
|
|
3297
|
-
zlevel: 2,
|
|
3298
|
-
label: {
|
|
3299
|
-
normal: {
|
|
3300
|
-
show: labelSetting.show,
|
|
3301
|
-
position: 'right',
|
|
3302
|
-
formatter: '{b}',
|
|
3303
|
-
color: labelSetting.color,
|
|
3304
|
-
fontFamily: labelSetting.fontFamily
|
|
3305
|
-
}
|
|
3306
|
-
},
|
|
3307
|
-
itemStyle: {
|
|
3308
|
-
normal: {
|
|
3309
|
-
color: lineSetting.color || labelSetting.color
|
|
3310
|
-
}
|
|
3311
|
-
},
|
|
3312
|
-
data: pointData
|
|
3313
|
-
}];
|
|
3314
|
-
|
|
3315
|
-
if (animationSetting.show) {
|
|
3316
|
-
pointSeries[0].type = 'effectScatter';
|
|
3317
|
-
pointSeries[0].rippleEffect = {
|
|
3318
|
-
brushType: 'stroke'
|
|
3319
|
-
};
|
|
3320
|
-
} else {
|
|
3321
|
-
pointSeries[0].type = 'scatter';
|
|
3322
|
-
}
|
|
3323
|
-
|
|
3324
|
-
return pointSeries;
|
|
3325
|
-
};
|
|
3326
|
-
|
|
3327
|
-
_proto._createLineSeries = function _createLineSeries(layerInfo, lineData, coordinateSystem) {
|
|
3328
|
-
var lineSetting = layerInfo.lineSetting;
|
|
3329
|
-
var animationSetting = layerInfo.animationSetting;
|
|
3330
|
-
var linesSeries = [{
|
|
3331
|
-
name: 'line-series',
|
|
3332
|
-
coordinateSystem: coordinateSystem,
|
|
3333
|
-
type: 'lines',
|
|
3334
|
-
zlevel: 1,
|
|
3335
|
-
effect: {
|
|
3336
|
-
show: animationSetting.show,
|
|
3337
|
-
constantSpeed: animationSetting.constantSpeed,
|
|
3338
|
-
trailLength: 0,
|
|
3339
|
-
symbol: animationSetting.symbol,
|
|
3340
|
-
symbolSize: animationSetting.symbolSize
|
|
3341
|
-
},
|
|
3342
|
-
lineStyle: {
|
|
3343
|
-
normal: {
|
|
3344
|
-
color: lineSetting.color,
|
|
3345
|
-
type: lineSetting.type,
|
|
3346
|
-
width: lineSetting.width,
|
|
3347
|
-
opacity: lineSetting.opacity,
|
|
3348
|
-
curveness: lineSetting.curveness
|
|
3349
|
-
}
|
|
3350
|
-
},
|
|
3351
|
-
data: lineData
|
|
3352
|
-
}];
|
|
3353
|
-
|
|
3354
|
-
if (lineData.length >= MAX_MIGRATION_ANIMATION_COUNT) {
|
|
3355
|
-
linesSeries[0].large = true;
|
|
3356
|
-
linesSeries[0].largeThreshold = 100;
|
|
3357
|
-
linesSeries[0].blendMode = 'lighter';
|
|
3358
|
-
}
|
|
3359
|
-
|
|
3360
|
-
return linesSeries;
|
|
3361
|
-
};
|
|
3362
|
-
|
|
3363
|
-
_proto._getLayerFeaturesSucceeded = function _getLayerFeaturesSucceeded(result, layer) {
|
|
3364
|
-
switch (result.type) {
|
|
3365
|
-
case 'feature':
|
|
3366
|
-
this._initOverlayLayer(layer, result.features);
|
|
3367
|
-
|
|
3368
|
-
break;
|
|
3369
|
-
|
|
3370
|
-
case 'restMap':
|
|
3371
|
-
layer.layerType = 'restMap';
|
|
3372
|
-
|
|
3373
|
-
this._initOverlayLayer(layer, result.restMaps);
|
|
3374
|
-
|
|
3375
|
-
break;
|
|
3376
|
-
|
|
3377
|
-
case 'mvt':
|
|
3378
|
-
layer.layerType = 'mvt';
|
|
3379
|
-
|
|
3380
|
-
this._initOverlayLayer(layer, result);
|
|
3381
|
-
|
|
3382
|
-
break;
|
|
3383
|
-
|
|
3384
|
-
case 'dataflow':
|
|
3385
|
-
case 'noServerId':
|
|
3386
|
-
this._initOverlayLayer(layer);
|
|
3387
|
-
|
|
3388
|
-
break;
|
|
3389
|
-
}
|
|
3390
|
-
};
|
|
3391
|
-
|
|
3392
|
-
return WebMapBase;
|
|
3393
|
-
}(_Events2.Events);
|
|
3394
|
-
|
|
3395
|
-
/***/ }),
|
|
3396
|
-
|
|
3397
|
-
/***/ 521:
|
|
3398
|
-
/***/ (function(module) {
|
|
3399
|
-
|
|
3400
|
-
module.exports = JSON.parse("[{\"name\":\"克拉玛依市\",\"coord\":[85.01486759299489,45.406422237230046]},{\"name\":\"昌吉回族自治州\",\"coord\":[88.7154624754753,44.26991024636568]},{\"name\":\"石河子市\",\"coord\":[86.0208600035924,44.239045558096805]},{\"name\":\"霍林郭勒市\",\"coord\":[114.73479243733115,44.16058374713977]},{\"name\":\"本溪市\",\"coord\":[124.64357865201586,41.177197783134275]},{\"name\":\"嘉峪关市\",\"coord\":[98.16891560537093,39.76279786284264]},{\"name\":\"莱芜市\",\"coord\":[117.65723565456207,36.27916499211527]},{\"name\":\"神农架林区\",\"coord\":[110.48296222218153,31.581260143666697]},{\"name\":\"天门市\",\"coord\":[113.00615321481195,30.64105781887143]},{\"name\":\"鄂州市\",\"coord\":[114.94764081970385,30.325634953844585]},{\"name\":\"潜江市\",\"coord\":[112.70703817700621,30.349210666019893]},{\"name\":\"仙桃市\",\"coord\":[113.34688900729822,30.315951161935402]},{\"name\":\"萍乡市\",\"coord\":[113.88072263074415,27.47193090553213]},{\"name\":\"台湾省\",\"coord\":[120.14338943402045,23.596002465926095]},{\"name\":\"东莞市\",\"coord\":[113.89443658529342,22.897826158636448]},{\"name\":\"中山市\",\"coord\":[113.37118387764659,22.501478858616522]},{\"name\":\"珠海市\",\"coord\":[113.21799258934986,22.23782602992192]},{\"name\":\"北海市\",\"coord\":[109.18248083043899,21.695773689750148]},{\"name\":\"香港\",\"coord\":[114.20689279508653,22.36016760139811]},{\"name\":\"舟山市\",\"coord\":[122.22514712841459,30.338633120695956]},{\"name\":\"克孜勒苏柯尔克孜\",\"coord\":[74.62910472637343,39.59886016069875]},{\"name\":\"喀什地区\",\"coord\":[77.19899922143753,37.85462871211595]},{\"name\":\"阿克苏地区\",\"coord\":[81.43930290016381,41.067304799230456]},{\"name\":\"和田地区\",\"coord\":[80.69780509160952,36.95287032287055]},{\"name\":\"阿里地区\",\"coord\":[82.536487505389,32.69566569631762]},{\"name\":\"日喀则地区\",\"coord\":[86.5996831353606,29.54861754814263]},{\"name\":\"那曲地区\",\"coord\":[88.32523292667608,33.20600450932715]},{\"name\":\"玉树藏族自治州\",\"coord\":[95.2107128446203,33.90320387919257]},{\"name\":\"迪庆藏族自治州\",\"coord\":[99.42465312188943,28.052797714348895]},{\"name\":\"怒江傈傈族自治州\",\"coord\":[98.85737910439825,26.98345757528851]},{\"name\":\"大理白族自治州\",\"coord\":[99.93934374816013,25.684737357453045]},{\"name\":\"德宏傣族景颇族自\",\"coord\":[98.13830877778075,24.593421919561205]},{\"name\":\"保山市\",\"coord\":[99.19031013453166,24.979380341662]},{\"name\":\"临沧市\",\"coord\":[99.62483778975081,24.058807858948214]},{\"name\":\"普洱市\",\"coord\":[100.94440267992684,23.44121660743221]},{\"name\":\"西双版纳傣族自治\",\"coord\":[100.86105801845994,21.882475641324206]},{\"name\":\"拉萨市\",\"coord\":[91.3684790613129,30.14176592960237]},{\"name\":\"山南地区\",\"coord\":[92.11665242621062,28.33000201578789]},{\"name\":\"林芝地区\",\"coord\":[94.9307847458166,29.125110156601963]},{\"name\":\"昌都地区\",\"coord\":[97.33912235873476,30.48520825551814]},{\"name\":\"丽江市\",\"coord\":[100.65713436205135,26.96190318191959]},{\"name\":\"攀枝花市\",\"coord\":[101.73355913301131,26.714486678752795]},{\"name\":\"凉山彝族自治州\",\"coord\":[102.08678551422615,27.683020519860396]},{\"name\":\"楚雄彝族自治州\",\"coord\":[101.68264761198458,25.369603845264024]},{\"name\":\"红河哈尼族彝族自\",\"coord\":[102.95101719613119,23.624860095239875]},{\"name\":\"文山壮族苗族自治\",\"coord\":[104.8708359910614,23.579587266862504]},{\"name\":\"百色市\",\"coord\":[106.69546907589859,23.98220841166522]},{\"name\":\"崇左市\",\"coord\":[107.3277087317123,22.49769755349952]},{\"name\":\"防城港市\",\"coord\":[107.88939931155171,21.94550204069006]},{\"name\":\"南宁市\",\"coord\":[108.67078983716917,23.12207641861882]},{\"name\":\"钦州市\",\"coord\":[108.8532307305186,22.157690108421384]},{\"name\":\"玉林市\",\"coord\":[110.26918466489103,22.391823643610415]},{\"name\":\"湛江市\",\"coord\":[109.93033457863683,21.086751055633457]},{\"name\":\"茂名市\",\"coord\":[110.80336192333934,22.069184739040775]},{\"name\":\"阳江市\",\"coord\":[111.70471342186183,22.108751366417575]},{\"name\":\"江门市\",\"coord\":[112.53715618649149,22.297368082806777]},{\"name\":\"广州市\",\"coord\":[113.4949302208309,23.28359314707863]},{\"name\":\"清远市\",\"coord\":[113.10957368131268,24.334444053233856]},{\"name\":\"肇庆市\",\"coord\":[112.11117530204233,23.60241158796112]},{\"name\":\"梧州市\",\"coord\":[111.01709510772797,23.518132876753846]},{\"name\":\"贺州市\",\"coord\":[111.50423061842756,24.4095096817199]},{\"name\":\"桂林市\",\"coord\":[110.44046163393094,25.353966673735407]},{\"name\":\"柳州市\",\"coord\":[109.34854449214147,24.972408051485047]},{\"name\":\"河池市\",\"coord\":[107.81191841865586,24.649291651298164]},{\"name\":\"黔东南苗族侗族自\",\"coord\":[108.39952601614591,26.429286420465576]},{\"name\":\"贵阳市\",\"coord\":[106.59784062851153,26.797907456479816]},{\"name\":\"安顺市\",\"coord\":[105.76161265300635,25.988644902171018]},{\"name\":\"黔西南布依族苗族\",\"coord\":[105.5954078788574,25.404850939549405]},{\"name\":\"曲靖市\",\"coord\":[103.9164335632742,25.697243690315265]},{\"name\":\"六盘水市\",\"coord\":[104.77723228072432,26.15402255629164]},{\"name\":\"毕节地区\",\"coord\":[105.03867422931839,27.077913968069666]},{\"name\":\"昭通市\",\"coord\":[104.29730513046874,27.62418247971078]},{\"name\":\"宜宾市\",\"coord\":[104.76748901448207,28.553501804266475]},{\"name\":\"乐山市\",\"coord\":[103.56027669102787,29.160754519210577]},{\"name\":\"自贡市\",\"coord\":[104.63272827056402,29.273152614922402]},{\"name\":\"内江市\",\"coord\":[104.82644562304716,29.61272653799929]},{\"name\":\"遵义市\",\"coord\":[106.82413636302059,28.191847588570702]},{\"name\":\"达州市\",\"coord\":[107.59704170009518,31.32138258839703]},{\"name\":\"遂宁市\",\"coord\":[105.48979445433736,30.677687821242678]},{\"name\":\"广安市\",\"coord\":[106.56708164098042,30.43500706741521]},{\"name\":\"泸州市\",\"coord\":[105.42591761727707,28.50277238478137]},{\"name\":\"资阳市\",\"coord\":[104.97995126874034,30.154251886139654]},{\"name\":\"雅安市\",\"coord\":[102.69931299964517,29.892630706195035]},{\"name\":\"眉山市\",\"coord\":[104.07052881858888,29.894202166560405]},{\"name\":\"甘孜藏族自治州\",\"coord\":[100.50721042614238,30.975216556269658]},{\"name\":\"果洛藏族自治州\",\"coord\":[99.30775565051923,34.03539865224808]},{\"name\":\"海南藏族自治州\",\"coord\":[100.39969108016373,35.90048272566899]},{\"name\":\"黄南藏族自治州\",\"coord\":[101.5360706381689,35.10286360841902]},{\"name\":\"赣南藏族自治州\",\"coord\":[102.97083885806067,34.326752803339026]},{\"name\":\"陇南市\",\"coord\":[105.24780098912132,33.57031117443431]},{\"name\":\"天水市\",\"coord\":[105.53503634660417,34.62320421368087]},{\"name\":\"定西市\",\"coord\":[104.58787768541339,35.08900966621695]},{\"name\":\"临夏回族自治州\",\"coord\":[103.2612870434902,35.591577124455235]},{\"name\":\"西宁市\",\"coord\":[101.57680657999033,36.84800271717157]},{\"name\":\"海东地区\",\"coord\":[102.30909850729282,36.287400615025646]},{\"name\":\"海北藏族自治州\",\"coord\":[100.27122484450717,37.892557516083826]},{\"name\":\"金昌市\",\"coord\":[102.02244049169511,38.497330414886164]},{\"name\":\"酒泉市\",\"coord\":[95.94486678270127,40.56891536586272]},{\"name\":\"海西蒙古族藏族自\",\"coord\":[94.67143298050689,36.022725148503724]},{\"name\":\"巴音郭楞蒙古自治\",\"coord\":[88.18116214759745,39.556478810319916]},{\"name\":\"哈密地区\",\"coord\":[93.84302392518026,42.95015211178875]},{\"name\":\"叶鲁番地区\",\"coord\":[89.82035217277885,42.399368632283505]},{\"name\":\"乌鲁木齐市\",\"coord\":[88.00048109561487,43.549986370786]},{\"name\":\"阿勒泰地区\",\"coord\":[88.11213933257655,47.05593413019629]},{\"name\":\"博尔塔拉蒙古自治\",\"coord\":[82.26402238163408,44.671135542630864]},{\"name\":\"伊犁哈萨克自治州\",\"coord\":[82.80778717477179,43.53783381365267]},{\"name\":\"阿拉善盟\",\"coord\":[103.29923966842289,40.10955801781495]},{\"name\":\"武威市\",\"coord\":[102.73362058791429,37.94211141321436]},{\"name\":\"兰州市\",\"coord\":[103.73793563506032,36.27379827886003]},{\"name\":\"中卫市\",\"coord\":[105.6943786030716,37.20654236148948]},{\"name\":\"银川市\",\"coord\":[106.20022174140034,38.52103167597483]},{\"name\":\"石嘴山市\",\"coord\":[106.41544011793628,38.84054137571417]},{\"name\":\"乌海市\",\"coord\":[106.8984175998405,39.54616572239788]},{\"name\":\"鄂尔多斯市\",\"coord\":[108.43285571424619,39.24036799350715]},{\"name\":\"巴彦淖尔市\",\"coord\":[107.45840392808307,41.30159860424196]},{\"name\":\"包头市\",\"coord\":[110.46472193224272,41.48017783644221]},{\"name\":\"呼和浩特市\",\"coord\":[111.48365173603975,40.498363056149884]},{\"name\":\"乌兰察布市\",\"coord\":[112.61568977597707,41.75789561273154]},{\"name\":\"大同市\",\"coord\":[113.7107192749083,39.898956799744184]},{\"name\":\"朔州市\",\"coord\":[112.65428748167508,39.681772914701924]},{\"name\":\"忻州市\",\"coord\":[112.36127575589583,38.88990233614568]},{\"name\":\"榆林市\",\"coord\":[109.68473112169593,38.19921027134876]},{\"name\":\"延安市\",\"coord\":[109.52425222161318,36.406522726136814]},{\"name\":\"庆阳市\",\"coord\":[107.73052193155061,36.183821532624464]},{\"name\":\"固原市\",\"coord\":[106.20191575442442,36.11634909496382]},{\"name\":\"白银市\",\"coord\":[104.68634478137065,36.51582865625868]},{\"name\":\"宝鸡市\",\"coord\":[107.33534779230747,34.3387216485855]},{\"name\":\"汉中市\",\"coord\":[107.03534754266246,33.00142998064871]},{\"name\":\"广元市\",\"coord\":[105.92928137563939,32.21872447205537]},{\"name\":\"巴中市\",\"coord\":[107.03422410306194,31.99874720836291]},{\"name\":\"南充市\",\"coord\":[106.32964805032347,31.156657700184095]},{\"name\":\"绵阳市\",\"coord\":[104.58949560201106,31.88628780630976]},{\"name\":\"德阳市\",\"coord\":[104.41542984932845,31.110558133718676]},{\"name\":\"成都市\",\"coord\":[103.8852290010473,30.777258040348634]},{\"name\":\"阿坝藏族羌族自治\",\"coord\":[102.26209319552814,32.45725845387284]},{\"name\":\"安康市\",\"coord\":[109.14236501848015,32.77467694678074]},{\"name\":\"十堰市\",\"coord\":[110.39934083416314,32.376209039347906]},{\"name\":\"襄阳市\",\"coord\":[111.97539147094662,31.93399822417465]},{\"name\":\"宜昌市\",\"coord\":[111.22204852395754,30.772457669035354]},{\"name\":\"恩施市\",\"coord\":[109.42158366502872,30.260366574390105]},{\"name\":\"张家界市\",\"coord\":[110.59760006538717,29.330107409240718]},{\"name\":\"吉首市\",\"coord\":[109.72176899848378,28.681903937242495]},{\"name\":\"铜仁地区\",\"coord\":[108.54247523485463,28.11736237519646]},{\"name\":\"重庆市\",\"coord\":[107.86007108564992,30.186253395053196]},{\"name\":\"怀化市\",\"coord\":[109.94325166787243,27.43919084801186]},{\"name\":\"益阳市\",\"coord\":[112.43060358108062,28.75127294553697]},{\"name\":\"娄底市\",\"coord\":[111.41891416951897,27.696312460064604]},{\"name\":\"常德市\",\"coord\":[111.72571610131646,29.27189463838195]},{\"name\":\"荆州市\",\"coord\":[112.65896596965268,30.05161542755362]},{\"name\":\"荆门市\",\"coord\":[112.6586855902184,31.01267124474617]},{\"name\":\"岳阳市\",\"coord\":[113.2595036144316,29.106247116930163]},{\"name\":\"长沙市\",\"coord\":[113.15415586456598,28.222934680488425]},{\"name\":\"湘潭市\",\"coord\":[112.51092596317824,27.69881544105668]},{\"name\":\"株州市\",\"coord\":[113.49665538546823,27.03993794610501]},{\"name\":\"衡阳市\",\"coord\":[112.48849636578527,26.783613569970782]},{\"name\":\"邵阳市\",\"coord\":[110.6723832117475,26.81652287086792]},{\"name\":\"永州市\",\"coord\":[111.8565364154186,25.768488267811968]},{\"name\":\"韶关市\",\"coord\":[113.53420325850979,24.69848878771937]},{\"name\":\"惠州市\",\"coord\":[114.32029589634925,23.25504544231892]},{\"name\":\"佛山市\",\"coord\":[112.95925897403649,23.10116677189257]},{\"name\":\"云浮市\",\"coord\":[111.78042514904234,22.840400494105687]},{\"name\":\"深圳市\",\"coord\":[114.13138648919008,22.649563063468342]},{\"name\":\"汕尾市\",\"coord\":[115.57412892884373,23.06989642104901]},{\"name\":\"河源市\",\"coord\":[114.89746229844398,23.97971937124767]},{\"name\":\"揭阳市\",\"coord\":[116.04290004239446,23.304802704715357]},{\"name\":\"汕头市\",\"coord\":[116.7008461897183,23.35898625947344]},{\"name\":\"潮州市\",\"coord\":[116.75405548481658,23.854381508863064]},{\"name\":\"梅州市\",\"coord\":[116.13719397345734,24.15633544812716]},{\"name\":\"漳州市\",\"coord\":[117.38279760543345,24.41111215459575]},{\"name\":\"厦门市\",\"coord\":[118.04275971554665,24.675908246507944]},{\"name\":\"龙岩市\",\"coord\":[116.69341144552507,25.20284542644492]},{\"name\":\"泉州市\",\"coord\":[118.12035864630246,25.22984144365049]},{\"name\":\"莆田市\",\"coord\":[118.82439690138142,25.439653480972687]},{\"name\":\"福州市\",\"coord\":[119.1608285845262,25.99117532466728]},{\"name\":\"三明市\",\"coord\":[117.51188176216434,26.318292906961602]},{\"name\":\"南平市\",\"coord\":[118.16153136678187,27.306303151805437]},{\"name\":\"抚州市\",\"coord\":[116.3455359885574,27.487043655935366]},{\"name\":\"鹰潭市\",\"coord\":[117.01082360702333,28.241253742969946]},{\"name\":\"吉安市\",\"coord\":[114.91377151807418,26.957486660664525]},{\"name\":\"赣州市\",\"coord\":[115.046455717572,25.81565075681663]},{\"name\":\"郴州市\",\"coord\":[113.1544526703492,25.871927095452524]},{\"name\":\"新余市\",\"coord\":[114.94161795877827,27.79044654578371]},{\"name\":\"宜春市\",\"coord\":[115.04574494880995,28.306428044943356]},{\"name\":\"南昌市\",\"coord\":[115.9963824234495,28.664803351584705]},{\"name\":\"九江市\",\"coord\":[115.53225905704193,29.362905920276297]},{\"name\":\"上饶市\",\"coord\":[117.8595355766598,28.765755150094634]},{\"name\":\"景德镇市\",\"coord\":[117.25387030721845,29.33426823662448]},{\"name\":\"黄山市\",\"coord\":[117.85476357809696,29.969632034273722]},{\"name\":\"池州市\",\"coord\":[117.34517113140791,30.208089337922335]},{\"name\":\"铜陵市\",\"coord\":[117.93160431300694,30.926442655001676]},{\"name\":\"安庆市\",\"coord\":[116.54307680610799,30.524265461641296]},{\"name\":\"黄石市\",\"coord\":[115.02354597728443,29.924060229331015]},{\"name\":\"咸宁市\",\"coord\":[114.26967602231792,29.652174021136048]},{\"name\":\"黄冈市\",\"coord\":[115.2859016705373,30.65856897065683]},{\"name\":\"武汉市\",\"coord\":[114.34552076948799,30.68836237966767]},{\"name\":\"随州市\",\"coord\":[113.3850627838818,31.87891659924412]},{\"name\":\"信阳市\",\"coord\":[114.81374730587638,32.0309685135914]},{\"name\":\"驻马店市\",\"coord\":[114.07756451509235,32.896720987266114]},{\"name\":\"商洛市\",\"coord\":[109.82044421310393,33.77403373563189]},{\"name\":\"西安市\",\"coord\":[109.11839808451401,34.225257215515896]},{\"name\":\"渭南市\",\"coord\":[109.75732444226935,35.025913644359306]},{\"name\":\"铜川市\",\"coord\":[108.98695328111377,35.19235092947735]},{\"name\":\"咸阳市\",\"coord\":[108.36398776446165,34.84311348287181]},{\"name\":\"三门峡市\",\"coord\":[110.80049688104964,34.31818709571671]},{\"name\":\"运城市\",\"coord\":[111.1736679525165,35.19010372283576]},{\"name\":\"洛阳市\",\"coord\":[111.87577573098216,34.33379926109848]},{\"name\":\"平顶山市\",\"coord\":[112.80931281928427,33.759895800153096]},{\"name\":\"漯河市\",\"coord\":[113.83505724178012,33.70034266174508]},{\"name\":\"许昌市\",\"coord\":[113.78762484088509,34.051835688452435]},{\"name\":\"郑州市\",\"coord\":[113.49619951867594,34.61181797865449]},{\"name\":\"焦作市\",\"coord\":[113.13404280173008,35.134167097471625]},{\"name\":\"晋城市\",\"coord\":[112.7495732073233,35.63186423091449]},{\"name\":\"长治市\",\"coord\":[112.85900842873183,36.45872910742828]},{\"name\":\"临汾市\",\"coord\":[111.49379787924448,36.22810800777857]},{\"name\":\"太原市\",\"coord\":[112.15628804033796,37.91704444063036]},{\"name\":\"吕梁市\",\"coord\":[111.31901105774872,37.712740463356496]},{\"name\":\"晋中市\",\"coord\":[113.08199599739676,37.36532613794343]},{\"name\":\"邯郸市\",\"coord\":[114.41824047234618,36.530119932543315]},{\"name\":\"安阳市\",\"coord\":[113.88883283163116,35.7797611183252]},{\"name\":\"鹤壁市\",\"coord\":[114.3654094911545,35.75770487428472]},{\"name\":\"新乡市\",\"coord\":[113.9184107718167,35.348471214026716]},{\"name\":\"开封市\",\"coord\":[114.52801677500626,34.61371216679872]},{\"name\":\"周口市\",\"coord\":[114.88509782391864,33.69999759722657]},{\"name\":\"阜阳市\",\"coord\":[115.44595951398213,32.98060371610532]},{\"name\":\"淮南市\",\"coord\":[116.68941991880993,32.79972275772595]},{\"name\":\"蚌埠市\",\"coord\":[117.38594715783302,33.106729536033896]},{\"name\":\"淮北市\",\"coord\":[116.69651711889378,33.69527529383458]},{\"name\":\"宿州市\",\"coord\":[117.30175405886838,33.943330421260015]},{\"name\":\"亳州市\",\"coord\":[116.12410804185097,33.46769392946132]},{\"name\":\"商丘市\",\"coord\":[115.59575176872548,34.28339840831147]},{\"name\":\"菏泽市\",\"coord\":[115.53631974831816,35.197319393220624]},{\"name\":\"濮阳市\",\"coord\":[115.3070485514902,35.775883510964334]},{\"name\":\"聊城市\",\"coord\":[115.8870069012884,36.40529594548765]},{\"name\":\"邢台市\",\"coord\":[114.74259008644859,37.251396750084155]},{\"name\":\"石家庄市\",\"coord\":[114.56923838363613,38.13141710980106]},{\"name\":\"阳泉市\",\"coord\":[113.39216149668508,38.09075470547468]},{\"name\":\"保定市\",\"coord\":[115.261524468934,39.09118520781398]},{\"name\":\"衡水市\",\"coord\":[115.8182936677897,37.715661598187154]},{\"name\":\"德州市\",\"coord\":[116.4582273790399,37.19372347888644]},{\"name\":\"沧州市\",\"coord\":[116.76192710911863,38.20240042039232]},{\"name\":\"廊坊市\",\"coord\":[116.50410772133856,39.27896741763884]},{\"name\":\"天津市\",\"coord\":[117.31988934444873,39.37154482470619]},{\"name\":\"北京市\",\"coord\":[116.59734730757869,40.237112944270976]},{\"name\":\"张家口市\",\"coord\":[115.1823606483226,40.83732566607167]},{\"name\":\"唐山市\",\"coord\":[117.8693184261954,39.71862889477249]},{\"name\":\"秦皇岛市\",\"coord\":[119.30467355367742,39.990574652162564]},{\"name\":\"承德市\",\"coord\":[117.16275671911026,41.36623845548547]},{\"name\":\"葫芦岛市\",\"coord\":[119.9342336210531,40.5628822626519]},{\"name\":\"朝阳市\",\"coord\":[120.11853493535794,41.471852354885755]},{\"name\":\"赤峰市\",\"coord\":[118.50943546234379,43.25452976059767]},{\"name\":\"锦州市\",\"coord\":[121.5167549323861,41.45933087433065]},{\"name\":\"营口市\",\"coord\":[122.58571915054674,40.42093503997384]},{\"name\":\"丹东市\",\"coord\":[124.33549382902183,40.46369290272115]},{\"name\":\"辽阳市\",\"coord\":[123.34064798039414,41.152331397771356]},{\"name\":\"盘锦市\",\"coord\":[122.06718005354679,41.05573599862555]},{\"name\":\"阜新市\",\"coord\":[121.93889757908204,42.27641773244204]},{\"name\":\"鞍山市\",\"coord\":[122.78904432242356,40.77781183142038]},{\"name\":\"沈阳市\",\"coord\":[122.99508899709724,42.1162195010079]},{\"name\":\"铁岭市\",\"coord\":[124.23100515588399,42.72666083611828]},{\"name\":\"扶顺市\",\"coord\":[124.46027188217573,41.82955407638859]},{\"name\":\"通辽市\",\"coord\":[122.0729370657937,43.90889130864869]},{\"name\":\"兴安盟\",\"coord\":[120.79456431092532,45.92003249442161]},{\"name\":\"白城市\",\"coord\":[123.10619907715235,45.25475749267784]},{\"name\":\"齐齐哈尔市\",\"coord\":[124.5462214659102,47.55395009317394]},{\"name\":\"大兴安岭地区\",\"coord\":[124.50992855161529,52.18438447846694]},{\"name\":\"黑河市\",\"coord\":[127.14721400335922,49.25080134026901]},{\"name\":\"大庆市\",\"coord\":[124.40329830095243,46.401048760966745]},{\"name\":\"绥化市\",\"coord\":[126.5214484055605,46.76992452194825]},{\"name\":\"松原市\",\"coord\":[124.21244334807682,44.75779381338502]},{\"name\":\"四平市\",\"coord\":[124.27839350328821,43.52139065090318]},{\"name\":\"通化市\",\"coord\":[125.67392830706305,41.91771808663852]},{\"name\":\"辽源市\",\"coord\":[125.33529527643432,42.758340204944986]},{\"name\":\"吉林市\",\"coord\":[126.83350281902375,43.60730120049175]},{\"name\":\"长春市\",\"coord\":[125.53597875970374,44.24624314701737]},{\"name\":\"白山市\",\"coord\":[127.16780160322108,42.093893880305075]},{\"name\":\"哈尔滨市\",\"coord\":[127.39125008786029,45.36200668820575]},{\"name\":\"鹤岗市\",\"coord\":[130.4703811258197,47.66520688940109]},{\"name\":\"伊春市\",\"coord\":[128.91240831703635,47.93833794565277]},{\"name\":\"七台河市\",\"coord\":[131.2677920224311,45.945099776108584]},{\"name\":\"鸡西市\",\"coord\":[132.38059153660274,45.722934218318535]},{\"name\":\"双鸭山市\",\"coord\":[132.3184817002743,46.65813679030265]},{\"name\":\"佳木斯市\",\"coord\":[132.26174446608726,47.17569713691394]},{\"name\":\"呼伦贝尔市\",\"coord\":[122.3210739998419,50.18176996070858]},{\"name\":\"孝感市\",\"coord\":[113.83749892135485,31.11757234692128]},{\"name\":\"贵港市\",\"coord\":[110.07354588052804,23.380735604767374]},{\"name\":\"黔南布依族苗族自\",\"coord\":[107.30931767543106,26.2976919432269]},{\"name\":\"宁德市\",\"coord\":[119.52482556634342,27.013151692716413]},{\"name\":\"温州市\",\"coord\":[120.30037042732202,27.8699145504001]},{\"name\":\"台州市\",\"coord\":[120.88886782713843,28.670799172772313]},{\"name\":\"丽水市\",\"coord\":[119.56796851966463,28.170268394477755]},{\"name\":\"衢州市\",\"coord\":[118.79479802644406,28.865874397158763]},{\"name\":\"金华市\",\"coord\":[119.99381920686633,29.093455548185744]},{\"name\":\"绍兴市\",\"coord\":[120.46546691682343,29.69382513836818]},{\"name\":\"宁波市\",\"coord\":[121.42142987830871,29.70001162878972]},{\"name\":\"杭州市\",\"coord\":[119.4405685790891,29.87218307296989]},{\"name\":\"宣城市\",\"coord\":[118.68748382914703,30.628143499626418]},{\"name\":\"湖州市\",\"coord\":[119.98261306633574,30.7945175862809]},{\"name\":\"嘉兴市\",\"coord\":[120.83889215988998,30.67538495499343]},{\"name\":\"上海市\",\"coord\":[121.37534147322967,31.25628247908459]},{\"name\":\"苏州市\",\"coord\":[120.6906182622391,31.381280695137775]},{\"name\":\"无锡市\",\"coord\":[120.32182300914366,31.54113306724517]},{\"name\":\"常州市\",\"coord\":[119.61953292830165,31.611878565375576]},{\"name\":\"南京市\",\"coord\":[118.71890548838064,31.910863187910323]},{\"name\":\"镇江市\",\"coord\":[119.42349332902813,31.97942313430778]},{\"name\":\"合肥市\",\"coord\":[117.30651975617157,31.79407863049138]},{\"name\":\"六安市\",\"coord\":[116.24668220575353,31.820846193819513]},{\"name\":\"滁州市\",\"coord\":[117.88422385307969,32.51792621904418]},{\"name\":\"泰州市\",\"coord\":[120.03124303305091,32.56503102346783]},{\"name\":\"南通市\",\"coord\":[120.85599446760912,32.18496706099728]},{\"name\":\"盐城市\",\"coord\":[120.01812490612667,33.54219948734023]},{\"name\":\"淮安市\",\"coord\":[119.0749424205415,33.39203631772854]},{\"name\":\"宿迁市\",\"coord\":[118.45404943216346,33.666258719120265]},{\"name\":\"徐州市\",\"coord\":[117.77482249295966,34.30847766157078]},{\"name\":\"济宁市\",\"coord\":[116.74147276546373,35.27488504351119]},{\"name\":\"枣庄市\",\"coord\":[117.43359942491492,34.884162021736]},{\"name\":\"连云港市\",\"coord\":[119.01553213785074,34.54316517587849]},{\"name\":\"临沂市\",\"coord\":[118.31478835349617,35.28173079028279]},{\"name\":\"日照市\",\"coord\":[119.14265350444272,35.54479073199592]},{\"name\":\"青岛市\",\"coord\":[120.27779044405756,36.3464117375903]},{\"name\":\"威海市\",\"coord\":[122.12963327195605,37.13879077904251]},{\"name\":\"烟台市\",\"coord\":[120.7689567423966,37.19772002195597]},{\"name\":\"潍坊市\",\"coord\":[119.02178548592039,36.49292234053931]},{\"name\":\"淄博市\",\"coord\":[117.92936024367185,36.60871347163638]},{\"name\":\"泰安市\",\"coord\":[116.93810893944303,36.0423330118612]},{\"name\":\"济南市\",\"coord\":[117.34560282551296,36.769574973846304]},{\"name\":\"东营市\",\"coord\":[118.4915054457184,37.52194690335787]},{\"name\":\"滨州市\",\"coord\":[117.67610299757533,37.4439597758601]},{\"name\":\"昆明市\",\"coord\":[102.93100245594789,25.481300763922075]},{\"name\":\"玉溪市\",\"coord\":[102.23080854291823,24.156168324611663]},{\"name\":\"塔城地区\",\"coord\":[83.60908162840168,45.3721852373893]},{\"name\":\"张掖市\",\"coord\":[100.47710030600572,38.704239320458385]},{\"name\":\"南阳市\",\"coord\":[112.1400670951149,33.03033276715801]},{\"name\":\"扬州市\",\"coord\":[119.48949608990988,32.80956776339646]},{\"name\":\"延边朝鲜族自治州\",\"coord\":[129.3577692895626,43.24968794080283]},{\"name\":\"牡丹江市\",\"coord\":[129.87240796405672,44.7073040108322]},{\"name\":\"澳门\",\"coord\":[113.56289691515346,22.14602596262204]},{\"name\":\"吴忠市\",\"coord\":[106.76894508116403,37.72566765880316]},{\"name\":\"来宾市\",\"coord\":[109.25592217010114,23.86346274681084]},{\"name\":\"平凉市\",\"coord\":[107.0708132782897,35.30329631658711]},{\"name\":\"马鞍山市\",\"coord\":[118.27245878467022,31.657727937739004]},{\"name\":\"芜湖市\",\"coord\":[118.32992684415504,31.081688223101658]},{\"name\":\"澄迈县\",\"coord\":[110.04198076060266,19.694955078668105]},{\"name\":\"保亭黎族苗族自治\",\"coord\":[109.6055304964257,18.6101488675304]},{\"name\":\"乐东黎族自治县\",\"coord\":[109.04051999525574,18.643137437909203]},{\"name\":\"儋州市\",\"coord\":[109.3431358337404,19.550974957403195]},{\"name\":\"定安县\",\"coord\":[110.38744429685676,19.47557074114284]},{\"name\":\"屯昌县\",\"coord\":[110.00574767630334,19.367175093044388]},{\"name\":\"白沙黎族自治县\",\"coord\":[109.36860737761768,19.214416393082217]},{\"name\":\"琼中黎族苗族自治\",\"coord\":[109.86691465937548,19.073671135862682]},{\"name\":\"东方市\",\"coord\":[108.86903802405428,19.017352815445214]},{\"name\":\"昌江黎族自治县\",\"coord\":[108.9686431884767,19.182594167127824]},{\"name\":\"海口市\",\"coord\":[110.420654296875,19.806565564640795]},{\"name\":\"济源市\",\"coord\":[112.38051465474433,35.07958362422394]},{\"name\":\"五指山市\",\"coord\":[109.53595187364496,18.832908264613966]},{\"name\":\"大连市\",\"coord\":[121.96662235866603,39.444150542439914]},{\"name\":\"文昌市三沙市\",\"coord\":[110.81828537536748,19.756501444162936]},{\"name\":\"三亚市\",\"coord\":[109.38424600793707,18.39186315877128]},{\"name\":\"万宁市\",\"coord\":[110.28485046979574,18.860240588635115]},{\"name\":\"陵水黎族自治县\",\"coord\":[109.95577603229562,18.594712684620465]},{\"name\":\"临高县\",\"coord\":[109.71915395436967,19.79420403032508]},{\"name\":\"琼海市\",\"coord\":[110.41650700703043,19.22315873149372]}]");
|
|
3401
|
-
|
|
3402
|
-
/***/ }),
|
|
3403
|
-
|
|
3404
|
-
/***/ 522:
|
|
3405
|
-
/***/ (function(module) {
|
|
3406
|
-
|
|
3407
|
-
module.exports = JSON.parse("[{\"name\":\"黑龙江省\",\"coord\":[127.64559817675396,48.48668098449708]},{\"name\":\"内蒙古自治区\",\"coord\":[118.34519572208615,45.370218276977525]},{\"name\":\"新疆维吾尔自治区\",\"coord\":[87.13479065593184,41.75497055053711]},{\"name\":\"吉林省\",\"coord\":[126.12985278813787,43.57983207702637]},{\"name\":\"辽宁省\",\"coord\":[124.02494773936439,41.105743408203125]},{\"name\":\"甘肃省\",\"coord\":[102.87785725633012,37.69582366943361]},{\"name\":\"河北省\",\"coord\":[115.66327227481898,39.33383178710938]},{\"name\":\"北京市\",\"coord\":[116.62199343603638,40.25053787231445]},{\"name\":\"山西省\",\"coord\":[112.45180235808988,37.666561126708984]},{\"name\":\"天津市\",\"coord\":[117.35711842642581,39.406789779663086]},{\"name\":\"陕西省\",\"coord\":[109.56294003056632,35.64754199981689]},{\"name\":\"宁夏回族自治区\",\"coord\":[105.96110877640074,37.3081169128418]},{\"name\":\"青海省\",\"coord\":[96.07301048277901,35.44417190551758]},{\"name\":\"山东省\",\"coord\":[118.03833752951093,36.29800605773925]},{\"name\":\"西藏自治区\",\"coord\":[87.47361520439412,31.6703872680664]},{\"name\":\"河南省\",\"coord\":[113.07832397097275,33.87751102447509]},{\"name\":\"江苏省\",\"coord\":[119.93926538201052,32.945452690124505]},{\"name\":\"安徽省\",\"coord\":[117.15146765881019,32.024482727050774]},{\"name\":\"四川省\",\"coord\":[102.28998890142759,30.182161331176758]},{\"name\":\"湖北省\",\"coord\":[112.87798261431585,31.157071113586426]},{\"name\":\"重庆市\",\"coord\":[107.870126637831,30.188085556030266]},{\"name\":\"上海市\",\"coord\":[121.42561166015514,31.276043891906745]},{\"name\":\"浙江省\",\"coord\":[119.75337092707514,29.175934791564945]},{\"name\":\"湖南省\",\"coord\":[111.52770282777405,27.38110256195069]},{\"name\":\"江西省\",\"coord\":[115.51091280655628,27.283511161804206]},{\"name\":\"云南省\",\"coord\":[101.27053825991308,25.19783210754396]},{\"name\":\"贵州省\",\"coord\":[106.49672346773299,26.92267990112305]},{\"name\":\"福建省\",\"coord\":[117.9976766946587,25.939599990844727]},{\"name\":\"广西壮族自治区\",\"coord\":[108.98706831086302,23.891559600830078]},{\"name\":\"台湾省\",\"coord\":[120.82468432537434,23.602651596069336]},{\"name\":\"香港特别行政区\",\"coord\":[114.21036850371561,22.374858856201172]},{\"name\":\"海南省\",\"coord\":[109.62792940960824,19.163116455078125]},{\"name\":\"广东省\",\"coord\":[113.32127888266032,22.873867034912106]},{\"name\":\"澳门特别行政区\",\"coord\":[113.56819996291901,22.160347992976]}]");
|
|
3408
|
-
|
|
3409
|
-
/***/ }),
|
|
3410
|
-
|
|
3411
|
-
/***/ 523:
|
|
3412
|
-
/***/ (function(module, exports) {
|
|
3413
|
-
|
|
3414
|
-
module.exports = require("@supermapgis/vue-iclient-leaflet/static/libs/json-sql/jsonsql");
|
|
3415
|
-
|
|
3416
|
-
/***/ }),
|
|
3417
|
-
|
|
3418
|
-
/***/ 524:
|
|
3419
|
-
/***/ (function(module, exports) {
|
|
3420
|
-
|
|
3421
|
-
module.exports = require("lodash.isnumber");
|
|
3422
|
-
|
|
3423
|
-
/***/ }),
|
|
3424
|
-
|
|
3425
|
-
/***/ 525:
|
|
3426
|
-
/***/ (function(module, exports) {
|
|
3427
|
-
|
|
3428
|
-
module.exports = require("canvg");
|
|
3429
|
-
|
|
3430
|
-
/***/ }),
|
|
3431
|
-
|
|
3432
|
-
/***/ 526:
|
|
3433
|
-
/***/ (function(module, exports) {
|
|
3434
|
-
|
|
3435
|
-
module.exports = require("@turf/meta");
|
|
3436
|
-
|
|
3437
|
-
/***/ }),
|
|
3438
|
-
|
|
3439
|
-
/***/ 527:
|
|
3440
|
-
/***/ (function(module, exports) {
|
|
3441
|
-
|
|
3442
|
-
module.exports = require("lodash.difference");
|
|
3443
|
-
|
|
3444
|
-
/***/ }),
|
|
3445
|
-
|
|
3446
|
-
/***/ 59:
|
|
3447
|
-
/***/ (function(module, exports) {
|
|
3448
|
-
|
|
3449
|
-
module.exports = require("lodash.max");
|
|
3450
|
-
|
|
3451
|
-
/***/ }),
|
|
3452
|
-
|
|
3453
|
-
/***/ 6:
|
|
3454
|
-
/***/ (function(module, exports) {
|
|
3455
|
-
|
|
3456
|
-
module.exports = require("@babel/runtime/helpers/inheritsLoose");
|
|
3457
|
-
|
|
3458
|
-
/***/ }),
|
|
3459
|
-
|
|
3460
|
-
/***/ 9:
|
|
3461
|
-
/***/ (function(module, exports) {
|
|
3462
|
-
|
|
3463
|
-
module.exports = require("@supermapgis/vue-iclient-leaflet/lib/_utils/util.js");
|
|
3464
|
-
|
|
3465
|
-
/***/ })
|
|
3466
|
-
|
|
3467
|
-
/******/ });
|