@antv/l7-layers 2.13.5 → 2.13.7

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.
Files changed (125) hide show
  1. package/es/Geometry/models/billboard.js +2 -6
  2. package/es/Geometry/models/plane.js +2 -6
  3. package/es/Geometry/models/sprite.js +2 -6
  4. package/es/citybuliding/models/build.js +2 -6
  5. package/es/core/BaseLayer.d.ts +3 -1
  6. package/es/core/BaseLayer.js +37 -6
  7. package/es/earth/models/atmosphere.js +2 -6
  8. package/es/earth/models/base.js +2 -6
  9. package/es/earth/models/bloomsphere.js +2 -6
  10. package/es/heatmap/models/grid.js +2 -6
  11. package/es/heatmap/models/grid3d.js +2 -6
  12. package/es/heatmap/models/heatmap.js +2 -6
  13. package/es/heatmap/models/hexagon.js +2 -6
  14. package/es/image/models/image.js +2 -6
  15. package/es/index.d.ts +1 -1
  16. package/es/index.js +2 -2
  17. package/es/line/models/arc.js +2 -6
  18. package/es/line/models/arc_3d.js +2 -6
  19. package/es/line/models/earthArc_3d.js +2 -6
  20. package/es/line/models/great_circle.js +2 -6
  21. package/es/line/models/half.js +2 -6
  22. package/es/line/models/line.d.ts +1 -0
  23. package/es/line/models/line.js +13 -7
  24. package/es/line/models/linearline.js +2 -6
  25. package/es/line/models/simpleLine.js +2 -6
  26. package/es/line/models/wall.js +2 -6
  27. package/es/mask/models/fill.js +6 -7
  28. package/es/plugins/DataMappingPlugin.js +13 -6
  29. package/es/plugins/DataSourcePlugin.js +14 -9
  30. package/es/plugins/FeatureScalePlugin.js +13 -7
  31. package/es/plugins/LayerModelPlugin.d.ts +1 -0
  32. package/es/plugins/LayerModelPlugin.js +68 -40
  33. package/es/point/models/earthExtrude.js +2 -6
  34. package/es/point/models/earthFill.js +2 -6
  35. package/es/point/models/extrude.js +2 -6
  36. package/es/point/models/normal.js +5 -7
  37. package/es/point/models/radar.js +3 -7
  38. package/es/point/models/simplePoint.js +2 -6
  39. package/es/polygon/models/extrude.js +4 -8
  40. package/es/polygon/models/fill.js +2 -6
  41. package/es/polygon/models/ocean.js +2 -6
  42. package/es/polygon/models/water.js +2 -6
  43. package/es/raster/models/raster.js +3 -7
  44. package/es/raster/models/rasterRgb.js +5 -9
  45. package/es/raster/models/rasterTerrainRgb.js +3 -7
  46. package/es/tile/manager/base.d.ts +1 -1
  47. package/es/tile/manager/base.js +16 -4
  48. package/es/tile/service/TileLayerService.d.ts +3 -3
  49. package/es/tile/service/TileLayerService.js +16 -18
  50. package/es/tile/service/TilePickService.d.ts +2 -2
  51. package/es/tile/service/TileSourceService.js +1 -1
  52. package/es/tile/tileFactory/DebugTile.js +3 -3
  53. package/es/tile/tileFactory/ImageTile.js +1 -0
  54. package/es/tile/tileFactory/MaskTile.js +5 -1
  55. package/es/tile/tileFactory/RasterRGBTile.js +1 -0
  56. package/es/tile/tileFactory/RasterTerrainRGBTile.js +1 -0
  57. package/es/tile/tileFactory/RasterTile.js +3 -2
  58. package/es/tile/tileFactory/Tile.d.ts +1 -0
  59. package/es/tile/tileFactory/Tile.js +5 -3
  60. package/es/tile/tileFactory/VectorTile.js +4 -4
  61. package/es/tile/tileFactory/index.d.ts +4 -4
  62. package/es/tile/tileFactory/index.js +4 -4
  63. package/es/tile/tileFactory/layers/TileDebugLayer.js +3 -0
  64. package/es/tile/tileFactory/util.d.ts +1 -1
  65. package/es/tile/tileFactory/util.js +1 -1
  66. package/es/tile/tileLayer/BaseLayer.d.ts +1 -1
  67. package/es/tile/tileLayer/BaseLayer.js +6 -4
  68. package/es/wind/models/wind.js +2 -6
  69. package/lib/Geometry/models/billboard.js +2 -6
  70. package/lib/Geometry/models/plane.js +2 -6
  71. package/lib/Geometry/models/sprite.js +2 -6
  72. package/lib/citybuliding/models/build.js +2 -6
  73. package/lib/core/BaseLayer.js +36 -5
  74. package/lib/earth/models/atmosphere.js +2 -6
  75. package/lib/earth/models/base.js +2 -6
  76. package/lib/earth/models/bloomsphere.js +2 -6
  77. package/lib/heatmap/models/grid.js +2 -6
  78. package/lib/heatmap/models/grid3d.js +2 -6
  79. package/lib/heatmap/models/heatmap.js +2 -6
  80. package/lib/heatmap/models/hexagon.js +2 -6
  81. package/lib/image/models/image.js +2 -6
  82. package/lib/line/models/arc.js +2 -6
  83. package/lib/line/models/arc_3d.js +2 -6
  84. package/lib/line/models/earthArc_3d.js +2 -6
  85. package/lib/line/models/great_circle.js +2 -6
  86. package/lib/line/models/half.js +2 -6
  87. package/lib/line/models/line.js +12 -7
  88. package/lib/line/models/linearline.js +2 -6
  89. package/lib/line/models/simpleLine.js +2 -6
  90. package/lib/line/models/wall.js +2 -6
  91. package/lib/mask/models/fill.js +6 -7
  92. package/lib/plugins/DataMappingPlugin.js +12 -5
  93. package/lib/plugins/DataSourcePlugin.js +13 -8
  94. package/lib/plugins/FeatureScalePlugin.js +12 -6
  95. package/lib/plugins/LayerModelPlugin.js +69 -40
  96. package/lib/point/models/earthExtrude.js +2 -6
  97. package/lib/point/models/earthFill.js +2 -6
  98. package/lib/point/models/extrude.js +2 -6
  99. package/lib/point/models/normal.js +5 -7
  100. package/lib/point/models/radar.js +4 -8
  101. package/lib/point/models/simplePoint.js +2 -6
  102. package/lib/polygon/models/extrude.js +4 -8
  103. package/lib/polygon/models/fill.js +2 -6
  104. package/lib/polygon/models/ocean.js +2 -6
  105. package/lib/polygon/models/water.js +2 -6
  106. package/lib/raster/models/raster.js +2 -6
  107. package/lib/raster/models/rasterRgb.js +5 -9
  108. package/lib/raster/models/rasterTerrainRgb.js +2 -6
  109. package/lib/tile/manager/base.js +16 -4
  110. package/lib/tile/service/TileLayerService.js +16 -18
  111. package/lib/tile/service/TileSourceService.js +1 -1
  112. package/lib/tile/tileFactory/DebugTile.js +3 -3
  113. package/lib/tile/tileFactory/ImageTile.js +1 -0
  114. package/lib/tile/tileFactory/MaskTile.js +5 -1
  115. package/lib/tile/tileFactory/RasterRGBTile.js +1 -0
  116. package/lib/tile/tileFactory/RasterTerrainRGBTile.js +1 -0
  117. package/lib/tile/tileFactory/RasterTile.js +4 -3
  118. package/lib/tile/tileFactory/Tile.js +5 -3
  119. package/lib/tile/tileFactory/VectorTile.js +5 -5
  120. package/lib/tile/tileFactory/index.js +5 -5
  121. package/lib/tile/tileFactory/layers/TileDebugLayer.js +3 -0
  122. package/lib/tile/tileFactory/util.js +2 -2
  123. package/lib/tile/tileLayer/BaseLayer.js +7 -5
  124. package/lib/wind/models/wind.js +2 -6
  125. package/package.json +7 -6
