@antv/l7-layers 2.12.1 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/es/core/BaseLayer.d.ts +1 -1
  2. package/es/core/BaseLayer.js +18 -7
  3. package/es/core/TextureService.d.ts +4 -3
  4. package/es/core/TextureService.js +32 -10
  5. package/es/core/interface.d.ts +5 -6
  6. package/es/core/interface.js +7 -0
  7. package/es/line/index.d.ts +1 -1
  8. package/es/line/models/index.d.ts +1 -1
  9. package/es/line/models/index.js +0 -2
  10. package/es/plugins/DataMappingPlugin.js +10 -7
  11. package/es/point/index.d.ts +1 -1
  12. package/es/point/models/fill.d.ts +0 -14
  13. package/es/point/models/fill.js +9 -100
  14. package/es/point/models/fillmage.d.ts +0 -5
  15. package/es/point/models/fillmage.js +15 -65
  16. package/es/point/models/index.d.ts +1 -1
  17. package/es/point/models/index.js +0 -4
  18. package/es/point/models/radar.d.ts +0 -7
  19. package/es/point/models/radar.js +13 -79
  20. package/es/point/models/text.js +1 -1
  21. package/es/point/shaders/fill_vert.glsl +9 -26
  22. package/es/point/shaders/image/fillImage_vert.glsl +8 -14
  23. package/es/point/shaders/radar/radar_vert.glsl +12 -19
  24. package/es/point/shaders/text_vert.glsl +1 -1
  25. package/es/polygon/index.js +0 -2
  26. package/es/polygon/models/index.d.ts +1 -1
  27. package/es/polygon/models/index.js +2 -4
  28. package/es/raster/models/raster.d.ts +0 -2
  29. package/es/raster/models/raster.js +6 -22
  30. package/es/raster/models/rasterTerrainRgb.js +6 -6
  31. package/es/raster/shaders/raster_2d_frag.glsl +1 -0
  32. package/es/tile/tileFactory/RasterRGBTile.js +0 -1
  33. package/es/tile/tileFactory/RasterTile.js +13 -8
  34. package/lib/core/BaseLayer.js +17 -6
  35. package/lib/core/TextureService.js +31 -9
  36. package/lib/core/interface.js +9 -1
  37. package/lib/line/models/index.js +0 -3
  38. package/lib/plugins/DataMappingPlugin.js +10 -7
  39. package/lib/point/models/fill.js +8 -98
  40. package/lib/point/models/fillmage.js +16 -67
  41. package/lib/point/models/index.js +0 -6
  42. package/lib/point/models/radar.js +13 -80
  43. package/lib/point/models/text.js +1 -1
  44. package/lib/point/shaders/fill_vert.glsl +9 -26
  45. package/lib/point/shaders/image/fillImage_vert.glsl +8 -14
  46. package/lib/point/shaders/radar/radar_vert.glsl +12 -19
  47. package/lib/point/shaders/text_vert.glsl +1 -1
  48. package/lib/polygon/index.js +0 -2
  49. package/lib/polygon/models/index.js +2 -5
  50. package/lib/raster/models/raster.js +5 -21
  51. package/lib/raster/models/rasterTerrainRgb.js +5 -5
  52. package/lib/raster/shaders/raster_2d_frag.glsl +1 -0
  53. package/lib/tile/tileFactory/RasterTile.js +14 -8
  54. package/package.json +6 -6
  55. package/es/line/models/tile.d.ts +0 -8
  56. package/es/line/models/tile.js +0 -201
  57. package/es/line/shaders/tile/line_tile_map_vert.glsl +0 -25
  58. package/es/line/shaders/tile/line_tile_vert.glsl +0 -52
  59. package/es/line/shaders/tile/simpleline_map_vert.glsl +0 -15
  60. package/es/line/shaders/tile/simpleline_vert.glsl +0 -21
  61. package/es/point/models/tile.d.ts +0 -15
  62. package/es/point/models/tile.js +0 -217
  63. package/es/point/models/tileText.d.ts +0 -52
  64. package/es/point/models/tileText.js +0 -544
  65. package/es/point/shaders/tile/fill_tile_frag.glsl +0 -76
  66. package/es/point/shaders/tile/fill_tile_vert.glsl +0 -78
  67. package/es/point/shaders/tile/text_frag.glsl +0 -33
  68. package/es/point/shaders/tile/text_map_frag.glsl +0 -31
  69. package/es/point/shaders/tile/text_map_vert.glsl +0 -38
  70. package/es/point/shaders/tile/text_vert.glsl +0 -48
  71. package/es/polygon/models/tile.d.ts +0 -12
  72. package/es/polygon/models/tile.js +0 -141
  73. package/es/polygon/shaders/tile/polygon_tile_map_vert.glsl +0 -16
  74. package/es/polygon/shaders/tile/polygon_tile_vert.glsl +0 -42
  75. package/es/raster/models/rasterTile.d.ts +0 -18
  76. package/es/raster/models/rasterTile.js +0 -180
  77. package/es/tile/tileFactory/layers/RasterDataLayer.d.ts +0 -11
  78. package/es/tile/tileFactory/layers/RasterDataLayer.js +0 -89
  79. package/lib/line/models/tile.js +0 -217
  80. package/lib/line/shaders/tile/line_tile_map_vert.glsl +0 -25
  81. package/lib/line/shaders/tile/line_tile_vert.glsl +0 -52
  82. package/lib/line/shaders/tile/simpleline_map_vert.glsl +0 -15
  83. package/lib/line/shaders/tile/simpleline_vert.glsl +0 -21
  84. package/lib/point/models/tile.js +0 -233
  85. package/lib/point/models/tileText.js +0 -560
  86. package/lib/point/shaders/tile/fill_tile_frag.glsl +0 -76
  87. package/lib/point/shaders/tile/fill_tile_vert.glsl +0 -78
  88. package/lib/point/shaders/tile/text_frag.glsl +0 -33
  89. package/lib/point/shaders/tile/text_map_frag.glsl +0 -31
  90. package/lib/point/shaders/tile/text_map_vert.glsl +0 -38
  91. package/lib/point/shaders/tile/text_vert.glsl +0 -48
  92. package/lib/polygon/models/tile.js +0 -156
  93. package/lib/polygon/shaders/tile/polygon_tile_map_vert.glsl +0 -16
  94. package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +0 -42
  95. package/lib/raster/models/rasterTile.js +0 -196
  96. package/lib/tile/tileFactory/layers/RasterDataLayer.js +0 -105
