@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
|
@@ -191,7 +191,6 @@ var BillBoardModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
191
191
|
descriptor: {
|
|
192
192
|
name: 'a_Extrude',
|
|
193
193
|
buffer: {
|
|
194
|
-
// give the WebGL driver a hint that this buffer may change
|
|
195
194
|
usage: gl.DYNAMIC_DRAW,
|
|
196
195
|
data: [],
|
|
197
196
|
type: gl.FLOAT
|
|
@@ -203,21 +202,19 @@ var BillBoardModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
203
202
|
return [extrude[extrudeIndex], extrude[extrudeIndex + 1], extrude[extrudeIndex + 2]];
|
|
204
203
|
}
|
|
205
204
|
}
|
|
206
|
-
});
|
|
207
|
-
|
|
205
|
+
});
|
|
208
206
|
this.styleAttributeService.registerStyleAttribute({
|
|
209
207
|
name: 'uv',
|
|
210
208
|
type: AttributeType.Attribute,
|
|
211
209
|
descriptor: {
|
|
212
210
|
name: 'a_Uv',
|
|
213
211
|
buffer: {
|
|
214
|
-
// give the WebGL driver a hint that this buffer may change
|
|
215
212
|
usage: gl.DYNAMIC_DRAW,
|
|
216
213
|
data: [],
|
|
217
214
|
type: gl.FLOAT
|
|
218
215
|
},
|
|
219
216
|
size: 2,
|
|
220
|
-
update: function update(feature, featureIdx, vertex
|
|
217
|
+
update: function update(feature, featureIdx, vertex) {
|
|
221
218
|
return [vertex[2], vertex[3]];
|
|
222
219
|
}
|
|
223
220
|
}
|
|
@@ -300,10 +300,10 @@ var PlaneModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
300
300
|
var gridX1 = gridX + 1;
|
|
301
301
|
var gridY1 = gridY + 1;
|
|
302
302
|
var widthStep = imgWidth / gridX;
|
|
303
|
-
var
|
|
303
|
+
var heightStep = imgHeight / gridY;
|
|
304
304
|
|
|
305
305
|
for (var iy = 0; iy < gridY1; iy++) {
|
|
306
|
-
var imgIndexY = Math.floor(iy *
|
|
306
|
+
var imgIndexY = Math.floor(iy * heightStep);
|
|
307
307
|
var imgLen = imgIndexY * imgWidth;
|
|
308
308
|
|
|
309
309
|
for (var ix = 0; ix < gridX1; ix++) {
|
|
@@ -405,7 +405,7 @@ var PlaneModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
405
405
|
type: gl.FLOAT
|
|
406
406
|
},
|
|
407
407
|
size: 2,
|
|
408
|
-
update: function update(feature, featureIdx, vertex
|
|
408
|
+
update: function update(feature, featureIdx, vertex) {
|
|
409
409
|
return [vertex[3], vertex[4]];
|
|
410
410
|
}
|
|
411
411
|
}
|
|
@@ -49,8 +49,7 @@ var SpriteModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
49
49
|
_ref$spriteBottom = _ref.spriteBottom,
|
|
50
50
|
spriteBottom = _ref$spriteBottom === void 0 ? -100000 : _ref$spriteBottom;
|
|
51
51
|
|
|
52
|
-
var updateZ = _this.spriteUpdate;
|
|
53
|
-
|
|
52
|
+
var updateZ = _this.spriteUpdate;
|
|
54
53
|
var bottomZ = spriteBottom;
|
|
55
54
|
var topZ = _this.spriteTop;
|
|
56
55
|
|
|
@@ -79,7 +78,7 @@ var SpriteModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
79
78
|
|
|
80
79
|
_defineProperty(_assertThisInitialized(_this), "updateModel", function () {
|
|
81
80
|
// @ts-ignore
|
|
82
|
-
var attributes = _this.layer.
|
|
81
|
+
var attributes = _this.layer.createAttributes({
|
|
83
82
|
triangulation: _this.planeGeometryUpdateTriangulation
|
|
84
83
|
});
|
|
85
84
|
|
package/es/core/BaseLayer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SyncBailHook, SyncHook, SyncWaterfallHook } from '@antv/async-hook';
|
|
2
|
-
import { BlendType, IActiveOption, IAnimateOption,
|
|
2
|
+
import { BlendType, IActiveOption, IAnimateOption, IAttributeAndElements, ICameraService, ICoordinateSystemService, IDataState, IEncodeFeature, IFontService, IGlobalConfigService, IIconService, IInteractionService, ILayer, ILayerConfig, ILayerModel, ILayerModelInitializationOptions, ILayerPlugin, ILayerService, IMapService, IModel, IModelInitializationOptions, IMultiPassRenderer, IPass, IPickingService, IPostProcessingPass, IRendererService, IScale, IScaleOptions, IShaderModuleService, ISourceCFG, IStyleAttributeService, IStyleAttributeUpdateOptions, LayerEventType, LegendItems, StyleAttributeField, StyleAttributeOption, Triangulation } from '@antv/l7-core';
|
|
3
3
|
import Source from '@antv/l7-source';
|
|
4
4
|
import { EventEmitter } from 'eventemitter3';
|
|
5
5
|
import { Container } from 'inversify';
|
|
@@ -79,7 +79,6 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|
|
79
79
|
*/
|
|
80
80
|
protected container: Container;
|
|
81
81
|
private encodedData;
|
|
82
|
-
private configSchema;
|
|
83
82
|
private currentPickId;
|
|
84
83
|
protected rawConfig: Partial<ILayerConfig & ChildLayerStyleOptions>;
|
|
85
84
|
private needUpdateConfig;
|
|
@@ -95,9 +94,9 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|
|
95
94
|
}>;
|
|
96
95
|
private scaleOptions;
|
|
97
96
|
private animateStartTime;
|
|
98
|
-
private
|
|
97
|
+
private animateStatus;
|
|
99
98
|
private bottomColor;
|
|
100
|
-
private
|
|
99
|
+
private isDestroyed;
|
|
101
100
|
constructor(config?: Partial<ILayerConfig & ChildLayerStyleOptions>);
|
|
102
101
|
addMaskLayer(maskLayer: ILayer): void;
|
|
103
102
|
removeMaskLayer(maskLayer: ILayer): void;
|
|
@@ -116,7 +115,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|
|
116
115
|
getBottomColor(): string;
|
|
117
116
|
addPlugin(plugin: ILayerPlugin): ILayer;
|
|
118
117
|
init(): this;
|
|
119
|
-
updateModelData(data:
|
|
118
|
+
updateModelData(data: IAttributeAndElements): void;
|
|
120
119
|
createModelData(data: any, option?: ISourceCFG): any;
|
|
121
120
|
calculateEncodeData(data: any, option?: ISourceCFG): IEncodeFeature[] | null;
|
|
122
121
|
/**
|
|
@@ -194,7 +193,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|
|
194
193
|
}): void;
|
|
195
194
|
boxSelect(box: [number, number, number, number], cb: (...args: any[]) => void): void;
|
|
196
195
|
buildLayerModel(options: ILayerModelInitializationOptions & Partial<IModelInitializationOptions>): Promise<IModel>;
|
|
197
|
-
|
|
196
|
+
createAttributes(options: ILayerModelInitializationOptions & Partial<IModelInitializationOptions>): any;
|
|
198
197
|
getTime(): number;
|
|
199
198
|
setAnimateStartTime(): void;
|
|
200
199
|
stopAnimate(): void;
|
package/es/core/BaseLayer.js
CHANGED
|
@@ -144,11 +144,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
144
144
|
|
|
145
145
|
_defineProperty(_assertThisInitialized(_this), "scaleOptions", {});
|
|
146
146
|
|
|
147
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
147
|
+
_defineProperty(_assertThisInitialized(_this), "animateStatus", false);
|
|
148
148
|
|
|
149
149
|
_defineProperty(_assertThisInitialized(_this), "bottomColor", 'rgba(0, 0, 0, 0)');
|
|
150
150
|
|
|
151
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
151
|
+
_defineProperty(_assertThisInitialized(_this), "isDestroyed", false);
|
|
152
152
|
|
|
153
153
|
_defineProperty(_assertThisInitialized(_this), "encodeDataLength", 0);
|
|
154
154
|
|
|
@@ -251,11 +251,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
251
251
|
}, {
|
|
252
252
|
key: "addPlugin",
|
|
253
253
|
value: function addPlugin(plugin) {
|
|
254
|
-
// TODO: 控制插件注册顺序
|
|
255
|
-
// @example:
|
|
256
|
-
// pointLayer.addPlugin(new MyCustomPlugin(), {
|
|
257
|
-
// before: 'L7BuiltinPlugin'
|
|
258
|
-
// });
|
|
259
254
|
this.plugins.push(plugin);
|
|
260
255
|
return this;
|
|
261
256
|
}
|
|
@@ -418,7 +413,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
418
413
|
|
|
419
414
|
if (animateOption !== null && animateOption !== void 0 && animateOption.enable) {
|
|
420
415
|
this.layerService.startAnimate();
|
|
421
|
-
this.
|
|
416
|
+
this.animateStatus = true;
|
|
422
417
|
}
|
|
423
418
|
}
|
|
424
419
|
}, {
|
|
@@ -497,8 +492,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
497
492
|
|
|
498
493
|
this.updateLayerConfig({
|
|
499
494
|
animateOption: rawAnimate
|
|
500
|
-
});
|
|
501
|
-
|
|
495
|
+
});
|
|
502
496
|
return this;
|
|
503
497
|
}
|
|
504
498
|
}, {
|
|
@@ -957,11 +951,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
957
951
|
}, {
|
|
958
952
|
key: "destroy",
|
|
959
953
|
value: function destroy() {
|
|
960
|
-
var _this$multiPassRender, _this$layerModel2;
|
|
954
|
+
var _this$multiPassRender, _this$layerModel2, _this$tileLayer;
|
|
961
955
|
|
|
962
956
|
var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
963
957
|
|
|
964
|
-
if (this.
|
|
958
|
+
if (this.isDestroyed) {
|
|
965
959
|
return;
|
|
966
960
|
} // remove child layer
|
|
967
961
|
|
|
@@ -985,6 +979,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
985
979
|
this.hooks.afterDestroy.call(); // Tip: 清除各个图层自定义的 models 资源
|
|
986
980
|
|
|
987
981
|
(_this$layerModel2 = this.layerModel) === null || _this$layerModel2 === void 0 ? void 0 : _this$layerModel2.clearModels(refresh);
|
|
982
|
+
(_this$tileLayer = this.tileLayer) === null || _this$tileLayer === void 0 ? void 0 : _this$tileLayer.destroy();
|
|
988
983
|
this.models = [];
|
|
989
984
|
this.layerService.cleanRemove(this, refresh);
|
|
990
985
|
this.emit('remove', {
|
|
@@ -998,7 +993,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
998
993
|
this.removeAllListeners(); // 解绑图层容器中的服务
|
|
999
994
|
// this.container.unbind(TYPES.IStyleAttributeService);
|
|
1000
995
|
|
|
1001
|
-
this.
|
|
996
|
+
this.isDestroyed = true;
|
|
1002
997
|
}
|
|
1003
998
|
}, {
|
|
1004
999
|
key: "clear",
|
|
@@ -1184,7 +1179,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1184
1179
|
elements = _this9$styleAttribute.elements,
|
|
1185
1180
|
count = _this9$styleAttribute.count;
|
|
1186
1181
|
|
|
1187
|
-
var
|
|
1182
|
+
var modelOptions = _objectSpread({
|
|
1188
1183
|
attributes: attributes,
|
|
1189
1184
|
uniforms: uniforms,
|
|
1190
1185
|
fs: fs,
|
|
@@ -1194,18 +1189,18 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1194
1189
|
}, rest);
|
|
1195
1190
|
|
|
1196
1191
|
if (count) {
|
|
1197
|
-
|
|
1192
|
+
modelOptions.count = count;
|
|
1198
1193
|
}
|
|
1199
1194
|
|
|
1200
|
-
var m = createModel(
|
|
1195
|
+
var m = createModel(modelOptions);
|
|
1201
1196
|
resolve(m);
|
|
1202
1197
|
}
|
|
1203
1198
|
});
|
|
1204
1199
|
});
|
|
1205
1200
|
}
|
|
1206
1201
|
}, {
|
|
1207
|
-
key: "
|
|
1208
|
-
value: function
|
|
1202
|
+
key: "createAttributes",
|
|
1203
|
+
value: function createAttributes(options) {
|
|
1209
1204
|
var triangulation = options.triangulation; // @ts-ignore
|
|
1210
1205
|
|
|
1211
1206
|
var _this$styleAttributeS4 = this.styleAttributeService.createAttributes(this.encodedData, triangulation),
|
|
@@ -1226,9 +1221,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1226
1221
|
}, {
|
|
1227
1222
|
key: "stopAnimate",
|
|
1228
1223
|
value: function stopAnimate() {
|
|
1229
|
-
if (this.
|
|
1224
|
+
if (this.animateStatus) {
|
|
1230
1225
|
this.layerService.stopAnimate();
|
|
1231
|
-
this.
|
|
1226
|
+
this.animateStatus = false;
|
|
1232
1227
|
this.updateLayerConfig({
|
|
1233
1228
|
animateOption: {
|
|
1234
1229
|
enable: false
|
package/es/core/BaseModel.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export default class BaseModel<ChildLayerStyleOptions = {}> implements ILayerMod
|
|
|
29
29
|
protected cellLength: number;
|
|
30
30
|
protected cellProperties: ICellProperty[];
|
|
31
31
|
protected cellTypeLayout: number[];
|
|
32
|
-
protected
|
|
32
|
+
protected stylePropertiesExist: {
|
|
33
33
|
hasThetaOffset: number;
|
|
34
34
|
hasOpacity: number;
|
|
35
35
|
hasStrokeOpacity: number;
|
package/es/core/BaseModel.js
CHANGED
|
@@ -61,7 +61,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
61
61
|
stroke: undefined,
|
|
62
62
|
offsets: undefined
|
|
63
63
|
};
|
|
64
|
-
this.
|
|
64
|
+
this.stylePropertiesExist = {
|
|
65
65
|
hasThetaOffset: 0,
|
|
66
66
|
hasOpacity: 0,
|
|
67
67
|
hasStrokeOpacity: 0,
|
|
@@ -97,7 +97,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
97
97
|
|
|
98
98
|
this.cellLength = 0; // 清空上一次计算的 cell 的长度
|
|
99
99
|
|
|
100
|
-
this.
|
|
100
|
+
this.stylePropertiesExist = {
|
|
101
101
|
// 全量清空上一次是否需要对 style 属性进行数据映射的判断
|
|
102
102
|
hasThetaOffset: 0,
|
|
103
103
|
hasOpacity: 0,
|
|
@@ -115,13 +115,13 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
115
115
|
this.rowCount, // 数据纹理有几行
|
|
116
116
|
this.DATA_TEXTURE_WIDTH, // 数据纹理有几列
|
|
117
117
|
0.0, 0.0, // 1
|
|
118
|
-
this.
|
|
119
|
-
this.
|
|
120
|
-
this.
|
|
121
|
-
this.
|
|
118
|
+
this.stylePropertiesExist.hasOpacity, // cell 中是否存在 opacity
|
|
119
|
+
this.stylePropertiesExist.hasStrokeOpacity, // cell 中是否存在 strokeOpacity
|
|
120
|
+
this.stylePropertiesExist.hasStrokeWidth, // cell 中是否存在 strokeWidth
|
|
121
|
+
this.stylePropertiesExist.hasStroke, // cell 中是否存在 stroke
|
|
122
122
|
// 2
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
123
|
+
this.stylePropertiesExist.hasOffsets, // cell 中是否存在 offsets
|
|
124
|
+
this.stylePropertiesExist.hasThetaOffset, // cell 中是否存在 thetaOffset
|
|
125
125
|
0.0, 0.0, // 3
|
|
126
126
|
0.0, 0.0, 0.0, 1.0];
|
|
127
127
|
} else {
|
|
@@ -198,7 +198,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
198
198
|
attr: 'opacity',
|
|
199
199
|
count: 1
|
|
200
200
|
});
|
|
201
|
-
this.
|
|
201
|
+
this.stylePropertiesExist.hasOpacity = 1;
|
|
202
202
|
this.cellLength += 1;
|
|
203
203
|
}
|
|
204
204
|
|
|
@@ -208,7 +208,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
208
208
|
attr: 'strokeOpacity',
|
|
209
209
|
count: 1
|
|
210
210
|
});
|
|
211
|
-
this.
|
|
211
|
+
this.stylePropertiesExist.hasStrokeOpacity = 1;
|
|
212
212
|
this.cellLength += 1;
|
|
213
213
|
}
|
|
214
214
|
|
|
@@ -218,7 +218,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
218
218
|
attr: 'strokeWidth',
|
|
219
219
|
count: 1
|
|
220
220
|
});
|
|
221
|
-
this.
|
|
221
|
+
this.stylePropertiesExist.hasStrokeWidth = 1;
|
|
222
222
|
this.cellLength += 1;
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -228,7 +228,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
228
228
|
attr: 'stroke',
|
|
229
229
|
count: 4
|
|
230
230
|
});
|
|
231
|
-
this.
|
|
231
|
+
this.stylePropertiesExist.hasStroke = 1;
|
|
232
232
|
this.cellLength += 4;
|
|
233
233
|
}
|
|
234
234
|
|
|
@@ -238,7 +238,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
238
238
|
attr: 'offsets',
|
|
239
239
|
count: 2
|
|
240
240
|
});
|
|
241
|
-
this.
|
|
241
|
+
this.stylePropertiesExist.hasOffsets = 1;
|
|
242
242
|
this.cellLength += 2;
|
|
243
243
|
}
|
|
244
244
|
|
|
@@ -248,10 +248,9 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
248
248
|
attr: 'thetaOffset',
|
|
249
249
|
count: 1
|
|
250
250
|
});
|
|
251
|
-
this.
|
|
251
|
+
this.stylePropertiesExist.hasThetaOffset = 1;
|
|
252
252
|
this.cellLength += 1;
|
|
253
|
-
}
|
|
254
|
-
|
|
253
|
+
}
|
|
255
254
|
}
|
|
256
255
|
/**
|
|
257
256
|
* 判断变量 stroke 是否是常量值
|
package/es/core/interface.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAnimateOption, IMapService } from '@antv/l7-core';
|
|
1
|
+
import { IAnimateOption, IMapService, ITexture2D } from '@antv/l7-core';
|
|
2
2
|
import { IColorRamp, IImagedata } from '@antv/l7-utils';
|
|
3
3
|
import { styleOffset } from '../core/BaseModel';
|
|
4
4
|
import { anchorType } from '../utils/symbol-layout';
|
|
@@ -143,6 +143,7 @@ export interface IImageLayerStyleOptions extends IBaseLayerStyleOptions {
|
|
|
143
143
|
clampHigh?: boolean;
|
|
144
144
|
rampColors?: IColorRamp;
|
|
145
145
|
rampColorsData?: ImageData | IImagedata;
|
|
146
|
+
colorTexture?: ITexture2D;
|
|
146
147
|
pixelConstant?: number;
|
|
147
148
|
pixelConstantR?: number;
|
|
148
149
|
pixelConstantG?: number;
|
|
@@ -209,6 +210,7 @@ export interface IHeatMapLayerStyleOptions extends IBaseLayerStyleOptions {
|
|
|
209
210
|
coverage?: number;
|
|
210
211
|
}
|
|
211
212
|
export interface IRasterLayerStyleOptions extends IBaseLayerStyleOptions {
|
|
213
|
+
colorTexture?: ITexture2D;
|
|
212
214
|
domain: [number, number];
|
|
213
215
|
noDataValue: number;
|
|
214
216
|
clampLow: boolean;
|
|
@@ -14,7 +14,7 @@ import BaseModel from "../../core/BaseModel";
|
|
|
14
14
|
import { earthTriangulation } from "../../core/triangulation";
|
|
15
15
|
|
|
16
16
|
/* babel-plugin-inline-import '../shaders/atmosphere_frag.glsl' */
|
|
17
|
-
var atmoSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\n\nvarying vec3 vVertexNormal;\nvarying float v_offset;\nvarying vec4 v_Color;\nvoid main() {\n \n \n // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n //
|
|
17
|
+
var atmoSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\n\nvarying vec3 vVertexNormal;\nvarying float v_offset;\nvarying vec4 v_Color;\nvoid main() {\n \n \n // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n // \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
|
|
18
18
|
|
|
19
19
|
/* babel-plugin-inline-import '../shaders/atmosphere_vert.glsl' */
|
|
20
20
|
var atmoSphereVert = "\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nattribute vec4 a_Color;\nuniform vec3 u_CameraPosition;\nvarying float v_CamreaDistance;\n\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_ViewMatrix;\n\nvarying vec3 vVertexNormal;\nvarying vec4 v_Color;\nvarying float v_offset;\n\nvoid main() {\n float EARTH_RADIUS = 100.0;\n \n v_Color = a_Color;\n\n v_offset = min(((length(u_CameraPosition) - EARTH_RADIUS)/600.0) * 0.5 + 0.4, 1.0);\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
|
|
@@ -57,7 +57,7 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
57
57
|
// TODO: 调整图层的绘制顺序 地球大气层
|
|
58
58
|
this.layer.zIndex = -997;
|
|
59
59
|
this.layer.buildLayerModel({
|
|
60
|
-
moduleName: '
|
|
60
|
+
moduleName: 'earthAtmoSphere',
|
|
61
61
|
vertexShader: atmoSphereVert,
|
|
62
62
|
fragmentShader: atmoSphereFrag,
|
|
63
63
|
triangulation: earthTriangulation,
|
|
@@ -82,13 +82,12 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
82
82
|
descriptor: {
|
|
83
83
|
name: 'a_Size',
|
|
84
84
|
buffer: {
|
|
85
|
-
// give the WebGL driver a hint that this buffer may change
|
|
86
85
|
usage: gl.DYNAMIC_DRAW,
|
|
87
86
|
data: [],
|
|
88
87
|
type: gl.FLOAT
|
|
89
88
|
},
|
|
90
89
|
size: 1,
|
|
91
|
-
update: function update(feature
|
|
90
|
+
update: function update(feature) {
|
|
92
91
|
var _feature$size = feature.size,
|
|
93
92
|
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
94
93
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
@@ -101,7 +100,6 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
101
100
|
descriptor: {
|
|
102
101
|
name: 'a_Normal',
|
|
103
102
|
buffer: {
|
|
104
|
-
// give the WebGL driver a hint that this buffer may change
|
|
105
103
|
usage: gl.STATIC_DRAW,
|
|
106
104
|
data: [],
|
|
107
105
|
type: gl.FLOAT
|
|
@@ -118,13 +116,12 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
118
116
|
descriptor: {
|
|
119
117
|
name: 'a_Uv',
|
|
120
118
|
buffer: {
|
|
121
|
-
// give the WebGL driver a hint that this buffer may change
|
|
122
119
|
usage: gl.DYNAMIC_DRAW,
|
|
123
120
|
data: [],
|
|
124
121
|
type: gl.FLOAT
|
|
125
122
|
},
|
|
126
123
|
size: 2,
|
|
127
|
-
update: function update(feature, featureIdx, vertex
|
|
124
|
+
update: function update(feature, featureIdx, vertex) {
|
|
128
125
|
return [vertex[3], vertex[4]];
|
|
129
126
|
}
|
|
130
127
|
}
|
package/es/earth/models/base.js
CHANGED
|
@@ -54,7 +54,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
54
54
|
value: function getUninforms() {
|
|
55
55
|
var _this$layer$getLayerC = this.layer.getLayerConfig(),
|
|
56
56
|
animateOption = _this$layer$getLayerC.animateOption,
|
|
57
|
-
|
|
57
|
+
globalOptions = _this$layer$getLayerC.globalOptions;
|
|
58
58
|
|
|
59
59
|
if (animateOption !== null && animateOption !== void 0 && animateOption.enable) {
|
|
60
60
|
// @ts-ignore
|
|
@@ -69,13 +69,12 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
return {
|
|
72
|
-
u_ambientRatio: (
|
|
72
|
+
u_ambientRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.ambientRatio) || 0.6,
|
|
73
73
|
// 环境光
|
|
74
|
-
u_diffuseRatio: (
|
|
74
|
+
u_diffuseRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.diffuseRatio) || 0.4,
|
|
75
75
|
// 漫反射
|
|
76
|
-
u_specularRatio: (
|
|
76
|
+
u_specularRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.specularRatio) || 0.1,
|
|
77
77
|
// 高光反射
|
|
78
|
-
// u_sunLight: [120, 120, 120],
|
|
79
78
|
u_sunLight: [this.sunX, this.sunY, this.sunZ],
|
|
80
79
|
u_texture: this.texture
|
|
81
80
|
};
|
|
@@ -95,10 +94,10 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
95
94
|
var _this2 = this;
|
|
96
95
|
|
|
97
96
|
var _this$layer$getLayerC2 = this.layer.getLayerConfig(),
|
|
98
|
-
|
|
97
|
+
globalOptions = _this$layer$getLayerC2.globalOptions;
|
|
99
98
|
|
|
100
|
-
if ((
|
|
101
|
-
this.setEarthTime(
|
|
99
|
+
if ((globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.earthTime) !== undefined) {
|
|
100
|
+
this.setEarthTime(globalOptions.earthTime);
|
|
102
101
|
}
|
|
103
102
|
|
|
104
103
|
var source = this.layer.getSource();
|
|
@@ -126,7 +125,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
126
125
|
}, {
|
|
127
126
|
key: "buildModels",
|
|
128
127
|
value: function buildModels(callbackModel) {
|
|
129
|
-
//
|
|
128
|
+
// Tip: 调整图层的绘制顺序 地球大气层
|
|
130
129
|
this.layer.zIndex = -998;
|
|
131
130
|
this.layer.buildLayerModel({
|
|
132
131
|
moduleName: 'earthBase',
|
|
@@ -147,20 +146,18 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
147
146
|
}, {
|
|
148
147
|
key: "registerBuiltinAttributes",
|
|
149
148
|
value: function registerBuiltinAttributes() {
|
|
150
|
-
// point layer size;
|
|
151
149
|
this.styleAttributeService.registerStyleAttribute({
|
|
152
150
|
name: 'size',
|
|
153
151
|
type: AttributeType.Attribute,
|
|
154
152
|
descriptor: {
|
|
155
153
|
name: 'a_Size',
|
|
156
154
|
buffer: {
|
|
157
|
-
// give the WebGL driver a hint that this buffer may change
|
|
158
155
|
usage: gl.DYNAMIC_DRAW,
|
|
159
156
|
data: [],
|
|
160
157
|
type: gl.FLOAT
|
|
161
158
|
},
|
|
162
159
|
size: 1,
|
|
163
|
-
update: function update(feature
|
|
160
|
+
update: function update(feature) {
|
|
164
161
|
var _feature$size = feature.size,
|
|
165
162
|
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
166
163
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
@@ -173,7 +170,6 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
173
170
|
descriptor: {
|
|
174
171
|
name: 'a_Normal',
|
|
175
172
|
buffer: {
|
|
176
|
-
// give the WebGL driver a hint that this buffer may change
|
|
177
173
|
usage: gl.STATIC_DRAW,
|
|
178
174
|
data: [],
|
|
179
175
|
type: gl.FLOAT
|
|
@@ -196,7 +192,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
196
192
|
type: gl.FLOAT
|
|
197
193
|
},
|
|
198
194
|
size: 2,
|
|
199
|
-
update: function update(feature, featureIdx, vertex
|
|
195
|
+
update: function update(feature, featureIdx, vertex) {
|
|
200
196
|
return [vertex[3], vertex[4]];
|
|
201
197
|
}
|
|
202
198
|
}
|
|
@@ -14,7 +14,7 @@ import BaseModel from "../../core/BaseModel";
|
|
|
14
14
|
import { earthOuterTriangulation } from "../../core/triangulation";
|
|
15
15
|
|
|
16
16
|
/* babel-plugin-inline-import '../shaders/bloomsphere_frag.glsl' */
|
|
17
|
-
var bloomSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\nvarying vec3 vVertexNormal;\n\nvarying vec4 v_Color;\nvoid main() {\n\n\n float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));\n //
|
|
17
|
+
var bloomSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\nvarying vec3 vVertexNormal;\n\nvarying vec4 v_Color;\nvoid main() {\n\n\n float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));\n // \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
|
|
18
18
|
|
|
19
19
|
/* babel-plugin-inline-import '../shaders/bloomsphere_vert.glsl' */
|
|
20
20
|
var bloomSphereVert = "\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nattribute vec4 a_Color;\nuniform vec3 u_CameraPosition;\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_ViewMatrix;\n\nvarying vec3 vVertexNormal;\nvarying vec4 v_Color;\n\nvoid main() {\n v_Color = a_Color;\n\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
|
|
@@ -54,7 +54,7 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
54
54
|
}, {
|
|
55
55
|
key: "buildModels",
|
|
56
56
|
value: function buildModels(callbackModel) {
|
|
57
|
-
//
|
|
57
|
+
// Tip: 调整图层的绘制顺序,让它保持在地球后面(减少锯齿现象)
|
|
58
58
|
this.layer.zIndex = -999;
|
|
59
59
|
this.layer.buildLayerModel({
|
|
60
60
|
moduleName: 'earthBloom',
|
|
@@ -75,20 +75,18 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
75
75
|
}, {
|
|
76
76
|
key: "registerBuiltinAttributes",
|
|
77
77
|
value: function registerBuiltinAttributes() {
|
|
78
|
-
// point layer size;
|
|
79
78
|
this.styleAttributeService.registerStyleAttribute({
|
|
80
79
|
name: 'size',
|
|
81
80
|
type: AttributeType.Attribute,
|
|
82
81
|
descriptor: {
|
|
83
82
|
name: 'a_Size',
|
|
84
83
|
buffer: {
|
|
85
|
-
// give the WebGL driver a hint that this buffer may change
|
|
86
84
|
usage: gl.DYNAMIC_DRAW,
|
|
87
85
|
data: [],
|
|
88
86
|
type: gl.FLOAT
|
|
89
87
|
},
|
|
90
88
|
size: 1,
|
|
91
|
-
update: function update(feature
|
|
89
|
+
update: function update(feature) {
|
|
92
90
|
var _feature$size = feature.size,
|
|
93
91
|
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
94
92
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
@@ -101,7 +99,6 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
101
99
|
descriptor: {
|
|
102
100
|
name: 'a_Normal',
|
|
103
101
|
buffer: {
|
|
104
|
-
// give the WebGL driver a hint that this buffer may change
|
|
105
102
|
usage: gl.STATIC_DRAW,
|
|
106
103
|
data: [],
|
|
107
104
|
type: gl.FLOAT
|
|
@@ -118,13 +115,12 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
118
115
|
descriptor: {
|
|
119
116
|
name: 'a_Uv',
|
|
120
117
|
buffer: {
|
|
121
|
-
// give the WebGL driver a hint that this buffer may change
|
|
122
118
|
usage: gl.DYNAMIC_DRAW,
|
|
123
119
|
data: [],
|
|
124
120
|
type: gl.FLOAT
|
|
125
121
|
},
|
|
126
122
|
size: 2,
|
|
127
|
-
update: function update(feature, featureIdx, vertex
|
|
123
|
+
update: function update(feature, featureIdx, vertex) {
|
|
128
124
|
return [vertex[3], vertex[4]];
|
|
129
125
|
}
|
|
130
126
|
}
|
package/es/heatmap/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IAttributeAndElements } from '@antv/l7-core';
|
|
2
2
|
import BaseLayer from '../core/BaseLayer';
|
|
3
3
|
import { IHeatMapLayerStyleOptions } from '../core/interface';
|
|
4
4
|
import { HeatMapModelType } from './models';
|
|
@@ -7,7 +7,7 @@ export default class HeatMapLayer extends BaseLayer<IHeatMapLayerStyleOptions> {
|
|
|
7
7
|
buildModels(): void;
|
|
8
8
|
rebuildModels(): void;
|
|
9
9
|
renderModels(): this;
|
|
10
|
-
updateModelData(data:
|
|
10
|
+
updateModelData(data: IAttributeAndElements): void;
|
|
11
11
|
protected getConfigSchema(): {
|
|
12
12
|
properties: {
|
|
13
13
|
opacity: {
|
package/es/heatmap/index.js
CHANGED
|
@@ -78,9 +78,7 @@ var HeatMapLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
78
78
|
if (this.layerModelNeedUpdate) {
|
|
79
79
|
this.layerModel.buildModels(function (models) {
|
|
80
80
|
return _this4.models = models;
|
|
81
|
-
});
|
|
82
|
-
// this.models = this.layerModel.buildModels();
|
|
83
|
-
|
|
81
|
+
});
|
|
84
82
|
this.layerModelNeedUpdate = false;
|
|
85
83
|
}
|
|
86
84
|
|
|
@@ -86,14 +86,12 @@ var GridModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
86
86
|
descriptor: {
|
|
87
87
|
name: 'a_Pos',
|
|
88
88
|
buffer: {
|
|
89
|
-
// give the WebGL driver a hint that this buffer may change
|
|
90
89
|
usage: gl.DYNAMIC_DRAW,
|
|
91
90
|
data: [],
|
|
92
91
|
type: gl.FLOAT
|
|
93
92
|
},
|
|
94
93
|
size: 3,
|
|
95
|
-
update: function update(feature
|
|
96
|
-
// const coordinates = feature.coordinates as number[];
|
|
94
|
+
update: function update(feature) {
|
|
97
95
|
var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
|
|
98
96
|
return [coordinates[0], coordinates[1], 0];
|
|
99
97
|
}
|