@antv/l7-layers 2.9.25-alpha.0 → 2.9.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/es/heatmap/models/heatmap.js +1 -1
  2. package/es/tile/utils.js +1 -1
  3. package/lib/Geometry/index.js +114 -77
  4. package/lib/Geometry/models/billboard.js +232 -181
  5. package/lib/Geometry/models/index.js +18 -34
  6. package/lib/Geometry/models/plane.js +407 -278
  7. package/lib/Geometry/models/sprite.js +291 -189
  8. package/lib/canvas/index.js +101 -66
  9. package/lib/canvas/models/canvas.js +207 -140
  10. package/lib/canvas/models/index.js +12 -30
  11. package/lib/citybuliding/building.js +98 -63
  12. package/lib/citybuliding/models/build.js +192 -146
  13. package/lib/core/BaseLayer.js +1331 -814
  14. package/lib/core/BaseModel.js +457 -279
  15. package/lib/core/interface.js +40 -53
  16. package/lib/core/schema.js +21 -39
  17. package/lib/core/shape/Path.js +67 -79
  18. package/lib/core/shape/extrude.js +132 -91
  19. package/lib/core/triangulation.js +378 -196
  20. package/lib/earth/index.js +100 -62
  21. package/lib/earth/models/atmosphere.js +146 -112
  22. package/lib/earth/models/base.js +210 -150
  23. package/lib/earth/models/bloomsphere.js +146 -112
  24. package/lib/earth/utils.js +111 -91
  25. package/lib/heatmap/index.js +149 -92
  26. package/lib/heatmap/models/grid.js +118 -91
  27. package/lib/heatmap/models/grid3d.js +155 -123
  28. package/lib/heatmap/models/heatmap.js +475 -338
  29. package/lib/heatmap/models/hexagon.js +121 -92
  30. package/lib/heatmap/models/index.js +22 -37
  31. package/lib/heatmap/triangulation.js +31 -47
  32. package/lib/image/index.js +111 -74
  33. package/lib/image/models/dataImage.js +232 -174
  34. package/lib/image/models/image.js +175 -128
  35. package/lib/image/models/index.js +15 -32
  36. package/lib/index.js +263 -97
  37. package/lib/line/index.js +131 -85
  38. package/lib/line/models/arc.js +352 -237
  39. package/lib/line/models/arc_3d.js +334 -228
  40. package/lib/line/models/earthArc_3d.js +336 -228
  41. package/lib/line/models/great_circle.js +291 -200
  42. package/lib/line/models/half.js +286 -201
  43. package/lib/line/models/index.js +42 -50
  44. package/lib/line/models/line.js +428 -299
  45. package/lib/line/models/linearline.js +277 -203
  46. package/lib/line/models/simpleLine.js +239 -175
  47. package/lib/line/models/tile.js +348 -237
  48. package/lib/line/models/wall.js +327 -235
  49. package/lib/mask/index.js +92 -59
  50. package/lib/mask/models/fill.js +134 -82
  51. package/lib/mask/models/index.js +12 -30
  52. package/lib/plugins/DataMappingPlugin.js +342 -224
  53. package/lib/plugins/DataSourcePlugin.js +102 -87
  54. package/lib/plugins/FeatureScalePlugin.js +330 -240
  55. package/lib/plugins/LayerAnimateStylePlugin.js +61 -55
  56. package/lib/plugins/LayerModelPlugin.js +80 -73
  57. package/lib/plugins/LayerStylePlugin.js +48 -51
  58. package/lib/plugins/LightingPlugin.js +80 -68
  59. package/lib/plugins/MultiPassRendererPlugin.js +91 -65
  60. package/lib/plugins/PixelPickingPlugin.js +150 -109
  61. package/lib/plugins/RegisterStyleAttributePlugin.js +110 -110
  62. package/lib/plugins/ShaderUniformPlugin.js +118 -99
  63. package/lib/plugins/UpdateModelPlugin.js +40 -47
  64. package/lib/plugins/UpdateStyleAttributePlugin.js +93 -75
  65. package/lib/point/index.js +226 -150
  66. package/lib/point/models/earthExtrude.js +279 -201
  67. package/lib/point/models/earthFill.js +287 -202
  68. package/lib/point/models/extrude.js +299 -203
  69. package/lib/point/models/fill.js +406 -275
  70. package/lib/point/models/fillmage.js +365 -256
  71. package/lib/point/models/image.js +241 -168
  72. package/lib/point/models/index.js +46 -52
  73. package/lib/point/models/normal.js +183 -134
  74. package/lib/point/models/radar.js +304 -211
  75. package/lib/point/models/simplePoint.js +194 -142
  76. package/lib/point/models/text.js +608 -385
  77. package/lib/point/models/tile.js +314 -223
  78. package/lib/point/shape/extrude.js +56 -52
  79. package/lib/polygon/index.js +154 -102
  80. package/lib/polygon/models/extrude.js +311 -223
  81. package/lib/polygon/models/fill.js +215 -153
  82. package/lib/polygon/models/index.js +46 -52
  83. package/lib/polygon/models/ocean.js +244 -173
  84. package/lib/polygon/models/tile.js +144 -100
  85. package/lib/polygon/models/water.js +222 -153
  86. package/lib/raster/buffers/triangulation.js +27 -40
  87. package/lib/raster/index.js +115 -75
  88. package/lib/raster/models/index.js +16 -33
  89. package/lib/raster/models/raster.js +178 -135
  90. package/lib/raster/raster.js +187 -132
  91. package/lib/tile/interface.js +4 -16
  92. package/lib/tile/manager/tileConfigManager.js +125 -86
  93. package/lib/tile/manager/tileLayerManager.js +313 -229
  94. package/lib/tile/manager/tilePickerManager.js +192 -123
  95. package/lib/tile/models/tileModel.js +71 -52
  96. package/lib/tile/tileFactory/base.js +432 -309
  97. package/lib/tile/tileFactory/index.js +51 -49
  98. package/lib/tile/tileFactory/line.js +65 -50
  99. package/lib/tile/tileFactory/point.js +65 -50
  100. package/lib/tile/tileFactory/polygon.js +65 -50
  101. package/lib/tile/tileFactory/raster.js +66 -54
  102. package/lib/tile/tileFactory/rasterData.js +88 -76
  103. package/lib/tile/tileFactory/rasterDataLayer.js +97 -62
  104. package/lib/tile/tileFactory/vectorLayer.js +168 -109
  105. package/lib/tile/tileLayer/baseTileLayer.js +420 -221
  106. package/lib/tile/tmsTileLayer.js +110 -67
  107. package/lib/tile/utils.js +110 -92
  108. package/lib/utils/blend.js +59 -79
  109. package/lib/utils/collision-index.js +107 -64
  110. package/lib/utils/dataMappingStyle.js +105 -60
  111. package/lib/utils/extrude_polyline.js +600 -398
  112. package/lib/utils/grid-index.js +163 -111
  113. package/lib/utils/layerData.js +130 -99
  114. package/lib/utils/multiPassRender.js +49 -41
  115. package/lib/utils/polylineNormal.js +148 -96
  116. package/lib/utils/simpleLine.js +100 -85
  117. package/lib/utils/symbol-layout.js +219 -116
  118. package/lib/utils/updateShape.js +15 -41
  119. package/lib/wind/index.js +109 -71
  120. package/lib/wind/models/index.js +12 -30
  121. package/lib/wind/models/utils.js +144 -105
  122. package/lib/wind/models/wind.js +333 -224
  123. package/lib/wind/models/windRender.js +329 -218
  124. package/lib/wind/models/windShader.js +23 -181
  125. package/package.json +6 -6