@@ -9,8 +9,6 @@ exports.default = void 0;
9
9
 
10
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
11
 
12
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
-
14
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
15
13
 
16
14
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
@@ -29,8 +27,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
29
27
 
30
28
  var _l7Core = require("@antv/l7-core");
31
29
 
32
- var _l7Maps = require("@antv/l7-maps");
33
-
34
30
  var _l7Utils = require("@antv/l7-utils");
35
31
 
36
32
  var _lodash = require("lodash");
@@ -39,6 +35,8 @@ var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
39
35
 
40
36
  var _triangulation = require("../../core/triangulation");
41
37
 
38
+ var _interface = require("../../core/interface");
39
+
42
40
  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); }; }
43
41
 
44
42
  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; } }
@@ -48,7 +46,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
48
46
  var pointFillFrag = "uniform sampler2D u_texture;\nuniform vec2 u_textSize;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\nvarying vec2 v_uv; // \u672C\u8EAB\u7684 uv \u5750\u6807\nvarying vec2 v_Iconuv;\n\nvoid main() {\n\n float opacity = styleMappingMat[0][0];\n\n vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;\n gl_FragColor = texture2D(u_texture, pos);\n gl_FragColor.a *= opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
49
47
 
50
48
  /* babel-plugin-inline-import '../shaders/image/fillImage_vert.glsl' */
51
- var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute vec2 a_Uv;\nattribute float a_Rotate;\n\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\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform mat2 u_RotateMatrix;\nuniform float u_isMeter;\n\nvarying vec2 v_uv; // \u672C\u8EAB\u7684 uv \u5750\u6807\nvarying vec2 v_Iconuv; // icon \u8D34\u56FE\u7684 uv \u5750\u6807\n\nuniform float u_raisingHeight: 0.0;\nuniform float u_heightfixed: 0.0;\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n\n v_uv = (a_Extrude.xy + 1.0)/2.0;\n v_uv.y = 1.0 - v_uv.y;\n v_Iconuv = a_Uv;\n\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 - empty - empty - empty\n 0.0, 0.0, 0.0, 0.0, // empty - empty - empty - empty\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0\n );\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\n vec2 textrueOffsets = vec2(0.0, 0.0);\n if(hasOffsets()) {\n vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n\n vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n } else {\n textrueOffsets = u_offsets;\n }\n\n // cal style mapping\n\n highp float angle_sin = sin(a_Rotate);\n highp float angle_cos = cos(a_Rotate);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n // vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);\n vec2 offset = (rotation_matrix * u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);\n vec3 aPosition = a_Position;\n if(u_isMeter < 1.0) {\n // \u4E0D\u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n offset = project_pixel(offset);\n } else {\n // \u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n aPosition.xy += offset;\n offset.x = 0.0;\n offset.y = 0.0;\n }\n }\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n float raisingHeight = u_raisingHeight;\n if(u_heightfixed < 1.0) { // height fixed\n raisingHeight = project_pixel(u_raisingHeight);\n } else {\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 raisingHeight = u_raisingHeight * mapboxZoomScale;\n }\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offset, raisingHeight, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n }\n \n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
49
+ var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute vec2 a_Uv;\nattribute float a_Rotate;\n\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\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform mat2 u_RotateMatrix;\nuniform int u_Size_Unit;\n\nvarying vec2 v_uv; // \u672C\u8EAB\u7684 uv \u5750\u6807\nvarying vec2 v_Iconuv; // icon \u8D34\u56FE\u7684 uv \u5750\u6807\n\nuniform float u_raisingHeight: 0.0;\nuniform float u_heightfixed: 0.0;\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n\n v_uv = (a_Extrude.xy + 1.0)/2.0;\n v_uv.y = 1.0 - v_uv.y;\n v_Iconuv = a_Uv;\n\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 - empty - empty - empty\n 0.0, 0.0, 0.0, 0.0, // empty - empty - empty - empty\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0\n );\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\n vec2 textrueOffsets = vec2(0.0, 0.0);\n if(hasOffsets()) {\n vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n\n vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n } else {\n textrueOffsets = u_offsets;\n }\n\n // cal style mapping\n\n highp float angle_sin = sin(a_Rotate);\n highp float angle_cos = cos(a_Rotate);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n float newSize = a_Size;\n if(u_Size_Unit == 1) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n\n // vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);\n vec2 offset = (rotation_matrix * u_RotateMatrix * extrude.xy * (newSize) + textrueOffsets);\n vec3 aPosition = a_Position;\n\n offset = project_pixel(offset);\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n float raisingHeight = u_raisingHeight;\n if(u_heightfixed < 1.0) { // height fixed\n raisingHeight = project_pixel(u_raisingHeight);\n } else {\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 raisingHeight = u_raisingHeight * mapboxZoomScale;\n }\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp *vec4(project_pos.xy + offset, raisingHeight, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n }\n \n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
52
50
 
