@antv/l7-layers 2.13.6 → 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 (121) 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 +1 -1
  6. package/es/core/BaseLayer.js +14 -8
  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.js +2 -2
  23. package/es/line/models/linearline.js +2 -6
  24. package/es/line/models/simpleLine.js +2 -6
  25. package/es/line/models/wall.js +2 -6
  26. package/es/mask/models/fill.js +6 -7
  27. package/es/plugins/DataMappingPlugin.js +10 -6
  28. package/es/plugins/DataSourcePlugin.js +4 -4
  29. package/es/plugins/FeatureScalePlugin.js +8 -6
  30. package/es/plugins/LayerModelPlugin.js +8 -6
  31. package/es/point/models/earthExtrude.js +2 -6
  32. package/es/point/models/earthFill.js +2 -6
  33. package/es/point/models/extrude.js +2 -6
  34. package/es/point/models/normal.js +5 -7
  35. package/es/point/models/radar.js +3 -7
  36. package/es/point/models/simplePoint.js +2 -6
  37. package/es/polygon/models/extrude.js +4 -8
  38. package/es/polygon/models/fill.js +2 -6
  39. package/es/polygon/models/ocean.js +2 -6
  40. package/es/polygon/models/water.js +2 -6
  41. package/es/raster/models/raster.js +3 -7
  42. package/es/raster/models/rasterRgb.js +5 -9
  43. package/es/raster/models/rasterTerrainRgb.js +3 -7
  44. package/es/tile/manager/base.d.ts +1 -1
  45. package/es/tile/manager/base.js +16 -4
  46. package/es/tile/service/TileLayerService.d.ts +3 -3
  47. package/es/tile/service/TileLayerService.js +16 -18
  48. package/es/tile/service/TileSourceService.js +1 -1
  49. package/es/tile/tileFactory/DebugTile.js +3 -3
  50. package/es/tile/tileFactory/ImageTile.js +1 -0
  51. package/es/tile/tileFactory/MaskTile.js +5 -1
  52. package/es/tile/tileFactory/RasterRGBTile.js +1 -0
  53. package/es/tile/tileFactory/RasterTerrainRGBTile.js +1 -0
  54. package/es/tile/tileFactory/RasterTile.js +3 -2
  55. package/es/tile/tileFactory/Tile.js +5 -3
  56. package/es/tile/tileFactory/VectorTile.js +0 -1
  57. package/es/tile/tileFactory/index.d.ts +4 -4
  58. package/es/tile/tileFactory/index.js +4 -4
  59. package/es/tile/tileFactory/layers/TileDebugLayer.js +3 -0
  60. package/es/tile/tileFactory/util.d.ts +1 -1
  61. package/es/tile/tileFactory/util.js +1 -1
  62. package/es/tile/tileLayer/BaseLayer.d.ts +1 -1
  63. package/es/tile/tileLayer/BaseLayer.js +6 -4
  64. package/es/wind/models/wind.js +2 -6
  65. package/lib/Geometry/models/billboard.js +2 -6
  66. package/lib/Geometry/models/plane.js +2 -6
  67. package/lib/Geometry/models/sprite.js +2 -6
  68. package/lib/citybuliding/models/build.js +2 -6
  69. package/lib/core/BaseLayer.js +13 -7
  70. package/lib/earth/models/atmosphere.js +2 -6
  71. package/lib/earth/models/base.js +2 -6
  72. package/lib/earth/models/bloomsphere.js +2 -6
  73. package/lib/heatmap/models/grid.js +2 -6
  74. package/lib/heatmap/models/grid3d.js +2 -6
  75. package/lib/heatmap/models/heatmap.js +2 -6
  76. package/lib/heatmap/models/hexagon.js +2 -6
  77. package/lib/image/models/image.js +2 -6
  78. package/lib/line/models/arc.js +2 -6
  79. package/lib/line/models/arc_3d.js +2 -6
  80. package/lib/line/models/earthArc_3d.js +2 -6
  81. package/lib/line/models/great_circle.js +2 -6
  82. package/lib/line/models/half.js +2 -6
  83. package/lib/line/models/line.js +2 -2
  84. package/lib/line/models/linearline.js +2 -6
  85. package/lib/line/models/simpleLine.js +2 -6
  86. package/lib/line/models/wall.js +2 -6
  87. package/lib/mask/models/fill.js +6 -7
  88. package/lib/plugins/DataMappingPlugin.js +9 -5
  89. package/lib/plugins/DataSourcePlugin.js +3 -3
  90. package/lib/plugins/FeatureScalePlugin.js +7 -5
  91. package/lib/plugins/LayerModelPlugin.js +7 -5
  92. package/lib/point/models/earthExtrude.js +2 -6
  93. package/lib/point/models/earthFill.js +2 -6
  94. package/lib/point/models/extrude.js +2 -6
  95. package/lib/point/models/normal.js +5 -7
  96. package/lib/point/models/radar.js +4 -8
  97. package/lib/point/models/simplePoint.js +2 -6
  98. package/lib/polygon/models/extrude.js +4 -8
  99. package/lib/polygon/models/fill.js +2 -6
  100. package/lib/polygon/models/ocean.js +2 -6
  101. package/lib/polygon/models/water.js +2 -6
  102. package/lib/raster/models/raster.js +2 -6
  103. package/lib/raster/models/rasterRgb.js +5 -9
  104. package/lib/raster/models/rasterTerrainRgb.js +2 -6
  105. package/lib/tile/manager/base.js +16 -4
  106. package/lib/tile/service/TileLayerService.js +16 -18
  107. package/lib/tile/service/TileSourceService.js +1 -1
  108. package/lib/tile/tileFactory/DebugTile.js +3 -3
  109. package/lib/tile/tileFactory/ImageTile.js +1 -0
  110. package/lib/tile/tileFactory/MaskTile.js +5 -1
  111. package/lib/tile/tileFactory/RasterRGBTile.js +1 -0
  112. package/lib/tile/tileFactory/RasterTerrainRGBTile.js +1 -0
  113. package/lib/tile/tileFactory/RasterTile.js +4 -3
  114. package/lib/tile/tileFactory/Tile.js +5 -3
  115. package/lib/tile/tileFactory/VectorTile.js +0 -1
  116. package/lib/tile/tileFactory/index.js +5 -5
  117. package/lib/tile/tileFactory/layers/TileDebugLayer.js +3 -0
  118. package/lib/tile/tileFactory/util.js +2 -2
  119. package/lib/tile/tileLayer/BaseLayer.js +7 -5
  120. package/lib/wind/models/wind.js +2 -6
  121. 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 { IDebugLog } from '@antv/l7-core';