@@ -1,182 +1,240 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
-
22
- // src/image/models/dataImage.ts
23
- var dataImage_exports = {};
24
- __export(dataImage_exports, {
25
- default: () => ImageDataModel
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
26
7
  });
27
- module.exports = __toCommonJS(dataImage_exports);
28
- var import_l7_core = require("@antv/l7-core");
29
- var import_l7_utils = require("@antv/l7-utils");
30
- var import_lodash = require("lodash");
31
- var import_BaseModel = __toESM(require("../../core/BaseModel"));
32
- var import_triangulation = require("../../core/triangulation");
33
- var import_dataImage_frag = __toESM(require("../shaders/dataImage_frag.glsl"));
34
- var import_image_vert = __toESM(require("../shaders/image_vert.glsl"));
35
- var ImageDataModel = class extends import_BaseModel.default {
36
- getUninforms() {
37
- const {
38
- opacity,
39
- clampLow = true,
40
- clampHigh = true,
41
- noDataValue = -9999999,
42
- domain = [0, 1],
43
- rampColors,
44
- pixelConstant = 0,
45
- pixelConstantR = 256 * 256,
46
- pixelConstantG = 256,
47
- pixelConstantB = 1,
48
- pixelConstantRGB = 0.1
49
- } = this.layer.getLayerConfig();
50
- if (!(0, import_lodash.isEqual)(this.rampColors, rampColors)) {
51
- this.updateColorTexure();
52
- this.rampColors = rampColors;
53
- }
54
- return {
55
- u_opacity: opacity || 1,
56
- u_texture: this.texture,
57
- u_pixelConstant: pixelConstant,
58
- u_pixelConstantR: pixelConstantR,
59
- u_pixelConstantG: pixelConstantG,
60
- u_pixelConstantB: pixelConstantB,
61
- u_pixelConstantRGB: pixelConstantRGB,
62
- u_domain: domain,
63
- u_clampLow: clampLow,
64
- u_clampHigh: typeof clampHigh !== "undefined" ? clampHigh : clampLow,
65
- u_noDataValue: noDataValue,
66
- u_colorTexture: this.colorTexture
67
- };
8
+ exports.default = void 0;
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
+
16
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
17
+
18
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
+
20
+ var _l7Core = require("@antv/l7-core");
21
+
22
+ var _l7Utils = require("@antv/l7-utils");
23
+
24
+ var _lodash = require("lodash");
25
+
26
+ var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
27
+
28
+ var _triangulation = require("../../core/triangulation");
29
+
30
+ 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); }; }
31
+
32
+ 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; } }
33
+
34
+ /* babel-plugin-inline-import '../shaders/dataImage_frag.glsl' */
35
+ var ImageFrag = "precision mediump float;\nuniform float u_opacity: 1.0;\n\nuniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\n\nvarying vec2 v_texCoord;\n\nuniform vec2 u_domain;\nuniform float u_noDataValue;\nuniform bool u_clampLow: true;\nuniform bool u_clampHigh: true;\n\nuniform float u_pixelConstant;\nuniform float u_pixelConstantR;\nuniform float u_pixelConstantG;\nuniform float u_pixelConstantB;\nuniform float u_pixelConstantRGB;\n\nvoid main() {\n vec4 baseColor = texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y));\n\n float r = baseColor.r;\n float g = baseColor.g;\n float b = baseColor.b;\n\n float value = u_pixelConstant + ((r * u_pixelConstantR + g * u_pixelConstantG + b * u_pixelConstantB) * u_pixelConstantRGB);\n if (value == u_noDataValue) {\n gl_FragColor = vec4(0.0, 0, 0, 0.0);\n } else if ((!u_clampLow && value < u_domain[0]) || (!u_clampHigh && value > u_domain[1])) {\n gl_FragColor = vec4(0, 0, 0, 0);\n } else {\n float normalisedValue =(value - u_domain[0]) / (u_domain[1] - u_domain[0]);\n vec4 color = texture2D(u_colorTexture, vec2(normalisedValue, 0));\n gl_FragColor = color;\n gl_FragColor.a = gl_FragColor.a * u_opacity ;\n }\n}\n";
36
+
37
+ /* babel-plugin-inline-import '../shaders/image_vert.glsl' */
38
+ var ImageVert = "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 // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\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";
39
+
40
+ var ImageDataModel = /*#__PURE__*/function (_BaseModel) {
41
+ (0, _inherits2.default)(ImageDataModel, _BaseModel);
42
+
43
+ var _super = _createSuper(ImageDataModel);
44
+
45
+ function ImageDataModel() {
46
+ (0, _classCallCheck2.default)(this, ImageDataModel);
47
+ return _super.apply(this, arguments);
68
48
  }
69
- initModels(callbackModel) {
70
- const {
71
- mask = false,
72
- maskInside = true,
73
- rampColorsData,
74
- rampColors
75
- } = this.layer.getLayerConfig();
76
- const source = this.layer.getSource();
77
- const { createTexture2D } = this.rendererService;
78
- this.texture = createTexture2D({
79
- height: 0,
80
- width: 0
81
- });
82
- if (import_l7_utils.isMini) {
83
- const canvas = this.layerService.sceneService.getSceneConfig().canvas;
84
- const img = canvas.createImage();
85
- img.crossOrigin = "anonymous";
86
- img.src = source.data.originData;
87
- img.onload = () => {
88
- this.texture = createTexture2D({
89
- data: img,
90
- width: img.width,
91
- height: img.height
92
- });
93
- this.layerService.updateLayerRenderList();
94
- this.layerService.renderLayers();
49
+
50
+ (0, _createClass2.default)(ImageDataModel, [{
51
+ key: "getUninforms",
52
+ value: function getUninforms() {
53
+ var _ref = this.layer.getLayerConfig(),
54
+ opacity = _ref.opacity,
55
+ _ref$clampLow = _ref.clampLow,
56
+ clampLow = _ref$clampLow === void 0 ? true : _ref$clampLow,
57
+ _ref$clampHigh = _ref.clampHigh,
58
+ clampHigh = _ref$clampHigh === void 0 ? true : _ref$clampHigh,
59
+ _ref$noDataValue = _ref.noDataValue,
60
+ noDataValue = _ref$noDataValue === void 0 ? -9999999 : _ref$noDataValue,
61
+ _ref$domain = _ref.domain,
62
+ domain = _ref$domain === void 0 ? [0, 1] : _ref$domain,
63
+ rampColors = _ref.rampColors,
64
+ _ref$pixelConstant = _ref.pixelConstant,
65
+ pixelConstant = _ref$pixelConstant === void 0 ? 0.0 : _ref$pixelConstant,
66
+ _ref$pixelConstantR = _ref.pixelConstantR,
67
+ pixelConstantR = _ref$pixelConstantR === void 0 ? 256 * 256 : _ref$pixelConstantR,
68
+ _ref$pixelConstantG = _ref.pixelConstantG,
69
+ pixelConstantG = _ref$pixelConstantG === void 0 ? 256 : _ref$pixelConstantG,
70
+ _ref$pixelConstantB = _ref.pixelConstantB,
71
+ pixelConstantB = _ref$pixelConstantB === void 0 ? 1 : _ref$pixelConstantB,
72
+ _ref$pixelConstantRGB = _ref.pixelConstantRGB,
73
+ pixelConstantRGB = _ref$pixelConstantRGB === void 0 ? 0.1 : _ref$pixelConstantRGB;
74
+
75
+ if (!(0, _lodash.isEqual)(this.rampColors, rampColors)) {
76
+ this.updateColorTexure();
77
+ this.rampColors = rampColors;
78
+ }
79
+
80
+ return {
81
+ u_opacity: opacity || 1,
82
+ u_texture: this.texture,
83
+ u_pixelConstant: pixelConstant,
84
+ u_pixelConstantR: pixelConstantR,
85
+ u_pixelConstantG: pixelConstantG,
86
+ u_pixelConstantB: pixelConstantB,
87
+ u_pixelConstantRGB: pixelConstantRGB,
88
+ u_domain: domain,
89
+ u_clampLow: clampLow,
90
+ u_clampHigh: typeof clampHigh !== 'undefined' ? clampHigh : clampLow,
91
+ u_noDataValue: noDataValue,
92
+ u_colorTexture: this.colorTexture
95
93
  };
96
- } else {
97
- source.data.images.then((imageData) => {
98
- this.texture = createTexture2D({
99
- data: imageData[0],
100
- width: imageData[0].width,
101
- height: imageData[0].height
94
+ }
95
+ }, {
96
+ key: "initModels",
97
+ value: function initModels(callbackModel) {
98
+ var _this = this;
99
+
100
+ var _ref2 = this.layer.getLayerConfig(),
101
+ _ref2$mask = _ref2.mask,
102
+ mask = _ref2$mask === void 0 ? false : _ref2$mask,
103
+ _ref2$maskInside = _ref2.maskInside,
104
+ maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside,
105
+ rampColorsData = _ref2.rampColorsData,
106
+ rampColors = _ref2.rampColors;
107
+
108
+ var source = this.layer.getSource();
109
+ var createTexture2D = this.rendererService.createTexture2D;
110
+ this.texture = createTexture2D({
111
+ height: 0,
112
+ width: 0
113
+ });
114
+
115
+ if (_l7Utils.isMini) {
116
+ // @ts-ignore
117
+ var canvas = this.layerService.sceneService.getSceneConfig().canvas;
118
+ var img = canvas.createImage();
119
+ img.crossOrigin = 'anonymous';
120
+ img.src = source.data.originData;
121
+
122
+ img.onload = function () {
123
+ _this.texture = createTexture2D({
124
+ data: img,
125
+ width: img.width,
126
+ height: img.height
127
+ });
128
+
129
+ _this.layerService.updateLayerRenderList();
130
+
131
+ _this.layerService.renderLayers();
132
+ };
133
+ } else {
134
+ source.data.images.then(function (imageData) {
135
+ _this.texture = createTexture2D({
136
+ data: imageData[0],
137
+ width: imageData[0].width,
138
+ height: imageData[0].height
139
+ });
140
+
141
+ _this.layerService.updateLayerRenderList();
142
+
143
+ _this.layerService.renderLayers();
102
144
  });
103
- this.layerService.updateLayerRenderList();
104
- this.layerService.renderLayers();
145
+ }
146
+
147
+ var rampImageData = rampColorsData ? rampColorsData : (0, _l7Utils.generateColorRamp)(rampColors);
148
+ this.colorTexture = createTexture2D({
149
+ data: rampImageData.data,
150
+ width: rampImageData.width,
151
+ height: rampImageData.height,
152
+ flipY: false
153
+ });
154
+ this.layer.buildLayerModel({
155
+ moduleName: 'RasterImage',
156
+ vertexShader: ImageVert,
157
+ fragmentShader: ImageFrag,
158
+ triangulation: _triangulation.RasterImageTriangulation,
159
+ primitive: _l7Core.gl.TRIANGLES,
160
+ depth: {
161
+ enable: false
162
+ },
163
+ blend: this.getBlend(),
164
+ stencil: (0, _l7Utils.getMask)(mask, maskInside)
165
+ }).then(function (model) {
166
+ callbackModel([model]);
167
+ }).catch(function (err) {
168
+ console.warn(err);
169
+ callbackModel([]);
105
170
  });
106
171
  }
107
- const rampImageData = rampColorsData ? rampColorsData : (0, import_l7_utils.generateColorRamp)(rampColors);
108
- this.colorTexture = createTexture2D({
109
- data: rampImageData.data,
110
- width: rampImageData.width,
111
- height: rampImageData.height,
112
- flipY: false
113
- });
114
- this.layer.buildLayerModel({
115
- moduleName: "RasterImage",
116
- vertexShader: import_image_vert.default,
117
- fragmentShader: import_dataImage_frag.default,
118
- triangulation: import_triangulation.RasterImageTriangulation,
119
- primitive: import_l7_core.gl.TRIANGLES,
120
- depth: { enable: false },
121
- blend: this.getBlend(),
122
- stencil: (0, import_l7_utils.getMask)(mask, maskInside)
123
- }).then((model) => {
124
- callbackModel([model]);
125
- }).catch((err) => {
126
- console.warn(err);
127
- callbackModel([]);
128
- });
129
- }
130
- clearModels() {
131
- var _a, _b;
132
- (_a = this.texture) == null ? void 0 : _a.destroy();
133
- (_b = this.colorTexture) == null ? void 0 : _b.destroy();
134
- }
135
- buildModels(callbackModel) {
136
- this.initModels(callbackModel);
137
- }
138
- getConfigSchema() {
139
- return {
140
- properties: {
141
- opacity: {
142
- type: "number",
143
- minimum: 0,
144
- maximum: 1
172
+ }, {
173
+ key: "clearModels",
174
+ value: function clearModels() {
175
+ var _this$texture, _this$colorTexture;
176
+
177
+ (_this$texture = this.texture) === null || _this$texture === void 0 ? void 0 : _this$texture.destroy();
178
+ (_this$colorTexture = this.colorTexture) === null || _this$colorTexture === void 0 ? void 0 : _this$colorTexture.destroy();
179
+ }
180
+ }, {
181
+ key: "buildModels",
182
+ value: function buildModels(callbackModel) {
183
+ this.initModels(callbackModel);
184
+ }
185
+ }, {
186
+ key: "getConfigSchema",
187
+ value: function getConfigSchema() {
188
+ return {
189
+ properties: {
190
+ opacity: {
191
+ type: 'number',
192
+ minimum: 0,
193
+ maximum: 1
194
+ }
145
195
  }
146
- }
147
- };
148
- }
149
- registerBuiltinAttributes() {
150
- this.styleAttributeService.registerStyleAttribute({
151
- name: "uv",
152
- type: import_l7_core.AttributeType.Attribute,
153
- descriptor: {
154
- name: "a_Uv",
155
- buffer: {
156
- usage: import_l7_core.gl.DYNAMIC_DRAW,
157
- data: [],
158
- type: import_l7_core.gl.FLOAT
159
- },
160
- size: 2,
161
- update: (feature, featureIdx, vertex, attributeIdx) => {
162
- return [vertex[3], vertex[4]];
196
+ };
197
+ }
198
+ }, {
199
+ key: "registerBuiltinAttributes",
200
+ value: function registerBuiltinAttributes() {
201
+ // point layer size;
202
+ this.styleAttributeService.registerStyleAttribute({
203
+ name: 'uv',
204
+ type: _l7Core.AttributeType.Attribute,
205
+ descriptor: {
206
+ name: 'a_Uv',
207
+ buffer: {
208
+ // give the WebGL driver a hint that this buffer may change
209
+ usage: _l7Core.gl.DYNAMIC_DRAW,
210
+ data: [],
211
+ type: _l7Core.gl.FLOAT
212
+ },
213
+ size: 2,
214
+ update: function update(feature, featureIdx, vertex, attributeIdx) {
215
+ return [vertex[3], vertex[4]];
216
+ }
163
217
  }
164
- }
165
- });
166
- }
167
- updateColorTexure() {
168
- const { createTexture2D } = this.rendererService;
169
- const {
170
- rampColors
171
- } = this.layer.getLayerConfig();
172
- const imageData = (0, import_l7_utils.generateColorRamp)(rampColors);
173
- this.colorTexture = createTexture2D({
174
- data: imageData.data,
175
- width: imageData.width,
176
- height: imageData.height,
177
- flipY: false
178
- });
179
- }
180
- };
181
- // Annotate the CommonJS export names for ESM import in node:
182
- 0 && (module.exports = {});
218
+ });
219
+ }
220
+ }, {
221
+ key: "updateColorTexure",
222
+ value: function updateColorTexure() {
223
+ var createTexture2D = this.rendererService.createTexture2D;
224
+
225
+ var _ref3 = this.layer.getLayerConfig(),
226
+ rampColors = _ref3.rampColors;
227
+
228
+ var imageData = (0, _l7Utils.generateColorRamp)(rampColors);
229
+ this.colorTexture = createTexture2D({
230
+ data: imageData.data,
231
+ width: imageData.width,
232
+ height: imageData.height,
233
+ flipY: false
234
+ });
235
+ }
236
+ }]);
237
+ return ImageDataModel;
238
+ }(_BaseModel2.default);
239
+
240
+ exports.default = ImageDataModel;