53
51
  var FillImageModel = /*#__PURE__*/function (_BaseModel) {
54
52
  (0, _inherits2.default)(FillImageModel, _BaseModel);
@@ -111,7 +109,9 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
111
109
  _ref$raisingHeight = _ref.raisingHeight,
112
110
  raisingHeight = _ref$raisingHeight === void 0 ? 0.0 : _ref$raisingHeight,
113
111
  _ref$heightfixed = _ref.heightfixed,
114
- heightfixed = _ref$heightfixed === void 0 ? false : _ref$heightfixed;
112
+ heightfixed = _ref$heightfixed === void 0 ? false : _ref$heightfixed,
113
+ _ref$unit = _ref.unit,
114
+ unit = _ref$unit === void 0 ? 'pixel' : _ref$unit;
115
115
 
116
116
  if (this.rendererService.getDirty()) {
117
117
  this.texture.bind();
@@ -172,7 +172,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
172
172
  return {
173
173
  u_raisingHeight: Number(raisingHeight),
174
174
  u_heightfixed: Number(heightfixed),
175
- u_isMeter: Number(this.isMeter),
175
+ u_Size_Unit: _interface.SizeUnitType[unit],
176
176
  u_RotateMatrix: new Float32Array([Math.cos(this.radian), Math.sin(this.radian), -Math.sin(this.radian), Math.cos(this.radian)]),
177
177
  u_dataTexture: this.dataTexture,
178
178
  // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
@@ -192,29 +192,19 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
192
192
  key: "initModels",
193
193
  value: function () {
194
194
  var _initModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
195
- var _ref2, _ref2$unit, unit, version;
196
-
197
195
  return _regenerator.default.wrap(function _callee$(_context) {
198
196
  while (1) {
199
197
  switch (_context.prev = _context.next) {
200
198
  case 0:
201
199
  this.iconService.on('imageUpdate', this.updateTexture);
202
200
  this.updateTexture();
203
- _ref2 = this.layer.getLayerConfig(), _ref2$unit = _ref2.unit, unit = _ref2$unit === void 0 ? 'l7size' : _ref2$unit;
204
- version = this.mapService.version;
205
-
206
- if (unit === 'meter' && version !== _l7Maps.Version.DEFUALT && version !== _l7Maps.Version.GLOBEL) {
207
- this.isMeter = true;
208
- this.calMeter2Coord();
209
- }
210
-
211
- _context.next = 7;
201
+ _context.next = 4;
212
202
  return this.buildModels();
213
203
 
214
- case 7:
204
+ case 4:
215
205
  return _context.abrupt("return", _context.sent);
216
206
 
217
- case 8:
207
+ case 5:
218
208
  case "end":
219
209
  return _context.stop();
220
210
  }
@@ -228,58 +218,17 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
228
218
 
229
219
  return initModels;
230
220
  }()
231
- /**
232
- * 计算等面积点图层(unit meter)笛卡尔坐标标度与世界坐标标度的比例
233
- * @returns
234
- */
235
-
236
- }, {
237
- key: "calMeter2Coord",
238
- value: function calMeter2Coord() {
239
- var _this$layer$getSource = (0, _slicedToArray2.default)(this.layer.getSource().extent, 4),
240
- minLng = _this$layer$getSource[0],
241
- minLat = _this$layer$getSource[1],
242
- maxLng = _this$layer$getSource[2],
243
- maxLat = _this$layer$getSource[3];
244
-
245
- var center = [(minLng + maxLng) / 2, (minLat + maxLat) / 2];
246
- var version = this.mapService.version;
247
-
248
- if (version === _l7Maps.Version.MAPBOX && window.mapboxgl.MercatorCoordinate) {
249
- var coord = window.mapboxgl.MercatorCoordinate.fromLngLat({
250
- lng: center[0],
251
- lat: center[1]
252
- }, 0);
253
- var offsetInMeters = 1;
254
- var offsetInMercatorCoordinateUnits = offsetInMeters * coord.meterInMercatorCoordinateUnits();
255
- var westCoord = new window.mapboxgl.MercatorCoordinate(coord.x - offsetInMercatorCoordinateUnits, coord.y, coord.z);
256
- var westLnglat = westCoord.toLngLat();
257
- this.meter2coord = center[0] - westLnglat.lng;
258
- return;
259
- } // @ts-ignore
260
-
261
-
262
- var m1 = this.mapService.meterToCoord(center, [minLng, minLat]); // @ts-ignore
263
-
264
- var m2 = this.mapService.meterToCoord(center, [maxLng === minLng ? maxLng + 0.1 : maxLng, maxLat === minLat ? minLat + 0.1 : maxLat]);
265
- this.meter2coord = (m1 + m2) / 2;
266
-
267
- if (!this.meter2coord) {
268
- // Tip: 兼容单个数据导致的 m1、m2 为 NaN
269
- this.meter2coord = 7.70681090738883;
270
- }
271
- }
272
221
  }, {
273
222
  key: "buildModels",
274
223
  value: function () {
275
224
  var _buildModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
276
- var _ref3, _ref3$mask, mask, _ref3$maskInside, maskInside, model;
225
+ var _ref2, _ref2$mask, mask, _ref2$maskInside, maskInside, model;
277
226
 
278
227
  return _regenerator.default.wrap(function _callee2$(_context2) {
279
228
  while (1) {
280
229
  switch (_context2.prev = _context2.next) {
281
230
  case 0:
282
- _ref3 = this.layer.getLayerConfig(), _ref3$mask = _ref3.mask, mask = _ref3$mask === void 0 ? false : _ref3$mask, _ref3$maskInside = _ref3.maskInside, maskInside = _ref3$maskInside === void 0 ? true : _ref3$maskInside;
231
+ _ref2 = this.layer.getLayerConfig(), _ref2$mask = _ref2.mask, mask = _ref2$mask === void 0 ? false : _ref2$mask, _ref2$maskInside = _ref2.maskInside, maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside;
283
232
  _context2.next = 3;
284
233
  return this.layer.buildLayerModel({
285
234
  moduleName: 'pointFillImage',
@@ -365,12 +314,12 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
365
314
 
366
315
  var shape = feature.shape;
367
316
 
368
- var _ref4 = iconMap[shape] || {
317
+ var _ref3 = iconMap[shape] || {
369
318
  x: 0,
370
319
  y: 0
371
320
  },
372
- x = _ref4.x,
373
- y = _ref4.y;
321
+ x = _ref3.x,
322
+ y = _ref3.y;
374
323
 
375
324
  return [x, y];
376
325
  }
@@ -411,7 +360,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
411
360
  update: function update(feature) {
412
361
  var _feature$size = feature.size,
413
362
  size = _feature$size === void 0 ? 5 : _feature$size;
414
- return Array.isArray(size) ? [size[0] * _this2.meter2coord] : [size * _this2.meter2coord];
363
+ return Array.isArray(size) ? [size[0]] : [size];
415
364
  }
416
365
  }
417
366
  });
@@ -27,10 +27,6 @@ var _simplePoint = _interopRequireDefault(require("./simplePoint"));
27
27
 
28
28
  var _text = _interopRequireDefault(require("./text"));
29
29
 
30
- var _tileText = _interopRequireDefault(require("./tileText"));
31
-
32
- var _tile = _interopRequireDefault(require("./tile"));
33
-
34
30
  // earth
35
31
  var PointModels = {
36
32
  fillImage: _fillmage.default,
@@ -41,8 +37,6 @@ var PointModels = {
41
37
  simplePoint: _simplePoint.default,
42
38
  extrude: _extrude.default,
43
39
  text: _text.default,
44
- tile: _tile.default,
45
- tileText: _tileText.default,
46
40
  earthFill: _earthFill.default,
47
41
  earthExtrude: _earthExtrude.default
48
42
  };
@@ -9,24 +9,18 @@ exports.default = void 0;
9
9
 
10
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
11
 
12
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
-
14
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
15
13
 
16
14
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
17
15
 
18
16
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
19
17
 
20
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
21
-
22
18
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
23
19
 
24
20
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
25
21
 
26
22
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
27
23
 
28
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
29
-
30
24
  var _l7Core = require("@antv/l7-core");
31
25
 
32
26
  var _l7Utils = require("@antv/l7-utils");
@@ -37,7 +31,7 @@ var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
37
31
 
38
32
  var _triangulation = require("../../core/triangulation");
39
33
 
40
- var _l7Maps = require("@antv/l7-maps");
34
+ var _interface = require("../../core/interface");
41
35
 
42
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); }; }
43
37
 
@@ -47,7 +41,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
47
41
  var pointFillFrag = "\nuniform float u_additive;\nuniform float u_opacity: 1.0;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nvarying vec2 v_exteude;\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df = sdCircle(v_data.xy, 1.0);\n float inner_df = sdCircle(v_data.xy, r);\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * u_opacity);\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n } else {\n gl_FragColor.a *= opacity_t;\n }\n\n if(gl_FragColor.a > 0.0) {\n gl_FragColor = filterColor(gl_FragColor);\n }\n\n vec2 extrude = v_exteude;\n vec2 dir = normalize(extrude);\n vec2 baseDir = vec2(1.0, 0.0);\n float pi = 3.14159265359;\n // full circle\n // float rades = dot(dir, baseDir);\n // float flag = sign(dir.y);\n // float radar_v = (flag - 1.0) * -0.5 + flag * acos(rades)/pi/2.0;\n \n // half circle\n float flag = sign(dir.y);\n float rades = dot(dir, baseDir);\n float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;\n // simple AA\n if(radar_v > 0.99) {\n radar_v = 1.0 - (radar_v - 0.99)/0.01;\n }\n\n gl_FragColor.a *= radar_v;\n}\n";
48
42
 
49
43
  /* babel-plugin-inline-import '../shaders/radar/radar_vert.glsl' */
50
- 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 float u_isMeter;\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 // radius(16-bit)\n v_radius = newSize;\n\n // anti-alias\n float blur = 0.0;\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);\n\n vec2 offset = (extrude.xy * (newSize));\n vec3 aPosition = a_Position;\n if(u_isMeter < 1.0) {\n // \u4E0D\u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n offset = project_pixel(offset);\n } else {\n // \u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n antialiasblur *= pow(19.0 - u_Zoom, 2.0);\n antialiasblur = max(antialiasblur, -0.01);\n // offset *= 0.5;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n aPosition.xy += offset;\n offset.x = 0.0;\n offset.y = 0.0;\n }\n }\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";
44
+ 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";
51
45
 
52
46
  var RadarModel = /*#__PURE__*/function (_BaseModel) {
53
47
  (0, _inherits2.default)(RadarModel, _BaseModel);
@@ -55,18 +49,8 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
55
49
  var _super = _createSuper(RadarModel);
56
50
 
57
51
  function RadarModel() {
58
- var _this;
59
-
60
52
  (0, _classCallCheck2.default)(this, RadarModel);
61
-
62
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
63
- args[_key] = arguments[_key];
64
- }
65
-
66
- _this = _super.call.apply(_super, [this].concat(args));
67
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meter2coord", 1);
68
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isMeter", false);
69
- return _this;
53
+ return _super.apply(this, arguments);
70
54
  }
71
55
 
72
56
  (0, _createClass2.default)(RadarModel, [{
@@ -77,10 +61,12 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
77
61
  opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
78
62
  blend = _ref.blend,
79
63
  _ref$speed = _ref.speed,
80
- speed = _ref$speed === void 0 ? 1 : _ref$speed;
64
+ speed = _ref$speed === void 0 ? 1 : _ref$speed,
65
+ _ref$unit = _ref.unit,
66
+ unit = _ref$unit === void 0 ? 'pixel' : _ref$unit;
81
67
 
82
68
  return {
83
- u_isMeter: Number(this.isMeter),
69
+ u_Size_Unit: _interface.SizeUnitType[unit],
84
70
  u_speed: speed,
85
71
  u_additive: blend === 'additive' ? 1.0 : 0.0,
86
72
  u_opacity: (0, _lodash.isNumber)(opacity) ? opacity : 1.0
@@ -109,27 +95,17 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
109
95
  key: "initModels",
110
96
  value: function () {
111
97
  var _initModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
112
- var _ref3, _ref3$unit, unit, version;
113
-
114
98
  return _regenerator.default.wrap(function _callee$(_context) {
115
99
  while (1) {
116
100
  switch (_context.prev = _context.next) {
117
101
  case 0:
118
- _ref3 = this.layer.getLayerConfig(), _ref3$unit = _ref3.unit, unit = _ref3$unit === void 0 ? 'l7size' : _ref3$unit;
119
- version = this.mapService.version;
120
-
121
- if (unit === 'meter' && version !== _l7Maps.Version.DEFUALT && version !== _l7Maps.Version.GLOBEL) {
122
- this.isMeter = true;
123
- this.calMeter2Coord();
124
- }
125
-
126
- _context.next = 5;
102
+ _context.next = 2;
127
103
  return this.buildModels();
128
104
 
129
- case 5:
105
+ case 2:
130
106
  return _context.abrupt("return", _context.sent);
131
107
 
132
- case 6:
108
+ case 3:
133
109
  case "end":
134
110
  return _context.stop();
135
111
  }
@@ -143,58 +119,17 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
143
119
 
144
120
  return initModels;
145
121
  }()
146
- /**
147
- * 计算等面积点图层(unit meter)笛卡尔坐标标度与世界坐标标度的比例
148
- * @returns
149
- */
150
-
151
- }, {
152
- key: "calMeter2Coord",
153
- value: function calMeter2Coord() {
154
- var _this$layer$getSource = (0, _slicedToArray2.default)(this.layer.getSource().extent, 4),
155
- minLng = _this$layer$getSource[0],
156
- minLat = _this$layer$getSource[1],
157
- maxLng = _this$layer$getSource[2],
158
- maxLat = _this$layer$getSource[3];
159
-
160
- var center = [(minLng + maxLng) / 2, (minLat + maxLat) / 2];
161
- var version = this.mapService.version;
162
-
163
- if (version === _l7Maps.Version.MAPBOX && window.mapboxgl.MercatorCoordinate) {
164
- var coord = window.mapboxgl.MercatorCoordinate.fromLngLat({
165
- lng: center[0],
166
- lat: center[1]
167
- }, 0);
168
- var offsetInMeters = 1;
169
- var offsetInMercatorCoordinateUnits = offsetInMeters * coord.meterInMercatorCoordinateUnits();
170
- var westCoord = new window.mapboxgl.MercatorCoordinate(coord.x - offsetInMercatorCoordinateUnits, coord.y, coord.z);
171
- var westLnglat = westCoord.toLngLat();
172
- this.meter2coord = center[0] - westLnglat.lng;
173
- return;
174
- } // @ts-ignore
175
-
176
-
177
- var m1 = this.mapService.meterToCoord(center, [minLng, minLat]); // @ts-ignore
178
-
179
- var m2 = this.mapService.meterToCoord(center, [maxLng === minLng ? maxLng + 0.1 : maxLng, maxLat === minLat ? minLat + 0.1 : maxLat]);
180
- this.meter2coord = (m1 + m2) / 2;
181
-
182
- if (!this.meter2coord) {
183
- // Tip: 兼容单个数据导致的 m1、m2 为 NaN
184
- this.meter2coord = 7.70681090738883;
185
- }
186
- }
187
122
  }, {
188
123
  key: "buildModels",
189
124
  value: function () {
190
125
  var _buildModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
191
- var _ref4, _ref4$mask, mask, _ref4$maskInside, maskInside, model;
126
+ var _ref3, _ref3$mask, mask, _ref3$maskInside, maskInside, model;
192
127
 
193
128
  return _regenerator.default.wrap(function _callee2$(_context2) {
194
129
  while (1) {
195
130
  switch (_context2.prev = _context2.next) {
196
131
  case 0:
197
- _ref4 = this.layer.getLayerConfig(), _ref4$mask = _ref4.mask, mask = _ref4$mask === void 0 ? false : _ref4$mask, _ref4$maskInside = _ref4.maskInside, maskInside = _ref4$maskInside === void 0 ? true : _ref4$maskInside;
132
+ _ref3 = this.layer.getLayerConfig(), _ref3$mask = _ref3.mask, mask = _ref3$mask === void 0 ? false : _ref3$mask, _ref3$maskInside = _ref3.maskInside, maskInside = _ref3$maskInside === void 0 ? true : _ref3$maskInside;
198
133
  _context2.next = 3;
199
134
  return this.layer.buildLayerModel({
200
135
  moduleName: 'pointRadar',
@@ -242,8 +177,6 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
242
177
  }, {
243
178
  key: "registerBuiltinAttributes",
244
179
  value: function registerBuiltinAttributes() {
245
- var _this2 = this;
246
-
247
180
  this.styleAttributeService.registerStyleAttribute({
248
181
  name: 'extrude',
249
182
  type: _l7Core.AttributeType.Attribute,
@@ -279,7 +212,7 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
279
212
  update: function update(feature) {
280
213
  var _feature$size = feature.size,
281
214
  size = _feature$size === void 0 ? 5 : _feature$size;
282
- return Array.isArray(size) ? [size[0] * _this2.meter2coord] : [size * _this2.meter2coord];
215
+ return Array.isArray(size) ? [size[0]] : [size];
283
216
  }
284
217
  }
285
218
  });
@@ -54,7 +54,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
54
54
  var textFrag = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 48.0\nuniform sampler2D u_sdf_map;\nuniform float u_gamma_scale : 0.5;\n// uniform float u_font_size : 24.0;\nuniform float u_opacity : 1.0;\nuniform vec4 u_stroke_color : [0, 0, 0, 1];\nuniform float u_stroke_width : 2.0;\nuniform float u_halo_blur : 0.5;\nuniform float u_DevicePixelRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_uv;\nvarying float v_gamma_scale;\nvarying float v_fontScale;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\n#pragma include \"picking\"\nvoid main() {\n // get style data mapping\n float opacity = styleMappingMat[0][0];\n float strokeWidth = styleMappingMat[0][2];\n vec4 textrueStroke = vec4(\n styleMappingMat[1][0],\n styleMappingMat[1][1],\n styleMappingMat[1][2],\n styleMappingMat[1][3]\n );\n\n // get sdf from atlas\n float dist = texture2D(u_sdf_map, v_uv).a;\n\n // float fontScale = u_font_size / FONT_SIZE;\n\n // lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;\n lowp float buff = (6.0 - strokeWidth / v_fontScale) / SDF_PX;\n highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;\n\n highp float gamma_scaled = gamma * v_gamma_scale;\n\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n // gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), vec4(u_stroke_color.rgb, u_stroke_color.a * u_opacity), smoothstep(0., 0.5, 1. - dist));\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * opacity), vec4(textrueStroke.rgb, textrueStroke.a * opacity), smoothstep(0., 0.5, 1. - dist));\n gl_FragColor.a= gl_FragColor.a * alpha;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
55
55
 
56
56
  /* babel-plugin-inline-import '../shaders/text_vert.glsl' */
57
- var textVert = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 24.0\nattribute vec3 a_Position;\nattribute vec2 a_tex;\nattribute vec2 a_textOffsets;\nattribute vec4 a_Color;\nattribute float a_Size;\nattribute float a_Rotate;\n\nuniform vec2 u_sdf_map_size;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_raisingHeight: 0.0;\n\nvarying vec2 v_uv;\nvarying float v_gamma_scale;\nvarying vec4 v_color;\nvarying float v_fontScale;\n\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\nuniform float u_opacity : 1;\nuniform float u_stroke_width : 2;\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n#pragma include \"styleMappingCalStrokeWidth\"\n\n#pragma include \"projection\"\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 - empty\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\n );\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\n vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][2] = strokeWidthAndOffset.r;\n textureOffset = strokeWidthAndOffset.g;\n\n vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);\n if(hasStroke()) {\n vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R\n textureOffset += 1.0;\n\n vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G\n textureOffset += 1.0;\n\n vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B\n textureOffset += 1.0;\n\n vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A\n textureOffset += 1.0;\n } else {\n if(u_stroke_color == vec4(0.0)) {\n styleMappingMat[1][0] = v_color.r;\n styleMappingMat[1][1] = v_color.g;\n styleMappingMat[1][2] = v_color.b;\n styleMappingMat[1][3] = v_color.a;\n } else {\n styleMappingMat[1][0] = u_stroke_color.r;\n styleMappingMat[1][1] = u_stroke_color.g;\n styleMappingMat[1][2] = u_stroke_color.b;\n styleMappingMat[1][3] = u_stroke_color.a;\n }\n }\n \n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n v_color = a_Color;\n v_uv = a_tex / u_sdf_map_size;\n\n // \u6587\u672C\u7F29\u653E\u6BD4\u4F8B\n float fontScale = a_Size / FONT_SIZE;\n v_fontScale = fontScale;\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n highp float angle_sin = sin(a_Rotate);\n highp float angle_cos = cos(a_Rotate);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n \n // gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n\n float raiseHeight = u_raisingHeight;\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 raiseHeight = u_raisingHeight * mapboxZoomScale;\n }\n\n vec4 projected_position;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n projected_position = u_Mvp * (vec4(a_Position.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));\n } else { // else\n projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));\n }\n\n gl_Position = vec4(\n projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n v_gamma_scale = gl_Position.w;\n setPickingColor(a_PickingColor);\n\n}\n";
57
+ var textVert = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 24.0\nattribute vec3 a_Position;\nattribute vec2 a_tex;\nattribute vec2 a_textOffsets;\nattribute vec4 a_Color;\nattribute float a_Size;\nattribute float a_Rotate;\n\nuniform vec2 u_sdf_map_size;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_raisingHeight: 0.0;\n\nvarying vec2 v_uv;\nvarying float v_gamma_scale;\nvarying vec4 v_color;\nvarying float v_fontScale;\n\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\nuniform float u_opacity : 1;\nuniform float u_stroke_width : 2;\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n#pragma include \"styleMappingCalStrokeWidth\"\n\n#pragma include \"projection\"\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 - empty\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\n );\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\n vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][2] = strokeWidthAndOffset.r;\n textureOffset = strokeWidthAndOffset.g;\n\n vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);\n if(hasStroke()) {\n vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R\n textureOffset += 1.0;\n\n vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G\n textureOffset += 1.0;\n\n vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B\n textureOffset += 1.0;\n\n vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A\n textureOffset += 1.0;\n } else {\n if(u_stroke_color == vec4(0.0)) {\n styleMappingMat[1][0] = v_color.r;\n styleMappingMat[1][1] = v_color.g;\n styleMappingMat[1][2] = v_color.b;\n styleMappingMat[1][3] = v_color.a;\n } else {\n styleMappingMat[1][0] = u_stroke_color.r;\n styleMappingMat[1][1] = u_stroke_color.g;\n styleMappingMat[1][2] = u_stroke_color.b;\n styleMappingMat[1][3] = u_stroke_color.a;\n }\n }\n \n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n v_color = a_Color;\n v_uv = a_tex / u_sdf_map_size;\n\n // \u6587\u672C\u7F29\u653E\u6BD4\u4F8B\n float fontScale = a_Size / FONT_SIZE;\n v_fontScale = fontScale;\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n highp float angle_sin = sin(a_Rotate);\n highp float angle_cos = cos(a_Rotate);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n \n // gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n\n float raiseHeight = u_raisingHeight;\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 raiseHeight = u_raisingHeight * mapboxZoomScale;\n }\n\n vec4 projected_position;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n projected_position = u_Mvp *(vec4(a_Position.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));\n } else { // else\n projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));\n }\n\n gl_Position = vec4(\n projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n v_gamma_scale = gl_Position.w;\n setPickingColor(a_PickingColor);\n\n}\n";
58
58
 
59
59
  function TextTriangulation(feature) {
60
60
  // @ts-ignore
@@ -8,9 +8,7 @@ varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样
8
8
 
9
9
  uniform mat4 u_ModelMatrix;
10
10
  uniform mat4 u_Mvp;
11
- uniform float u_meter2coord;
12
- uniform float u_meteryScale;
13
- uniform float u_isMeter;
11
+ uniform int u_Size_Unit;
14
12
 
15
13
  varying vec4 v_data;
16
14
  varying vec4 v_color;
@@ -42,7 +40,7 @@ void main() {
42
40
  * setPickingSize 设置拾取大小
43
41
  * u_meter2coord 在等面积大小的时候设置单位
44
42
  */
45
- float newSize = setPickingSize(a_Size) * u_meter2coord;
43
+ float newSize = setPickingSize(a_Size);
46
44
  // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;
47
45
 
48
46
  // cal style mapping - 数据纹理映射部分的计算
@@ -126,9 +124,11 @@ void main() {
126
124
 
127
125
  // unpack color(vec2)
128
126
  v_color = a_Color;
127
+ if(u_Size_Unit == 1) {
128
+ newSize = newSize * u_PixelsPerMeter.z;
129
+ }
129
130
 
130
- // radius(16-bit)
131
- v_radius = newSize;
131
+ v_radius = newSize;
132
132
 
133
133
  // anti-alias
134
134
  // float antialiased_blur = -max(u_blur, antialiasblur);
@@ -136,26 +136,9 @@ void main() {
136
136
 
137
137
  vec2 offset = (extrude.xy * (newSize + u_stroke_width) + textrueOffsets);
138
138
  vec3 aPosition = a_Position;
139
- if(u_isMeter < 1.0) {
140
- // 不以米为实际单位
141
- offset = project_pixel(offset);
142
- } else {
143
- // 以米为实际单位
144
- if(newSize * pow(2.0, u_Zoom) < 48.0) {
145
- antialiasblur = max(antialiasblur, -0.05);
146
- } else if(newSize * pow(2.0, u_Zoom) < 128.0) {
147
- antialiasblur = max(antialiasblur, -0.6/pow(u_Zoom, 2.0));
148
- } else {
149
- antialiasblur = max(antialiasblur, -0.8/pow(u_Zoom, 2.0));
150
- }
151
-
152
- if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
153
- aPosition.x += offset.x / u_meteryScale;
154
- aPosition.y += offset.y;
155
- offset = vec2(0.0);
156
- }
157
- }
158
139
 
140
+ offset = project_pixel(offset);
141
+
159
142
  // TODP: /abs(extrude.x) 是为了兼容地球模式
160
143
  v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
161
144
 
@@ -177,7 +160,7 @@ void main() {
177
160
 
178
161
 
179
162
  if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
180
- gl_Position = u_Mvp * vec4(project_pos.xy + offset, raisingHeight, 1.0);
163
+ gl_Position = u_Mvp * vec4(project_pos.xy + offset, raisingHeight, 1.0);
181
164
  } else {
182
165
  gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));
183
166
  }
@@ -10,7 +10,7 @@ varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样
10
10
  uniform mat4 u_ModelMatrix;
11
11
  uniform mat4 u_Mvp;
12
12
  uniform mat2 u_RotateMatrix;
13
- uniform float u_isMeter;
13
+ uniform int u_Size_Unit;
14
14
 
15
15
  varying vec2 v_uv; // 本身的 uv 坐标
16
16
  varying vec2 v_Iconuv; // icon 贴图的 uv 坐标
@@ -76,22 +76,16 @@ void main() {
76
76
  highp float angle_sin = sin(a_Rotate);
77
77
  highp float angle_cos = cos(a_Rotate);
78
78
  mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);
79
+ float newSize = a_Size;
80
+ if(u_Size_Unit == 1) {
81
+ newSize = newSize * u_PixelsPerMeter.z;
82
+ }
79
83
 
80
84
  // vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);
81
- vec2 offset = (rotation_matrix * u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);
85
+ vec2 offset = (rotation_matrix * u_RotateMatrix * extrude.xy * (newSize) + textrueOffsets);
82
86
  vec3 aPosition = a_Position;
83
- if(u_isMeter < 1.0) {
84
- // 不以米为实际单位
85
- offset = project_pixel(offset);
86
- } else {
87
- // 以米为实际单位
88
87
 
89
- if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
90
- aPosition.xy += offset;
91
- offset.x = 0.0;
92
- offset.y = 0.0;
93
- }
94
- }
88
+ offset = project_pixel(offset);
95
89
 
96
90
  vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
97
91
  float raisingHeight = u_raisingHeight;
@@ -105,7 +99,7 @@ void main() {
105
99
  }
106
100
 
107
101
  if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
108
- gl_Position = u_Mvp * vec4(project_pos.xy + offset, raisingHeight, 1.0);
102
+ gl_Position = u_Mvp *vec4(project_pos.xy + offset, raisingHeight, 1.0);
109
103
  } else {
110
104
  gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));
111
105
  }
@@ -7,7 +7,7 @@ uniform float u_time;
7
7
 
8
8
  uniform mat4 u_ModelMatrix;
9
9
  uniform mat4 u_Mvp;
10
- uniform float u_isMeter;
10
+ uniform int u_Size_Unit;
11
11
 
12
12
  varying vec4 v_data;
13
13
  varying vec4 v_color;
@@ -31,37 +31,30 @@ void main() {
31
31
  // unpack color(vec2)
32
32
  v_color = a_Color;
33
33
 
34
- // radius(16-bit)
35
- v_radius = newSize;
34
+
36
35
 
37
36
  // anti-alias
38
37
  float blur = 0.0;
39
38
  float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);
40
39
 
40
+ if(u_Size_Unit == 1) {
41
+ newSize = newSize * u_PixelsPerMeter.z;
42
+ }
43
+ // radius(16-bit)
44
+ v_radius = newSize;
45
+
41
46
  vec2 offset = (extrude.xy * (newSize));
42
47
  vec3 aPosition = a_Position;
43
- if(u_isMeter < 1.0) {
48
+
44
49
  // 不以米为实际单位
45
- offset = project_pixel(offset);
46
- } else {
47
- // 以米为实际单位
48
- antialiasblur *= pow(19.0 - u_Zoom, 2.0);
49
- antialiasblur = max(antialiasblur, -0.01);
50
- // offset *= 0.5;
51
-
52
- if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
53
- aPosition.xy += offset;
54
- offset.x = 0.0;
55
- offset.y = 0.0;
56
- }
57
- }
58
-
50
+ offset = project_pixel(offset);
51
+
59
52
  v_data = vec4(extrude.x, extrude.y, antialiasblur, -1.0);
60
53
 
61
54
  vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
62
55
 
63
56
  if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
64
- gl_Position = u_Mvp * vec4(project_pos.xy + offset, 0.0, 1.0);
57
+ gl_Position = u_Mvp *vec4(project_pos.xy + offset, 0.0, 1.0);
65
58
  } else {
66
59
  gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));
67
60
  }
@@ -118,7 +118,7 @@ void main() {
118
118
 
119
119
  vec4 projected_position;
120
120
  if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
121
- projected_position = u_Mvp * (vec4(a_Position.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));
121
+ projected_position = u_Mvp *(vec4(a_Position.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));
122
122
  } else { // else
123
123
  projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));
124
124
  }
@@ -98,8 +98,6 @@ var PolygonLayer = /*#__PURE__*/function (_BaseLayer) {
98
98
  return 'ocean';
99
99
  } else if (shape === 'line') {
100
100
  return 'line';
101
- } else if (shape === 'tile') {
102
- return 'tile';
103
101
  } else {
104
102
  return this.getPointModelType();
105
103
  }