@@ -5,7 +5,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
5
  var _dec, _class;
6
6
 
7
7
  import _regeneratorRuntime from "@babel/runtime/regenerator";
8
- import { TYPES } from '@antv/l7-core';
8
+ import { IDebugLog, ILayerStage, TYPES } from '@antv/l7-core';
9
9
  import Source from '@antv/l7-source';
10
10
  import { injectable } from 'inversify';
11
11
  import 'reflect-metadata';
@@ -27,6 +27,7 @@ var DataSourcePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
27
27
  while (1) {
28
28
  switch (_context.prev = _context.next) {
29
29
  case 0:
30
+ layer.log(IDebugLog.SourceInitStart, ILayerStage.INIT);
30
31
  source = layer.getSource();
31
32
 
32
33
  if (!source) {
@@ -37,28 +38,31 @@ var DataSourcePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
37
38
  }
38
39
 
39
40
  if (!source.inited) {
40
- _context.next = 6;
41
+ _context.next = 8;
41
42
  break;
42
43
  }
43
44
 
44
45
  _this.updateClusterData(layer);
45
46
 
46
- _context.next = 8;
47
+ layer.log(IDebugLog.SourceInitEnd, ILayerStage.INIT);
48
+ _context.next = 10;
47
49
  break;
48
50
 
49
- case 6:
50
- _context.next = 8;
51
+ case 8:
52
+ _context.next = 10;
51
53
  return new Promise(function (resolve) {
52
54
  source.on('update', function (e) {
53
55
  if (e.type === 'inited') {
54
56
  _this.updateClusterData(layer);
57
+
58
+ layer.log(IDebugLog.SourceInitEnd, ILayerStage.INIT);
55
59
  }
56
60
 
57
61
  resolve(null);
58
62
  });
59
63
  });
60
64
 
61
- case 8:
65
+ case 10:
62
66
  case "end":
63
67
  return _context.stop();
64
68
  }
@@ -67,7 +71,7 @@ var DataSourcePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
67
71
  }))); // 检测数据是否需要更新
