@antv/l7-layers 2.9.35 → 2.9.36-alpha.1
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/core/BaseLayer.js +2 -0
- package/es/glsl.d.ts +5 -0
- package/es/plugins/DataMappingPlugin.js +1 -1
- package/es/plugins/ShaderUniformPlugin.d.ts +5 -1
- package/es/plugins/ShaderUniformPlugin.js +12 -5
- package/es/tile/tileFactory/base.d.ts +1 -1
- package/lib/core/BaseLayer.js +2 -0
- package/lib/glsl.d.ts +5 -0
- package/lib/plugins/DataMappingPlugin.js +1 -1
- package/lib/plugins/ShaderUniformPlugin.js +12 -5
- package/package.json +6 -6
package/es/core/BaseLayer.js
CHANGED
|
@@ -793,6 +793,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
793
793
|
visible: true
|
|
794
794
|
});
|
|
795
795
|
this.reRender();
|
|
796
|
+
this.emit('show');
|
|
796
797
|
return this;
|
|
797
798
|
}
|
|
798
799
|
}, {
|
|
@@ -802,6 +803,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
802
803
|
visible: false
|
|
803
804
|
});
|
|
804
805
|
this.reRender();
|
|
806
|
+
this.emit('hide');
|
|
805
807
|
return this;
|
|
806
808
|
}
|
|
807
809
|
}, {
|
package/es/glsl.d.ts
ADDED
|
@@ -254,7 +254,7 @@ var DataMappingPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IMapService),
|
|
|
254
254
|
|
|
255
255
|
// 根据地图的类型判断是否需要对点位数据进行处理, 若是高德2.0则需要对坐标进行相对偏移
|
|
256
256
|
if (mappedData.length > 0 && this.mapService.version === Version['GAODE2.x']) {
|
|
257
|
-
var layerCenter = layer.coordCenter;
|
|
257
|
+
var layerCenter = layer.coordCenter || layer.getSource().center;
|
|
258
258
|
|
|
259
259
|
if (typeof mappedData[0].coordinates[0] === 'number') {
|
|
260
260
|
// 单个的点数据
|
|
@@ -13,5 +13,9 @@ export default class ShaderUniformPlugin implements ILayerPlugin {
|
|
|
13
13
|
private readonly rendererService;
|
|
14
14
|
private readonly mapService;
|
|
15
15
|
apply(layer: ILayer): void;
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* 对于每个 layer 都有不同的几何中心点,因此在绘制每个 layer 的时候都需要重新设置
|
|
18
|
+
* @param layer
|
|
19
|
+
*/
|
|
20
|
+
private setLayerCenter;
|
|
17
21
|
}
|
|
@@ -48,7 +48,9 @@ var ShaderUniformPlugin = (_dec = injectable(), _dec2 = inject(TYPES.ICameraServ
|
|
|
48
48
|
_this.coordinateSystemService.refresh(offset);
|
|
49
49
|
|
|
50
50
|
if (version === 'GAODE2.x') {
|
|
51
|
-
// @ts-ignore
|
|
51
|
+
_this.setLayerCenter(layer); // @ts-ignore
|
|
52
|
+
|
|
53
|
+
|
|
52
54
|
mvp = _this.mapService.map.customCoords.getMVPMatrix(); // mvp = amapCustomCoords.getMVPMatrix()
|
|
53
55
|
// @ts-ignore
|
|
54
56
|
|
|
@@ -66,11 +68,16 @@ var ShaderUniformPlugin = (_dec = injectable(), _dec2 = inject(TYPES.ICameraServ
|
|
|
66
68
|
}); // TODO:脏检查,决定是否需要渲染
|
|
67
69
|
});
|
|
68
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* 对于每个 layer 都有不同的几何中心点,因此在绘制每个 layer 的时候都需要重新设置
|
|
73
|
+
* @param layer
|
|
74
|
+
*/
|
|
75
|
+
|
|
69
76
|
}, {
|
|
70
|
-
key: "
|
|
71
|
-
value: function
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
key: "setLayerCenter",
|
|
78
|
+
value: function setLayerCenter(layer) {
|
|
79
|
+
if (layer.coordCenter === undefined) layer.coordCenter = layer.getSource().center;
|
|
80
|
+
this.mapService.setCoordCenter && this.mapService.setCoordCenter(layer.coordCenter);
|
|
74
81
|
}
|
|
75
82
|
}]);
|
|
76
83
|
|
|
@@ -32,7 +32,7 @@ export default class TileFactory implements ITileFactory {
|
|
|
32
32
|
updateStyle(styles: ITileStyles): string;
|
|
33
33
|
getDefaultStyleAttributeField(layer: ILayer, type: string): string | string[] | 1;
|
|
34
34
|
setStyleAttributeField(layer: ILayer, type: ScaleAttributeType, value: IScaleValue | undefined | string | string[]): ILayer | undefined;
|
|
35
|
-
protected parseScaleValue(value: IScaleValue | string, type: string): (string | number |
|
|
35
|
+
protected parseScaleValue(value: IScaleValue | string, type: string): (string | number | any[])[] | (import("@antv/l7-core").StyleAttributeField | ((...args: any[]) => [] | undefined))[];
|
|
36
36
|
protected getTile(lng: number, lat: number): Tile;
|
|
37
37
|
protected emitEvent(layers: ILayer[], isVector?: boolean): void;
|
|
38
38
|
protected getCombineFeature(features: IParseDataItem[]): any;
|
package/lib/core/BaseLayer.js
CHANGED
|
@@ -790,6 +790,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
790
790
|
visible: true
|
|
791
791
|
});
|
|
792
792
|
this.reRender();
|
|
793
|
+
this.emit('show');
|
|
793
794
|
return this;
|
|
794
795
|
}
|
|
795
796
|
}, {
|
|
@@ -799,6 +800,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
799
800
|
visible: false
|
|
800
801
|
});
|
|
801
802
|
this.reRender();
|
|
803
|
+
this.emit('hide');
|
|
802
804
|
return this;
|
|
803
805
|
}
|
|
804
806
|
}, {
|
package/lib/glsl.d.ts
ADDED
|
@@ -269,7 +269,7 @@ var DataMappingPlugin = (_dec = (0, _inversify.injectable)(), _dec2 = (0, _inver
|
|
|
269
269
|
|
|
270
270
|
// 根据地图的类型判断是否需要对点位数据进行处理, 若是高德2.0则需要对坐标进行相对偏移
|
|
271
271
|
if (mappedData.length > 0 && this.mapService.version === _l7Maps.Version['GAODE2.x']) {
|
|
272
|
-
var layerCenter = layer.coordCenter;
|
|
272
|
+
var layerCenter = layer.coordCenter || layer.getSource().center;
|
|
273
273
|
|
|
274
274
|
if (typeof mappedData[0].coordinates[0] === 'number') {
|
|
275
275
|
// 单个的点数据
|
|
@@ -62,7 +62,9 @@ _dec = (0, _inversify.injectable)(), _dec2 = (0, _inversify.inject)(_l7Core.TYPE
|
|
|
62
62
|
_this.coordinateSystemService.refresh(offset);
|
|
63
63
|
|
|
64
64
|
if (version === 'GAODE2.x') {
|
|
65
|
-
// @ts-ignore
|
|
65
|
+
_this.setLayerCenter(layer); // @ts-ignore
|
|
66
|
+
|
|
67
|
+
|
|
66
68
|
mvp = _this.mapService.map.customCoords.getMVPMatrix(); // mvp = amapCustomCoords.getMVPMatrix()
|
|
67
69
|
// @ts-ignore
|
|
68
70
|
|
|
@@ -80,11 +82,16 @@ _dec = (0, _inversify.injectable)(), _dec2 = (0, _inversify.inject)(_l7Core.TYPE
|
|
|
80
82
|
}); // TODO:脏检查,决定是否需要渲染
|
|
81
83
|
});
|
|
82
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* 对于每个 layer 都有不同的几何中心点,因此在绘制每个 layer 的时候都需要重新设置
|
|
87
|
+
* @param layer
|
|
88
|
+
*/
|
|
89
|
+
|
|
83
90
|
}, {
|
|
84
|
-
key: "
|
|
85
|
-
value: function
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
key: "setLayerCenter",
|
|
92
|
+
value: function setLayerCenter(layer) {
|
|
93
|
+
if (layer.coordCenter === undefined) layer.coordCenter = layer.getSource().center;
|
|
94
|
+
this.mapService.setCoordCenter && this.mapService.setCoordCenter(layer.coordCenter);
|
|
88
95
|
}
|
|
89
96
|
}]);
|
|
90
97
|
return ShaderUniformPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-layers",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.36-alpha.1",
|
|
4
4
|
"description": "L7's collection of built-in layers",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"license": "ISC",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@antv/async-hook": "^2.2.2",
|
|
30
|
-
"@antv/l7-core": "2.9.
|
|
31
|
-
"@antv/l7-maps": "2.9.
|
|
32
|
-
"@antv/l7-source": "2.9.
|
|
33
|
-
"@antv/l7-utils": "2.9.
|
|
30
|
+
"@antv/l7-core": "2.9.36-alpha.1",
|
|
31
|
+
"@antv/l7-maps": "2.9.36-alpha.1",
|
|
32
|
+
"@antv/l7-source": "2.9.36-alpha.1",
|
|
33
|
+
"@antv/l7-utils": "2.9.36-alpha.1",
|
|
34
34
|
"@babel/runtime": "^7.7.7",
|
|
35
35
|
"@mapbox/martini": "^0.2.0",
|
|
36
36
|
"@turf/clone": "^6.5.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@types/gl-matrix": "^2.4.5",
|
|
62
62
|
"@types/lodash": "^4.14.138"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "dafb82e5eb2cf73db95d8dbdcef63d4ad5f99554",
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
}
|