gis-common 1.0.18 → 1.1.2

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.
@@ -125,6 +125,8 @@ __webpack_require__.d(__webpack_exports__, "Utils", function() { return /* reexp
125
125
  __webpack_require__.d(__webpack_exports__, "EventType", function() { return /* reexport */ EventTypeConstant; });
126
126
  __webpack_require__.d(__webpack_exports__, "ErrorType", function() { return /* reexport */ ErrorTypeConstant; });
127
127
  __webpack_require__.d(__webpack_exports__, "LayerType", function() { return /* reexport */ LayerType; });
128
+ __webpack_require__.d(__webpack_exports__, "GraphicType", function() { return /* reexport */ GraphicType; });
129
+ __webpack_require__.d(__webpack_exports__, "MeasureMode", function() { return /* reexport */ MeasureMode; });
128
130
  __webpack_require__.d(__webpack_exports__, "AudioPlayer", function() { return /* reexport */ core_AudioPlayer; });
129
131
  __webpack_require__.d(__webpack_exports__, "CanvasDrawer", function() { return /* reexport */ core_CanvasDrawer; });
130
132
  __webpack_require__.d(__webpack_exports__, "ElQuery", function() { return /* reexport */ core_ElQuery; });
@@ -262,10 +264,28 @@ __webpack_require__.d(__webpack_exports__, "WebStorage", function() { return /*
262
264
  S3M_GROUP: "S3MGroup", // addS3MGroupLayer(url, options, index) 添加S3M分组图层。
263
265
  TERRAIN_LAYER: "TerrainFileLayer" // 地形图层, 需要单独处理
264
266
  });
267
+ // CONCATENATED MODULE: ./src/constant/GraphicConstant.js
268
+ var GraphicType = {
269
+ POINT: 'point',
270
+ POLYLINE: 'polyline',
271
+ POLYGON: 'polygon',
272
+ BILLBOARD: 'billboard',
273
+ CYLINDER: 'cylinder',
274
+ ELLIPSOID: 'ellipsoid',
275
+ LABEL: 'label',
276
+ MODEL: 'model',
277
+ WALL: 'wall'
278
+ };
279
+ var MeasureMode = {
280
+ DISTANCE: 'distance',
281
+ AREA: 'area',
282
+ HEIGHT: 'height'
283
+ };
265
284
  // CONCATENATED MODULE: ./src/constant/index.js
266
285
 
267
286
 
268
287
 
288
+
269
289
  // CONCATENATED MODULE: ./src/utils/CommUtils.js
270
290
 
271
291
 
@@ -1448,9 +1468,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
1448
1468
  */
1449
1469
  throttle: function throttle(func, wait, type) {
1450
1470
  if (type === 1) {
1451
- var _previous = 0;
1471
+ var previous = 0;
1452
1472
  } else if (type === 2) {
1453
- var _timeout = void 0;
1473
+ var timeout;
1454
1474
  }
1455
1475
  return function () {
1456
1476
  var context = this;
@@ -2285,40 +2305,40 @@ var WebSocketClient_WebSocketClient = function (_EventDispatcher) {
2285
2305
  WebSocketClient_createClass(WebSocketClient, [{
2286
2306
  key: 'connect',
2287
2307
  value: function connect() {
2288
- var _this2 = this;
2289
-
2290
- this.checkTimes++;
2291
2308
  this.disconnect();
2292
2309
  if (this.url) {
2293
2310
  try {
2294
2311
  console.info('创建ws连接' + this.url);
2295
2312
  this.client = new WebSocket(this.url);
2296
2313
  if (this.client) {
2314
+ var self = this;
2297
2315
  this.client.onopen = function (message) {
2298
- _this2.dispatchEvent({
2316
+ self.dispatchEvent({
2299
2317
  type: EventTypeConstant.WEB_SOCKET_CONNECT,
2300
2318
  message: message
2301
2319
  });
2302
2320
  };
2303
2321
  this.client.onmessage = function (message) {
2304
- _this2.connectStatus = true;
2305
- _this2.dispatchEvent({
2322
+ self.connectStatus = true;
2323
+ self.dispatchEvent({
2306
2324
  type: EventTypeConstant.WEB_SOCKET_MESSAGE,
2307
2325
  message: message
2308
2326
  });
2309
2327
  };
2310
2328
  this.client.onclose = function (message) {
2311
- _this2.dispatchEvent({
2329
+ self.dispatchEvent({
2312
2330
  type: EventTypeConstant.WEB_SOCKET_CLOSE,
2313
2331
  message: message
2314
2332
  });
2315
2333
  };
2316
- this.client.onerror = function (message) {
2317
- _this2.dispatchEvent({
2318
- type: EventTypeConstant.WEB_SOCKET_ERROR,
2319
- message: message
2320
- });
2321
- };
2334
+ if (this.checkTimes === this.maxCheckTimes) {
2335
+ this.client.onerror = function (message) {
2336
+ self.dispatchEvent({
2337
+ type: EventTypeConstant.WEB_SOCKET_ERROR,
2338
+ message: message
2339
+ });
2340
+ };
2341
+ }
2322
2342
  }
2323
2343
  } catch (ex) {
2324
2344
  console.error('创建ws连接失败' + this.url + ':' + ex);
@@ -2341,14 +2361,15 @@ var WebSocketClient_WebSocketClient = function (_EventDispatcher) {
2341
2361
  }, {
2342
2362
  key: 'connCheckStatus',
2343
2363
  value: function connCheckStatus(times) {
2344
- var _this3 = this;
2364
+ var _this2 = this;
2345
2365
 
2346
2366
  if (this.checkTimes > times) return;
2347
2367
  setTimeout(function () {
2348
- if (_this3.client && _this3.client.readyState !== 0 && _this3.client.readyState !== 1) {
2349
- _this3.connect();
2368
+ _this2.checkTimes++;
2369
+ if (_this2.client && _this2.client.readyState !== 0 && _this2.client.readyState !== 1) {
2370
+ _this2.connect();
2350
2371
  }
2351
- _this3.connCheckStatus(times);
2372
+ _this2.connCheckStatus(times);
2352
2373
  }, 2000);
2353
2374
  }
2354
2375
  }, {
@@ -2364,14 +2385,14 @@ var WebSocketClient_WebSocketClient = function (_EventDispatcher) {
2364
2385
  }, {
2365
2386
  key: 'heartbeat',
2366
2387
  value: function heartbeat() {
2367
- var _this4 = this;
2388
+ var _this3 = this;
2368
2389
 
2369
2390
  setTimeout(function () {
2370
- if (_this4.client && _this4.client.readyState === 1) {
2371
- _this4.send('HeartBeat');
2391
+ if (_this3.client && _this3.client.readyState === 1) {
2392
+ _this3.send('HeartBeat');
2372
2393
  }
2373
- console.log('HeartBeat,' + _this4.url);
2374
- setTimeout(_this4.heartbeat, 30000);
2394
+ console.log('HeartBeat,' + _this3.url);
2395
+ setTimeout(_this3.heartbeat, 30000);
2375
2396
  }, 1000);
2376
2397
  }
2377
2398
  }], [{
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "gis-common",
3
3
  "description": "gis-common",
4
4
  "main": "dist/resource.min.js",
5
- "version": "1.0.18",
5
+ "version": "1.1.2",
6
6
  "author": "Guo.Yan <luv02@vip.qq.com>",
7
7
  "license": "MIT",
8
8
  "private": false,