68
72
 
69
73
  layer.hooks.beforeRenderData.tapPromise('DataSourcePlugin', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
70
- var neeUpdateCluster, dataSourceNeedUpdate;
74
+ var neeUpdateCluster, dataSourceNeedUpdate, needScale;
71
75
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
72
76
  while (1) {
73
77
  switch (_context2.prev = _context2.next) {
@@ -75,9 +79,10 @@ var DataSourcePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
75
79
  neeUpdateCluster = _this.updateClusterData(layer);
76
80
  dataSourceNeedUpdate = layer.dataState.dataSourceNeedUpdate;
77
81
  layer.dataState.dataSourceNeedUpdate = false;
78
- return _context2.abrupt("return", neeUpdateCluster || dataSourceNeedUpdate);
82
+ needScale = neeUpdateCluster || dataSourceNeedUpdate;
83
+ return _context2.abrupt("return", needScale);
79
84
 
80
- case 4:
85
+ case 5:
81
86
  case "end":
82
87
  return _context2.stop();
83
88
  }
@@ -7,7 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
7
  var _scaleMap, _dec, _class;
8
8
 
9
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
10
- import { ScaleTypes, StyleScaleType } from '@antv/l7-core';
10
+ import { IDebugLog, ILayerStage, ScaleTypes, StyleScaleType } from '@antv/l7-core';
11
11
  import { extent } from 'd3-array';
12
12
  import * as d3interpolate from 'd3-interpolate';
13
13
  import * as d3 from 'd3-scale';
@@ -42,21 +42,25 @@ var FeatureScalePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
42
42
  while (1) {
43
43
  switch (_context.prev = _context.next) {
44
44
  case 0:
45
+ layer.log(IDebugLog.ScaleInitStart, ILayerStage.INIT);
45
46
  _this.scaleOptions = layer.getScaleOptions();
46
47
  attributes = styleAttributeService.getLayerStyleAttributes();
47
48
  dataArray = (_layer$getSource = layer.getSource()) === null || _layer$getSource === void 0 ? void 0 : _layer$getSource.data.dataArray;
48
49
 
49
50
  if (!(Array.isArray(dataArray) && dataArray.length === 0)) {
50
- _context.next = 7;
51
+ _context.next = 8;
51
52
  break;
52
53
  }
53
54
 
54
55
  return _context.abrupt("return");
55
56
 
56
- case 7:
57
+ case 8:
57
58
  _this.caculateScalesForAttributes(attributes || [], dataArray);
58
59
 
59
- case 8:
60
+ case 9:
61
+ layer.log(IDebugLog.ScaleInitEnd, ILayerStage.INIT);
62
+
63
+ case 10:
60
64
  case "end":
61
65
  return _context.stop();
62
66
  }
@@ -79,24 +83,26 @@ var FeatureScalePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
79
83
  return _context2.abrupt("return", flag);
80
84
 
81
85
  case 2:
86
+ layer.log(IDebugLog.ScaleInitStart, ILayerStage.UPDATE);
82
87
  _this.scaleOptions = layer.getScaleOptions();
83
88
  attributes = styleAttributeService.getLayerStyleAttributes();
84
89
  dataArray = layer.getSource().data.dataArray;
85
90
 
86
91
  if (!(Array.isArray(dataArray) && dataArray.length === 0)) {
87
- _context2.next = 7;
92
+ _context2.next = 8;
88
93
  break;
89
94
  }
90
95
 
91
96
  return _context2.abrupt("return", true);
92
97
 
93
- case 7:
98
+ case 8:
94
99
  _this.caculateScalesForAttributes(attributes || [], dataArray);
95
100
 
101
+ layer.log(IDebugLog.ScaleInitEnd, ILayerStage.UPDATE);
96
102
  layer.layerModelNeedUpdate = true;
97
103
  return _context2.abrupt("return", true);
98
104
 
99
- case 10:
105
+ case 12:
100
106
  case "end":
101
107
  return _context2.stop();
102
108
  }
@@ -4,6 +4,7 @@ import 'reflect-metadata';
4
4
  * Layer Model 初始化,更新,销毁
5
5
  */
6
6
  export default class LayerModelPlugin implements ILayerPlugin {
7
+ private build;
7
8
  initLayerModel(layer: ILayer): Promise<void>;
8
9
  prepareLayerModel(layer: ILayer): Promise<void>;
9
10
  apply(layer: ILayer): void;
@@ -5,6 +5,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
5
  var _dec, _class;
6
6
 
7
7
  import _regeneratorRuntime from "@babel/runtime/regenerator";
8
+ import { IDebugLog, ILayerStage } from '@antv/l7-core';
8
9
  import { injectable } from 'inversify';
9
10
  import 'reflect-metadata';
10
11
  import TileLayer from "../tile/tileLayer/BaseLayer";
@@ -18,9 +19,9 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
18
19
  }
19
20
 
20
21
  _createClass(LayerModelPlugin, [{
21
- key: "initLayerModel",
22
+ key: "build",
22
23
  value: function () {
23
- var _initLayerModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(layer) {
24
+ var _build = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(layer) {
24
25
  return _regeneratorRuntime.wrap(function _callee$(_context) {
25
26
  while (1) {
26
27
  switch (_context.prev = _context.next) {
@@ -32,9 +33,6 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
32
33
  return layer.buildModels();
33
34
 
34
35
  case 3:
35
- layer.styleNeedUpdate = false;
36
-
37
- case 4:
38
36
  case "end":
39
37
  return _context.stop();
40
38
  }
@@ -42,36 +40,60 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
42
40
  }, _callee);
43
41
  }));
44
42
 
45
- function initLayerModel(_x) {
46
- return _initLayerModel.apply(this, arguments);
43
+ function build(_x) {
44
+ return _build.apply(this, arguments);
47
45
  }
48
46
 
49
- return initLayerModel;
47
+ return build;
50
48
  }()
51
49
  }, {
52
- key: "prepareLayerModel",
50
+ key: "initLayerModel",
53
51
  value: function () {
54
- var _prepareLayerModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(layer) {
52
+ var _initLayerModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(layer) {
55
53
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
56
54
  while (1) {
57
55
  switch (_context2.prev = _context2.next) {
58
56
  case 0:
59
- // 更新Model 配置项
60
- layer.prepareBuildModel(); // clear layerModel resource
61
- // 初始化 Model
57
+ _context2.next = 2;
58
+ return this.build(layer);
62
59
 
63
- _context2.next = 3;
64
- return layer.buildModels();
60
+ case 2:
61
+ layer.styleNeedUpdate = false;
65
62
 
66
63
  case 3:
67
64
  case "end":
68
65
  return _context2.stop();
69
66
  }
70
67
  }
71
- }, _callee2);
68
+ }, _callee2, this);
69
+ }));
70
+
71
+ function initLayerModel(_x2) {
72
+ return _initLayerModel.apply(this, arguments);
73
+ }
74
+
75
+ return initLayerModel;
76
+ }()
77
+ }, {
78
+ key: "prepareLayerModel",
79
+ value: function () {
80
+ var _prepareLayerModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(layer) {
81
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
82
+ while (1) {
83
+ switch (_context3.prev = _context3.next) {
84
+ case 0:
85
+ _context3.next = 2;
86
+ return this.build(layer);
87
+
88
+ case 2:
89
+ case "end":
90
+ return _context3.stop();
91
+ }
92
+ }
93
+ }, _callee3, this);
72
94
  }));