8
+ import { IDebugLog, ILayerStage } from '@antv/l7-core';
9
9
  import { injectable } from 'inversify';
10
10
  import 'reflect-metadata';
11
11
  import TileLayer from "../tile/tileLayer/BaseLayer";
@@ -119,12 +119,12 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
119
119
  return _context4.abrupt("return");
120
120
 
121
121
  case 4:
122
- layer.log(IDebugLog.BuildModelStart);
122
+ layer.log(IDebugLog.BuildModelStart, ILayerStage.INIT);
123
123
  _context4.next = 7;
124
124
  return _this.initLayerModel(layer);
125
125
 
126
126
  case 7:
127
- layer.log(IDebugLog.BuildModelEnd);
127
+ layer.log(IDebugLog.BuildModelEnd, ILayerStage.INIT);
128
128
 
129
129
  case 8:
130
130
  case "end":
@@ -156,13 +156,15 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
156
156
  return _context5.abrupt("return", false);
157
157
 
158
158
  case 5:
159
- _context5.next = 7;
159
+ layer.log(IDebugLog.BuildModelStart, ILayerStage.UPDATE);
160
+ _context5.next = 8;
160
161
  return _this.prepareLayerModel(layer);
161
162
 
162
- case 7:
163
+ case 8:
164
+ layer.log(IDebugLog.BuildModelEnd, ILayerStage.UPDATE);
163
165
  return _context5.abrupt("return", true);
164
166
 
165
- case 8:
167
+ case 10:
166
168
  case "end":
167
169
  return _context5.stop();
168
170
  }
@@ -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
  }
@@ -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
 
