@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
@@ -15,6 +15,8 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
15
15
 
16
16
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
17
17
 
18
+ var _l7Core = require("@antv/l7-core");
19
+
18
20
  var _inversify = require("inversify");
19
21
 
20
22
  require("reflect-metadata");
@@ -33,9 +35,9 @@ _dec = (0, _inversify.injectable)(), _dec(_class = /*#__PURE__*/function () {
33
35
  }
34
36
 
35
37
  (0, _createClass2.default)(LayerModelPlugin, [{
36
- key: "initLayerModel",
38
+ key: "build",
37
39
  value: function () {
38
- var _initLayerModel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(layer) {
40
+ var _build = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(layer) {
39
41
  return _regenerator.default.wrap(function _callee$(_context) {
40
42
  while (1) {
41
43
  switch (_context.prev = _context.next) {
@@ -47,9 +49,6 @@ _dec = (0, _inversify.injectable)(), _dec(_class = /*#__PURE__*/function () {
47
49
  return layer.buildModels();
48
50
 
49
51
  case 3:
50
- layer.styleNeedUpdate = false;
51
-
52
- case 4:
53
52
  case "end":
54
53
  return _context.stop();
55
54
  }
@@ -57,36 +56,60 @@ _dec = (0, _inversify.injectable)(), _dec(_class = /*#__PURE__*/function () {
57
56
  }, _callee);
58
57
  }));
59
58
 
60
- function initLayerModel(_x) {
61
- return _initLayerModel.apply(this, arguments);
59
+ function build(_x) {
60
+ return _build.apply(this, arguments);
62
61
  }
63
62
 
64
- return initLayerModel;
63
+ return build;
65
64
  }()
66
65
  }, {
67
- key: "prepareLayerModel",
66
+ key: "initLayerModel",
68
67
  value: function () {
69
- var _prepareLayerModel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(layer) {
68
+ var _initLayerModel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(layer) {
70
69
  return _regenerator.default.wrap(function _callee2$(_context2) {
71
70
  while (1) {
72
71
  switch (_context2.prev = _context2.next) {
73
72
  case 0:
74
- // 更新Model 配置项
75
- layer.prepareBuildModel(); // clear layerModel resource
76
- // 初始化 Model
73
+ _context2.next = 2;
74
+ return this.build(layer);
77
75
 
78
- _context2.next = 3;
79
- return layer.buildModels();
76
+ case 2:
77
+ layer.styleNeedUpdate = false;
80
78
 
81
79
  case 3:
82
80
  case "end":
83
81
  return _context2.stop();
84
82
  }
85
83
  }
86
- }, _callee2);
84
+ }, _callee2, this);
87
85
  }));
88
86
 
89
- function prepareLayerModel(_x2) {
87
+ function initLayerModel(_x2) {
88
+ return _initLayerModel.apply(this, arguments);
89
+ }
90
+
91
+ return initLayerModel;
92
+ }()
93
+ }, {
94
+ key: "prepareLayerModel",
95
+ value: function () {
96
+ var _prepareLayerModel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(layer) {
97
+ return _regenerator.default.wrap(function _callee3$(_context3) {
98
+ while (1) {
99
+ switch (_context3.prev = _context3.next) {
100
+ case 0:
101
+ _context3.next = 2;
102
+ return this.build(layer);
103
+
104
+ case 2:
105
+ case "end":
106
+ return _context3.stop();
107
+ }
108
+ }
109
+ }, _callee3, this);
110
+ }));
111
+
112
+ function prepareLayerModel(_x3) {
90
113
  return _prepareLayerModel.apply(this, arguments);
91
114
  }
92
115
 
@@ -97,69 +120,75 @@ _dec = (0, _inversify.injectable)(), _dec(_class = /*#__PURE__*/function () {
97
120
  value: function apply(layer) {
98
121
  var _this = this;
99
122
 
100
- layer.hooks.init.tapPromise('LayerModelPlugin', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
101
- return _regenerator.default.wrap(function _callee3$(_context3) {
123
+ layer.hooks.init.tapPromise('LayerModelPlugin', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
124
+ return _regenerator.default.wrap(function _callee4$(_context4) {
102
125
  while (1) {
103
- switch (_context3.prev = _context3.next) {
126
+ switch (_context4.prev = _context4.next) {
104
127
  case 0:
105
128
  if (!layer.getSource().isTile) {
106
- _context3.next = 4;
129
+ _context4.next = 4;
107
130
  break;
108
131
  }
109
132
 
110
133
  layer.prepareBuildModel();
111
134
  layer.tileLayer = new _BaseLayer.default(layer);
112
- return _context3.abrupt("return");
135
+ return _context4.abrupt("return");
113
136
 
114
137
  case 4:
115
- _context3.next = 6;
138
+ layer.log(_l7Core.IDebugLog.BuildModelStart, _l7Core.ILayerStage.INIT);
139
+ _context4.next = 7;
116
140
  return _this.initLayerModel(layer);
117
141
 
118
- case 6:
142
+ case 7:
143
+ layer.log(_l7Core.IDebugLog.BuildModelEnd, _l7Core.ILayerStage.INIT);
144
+
145
+ case 8:
119
146
  case "end":
120
- return _context3.stop();
147
+ return _context4.stop();
121
148
  }
122
149
  }
123
- }, _callee3);
150
+ }, _callee4);
124
151
  })));
125
152
  layer.hooks.beforeRenderData.tapPromise('LayerModelPlugin', /*#__PURE__*/function () {
126
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(flag) {
127
- return _regenerator.default.wrap(function _callee4$(_context4) {
153
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(flag) {
154
+ return _regenerator.default.wrap(function _callee5$(_context5) {
128
155
  while (1) {
129
- switch (_context4.prev = _context4.next) {
156
+ switch (_context5.prev = _context5.next) {
130
157
  case 0:
131
158
  if (flag) {
132
- _context4.next = 2;
159
+ _context5.next = 2;
133
160
  break;
134
161
  }
135
162
 
136
- return _context4.abrupt("return", false);
163
+ return _context5.abrupt("return", false);
137
164
 
138
165
  case 2:
139
166
  if (!layer.getSource().isTile) {
140
- _context4.next = 5;
167
+ _context5.next = 5;
141
168
  break;
142
169
  }
143
170
 
144
171
  layer.tileLayer = new _BaseLayer.default(layer);
145
- return _context4.abrupt("return", false);
172
+ return _context5.abrupt("return", false);
146
173
 
147
174
  case 5:
148
- _context4.next = 7;
175
+ layer.log(_l7Core.IDebugLog.BuildModelStart, _l7Core.ILayerStage.UPDATE);
176
+ _context5.next = 8;
149
177
  return _this.prepareLayerModel(layer);
150
178
 
151
- case 7:
152
- return _context4.abrupt("return", true);
153
-
154
179
  case 8:
180
+ layer.log(_l7Core.IDebugLog.BuildModelEnd, _l7Core.ILayerStage.UPDATE);
181
+ return _context5.abrupt("return", true);
182
+
183
+ case 10:
155
184
  case "end":
156
- return _context4.stop();
185
+ return _context5.stop();
157
186
  }
158
187
  }
159
- }, _callee4);
188
+ }, _callee5);
160
189
  }));
161
190
 
162
- return function (_x3) {
191
+ return function (_x4) {
163
192
  return _ref2.apply(this, arguments);
164
193
  };
165
194
  }());
@@ -183,13 +183,9 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
183
183
  while (1) {
184
184
  switch (_context.prev = _context.next) {
185
185
  case 0:
186
- _context.next = 2;
187
- return this.buildModels();
186
+ return _context.abrupt("return", this.buildModels());
188
187
 
189
- case 2:
190
- return _context.abrupt("return", _context.sent);
191
-
192
- case 3:
188
+ case 1:
193
189
  case "end":
194
190
  return _context.stop();
195
191
  }
@@ -149,13 +149,9 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
149
149
  while (1) {
150
150
  switch (_context.prev = _context.next) {
151
151
  case 0:
152
- _context.next = 2;
153
- return this.buildModels();
152
+ return _context.abrupt("return", this.buildModels());
154
153
 
155
- case 2:
156
- return _context.abrupt("return", _context.sent);
157
-
158
- case 3:
154
+ case 1:
159
155
  case "end":
160
156
  return _context.stop();
161
157
  }
@@ -181,13 +181,9 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
181
181
  while (1) {
182
182
  switch (_context.prev = _context.next) {
183
183
  case 0:
184
- _context.next = 2;
185
- return this.buildModels();
184
+ return _context.abrupt("return", this.buildModels());
186
185
 
187
- case 2:
188
- return _context.abrupt("return", _context.sent);
189
-
190
- case 3:
186
+ case 1:
191
187
  case "end":
192
188
  return _context.stop();
193
189
  }
@@ -87,13 +87,9 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
87
87
  while (1) {
88
88
  switch (_context.prev = _context.next) {
89
89
  case 0:
90
- _context.next = 2;
91
- return this.buildModels();
90
+ return _context.abrupt("return", this.buildModels());
92
91
 
93
- case 2:
94
- return _context.abrupt("return", _context.sent);
95
-
96
- case 3:
92
+ case 1:
97
93
  case "end":
98
94
  return _context.stop();
99
95
  }
@@ -154,7 +150,9 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
154
150
  }()
155
151
  }, {
156
152
  key: "clearModels",
157
- value: function clearModels() {}
153
+ value: function clearModels() {
154
+ return;
155
+ }
158
156
  }, {
159
157
  key: "registerBuiltinAttributes",
160
158
  value: function registerBuiltinAttributes() {
@@ -29,10 +29,10 @@ var _lodash = require("lodash");
29
29
 
30
30
  var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
31
31
 
32
- var _triangulation = require("../../core/triangulation");
33
-
34
32
  var _interface = require("../../core/interface");
35
33
 
34
+ var _triangulation = require("../../core/triangulation");
35
+
36
36
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
37
37
 
38
38
  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; } }
@@ -99,13 +99,9 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
99
99
  while (1) {
100
100
  switch (_context.prev = _context.next) {
101
101
  case 0:
102
- _context.next = 2;
103
- return this.buildModels();
104
-
105
- case 2:
106
- return _context.abrupt("return", _context.sent);
102
+ return _context.abrupt("return", this.buildModels());
107
103
 
108
- case 3:
104
+ case 1:
109
105
  case "end":
110
106
  return _context.stop();
111
107
  }
@@ -139,13 +139,9 @@ var SimplePointModel = /*#__PURE__*/function (_BaseModel) {
139
139
  while (1) {
140
140
  switch (_context.prev = _context.next) {
141
141
  case 0:
142
- _context.next = 2;
143
- return this.buildModels();
142
+ return _context.abrupt("return", this.buildModels());
144
143
 
145
- case 2:
146
- return _context.abrupt("return", _context.sent);
147
-
148
- case 3:
144
+ case 1:
149
145
  case "end":
150
146
  return _context.stop();
151
147
  }
@@ -38,10 +38,10 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
38
38
  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; } }
39
39
 
40
40
  /* babel-plugin-inline-import '../shaders/extrude/polygon_extrude_frag.glsl' */
41
- 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
41
+ 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";
42
42
 
43
43
  /* babel-plugin-inline-import '../shaders/extrude/polygon_extrude_vert.glsl' */
44
- 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";
44
+ 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
45
45
 
46
46
  /* babel-plugin-inline-import '../shaders/extrude/polygon_extrudetex_frag.glsl' */
47
47
  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
@@ -152,13 +152,9 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
152
152
  switch (_context.prev = _context.next) {
153
153
  case 0:
154
154
  this.loadTexture();
155
- _context.next = 3;
156
- return this.buildModels();
155
+ return _context.abrupt("return", this.buildModels());
157
156
 
158
- case 3:
159
- return _context.abrupt("return", _context.sent);
160
-
161
- case 4:
157
+ case 2:
162
158
  case "end":
163
159
  return _context.stop();
164
160
  }
@@ -121,13 +121,9 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
121
121
  while (1) {
122
122
  switch (_context.prev = _context.next) {
123
123
  case 0:
124
- _context.next = 2;
125
- return this.buildModels();
124
+ return _context.abrupt("return", this.buildModels());
126
125
 
127
- case 2:
128
- return _context.abrupt("return", _context.sent);
129
-
130
- case 3:
126
+ case 1:
131
127
  case "end":
132
128
  return _context.stop();
133
129
  }
@@ -91,13 +91,9 @@ var OceanModel = /*#__PURE__*/function (_BaseModel) {
91
91
  switch (_context.prev = _context.next) {
92
92
  case 0:
93
93
  this.loadTexture();
94
- _context.next = 3;
95
- return this.buildModels();
94
+ return _context.abrupt("return", this.buildModels());
96
95
 
97
- case 3:
98
- return _context.abrupt("return", _context.sent);
99
-
100
- case 4:
96
+ case 2:
101
97
  case "end":
102
98
  return _context.stop();
103
99
  }
@@ -86,13 +86,9 @@ var WaterModel = /*#__PURE__*/function (_BaseModel) {
86
86
  switch (_context.prev = _context.next) {
87
87
  case 0:
88
88
  this.loadTexture();
89
- _context.next = 3;
90
- return this.buildModels();
89
+ return _context.abrupt("return", this.buildModels());
91
90
 
92
- case 3:
93
- return _context.abrupt("return", _context.sent);
94
-
95
- case 4:
91
+ case 2:
96
92
  case "end":
97
93
  return _context.stop();
98
94
  }
@@ -195,13 +195,9 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
195
195
  while (1) {
196
196
  switch (_context3.prev = _context3.next) {
197
197
  case 0:
198
- _context3.next = 2;
199
- return this.initModels();
198
+ return _context3.abrupt("return", this.initModels());
200
199
 
201
- case 2:
202
- return _context3.abrupt("return", _context3.sent);
203
-
204
- case 3:
200
+ case 1:
205
201
  case "end":
206
202
  return _context3.stop();
207
203
  }
@@ -44,12 +44,12 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
44
44
 
45
45
  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; } }
46
46
 
47
- /* babel-plugin-inline-import '../shaders/raster_rgb_frag.glsl' */
48
- 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}";
49
-
50
47
  /* babel-plugin-inline-import '../shaders/raster_2d_vert.glsl' */
51
48
  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";
52
49
 
50
+ /* babel-plugin-inline-import '../shaders/raster_rgb_frag.glsl' */
51
+ 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}";
52
+
53
53
  var RasterModel = /*#__PURE__*/function (_BaseModel) {
54
54
  (0, _inherits2.default)(RasterModel, _BaseModel);
55
55
 
@@ -219,13 +219,9 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
219
219
  while (1) {
220
220
  switch (_context3.prev = _context3.next) {
221
221
  case 0:
222
- _context3.next = 2;
223
- return this.initModels();
224
-
225
- case 2:
226
- return _context3.abrupt("return", _context3.sent);
222
+ return _context3.abrupt("return", this.initModels());
227
223
 
228
- case 3:
224
+ case 1:
229
225
  case "end":
230
226
  return _context3.stop();
231
227
  }
@@ -153,13 +153,9 @@ var RasterTerrainRGB = /*#__PURE__*/function (_BaseModel) {
153
153
  while (1) {
154
154
  switch (_context2.prev = _context2.next) {
155
155
  case 0:
156
- _context2.next = 2;
157
- return this.initModels();
156
+ return _context2.abrupt("return", this.initModels());
158
157
 
159
- case 2:
160
- return _context2.abrupt("return", _context2.sent);
161
-
162
- case 3:
158
+ case 1:
163
159
  case "end":
164
160
  return _context2.stop();
165
161
  }
@@ -192,7 +192,10 @@ var Base = /*#__PURE__*/function () {
192
192
  }, {
193
193
  key: "getLayers",
194
194
  value: function getLayers(tile) {
195
- if (!tile) return [];
195
+ if (!tile) {
196
+ return [];
197
+ }
198
+
196
199
  return this.tileLayerCache.get(tile.key) || [];
197
200
  }
198
201
  }, {
@@ -238,7 +241,10 @@ var Base = /*#__PURE__*/function () {
238
241
  key: "updateTileVisible",
239
242
  value: function updateTileVisible(tile, layerService) {
240
243
  var layers = this.getLayers(tile);
241
- if (layers.length === 0) return;
244
+
245
+ if (layers.length === 0) {
246
+ return;
247
+ }
242
248
 
243
249
  if (tile.isVisible) {
244
250
  // 如果可见直接进行渲染,父级发
@@ -277,7 +283,10 @@ var Base = /*#__PURE__*/function () {
277
283
  }, {
278
284
  key: "isTileLoaded",
279
285
  value: function isTileLoaded(tile) {
280
- if (tile.isLoad) return true;
286
+ if (tile.isLoad) {
287
+ return true;
288
+ }
289
+
281
290
  var isLoad = this.getLayers(tile).length === tile.loadedLayers;
282
291
  tile.isLoad = isLoad;
283
292
  return isLoad;
@@ -287,7 +296,10 @@ var Base = /*#__PURE__*/function () {
287
296
  value: function isTileChildLoaded(tile) {
288
297
  var _this2 = this;
289
298
 
290
- if (tile.isChildLoad) return true;
299
+ if (tile.isChildLoad) {
300
+ return true;
301
+ }
302
+
291
303
  var children = tile.children;
292
304
  var isLoad = children.filter(function (child) {
293
305
  return _this2.isTileLoaded(child);
@@ -31,7 +31,7 @@ var TileLayerService = /*#__PURE__*/function () {
31
31
  parent = _ref.parent;
32
32
  (0, _classCallCheck2.default)(this, TileLayerService);
33
33
  (0, _defineProperty2.default)(this, "tileResource", new Map());
34
- (0, _defineProperty2.default)(this, "_tiles", []);
34
+ (0, _defineProperty2.default)(this, "layerTiles", []);
35
35
  this.rendererService = rendererService;
36
36
  this.layerService = layerService;
37
37
  this.parent = parent;
@@ -40,24 +40,24 @@ var TileLayerService = /*#__PURE__*/function () {
40
40
  (0, _createClass2.default)(TileLayerService, [{
41
41
  key: "tiles",
42
42
  get: function get() {
43
- return this._tiles;
43
+ return this.layerTiles;
44
44
  }
45
45
  }, {
46
46
  key: "hasTile",
47
47
  value: function hasTile(tileKey) {
48
- return this._tiles.some(function (tile) {
48
+ return this.layerTiles.some(function (tile) {
49
49
  return tile.key === tileKey;
50
50
  });
51
51
  }
52
52
  }, {
53
53
  key: "addTile",
54
54
  value: function addTile(tile) {
55
- this._tiles.push(tile);
55
+ this.layerTiles.push(tile);
56
56
  }
57
57
  }, {
58
58
  key: "getTile",
59
59
  value: function getTile(tileKey) {
60
- return this._tiles.find(function (tile) {
60
+ return this.layerTiles.find(function (tile) {
61
61
  return tile.key === tileKey;
62
62
  });
63
63
  }
@@ -65,20 +65,21 @@ var TileLayerService = /*#__PURE__*/function () {
65
65
  key: "getVisibleTileBylngLat",
66
66
  value: function getVisibleTileBylngLat(lngLat) {
67
67
  // 加载完成 & 可见 & 鼠标选中
68
- return this._tiles.find(function (tile) {
68
+ return this.layerTiles.find(function (tile) {
69
69
  return tile.isLoaded && tile.visible && tile.lnglatInBounds(lngLat);
70
70
  });
71
71
  }
72
72
  }, {
73
73
  key: "removeTile",
74
74
  value: function removeTile(tileKey) {
75
- var index = this._tiles.findIndex(function (tile) {
76
- return tile.key === tileKey;
75
+ var index = this.layerTiles.findIndex(function (t) {
76
+ return t.key === tileKey;
77
77
  });
78
+ var tile = this.layerTiles.splice(index, 1);
78
79
 
79
- var tile = this._tiles.splice(index, 1);
80
-
81
- tile[0] && tile[0].destroy();
80
+ if (tile[0]) {
81
+ tile[0].destroy();
82
+ }
82
83
  }
83
84
  }, {
84
85
  key: "updateTileVisible",
@@ -189,10 +190,9 @@ var TileLayerService = /*#__PURE__*/function () {
189
190
  }, {
190
191
  key: "getRenderLayers",
191
192
  value: function getRenderLayers() {
192
- var tileList = this._tiles.filter(function (t) {
193
+ var tileList = this.layerTiles.filter(function (t) {
193
194
  return t.visible && t.isLoaded;
194
195
  });
195
-
196
196
  var layers = [];
197
197
  tileList.map(function (tile) {
198
198
  return layers.push.apply(layers, (0, _toConsumableArray2.default)(tile.getLayers()));
@@ -202,10 +202,9 @@ var TileLayerService = /*#__PURE__*/function () {
202
202
  }, {
203
203
  key: "getLayers",
204
204
  value: function getLayers() {
205
- var tileList = this._tiles.filter(function (t) {
205
+ var tileList = this.layerTiles.filter(function (t) {
206
206
  return t.isLoaded;
207
207
  });
208
-
209
208
  var layers = [];
210
209
  tileList.map(function (tile) {
211
210
  return layers.push.apply(layers, (0, _toConsumableArray2.default)(tile.getLayers()));
@@ -215,15 +214,14 @@ var TileLayerService = /*#__PURE__*/function () {
215
214
  }, {
216
215
  key: "getTiles",
217
216
  value: function getTiles() {
218
- return this._tiles;
217
+ return this.layerTiles;
219
218
  }
220
219
  }, {
221
220
  key: "destroy",
222
221
  value: function destroy() {
223
- this._tiles.forEach(function (t) {
222
+ this.layerTiles.forEach(function (t) {
224
223
  return t.destroy();
225
224
  });
226
-
227
225
  this.tileResource.clear();
228
226
  }
229
227
  }]);