73
95
 
74
- function prepareLayerModel(_x2) {
96
+ function prepareLayerModel(_x3) {
75
97
  return _prepareLayerModel.apply(this, arguments);
76
98
  }
77
99
 
@@ -82,69 +104,75 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
82
104
  value: function apply(layer) {
83
105
  var _this = this;
84
106
 
85
- layer.hooks.init.tapPromise('LayerModelPlugin', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
86
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
107
+ layer.hooks.init.tapPromise('LayerModelPlugin', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
108
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
87
109
  while (1) {
88
- switch (_context3.prev = _context3.next) {
110
+ switch (_context4.prev = _context4.next) {
89
111
  case 0:
90
112
  if (!layer.getSource().isTile) {
91
- _context3.next = 4;
113
+ _context4.next = 4;
92
114
  break;
93
115
  }
94
116
 
95
117
  layer.prepareBuildModel();
96
118
  layer.tileLayer = new TileLayer(layer);
97
- return _context3.abrupt("return");
119
+ return _context4.abrupt("return");
98
120
 
99
121
  case 4:
100
- _context3.next = 6;
122
+ layer.log(IDebugLog.BuildModelStart, ILayerStage.INIT);
123
+ _context4.next = 7;
101
124
  return _this.initLayerModel(layer);
102
125
 
103
- case 6:
126
+ case 7:
127
+ layer.log(IDebugLog.BuildModelEnd, ILayerStage.INIT);
128
+
129
+ case 8:
104
130
  case "end":
105
- return _context3.stop();
131
+ return _context4.stop();
106
132
  }
107
133
  }
108
- }, _callee3);
134
+ }, _callee4);
109
135
  })));