@@ -136,13 +136,9 @@ var RasterTerrainRGB = /*#__PURE__*/function (_BaseModel) {
136
136
  while (1) {
137
137
  switch (_context2.prev = _context2.next) {
138
138
  case 0:
139
- _context2.next = 2;
140
- return this.initModels();
139
+ return _context2.abrupt("return", this.initModels());
141
140
 
142
- case 2:
143
- return _context2.abrupt("return", _context2.sent);
144
-
145
- case 3:
141
+ case 1:
146
142
  case "end":
147
143
  return _context2.stop();
148
144
  }
@@ -1,4 +1,4 @@
1
- import { ILayer, IRendererService, IMapService, ISubLayerInitOptions, ILayerService } from '@antv/l7-core';
1
+ import { ILayer, ILayerService, IMapService, IRendererService, ISubLayerInitOptions } from '@antv/l7-core';
2
2
  import { SourceTile } from '@antv/l7-utils';
3
3
  export declare class Base {
4
4
  sourceLayer: string;
@@ -177,7 +177,10 @@ export var Base = /*#__PURE__*/function () {
177
177
  }, {
178
178
  key: "getLayers",
179
179
  value: function getLayers(tile) {
180
- if (!tile) return [];
180
+ if (!tile) {
181
+ return [];
182
+ }
183
+
181
184
  return this.tileLayerCache.get(tile.key) || [];
182
185
  }
183
186
  }, {
@@ -223,7 +226,10 @@ export var Base = /*#__PURE__*/function () {
223
226
  key: "updateTileVisible",
224
227
  value: function updateTileVisible(tile, layerService) {
225
228
  var layers = this.getLayers(tile);
226
- if (layers.length === 0) return;
229
+
230
+ if (layers.length === 0) {
231
+ return;
232
+ }
227
233
 
228
234
  if (tile.isVisible) {
229
235
  // 如果可见直接进行渲染,父级发
@@ -262,7 +268,10 @@ export var Base = /*#__PURE__*/function () {
262
268
  }, {
263
269
  key: "isTileLoaded",
264
270
  value: function isTileLoaded(tile) {
265
- if (tile.isLoad) return true;
271
+ if (tile.isLoad) {
272
+ return true;
273
+ }
274
+
266
275
  var isLoad = this.getLayers(tile).length === tile.loadedLayers;
267
276
  tile.isLoad = isLoad;
268
277
  return isLoad;
@@ -272,7 +281,10 @@ export var Base = /*#__PURE__*/function () {
272
281
  value: function isTileChildLoaded(tile) {
273
282
  var _this2 = this;
274
283
 
275
- if (tile.isChildLoad) return true;
284
+ if (tile.isChildLoad) {
285
+ return true;
286
+ }
287
+
276
288
  var children = tile.children;
277
289
  var isLoad = children.filter(function (child) {
278
290
  return _this2.isTileLoaded(child);
@@ -1,7 +1,7 @@
1
1
  import { ILayer, ILayerService, ILngLat, IRendererService, ITile } from '@antv/l7-core';
2
2
  import { SourceTile } from '@antv/l7-utils';
3
3
  import 'reflect-metadata';
4
- interface TileLayerServiceOptions {
4
+ interface ITileLayerServiceOptions {
5
5
  rendererService: IRendererService;
6
6
  layerService: ILayerService;
7
7
  parent: ILayer;
@@ -14,8 +14,8 @@ export declare class TileLayerService {
14
14
  private rendererService;
15
15
  private layerService;
16
16
  private parent;
17
- private _tiles;
18
- constructor({ rendererService, layerService, parent }: TileLayerServiceOptions);
17
+ private layerTiles;
18
+ constructor({ rendererService, layerService, parent, }: ITileLayerServiceOptions);
19
19
  get tiles(): ITile[];
20
20
  hasTile(tileKey: string): boolean;
21
21
  addTile(tile: ITile): void;
@@ -18,7 +18,7 @@ export var TileLayerService = /*#__PURE__*/function () {
18
18
 
19
19
  _defineProperty(this, "tileResource", new Map());
20
20
 
21
- _defineProperty(this, "_tiles", []);
21
+ _defineProperty(this, "layerTiles", []);
22
22
 
23
23
  this.rendererService = rendererService;
24
24
  this.layerService = layerService;
@@ -28,24 +28,24 @@ export var TileLayerService = /*#__PURE__*/function () {
28
28
  _createClass(TileLayerService, [{
29
29
  key: "tiles",
30
30
  get: function get() {
31
- return this._tiles;
31
+ return this.layerTiles;
32
32
  }
33
33
  }, {
34
34
  key: "hasTile",
35
35
  value: function hasTile(tileKey) {
36
- return this._tiles.some(function (tile) {
36
+ return this.layerTiles.some(function (tile) {
37
37
  return tile.key === tileKey;
38
38
  });
39
39
  }
40
40
  }, {
41
41
  key: "addTile",
42
42
  value: function addTile(tile) {
43
- this._tiles.push(tile);
43
+ this.layerTiles.push(tile);
44
44
  }
45
45
  }, {
46
46
  key: "getTile",
47
47
  value: function getTile(tileKey) {
48
- return this._tiles.find(function (tile) {
48
+ return this.layerTiles.find(function (tile) {
49
49
  return tile.key === tileKey;
50
50
  });
51
51
  }
@@ -53,20 +53,21 @@ export var TileLayerService = /*#__PURE__*/function () {
53
53
  key: "getVisibleTileBylngLat",
54
54
  value: function getVisibleTileBylngLat(lngLat) {
55
55
  // 加载完成 & 可见 & 鼠标选中
56
- return this._tiles.find(function (tile) {
56
+ return this.layerTiles.find(function (tile) {
57
57
  return tile.isLoaded && tile.visible && tile.lnglatInBounds(lngLat);
58
58
  });
59
59
  }
60
60
  }, {
61
61
  key: "removeTile",
62
62
  value: function removeTile(tileKey) {
63
- var index = this._tiles.findIndex(function (tile) {
64
- return tile.key === tileKey;
63
+ var index = this.layerTiles.findIndex(function (t) {
64
+ return t.key === tileKey;
65
65
  });
66
+ var tile = this.layerTiles.splice(index, 1);
66
67
 
67
- var tile = this._tiles.splice(index, 1);
68
-
69
- tile[0] && tile[0].destroy();
68
+ if (tile[0]) {
69
+ tile[0].destroy();
70
+ }
70
71
  }
71
72
  }, {
72
73
  key: "updateTileVisible",
@@ -177,10 +178,9 @@ export var TileLayerService = /*#__PURE__*/function () {
177
178
  }, {
178
179
  key: "getRenderLayers",
179
180
  value: function getRenderLayers() {
180
- var tileList = this._tiles.filter(function (t) {
181
+ var tileList = this.layerTiles.filter(function (t) {
181
182
  return t.visible && t.isLoaded;
182
183
  });
183
-
184
184
  var layers = [];
185
185
  tileList.map(function (tile) {
186
186
  return layers.push.apply(layers, _toConsumableArray(tile.getLayers()));
@@ -190,10 +190,9 @@ export var TileLayerService = /*#__PURE__*/function () {
190
190
  }, {
191
191
  key: "getLayers",
192
192
  value: function getLayers() {
193
- var tileList = this._tiles.filter(function (t) {
193
+ var tileList = this.layerTiles.filter(function (t) {
194
194
  return t.isLoaded;
195
195
  });
196
-
197
196
  var layers = [];
198
197
  tileList.map(function (tile) {
199
198
  return layers.push.apply(layers, _toConsumableArray(tile.getLayers()));
@@ -203,15 +202,14 @@ export var TileLayerService = /*#__PURE__*/function () {
203
202
  }, {
204
203
  key: "getTiles",
205
204
  value: function getTiles() {
206
- return this._tiles;
205
+ return this.layerTiles;
207
206
  }
208
207
  }, {
209
208
  key: "destroy",
210
209
  value: function destroy() {
211
- this._tiles.forEach(function (t) {
210
+ this.layerTiles.forEach(function (t) {
212
211
  return t.destroy();
213
212
  });
214
-
215
213
  this.tileResource.clear();
216
214
  }
217
215
  }]);
@@ -18,7 +18,7 @@ export var TileSourceService = /*#__PURE__*/function () {
18
18
  var p = null;
19
19
  var properties = features[0];
20
20
  features.map(function (feature) {
21
- var polygon = turf.polygon(feature.coordinates);
21
+ var polygon = turf.polygon(feature.coordinates); // tslint:disable-next-line: prefer-conditional-expression
22
22
 
23
23
  if (p === null) {
24
24
  p = polygon;
@@ -10,9 +10,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
10
10
 
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
- import Tile from "./Tile";
14
- import PointLayer from "../../point";
15
13
  import LineLayer from "../../line";
14
+ import PointLayer from "../../point";
15
+ import Tile from "./Tile";
16
16
 
17
17
  var DebugTile = /*#__PURE__*/function (_Tile) {
18
18
  _inherits(DebugTile, _Tile);
@@ -78,7 +78,7 @@ var DebugTile = /*#__PURE__*/function (_Tile) {
78
78
  key: "getSourceOption",
79
79
  value: function getSourceOption() {
80
80
  var rawSource = this.parent.getSource();
81
- var features = this.sourceTile.data.layers['testTile'].features;
81
+ var features = this.sourceTile.data.layers.testTile.features;
82
82
  return {
83
83
  data: {
84
84
  type: 'FeatureCollection',
@@ -38,6 +38,7 @@ var ImageTile = /*#__PURE__*/function (_Tile) {
38
38
  layerOptions = this.getLayerOptions();
39
39
  sourceOptions = this.getSourceOption();
40
40
  layer = new ImageLayer(_objectSpread({}, layerOptions)).source(sourceOptions.data, sourceOptions.options); // 初始化数据映射
41
+ // tslint:disable-next-line: no-unused-expression
41
42
 
42
43
  attributes && Object.keys(attributes).forEach(function (type) {
43
44
  var _attributes$attr, _attributes$attr2;
@@ -38,6 +38,7 @@ var MaskTile = /*#__PURE__*/function (_Tile) {
38
38
  layerOptions = this.getLayerOptions();
39
39
  sourceOptions = this.getSourceOption();
40
40
  layer = new MaskLayer(_objectSpread({}, layerOptions)).source(sourceOptions.data, sourceOptions.options); // 初始化数据映射
41
+ // tslint:disable-next-line: no-unused-expression
41
42
 
42
43
  attributes && Object.keys(attributes).forEach(function (type) {
43
44
  var _attributes$attr, _attributes$attr2;
@@ -69,7 +70,10 @@ var MaskTile = /*#__PURE__*/function (_Tile) {
69
70
  }, {
70
71
  key: "getFeatures",
71
72
  value: function getFeatures(sourceLayer) {
72
- if (!sourceLayer) return [];
73
+ if (!sourceLayer) {
74
+ return [];
75
+ }
76
+
73
77
  var source = this.sourceTile.data;
74
78
  return source.getTileData(sourceLayer);
75
79
  }
@@ -40,6 +40,7 @@ var RasterTile = /*#__PURE__*/function (_Tile) {
40
40
  layerOptions = this.getLayerOptions();
41
41
  sourceOptions = this.getSourceOption();
42
42
  layer = new RasterLayer(_objectSpread({}, layerOptions)).source(sourceOptions.data, sourceOptions.options); // 初始化数据映射
43
+ // tslint:disable-next-line: no-unused-expression
43
44
 
44
45
  attributes && Object.keys(attributes).forEach(function (type) {
45
46
  var _attributes$attr, _attributes$attr2;
@@ -38,6 +38,7 @@ var RasterTerrainRGBTile = /*#__PURE__*/function (_Tile) {
38
38
  layerOptions = this.getLayerOptions();
39
39
  sourceOptions = this.getSourceOption();
40
40
  layer = new RasterLayer(_objectSpread({}, layerOptions)).source(sourceOptions.data, sourceOptions.options); // 初始化数据映射
41
+ // tslint:disable-next-line: no-unused-expression
41
42
 
42
43
  attributes && Object.keys(attributes).forEach(function (type) {
43
44
  var _attributes$attr, _attributes$attr2;