@antv/l7-layers 2.9.27-alpha.3 → 2.9.27
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.
- package/es/Geometry/models/billboard.js +2 -5
- package/es/Geometry/models/plane.js +3 -3
- package/es/Geometry/models/sprite.js +2 -3
- package/es/core/BaseLayer.d.ts +5 -6
- package/es/core/BaseLayer.js +15 -20
- package/es/core/BaseModel.d.ts +1 -1
- package/es/core/BaseModel.js +15 -16
- package/es/core/interface.d.ts +3 -1
- package/es/earth/models/atmosphere.js +4 -7
- package/es/earth/models/base.js +10 -14
- package/es/earth/models/bloomsphere.js +4 -8
- package/es/heatmap/index.d.ts +2 -2
- package/es/heatmap/index.js +1 -3
- package/es/heatmap/models/grid.js +1 -3
- package/es/heatmap/models/grid3d.js +4 -11
- package/es/heatmap/models/heatmap.js +3 -6
- package/es/heatmap/models/hexagon.js +2 -6
- package/es/heatmap/triangulation.js +0 -1
- package/es/image/index.d.ts +1 -1
- package/es/image/index.js +4 -1
- package/es/image/models/dataImage.d.ts +1 -1
- package/es/image/models/dataImage.js +12 -34
- package/es/image/models/image.js +1 -3
- package/es/image/models/index.d.ts +1 -1
- package/es/image/models/index.js +3 -1
- package/es/image/models/tileDataImage.d.ts +19 -0
- package/es/image/models/tileDataImage.js +174 -0
- package/es/line/models/arc.js +7 -8
- package/es/line/models/arc_3d.js +8 -10
- package/es/line/models/earthArc_3d.js +8 -10
- package/es/line/models/great_circle.js +7 -7
- package/es/line/models/line.js +4 -4
- package/es/line/models/linearline.js +3 -4
- package/es/line/models/simpleLine.js +3 -3
- package/es/line/models/tile.js +1 -1
- package/es/line/models/wall.js +3 -3
- package/es/line/shaders/dash/line_dash_frag.glsl +1 -1
- package/es/line/shaders/line_arc2d_vert.glsl +2 -2
- package/es/line/shaders/line_arc_3d_frag.glsl +10 -10
- package/es/line/shaders/line_arc_3d_vert.glsl +3 -4
- package/es/line/shaders/line_arc_frag.glsl +9 -10
- package/es/line/shaders/line_arc_great_circle_frag.glsl +6 -6
- package/es/line/shaders/line_arc_great_circle_vert.glsl +2 -3
- package/es/line/shaders/line_arc_vert.glsl +2 -2
- package/es/line/shaders/line_bezier_vert.glsl +2 -2
- package/es/line/shaders/line_frag.glsl +5 -5
- package/es/line/shaders/line_vert.glsl +1 -1
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +9 -10
- package/es/line/shaders/linear/arc_linear_frag.glsl +1 -1
- package/es/line/shaders/wall/wall_frag.glsl +5 -5
- package/es/line/shaders/wall/wall_vert.glsl +2 -2
- package/es/plugins/LayerAnimateStylePlugin.js +2 -2
- package/es/point/index.js +3 -4
- package/es/point/models/earthExtrude.d.ts +1 -1
- package/es/point/models/earthExtrude.js +9 -14
- package/es/point/models/earthFill.js +2 -2
- package/es/point/models/extrude.d.ts +1 -1
- package/es/point/models/extrude.js +9 -12
- package/es/point/models/fill.d.ts +1 -1
- package/es/point/models/fill.js +7 -8
- package/es/point/models/fillmage.js +4 -5
- package/es/point/models/image.js +2 -2
- package/es/point/models/index.d.ts +1 -1
- package/es/point/models/index.js +3 -3
- package/es/point/models/normal.js +0 -2
- package/es/point/models/radar.js +1 -1
- package/es/point/models/text.js +1 -3
- package/es/point/models/tile.js +2 -3
- package/es/point/models/tileText.js +3 -5
- package/es/point/shaders/animate/wave_frag.glsl +2 -2
- package/es/polygon/models/extrude.js +3 -5
- package/es/raster/index.js +1 -2
- package/es/raster/models/raster.d.ts +1 -1
- package/es/raster/models/raster.js +5 -5
- package/es/raster/models/rasterTile.d.ts +18 -0
- package/es/raster/models/rasterTile.js +140 -0
- package/es/raster/shaders/raster_2d_frag.glsl +0 -2
- package/es/raster/shaders/raster_2d_vert.glsl +0 -1
- package/es/tile/manager/baseMapTileLayerManager.d.ts +3 -25
- package/es/tile/manager/baseMapTileLayerManager.js +31 -119
- package/es/tile/manager/baseTileManager.d.ts +27 -0
- package/es/tile/manager/baseTileManager.js +107 -0
- package/es/tile/manager/tileLayerManager.d.ts +4 -26
- package/es/tile/manager/tileLayerManager.js +64 -132
- package/es/tile/manager/tilePickerManager.d.ts +1 -0
- package/es/tile/manager/tilePickerManager.js +5 -0
- package/es/tile/models/tileModel.d.ts +1 -0
- package/es/tile/models/tileModel.js +3 -0
- package/es/tile/tileFactory/rasterData.js +9 -11
- package/es/tile/tileFactory/rasterDataLayer.d.ts +1 -1
- package/es/tile/tileFactory/rasterDataLayer.js +1 -1
- package/es/tile/tileLayer/baseMapTileLayer.d.ts +1 -0
- package/es/tile/tileLayer/baseMapTileLayer.js +7 -0
- package/es/tile/tileLayer/baseTileLayer.d.ts +1 -0
- package/es/tile/tileLayer/baseTileLayer.js +12 -1
- package/es/tile/tmsMapTileLayer.js +2 -2
- package/es/tile/tmsTileLayer.js +2 -2
- package/es/tile/utils.d.ts +1 -0
- package/es/tile/utils.js +13 -0
- package/lib/Geometry/models/billboard.js +2 -5
- package/lib/Geometry/models/plane.js +3 -3
- package/lib/Geometry/models/sprite.js +2 -3
- package/lib/core/BaseLayer.js +15 -20
- package/lib/core/BaseModel.js +15 -16
- package/lib/earth/models/atmosphere.js +4 -7
- package/lib/earth/models/base.js +10 -14
- package/lib/earth/models/bloomsphere.js +4 -8
- package/lib/heatmap/index.js +1 -3
- package/lib/heatmap/models/grid.js +1 -3
- package/lib/heatmap/models/grid3d.js +4 -11
- package/lib/heatmap/models/heatmap.js +3 -6
- package/lib/heatmap/models/hexagon.js +2 -6
- package/lib/heatmap/triangulation.js +0 -1
- package/lib/image/index.js +4 -1
- package/lib/image/models/dataImage.js +11 -33
- package/lib/image/models/image.js +1 -3
- package/lib/image/models/index.js +4 -1
- package/lib/image/models/tileDataImage.js +188 -0
- package/lib/line/models/arc.js +7 -8
- package/lib/line/models/arc_3d.js +8 -10
- package/lib/line/models/earthArc_3d.js +8 -10
- package/lib/line/models/great_circle.js +7 -7
- package/lib/line/models/line.js +4 -4
- package/lib/line/models/linearline.js +3 -4
- package/lib/line/models/simpleLine.js +3 -3
- package/lib/line/models/tile.js +1 -1
- package/lib/line/models/wall.js +3 -3
- package/lib/line/shaders/dash/line_dash_frag.glsl +1 -1
- package/lib/line/shaders/line_arc2d_vert.glsl +2 -2
- package/lib/line/shaders/line_arc_3d_frag.glsl +10 -10
- package/lib/line/shaders/line_arc_3d_vert.glsl +3 -4
- package/lib/line/shaders/line_arc_frag.glsl +9 -10
- package/lib/line/shaders/line_arc_great_circle_frag.glsl +6 -6
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +2 -3
- package/lib/line/shaders/line_arc_vert.glsl +2 -2
- package/lib/line/shaders/line_bezier_vert.glsl +2 -2
- package/lib/line/shaders/line_frag.glsl +5 -5
- package/lib/line/shaders/line_vert.glsl +1 -1
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +9 -10
- package/lib/line/shaders/linear/arc_linear_frag.glsl +1 -1
- package/lib/line/shaders/wall/wall_frag.glsl +5 -5
- package/lib/line/shaders/wall/wall_vert.glsl +2 -2
- package/lib/plugins/LayerAnimateStylePlugin.js +2 -2
- package/lib/point/index.js +3 -4
- package/lib/point/models/earthExtrude.js +9 -14
- package/lib/point/models/earthFill.js +2 -2
- package/lib/point/models/extrude.js +9 -12
- package/lib/point/models/fill.js +7 -8
- package/lib/point/models/fillmage.js +4 -5
- package/lib/point/models/image.js +2 -2
- package/lib/point/models/index.js +1 -1
- package/lib/point/models/normal.js +0 -2
- package/lib/point/models/radar.js +1 -1
- package/lib/point/models/text.js +1 -3
- package/lib/point/models/tile.js +2 -3
- package/lib/point/models/tileText.js +3 -5
- package/lib/point/shaders/animate/wave_frag.glsl +2 -2
- package/lib/polygon/models/extrude.js +3 -5
- package/lib/raster/index.js +1 -2
- package/lib/raster/models/raster.js +5 -5
- package/lib/raster/models/rasterTile.js +154 -0
- package/lib/raster/shaders/raster_2d_frag.glsl +0 -2
- package/lib/raster/shaders/raster_2d_vert.glsl +0 -1
- package/lib/tile/manager/baseMapTileLayerManager.js +33 -121
- package/lib/tile/manager/baseTileManager.js +121 -0
- package/lib/tile/manager/tileLayerManager.js +66 -134
- package/lib/tile/manager/tilePickerManager.js +5 -0
- package/lib/tile/models/tileModel.js +3 -0
- package/lib/tile/tileFactory/rasterData.js +9 -11
- package/lib/tile/tileFactory/rasterDataLayer.js +2 -2
- package/lib/tile/tileLayer/baseMapTileLayer.js +7 -0
- package/lib/tile/tileLayer/baseTileLayer.js +12 -1
- package/lib/tile/tmsMapTileLayer.js +1 -1
- package/lib/tile/tmsTileLayer.js +1 -1
- package/lib/tile/utils.js +16 -0
- package/package.json +6 -6
package/lib/point/models/fill.js
CHANGED
|
@@ -42,9 +42,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
42
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; } }
|
|
43
43
|
|
|
44
44
|
/* babel-plugin-inline-import '../shaders/animate/wave_frag.glsl' */
|
|
45
|
-
// import { PointFillTriangulation } from '../../core/triangulation';
|
|
46
45
|
// animate pointLayer shader - support animate
|
|
47
|
-
var waveFillFrag = "\nuniform float u_additive;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nuniform float u_time;\nuniform vec4
|
|
46
|
+
var waveFillFrag = "\nuniform float u_additive;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n\n vec4 textrueStroke = vec4(\n styleMappingMat[1][0],\n styleMappingMat[1][1],\n styleMappingMat[1][2],\n styleMappingMat[1][3]\n );\n\n float opacity = styleMappingMat[0][0];\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n \n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n float PI = 3.14159;\n float N_RINGS = 3.0;\n float FREQ = 1.0;\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);\n\n float d = length(v_data.xy);\n if(d > 0.5) {\n discard;\n }\n float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_animate.z - u_animate.y * u_time)), 0.0, 1.0);\n \n // \u6839\u636E\u53E0\u52A0\u6A21\u5F0F\u9009\u62E9\u6548\u679C\n if(u_additive > 0.0) {\n gl_FragColor *= intensity;\n // \u4F18\u5316\u6C34\u6CE2\u70B9 blend additive \u6A21\u5F0F\u4E0B\u6709\u7684\u62FE\u53D6\u6548\u679C \n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor = vec4(gl_FragColor.xyz, gl_FragColor.a * intensity);\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n"; // static pointLayer shader - not support animate
|
|
48
47
|
|
|
49
48
|
/* babel-plugin-inline-import '../shaders/fill_frag.glsl' */
|
|
50
49
|
var pointFillFrag = "uniform float u_additive;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n vec4 textrueStroke = vec4(\n styleMappingMat[1][0],\n styleMappingMat[1][1],\n styleMappingMat[1][2],\n styleMappingMat[1][3]\n );\n\n float opacity = styleMappingMat[0][0];\n float stroke_opacity = styleMappingMat[0][1];\n float strokeWidth = styleMappingMat[0][2];\n vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke;\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius + strokeWidth);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n } else if (shape == 1) {\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n } else if (shape == 2) {\n outer_df = sdBox(v_data.xy, vec2(1.));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = strokeWidth < 0.01 ? 0.0 : smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n\n if(strokeWidth < 0.01) {\n gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);\n } else {\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * opacity), strokeColor * stroke_opacity, color_t);\n }\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor.a *= opacity_t;\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n";
|
|
@@ -68,7 +67,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
68
67
|
|
|
69
68
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
70
69
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meter2coord", 1);
|
|
71
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "
|
|
70
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meterYScale", 1);
|
|
72
71
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isMeter", false);
|
|
73
72
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unit", 'l7size');
|
|
74
73
|
return _this;
|
|
@@ -145,7 +144,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
145
144
|
u_raisingHeight: Number(raisingHeight),
|
|
146
145
|
u_heightfixed: Number(heightfixed),
|
|
147
146
|
u_meter2coord: this.meter2coord,
|
|
148
|
-
u_meteryScale: this.
|
|
147
|
+
u_meteryScale: this.meterYScale,
|
|
149
148
|
u_isMeter: Number(this.isMeter),
|
|
150
149
|
u_blur: blur,
|
|
151
150
|
u_additive: blend === 'additive' ? 1.0 : 0.0,
|
|
@@ -169,7 +168,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
169
168
|
} : _ref2$animateOption;
|
|
170
169
|
|
|
171
170
|
return {
|
|
172
|
-
|
|
171
|
+
u_animate: this.animateOption2Array(animateOption),
|
|
173
172
|
u_time: this.layer.getLayerAnimateTime()
|
|
174
173
|
};
|
|
175
174
|
}
|
|
@@ -215,7 +214,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
215
214
|
var southCoord = new mapboxContext.MercatorCoordinate(coord.x, coord.y - offsetInMercatorCoordinateUnits, coord.z);
|
|
216
215
|
var southLnglat = southCoord.toLngLat();
|
|
217
216
|
this.meter2coord = center[0] - westLnglat.lng;
|
|
218
|
-
this.
|
|
217
|
+
this.meterYScale = (southLnglat.lat - center[1]) / this.meter2coord;
|
|
219
218
|
return;
|
|
220
219
|
}
|
|
221
220
|
|
|
@@ -361,7 +360,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
361
360
|
type: _l7Core.gl.FLOAT
|
|
362
361
|
},
|
|
363
362
|
size: 1,
|
|
364
|
-
update: function update(feature
|
|
363
|
+
update: function update(feature) {
|
|
365
364
|
var _feature$size = feature.size,
|
|
366
365
|
size = _feature$size === void 0 ? 5 : _feature$size;
|
|
367
366
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
@@ -381,7 +380,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
381
380
|
type: _l7Core.gl.FLOAT
|
|
382
381
|
},
|
|
383
382
|
size: 1,
|
|
384
|
-
update: function update(feature
|
|
383
|
+
update: function update(feature) {
|
|
385
384
|
var _feature$shape = feature.shape,
|
|
386
385
|
shape = _feature$shape === void 0 ? 2 : _feature$shape;
|
|
387
386
|
var shapeIndex = shape2d.indexOf(shape);
|
|
@@ -73,8 +73,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
73
73
|
mag: 'linear',
|
|
74
74
|
min: 'linear mipmap nearest',
|
|
75
75
|
mipmap: true
|
|
76
|
-
}); //
|
|
77
|
-
// TODO: 更新完纹理后在更新的图层的时候需要更新所有的图层
|
|
76
|
+
}); // 更新完纹理后在更新的图层的时候需要更新所有的图层
|
|
78
77
|
|
|
79
78
|
|
|
80
79
|
_this.layerService.throttleRenderLayers();
|
|
@@ -301,7 +300,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
301
300
|
type: _l7Core.gl.FLOAT
|
|
302
301
|
},
|
|
303
302
|
size: 1,
|
|
304
|
-
update: function update(feature
|
|
303
|
+
update: function update(feature) {
|
|
305
304
|
var _feature$rotate = feature.rotate,
|
|
306
305
|
rotate = _feature$rotate === void 0 ? 0 : _feature$rotate;
|
|
307
306
|
return Array.isArray(rotate) ? [rotate[0]] : [rotate];
|
|
@@ -320,7 +319,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
320
319
|
type: _l7Core.gl.FLOAT
|
|
321
320
|
},
|
|
322
321
|
size: 2,
|
|
323
|
-
update: function update(feature
|
|
322
|
+
update: function update(feature) {
|
|
324
323
|
var iconMap = _this2.iconService.getIconMap();
|
|
325
324
|
|
|
326
325
|
var shape = feature.shape;
|
|
@@ -368,7 +367,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
368
367
|
type: _l7Core.gl.FLOAT
|
|
369
368
|
},
|
|
370
369
|
size: 1,
|
|
371
|
-
update: function update(feature
|
|
370
|
+
update: function update(feature) {
|
|
372
371
|
var _feature$size = feature.size,
|
|
373
372
|
size = _feature$size === void 0 ? 5 : _feature$size;
|
|
374
373
|
return Array.isArray(size) ? [size[0] * _this2.meter2coord] : [size * _this2.meter2coord];
|
|
@@ -65,7 +65,7 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
65
65
|
mag: 'linear',
|
|
66
66
|
min: 'linear mipmap nearest',
|
|
67
67
|
mipmap: true
|
|
68
|
-
}); //
|
|
68
|
+
}); // 更新完纹理后在更新的图层的时候需要更新所有的图层
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
_this.layerService.throttleRenderLayers();
|
|
@@ -211,7 +211,7 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
211
211
|
type: _l7Core.gl.FLOAT
|
|
212
212
|
},
|
|
213
213
|
size: 1,
|
|
214
|
-
update: function update(feature
|
|
214
|
+
update: function update(feature) {
|
|
215
215
|
var _feature$size = feature.size,
|
|
216
216
|
size = _feature$size === void 0 ? 5 : _feature$size;
|
|
217
217
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
@@ -43,7 +43,7 @@ var PointModels = {
|
|
|
43
43
|
simplePoint: _simplePoint.default,
|
|
44
44
|
extrude: _extrude.default,
|
|
45
45
|
text: _text.default,
|
|
46
|
-
|
|
46
|
+
vectorPoint: _tileModel.default,
|
|
47
47
|
tile: _tile.default,
|
|
48
48
|
tileText: _tileText.default,
|
|
49
49
|
earthFill: _earthFill.default,
|
|
@@ -115,14 +115,12 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
115
115
|
}, {
|
|
116
116
|
key: "registerBuiltinAttributes",
|
|
117
117
|
value: function registerBuiltinAttributes() {
|
|
118
|
-
// point layer size;
|
|
119
118
|
this.styleAttributeService.registerStyleAttribute({
|
|
120
119
|
name: 'size',
|
|
121
120
|
type: _l7Core.AttributeType.Attribute,
|
|
122
121
|
descriptor: {
|
|
123
122
|
name: 'a_Size',
|
|
124
123
|
buffer: {
|
|
125
|
-
// give the WebGL driver a hint that this buffer may change
|
|
126
124
|
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
127
125
|
data: [],
|
|
128
126
|
type: _l7Core.gl.FLOAT
|
|
@@ -92,7 +92,7 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
92
92
|
} : _ref2$animateOption;
|
|
93
93
|
|
|
94
94
|
return {
|
|
95
|
-
|
|
95
|
+
u_animate: this.animateOption2Array(animateOption),
|
|
96
96
|
u_time: this.layer.getLayerAnimateTime()
|
|
97
97
|
};
|
|
98
98
|
}
|
package/lib/point/models/text.js
CHANGED
|
@@ -348,15 +348,13 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
348
348
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
});
|
|
352
|
-
|
|
351
|
+
});
|
|
353
352
|
this.styleAttributeService.registerStyleAttribute({
|
|
354
353
|
name: 'textUv',
|
|
355
354
|
type: _l7Core.AttributeType.Attribute,
|
|
356
355
|
descriptor: {
|
|
357
356
|
name: 'a_tex',
|
|
358
357
|
buffer: {
|
|
359
|
-
// give the WebGL driver a hint that this buffer may change
|
|
360
358
|
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
361
359
|
data: [],
|
|
362
360
|
type: _l7Core.gl.FLOAT
|
package/lib/point/models/tile.js
CHANGED
|
@@ -146,13 +146,12 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
146
146
|
descriptor: {
|
|
147
147
|
name: 'a_Size',
|
|
148
148
|
buffer: {
|
|
149
|
-
// give the WebGL driver a hint that this buffer may change
|
|
150
149
|
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
151
150
|
data: [],
|
|
152
151
|
type: _l7Core.gl.FLOAT
|
|
153
152
|
},
|
|
154
153
|
size: 1,
|
|
155
|
-
update: function update(feature
|
|
154
|
+
update: function update(feature) {
|
|
156
155
|
var _feature$size = feature.size,
|
|
157
156
|
size = _feature$size === void 0 ? 5 : _feature$size;
|
|
158
157
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
@@ -171,7 +170,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
171
170
|
type: _l7Core.gl.FLOAT
|
|
172
171
|
},
|
|
173
172
|
size: 1,
|
|
174
|
-
update: function update(feature
|
|
173
|
+
update: function update(feature) {
|
|
175
174
|
var _feature$shape = feature.shape,
|
|
176
175
|
shape = _feature$shape === void 0 ? 2 : _feature$shape;
|
|
177
176
|
|
|
@@ -256,7 +256,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
256
256
|
type: _l7Core.gl.FLOAT
|
|
257
257
|
},
|
|
258
258
|
size: 2,
|
|
259
|
-
update: function update(feature, featureIdx, vertex
|
|
259
|
+
update: function update(feature, featureIdx, vertex) {
|
|
260
260
|
return [vertex[5], vertex[6]];
|
|
261
261
|
}
|
|
262
262
|
}
|
|
@@ -269,13 +269,12 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
269
269
|
descriptor: {
|
|
270
270
|
name: 'a_Size',
|
|
271
271
|
buffer: {
|
|
272
|
-
// give the WebGL driver a hint that this buffer may change
|
|
273
272
|
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
274
273
|
data: [],
|
|
275
274
|
type: _l7Core.gl.FLOAT
|
|
276
275
|
},
|
|
277
276
|
size: 1,
|
|
278
|
-
update: function update(feature
|
|
277
|
+
update: function update(feature) {
|
|
279
278
|
var _feature$size = feature.size,
|
|
280
279
|
size = _feature$size === void 0 ? 12 : _feature$size;
|
|
281
280
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
@@ -290,13 +289,12 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
290
289
|
descriptor: {
|
|
291
290
|
name: 'a_tex',
|
|
292
291
|
buffer: {
|
|
293
|
-
// give the WebGL driver a hint that this buffer may change
|
|
294
292
|
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
295
293
|
data: [],
|
|
296
294
|
type: _l7Core.gl.FLOAT
|
|
297
295
|
},
|
|
298
296
|
size: 2,
|
|
299
|
-
update: function update(feature, featureIdx, vertex
|
|
297
|
+
update: function update(feature, featureIdx, vertex) {
|
|
300
298
|
return [vertex[3], vertex[4]];
|
|
301
299
|
}
|
|
302
300
|
}
|
|
@@ -7,7 +7,7 @@ varying vec4 v_data;
|
|
|
7
7
|
varying vec4 v_color;
|
|
8
8
|
varying float v_radius;
|
|
9
9
|
uniform float u_time;
|
|
10
|
-
uniform vec4
|
|
10
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
11
11
|
|
|
12
12
|
#pragma include "sdf_2d"
|
|
13
13
|
#pragma include "picking"
|
|
@@ -51,7 +51,7 @@ void main() {
|
|
|
51
51
|
if(d > 0.5) {
|
|
52
52
|
discard;
|
|
53
53
|
}
|
|
54
|
-
float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 *
|
|
54
|
+
float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_animate.z - u_animate.y * u_time)), 0.0, 1.0);
|
|
55
55
|
|
|
56
56
|
// 根据叠加模式选择效果
|
|
57
57
|
if(u_additive > 0.0) {
|
|
@@ -234,14 +234,13 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
234
234
|
type: _l7Core.gl.FLOAT
|
|
235
235
|
},
|
|
236
236
|
size: 3,
|
|
237
|
-
update: function update(feature, featureIdx, vertex
|
|
237
|
+
update: function update(feature, featureIdx, vertex) {
|
|
238
238
|
var lng = vertex[0];
|
|
239
239
|
var lat = vertex[1];
|
|
240
240
|
return [(lng - minLng) / lngLen, (lat - minLat) / latLen, vertex[4]];
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
});
|
|
244
|
-
|
|
243
|
+
});
|
|
245
244
|
this.styleAttributeService.registerStyleAttribute({
|
|
246
245
|
name: 'normal',
|
|
247
246
|
type: _l7Core.AttributeType.Attribute,
|
|
@@ -265,13 +264,12 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
265
264
|
descriptor: {
|
|
266
265
|
name: 'a_Size',
|
|
267
266
|
buffer: {
|
|
268
|
-
// give the WebGL driver a hint that this buffer may change
|
|
269
267
|
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
270
268
|
data: [],
|
|
271
269
|
type: _l7Core.gl.FLOAT
|
|
272
270
|
},
|
|
273
271
|
size: 1,
|
|
274
|
-
update: function update(feature
|
|
272
|
+
update: function update(feature) {
|
|
275
273
|
var _feature$size = feature.size,
|
|
276
274
|
size = _feature$size === void 0 ? 10 : _feature$size;
|
|
277
275
|
return Array.isArray(size) ? [size[0]] : [size];
|
package/lib/raster/index.js
CHANGED
|
@@ -32,10 +32,10 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
32
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
33
|
|
|
34
34
|
/* babel-plugin-inline-import '../shaders/raster_2d_frag.glsl' */
|
|
35
|
-
var rasterFrag = "precision mediump float;\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\nuniform float u_min;\nuniform float u_max;\nuniform vec2 u_domain;\nuniform float u_noDataValue;\nuniform bool u_clampLow: true;\nuniform bool u_clampHigh: true;\nvarying vec2 v_texCoord;\n\nvoid main() {\n\n float value = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).r;\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
|
|
35
|
+
var rasterFrag = "precision mediump float;\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\nuniform float u_min;\nuniform float u_max;\nuniform vec2 u_domain;\nuniform float u_noDataValue;\nuniform bool u_clampLow: true;\nuniform bool u_clampHigh: true;\nvarying vec2 v_texCoord;\n\nvoid main() {\n\n float value = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).r;\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
36
|
|
|
37
37
|
/* babel-plugin-inline-import '../shaders/raster_2d_vert.glsl' */
|
|
38
|
-
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
|
|
38
|
+
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";
|
|
39
39
|
|
|
40
40
|
var RasterModel = /*#__PURE__*/function (_BaseModel) {
|
|
41
41
|
(0, _inherits2.default)(RasterModel, _BaseModel);
|
|
@@ -64,7 +64,7 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
64
64
|
rampColors = _ref.rampColors;
|
|
65
65
|
|
|
66
66
|
if (!(0, _lodash.isEqual)(this.rampColors, rampColors)) {
|
|
67
|
-
this.
|
|
67
|
+
this.updateColorTexture();
|
|
68
68
|
this.rampColors = rampColors;
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -161,8 +161,8 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
}, {
|
|
164
|
-
key: "
|
|
165
|
-
value: function
|
|
164
|
+
key: "updateColorTexture",
|
|
165
|
+
value: function updateColorTexture() {
|
|
166
166
|
var createTexture2D = this.rendererService.createTexture2D;
|
|
167
167
|
|
|
168
168
|
var _ref3 = this.layer.getLayerConfig(),
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
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 _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
|
|
25
|
+
|
|
26
|
+
var _triangulation = require("../../core/triangulation");
|
|
27
|
+
|
|
28
|
+
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); }; }
|
|
29
|
+
|
|
30
|
+
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; } }
|
|
31
|
+
|
|
32
|
+
/* babel-plugin-inline-import '../shaders/raster_2d_frag.glsl' */
|
|
33
|
+
var rasterFrag = "precision mediump float;\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\nuniform float u_min;\nuniform float u_max;\nuniform vec2 u_domain;\nuniform float u_noDataValue;\nuniform bool u_clampLow: true;\nuniform bool u_clampHigh: true;\nvarying vec2 v_texCoord;\n\nvoid main() {\n\n float value = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).r;\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";
|
|
34
|
+
|
|
35
|
+
/* babel-plugin-inline-import '../shaders/raster_2d_vert.glsl' */
|
|
36
|
+
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";
|
|
37
|
+
|
|
38
|
+
var RasterModel = /*#__PURE__*/function (_BaseModel) {
|
|
39
|
+
(0, _inherits2.default)(RasterModel, _BaseModel);
|
|
40
|
+
|
|
41
|
+
var _super = _createSuper(RasterModel);
|
|
42
|
+
|
|
43
|
+
function RasterModel() {
|
|
44
|
+
(0, _classCallCheck2.default)(this, RasterModel);
|
|
45
|
+
return _super.apply(this, arguments);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
(0, _createClass2.default)(RasterModel, [{
|
|
49
|
+
key: "getUninforms",
|
|
50
|
+
value: function getUninforms() {
|
|
51
|
+
var createTexture2D = this.rendererService.createTexture2D;
|
|
52
|
+
|
|
53
|
+
var _ref = this.layer.getLayerConfig(),
|
|
54
|
+
_ref$colorTexture = _ref.colorTexture,
|
|
55
|
+
colorTexture = _ref$colorTexture === void 0 ? createTexture2D({
|
|
56
|
+
data: [],
|
|
57
|
+
width: 0,
|
|
58
|
+
height: 0,
|
|
59
|
+
flipY: false
|
|
60
|
+
}) : _ref$colorTexture,
|
|
61
|
+
_ref$opacity = _ref.opacity,
|
|
62
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
63
|
+
_ref$clampLow = _ref.clampLow,
|
|
64
|
+
clampLow = _ref$clampLow === void 0 ? true : _ref$clampLow,
|
|
65
|
+
_ref$clampHigh = _ref.clampHigh,
|
|
66
|
+
clampHigh = _ref$clampHigh === void 0 ? true : _ref$clampHigh,
|
|
67
|
+
_ref$noDataValue = _ref.noDataValue,
|
|
68
|
+
noDataValue = _ref$noDataValue === void 0 ? -9999999 : _ref$noDataValue,
|
|
69
|
+
_ref$domain = _ref.domain,
|
|
70
|
+
domain = _ref$domain === void 0 ? [0, 1] : _ref$domain;
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
u_opacity: opacity || 1,
|
|
74
|
+
u_texture: this.texture,
|
|
75
|
+
u_domain: domain,
|
|
76
|
+
u_clampLow: clampLow,
|
|
77
|
+
u_clampHigh: typeof clampHigh !== 'undefined' ? clampHigh : clampLow,
|
|
78
|
+
u_noDataValue: noDataValue,
|
|
79
|
+
u_colorTexture: colorTexture
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
key: "initModels",
|
|
84
|
+
value: function initModels(callbackModel) {
|
|
85
|
+
var _ref2 = this.layer.getLayerConfig(),
|
|
86
|
+
_ref2$mask = _ref2.mask,
|
|
87
|
+
mask = _ref2$mask === void 0 ? false : _ref2$mask,
|
|
88
|
+
_ref2$maskInside = _ref2.maskInside,
|
|
89
|
+
maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside;
|
|
90
|
+
|
|
91
|
+
var source = this.layer.getSource();
|
|
92
|
+
var createTexture2D = this.rendererService.createTexture2D;
|
|
93
|
+
var parserDataItem = source.data.dataArray[0];
|
|
94
|
+
this.texture = createTexture2D({
|
|
95
|
+
data: parserDataItem.data,
|
|
96
|
+
width: parserDataItem.width,
|
|
97
|
+
height: parserDataItem.height,
|
|
98
|
+
format: _l7Core.gl.LUMINANCE,
|
|
99
|
+
type: _l7Core.gl.FLOAT
|
|
100
|
+
});
|
|
101
|
+
this.layer.buildLayerModel({
|
|
102
|
+
moduleName: 'rasterTileImageData',
|
|
103
|
+
vertexShader: rasterVert,
|
|
104
|
+
fragmentShader: rasterFrag,
|
|
105
|
+
triangulation: _triangulation.RasterImageTriangulation,
|
|
106
|
+
depth: {
|
|
107
|
+
enable: false
|
|
108
|
+
},
|
|
109
|
+
stencil: (0, _l7Utils.getMask)(mask, maskInside),
|
|
110
|
+
pick: false
|
|
111
|
+
}).then(function (model) {
|
|
112
|
+
callbackModel([model]);
|
|
113
|
+
}).catch(function (err) {
|
|
114
|
+
console.warn(err);
|
|
115
|
+
callbackModel([]);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
key: "buildModels",
|
|
120
|
+
value: function buildModels(callbackModel) {
|
|
121
|
+
this.initModels(callbackModel);
|
|
122
|
+
}
|
|
123
|
+
}, {
|
|
124
|
+
key: "clearModels",
|
|
125
|
+
value: function clearModels() {
|
|
126
|
+
var _this$texture;
|
|
127
|
+
|
|
128
|
+
(_this$texture = this.texture) === null || _this$texture === void 0 ? void 0 : _this$texture.destroy();
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
key: "registerBuiltinAttributes",
|
|
132
|
+
value: function registerBuiltinAttributes() {
|
|
133
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
134
|
+
name: 'uv',
|
|
135
|
+
type: _l7Core.AttributeType.Attribute,
|
|
136
|
+
descriptor: {
|
|
137
|
+
name: 'a_Uv',
|
|
138
|
+
buffer: {
|
|
139
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
140
|
+
data: [],
|
|
141
|
+
type: _l7Core.gl.FLOAT
|
|
142
|
+
},
|
|
143
|
+
size: 2,
|
|
144
|
+
update: function update(feature, featureIdx, vertex) {
|
|
145
|
+
return [vertex[3], vertex[4]];
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}]);
|
|
151
|
+
return RasterModel;
|
|
152
|
+
}(_BaseModel2.default);
|
|
153
|
+
|
|
154
|
+
exports.default = RasterModel;
|
|
@@ -8,7 +8,6 @@ varying vec2 v_texCoord;
|
|
|
8
8
|
void main() {
|
|
9
9
|
v_texCoord = a_Uv;
|
|
10
10
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
11
|
-
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));
|
|
12
11
|
|
|
13
12
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
14
13
|
gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));
|