110
136
  layer.hooks.beforeRenderData.tapPromise('LayerModelPlugin', /*#__PURE__*/function () {
111
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(flag) {
112
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
137
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(flag) {
138
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
113
139
  while (1) {
114
- switch (_context4.prev = _context4.next) {
140
+ switch (_context5.prev = _context5.next) {
115
141
  case 0:
116
142
  if (flag) {
117
- _context4.next = 2;
143
+ _context5.next = 2;
118
144
  break;
119
145
  }
120
146
 
121
- return _context4.abrupt("return", false);
147
+ return _context5.abrupt("return", false);
122
148
 
123
149
  case 2:
124
150
  if (!layer.getSource().isTile) {
125
- _context4.next = 5;
151
+ _context5.next = 5;
126
152
  break;
127
153
  }
128
154
 
129
155
  layer.tileLayer = new TileLayer(layer);
130
- return _context4.abrupt("return", false);
156
+ return _context5.abrupt("return", false);
131
157
 
132
158
  case 5:
133
- _context4.next = 7;
159
+ layer.log(IDebugLog.BuildModelStart, ILayerStage.UPDATE);
160
+ _context5.next = 8;
134
161
  return _this.prepareLayerModel(layer);
135
162
 
136
- case 7:
137
- return _context4.abrupt("return", true);
138
-
139
163
  case 8:
164
+ layer.log(IDebugLog.BuildModelEnd, ILayerStage.UPDATE);
165
+ return _context5.abrupt("return", true);
166
+
167
+ case 10:
140
168
  case "end":
141
- return _context4.stop();
169
+ return _context5.stop();
142
170
  }
143
171
  }
144
- }, _callee4);
172
+ }, _callee5);
145
173
  }));
146
174
 
147
- return function (_x3) {
175
+ return function (_x4) {
148
176
  return _ref2.apply(this, arguments);
149
177
  };
150
178
  }());
@@ -164,13 +164,9 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
164
164
  while (1) {
165
165
  switch (_context.prev = _context.next) {
166
166
  case 0:
167
- _context.next = 2;
168
- return this.buildModels();
167
+ return _context.abrupt("return", this.buildModels());
169
168
 
170
- case 2:
171
- return _context.abrupt("return", _context.sent);
172
-
173
- case 3:
169
+ case 1:
174
170
  case "end":
175
171
  return _context.stop();
176
172
  }
@@ -129,13 +129,9 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
129
129
  while (1) {
130
130
  switch (_context.prev = _context.next) {
131
131
  case 0:
132
- _context.next = 2;
133
- return this.buildModels();
132
+ return _context.abrupt("return", this.buildModels());
134
133
 
135
- case 2:
136
- return _context.abrupt("return", _context.sent);
137
-
138
- case 3:
134
+ case 1:
139
135
  case "end":
140
136
  return _context.stop();
141
137
  }
@@ -163,13 +163,9 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
163
163
  while (1) {
164
164
  switch (_context.prev = _context.next) {
165
165
  case 0:
166
- _context.next = 2;
167
- return this.buildModels();
166
+ return _context.abrupt("return", this.buildModels());
168
167
 
169
- case 2:
170
- return _context.abrupt("return", _context.sent);
171
-
172
- case 3:
168
+ case 1:
173
169
  case "end":
174
170
  return _context.stop();
175
171
  }
@@ -67,13 +67,9 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
67
67
  while (1) {
68
68
  switch (_context.prev = _context.next) {
69
69
  case 0:
70
- _context.next = 2;
71
- return this.buildModels();
70
+ return _context.abrupt("return", this.buildModels());
72
71
 
73
- case 2:
74
- return _context.abrupt("return", _context.sent);
75
-
76
- case 3:
72
+ case 1:
77
73
  case "end":
78
74
  return _context.stop();
79
75
  }
@@ -134,7 +130,9 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
134
130
  }()
135
131
  }, {
136
132
  key: "clearModels",
137
- value: function clearModels() {}
133
+ value: function clearModels() {
134
+ return;
135
+ }
138
136
  }, {
139
137
  key: "registerBuiltinAttributes",
140
138
  value: function registerBuiltinAttributes() {
@@ -14,6 +14,7 @@ import { AttributeType, gl } from '@antv/l7-core';
14
14
  import { getMask } from '@antv/l7-utils';
15
15
  import { isNumber } from 'lodash';
16
16
  import BaseModel from "../../core/BaseModel";
17
+ import { SizeUnitType } from "../../core/interface";
17
18
  import { PointFillTriangulation } from "../../core/triangulation";
18
19
 
19
20
  /* babel-plugin-inline-import '../shaders/radar/radar_frag.glsl' */
@@ -21,7 +22,6 @@ var pointFillFrag = "\nuniform float u_additive;\nuniform float u_opacity: 1.0;\
21
22
 
22
23
  /* babel-plugin-inline-import '../shaders/radar/radar_vert.glsl' */
23
24
  var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nuniform float u_speed: 1.0;\nuniform float u_time;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform int u_Size_Unit;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nvarying vec2 v_exteude;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float newSize = setPickingSize(a_Size);\n\n float time = u_time * u_speed;\n mat2 rotateMatrix = mat2( \n cos(time), sin(time), \n -sin(time), cos(time)\n );\n v_exteude = rotateMatrix * a_Extrude.xy;\n\n // unpack color(vec2)\n v_color = a_Color;\n\n\n\n // anti-alias\n float blur = 0.0;\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);\n\n if(u_Size_Unit == 1) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n // radius(16-bit)\n v_radius = newSize;\n\n vec2 offset = (extrude.xy * (newSize));\n vec3 aPosition = a_Position;\n \n // \u4E0D\u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n offset = project_pixel(offset);\n \n v_data = vec4(extrude.x, extrude.y, antialiasblur, -1.0);\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp *vec4(project_pos.xy + offset, 0.0, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
24
- import { SizeUnitType } from "../../core/interface";
25
25
 
26
26
  var RadarModel = /*#__PURE__*/function (_BaseModel) {
27
27
  _inherits(RadarModel, _BaseModel);
@@ -80,13 +80,9 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
80
80
  while (1) {
81
81
  switch (_context.prev = _context.next) {
82
82
  case 0:
83
- _context.next = 2;
84
- return this.buildModels();
83
+ return _context.abrupt("return", this.buildModels());
85
84
 
86
- case 2:
87
- return _context.abrupt("return", _context.sent);
88
-
89
- case 3:
85
+ case 1:
90
86
  case "end":
91
87
  return _context.stop();
92
88
  }
@@ -119,13 +119,9 @@ var SimplePointModel = /*#__PURE__*/function (_BaseModel) {
119
119
  while (1) {
120
120
  switch (_context.prev = _context.next) {
121
121
  case 0:
122
- _context.next = 2;
123
- return this.buildModels();
122
+ return _context.abrupt("return", this.buildModels());
124
123
 
125
- case 2:
126
- return _context.abrupt("return", _context.sent);
127
-
128
- case 3:
124
+ case 1:
129
125
  case "end":
130
126
  return _context.stop();
131
127
  }
@@ -18,10 +18,10 @@ import BaseModel from "../../core/BaseModel";
18
18
  import { PolygonExtrudeTriangulation } from "../../core/triangulation";
19
19
 
20
20
  /* babel-plugin-inline-import '../shaders/extrude/polygon_extrude_frag.glsl' */
21
- var polygonExtrudeFrag = "uniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0]; \n float isSide = styleMappingMat[0][3];\n float sidey = styleMappingMat[3][0];\n float lightWeight = styleMappingMat[3][1];\n\n // Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9\n if(isSide < 0.999) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n\n if(u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n gl_FragColor = v_Color;\n }\n\n } else {\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n\n gl_FragColor = v_Color;\n }\n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n"; // extrude
21
+ var polygonExtrudeFrag = "uniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0]; \n float isSide = styleMappingMat[0][3];\n float sidey = styleMappingMat[3][0];\n float lightWeight = styleMappingMat[3][1];\n\n // Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9\n if(isSide < 0.999) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n\n if(u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n gl_FragColor = v_Color;\n }\n\n } else {\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n\n gl_FragColor = v_Color;\n }\n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
22
22
 
23
23
  /* babel-plugin-inline-import '../shaders/extrude/polygon_extrude_vert.glsl' */
24
- var polygonExtrudeVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec3 a_uvs;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_Color;\nuniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A\nuniform float u_raisingHeight: 0.0;\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - isSide\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0 // sidey\n );\n styleMappingMat[0][3] = a_Position.z;\n styleMappingMat[3][0] = a_uvs[2];\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6\n project_pos.z = a_Position.z * a_Size;\n project_pos.z += u_raisingHeight;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n }\n\n // project_pos.z += 500000.0; // amap1\n\n // project_pos.z += (500000.0 * 4.0)/pow(2.0, 21.0 - u_Zoom); // mapbox\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n styleMappingMat[3][1] = lightWeight;\n\n setPickingColor(a_PickingColor);\n}\n";
24
+ var polygonExtrudeVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec3 a_uvs;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_Color;\nuniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A\nuniform float u_raisingHeight: 0.0;\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - isSide\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0 // sidey\n );\n styleMappingMat[0][3] = a_Position.z;\n styleMappingMat[3][0] = a_uvs[2];\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6\n project_pos.z = a_Position.z * a_Size;\n project_pos.z += u_raisingHeight;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n }\n\n // project_pos.z += 500000.0; // amap1\n\n // project_pos.z += (500000.0 * 4.0)/pow(2.0, 21.0 - u_Zoom); // mapbox\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n styleMappingMat[3][1] = lightWeight;\n\n setPickingColor(a_PickingColor);\n}\n"; // extrude
25
25
 
26
26
  /* babel-plugin-inline-import '../shaders/extrude/polygon_extrudetex_frag.glsl' */
27
27
  var polygonExtrudeTexFrag = "uniform sampler2D u_texture;\nuniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float isSide = styleMappingMat[0][3];\n float lightWeight = styleMappingMat[3][1];\n float topU = styleMappingMat[2][2];\n float topV = styleMappingMat[2][3];\n\n float sidey = styleMappingMat[3][0];\n // Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9\n if(isSide < 0.999) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n\n if(u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n gl_FragColor = v_Color;\n }\n } else {\n\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n\n gl_FragColor = texture2D(u_texture, vec2(topU, topV));\n }\n \n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n"; // texture
@@ -133,13 +133,9 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
133
133
  switch (_context.prev = _context.next) {
134
134
  case 0:
135
135
  this.loadTexture();
136
- _context.next = 3;
137
- return this.buildModels();
136
+ return _context.abrupt("return", this.buildModels());
138
137
 
139
- case 3:
140
- return _context.abrupt("return", _context.sent);
141
-
142
- case 4:
138
+ case 2:
143
139
  case "end":
144
140
  return _context.stop();
145
141
  }
@@ -103,13 +103,9 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
103
103
  while (1) {
104
104
  switch (_context.prev = _context.next) {
105
105
  case 0:
106
- _context.next = 2;
107
- return this.buildModels();
106
+ return _context.abrupt("return", this.buildModels());
108
107
 
109
- case 2:
110
- return _context.abrupt("return", _context.sent);
111
-
112
- case 3:
108
+ case 1:
113
109
  case "end":
114
110
  return _context.stop();
115
111
  }
@@ -71,13 +71,9 @@ var OceanModel = /*#__PURE__*/function (_BaseModel) {
71
71
  switch (_context.prev = _context.next) {
72
72
  case 0:
73
73
  this.loadTexture();
74
- _context.next = 3;
75
- return this.buildModels();
74
+ return _context.abrupt("return", this.buildModels());
76
75
 
77
- case 3:
78
- return _context.abrupt("return", _context.sent);
79
-
80
- case 4:
76
+ case 2:
81
77
  case "end":
82
78
  return _context.stop();
83
79
  }
@@ -66,13 +66,9 @@ var WaterModel = /*#__PURE__*/function (_BaseModel) {
66
66
  switch (_context.prev = _context.next) {
67
67
  case 0:
68
68
  this.loadTexture();
69
- _context.next = 3;
70
- return this.buildModels();
69
+ return _context.abrupt("return", this.buildModels());
71
70
 
72
- case 3:
73
- return _context.abrupt("return", _context.sent);
74
-
75
- case 4:
71
+ case 2:
76
72
  case "end":
77
73
  return _context.stop();
78
74
  }
@@ -11,7 +11,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
11
11
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
12
 
13
13
  import { AttributeType, gl } from '@antv/l7-core';
14
- import { getMask, getDefaultDomain } from '@antv/l7-utils';
14
+ import { getDefaultDomain, getMask } from '@antv/l7-utils';
15
15
  import BaseModel from "../../core/BaseModel";
16
16
  import { RasterImageTriangulation } from "../../core/triangulation";
17
17
 
@@ -178,13 +178,9 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
178
178
  while (1) {
179
179
  switch (_context3.prev = _context3.next) {
180
180
  case 0:
181
- _context3.next = 2;
182
- return this.initModels();
181
+ return _context3.abrupt("return", this.initModels());
183
182
 
184
- case 2:
185
- return _context3.abrupt("return", _context3.sent);
186
-
187
- case 3:
183
+ case 1:
188
184
  case "end":
189
185
  return _context3.stop();
190
186
  }
@@ -21,12 +21,12 @@ import { getMask } from '@antv/l7-utils';
21
21
  import BaseModel from "../../core/BaseModel";
22
22
  import { RasterImageTriangulation } from "../../core/triangulation";
23
23
 
24
- /* babel-plugin-inline-import '../shaders/raster_rgb_frag.glsl' */
25
- var rasterFrag = "precision mediump float;\nuniform vec2 u_rminmax: vec2(0,255); \nuniform vec2 u_gminmax: vec2(0,255);\nuniform vec2 u_bminmax: vec2(0,255);\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nuniform float u_noDataValue : 0.0;\nvarying vec2 v_texCoord;\n\nvoid main() {\n vec3 rgb = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).rgb;\n if(rgb == vec3(u_noDataValue)) {\n gl_FragColor = vec4(0.0, 0, 0, 0.0);\n } else {\n gl_FragColor = vec4(rgb.r / (u_rminmax.y -u_rminmax.x), rgb.g /(u_gminmax.y -u_gminmax.x), rgb.b/ (u_bminmax.y - u_bminmax.x), u_opacity);\n }\n \n}";
26
-
27
24
  /* babel-plugin-inline-import '../shaders/raster_2d_vert.glsl' */
28
25
  var rasterVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n }\n}\n";
29
26
 
27
+ /* babel-plugin-inline-import '../shaders/raster_rgb_frag.glsl' */
28
+ var rasterFrag = "precision mediump float;\nuniform vec2 u_rminmax: vec2(0,255); \nuniform vec2 u_gminmax: vec2(0,255);\nuniform vec2 u_bminmax: vec2(0,255);\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nuniform float u_noDataValue : 0.0;\nvarying vec2 v_texCoord;\n\nvoid main() {\n vec3 rgb = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).rgb;\n if(rgb == vec3(u_noDataValue)) {\n gl_FragColor = vec4(0.0, 0, 0, 0.0);\n } else {\n gl_FragColor = vec4(rgb.r / (u_rminmax.y -u_rminmax.x), rgb.g /(u_gminmax.y -u_gminmax.x), rgb.b/ (u_bminmax.y - u_bminmax.x), u_opacity);\n }\n \n}";
29
+
30
30
  var RasterModel = /*#__PURE__*/function (_BaseModel) {
31
31
  _inherits(RasterModel, _BaseModel);
32
32
 
@@ -198,13 +198,9 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
198
198
  while (1) {
199
199
  switch (_context3.prev = _context3.next) {
200
200
  case 0:
201
- _context3.next = 2;
202
- return this.initModels();
203
-
204
- case 2:
205
- return _context3.abrupt("return", _context3.sent);
201
+ return _context3.abrupt("return", this.initModels());
206
202
 
207
- case 3:
203
+ case 1:
208
204
  case "end":
209
205
  return _context3.stop();
210
206
  }