@antv/l7-layers 2.10.9 → 2.10.11
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/index.d.ts +1 -1
- package/es/canvas/models/index.d.ts +1 -1
- package/es/core/BaseLayer.js +1 -2
- package/es/core/BaseModel.d.ts +3 -3
- package/es/core/shape/Path.d.ts +2 -2
- package/es/earth/index.d.ts +1 -1
- package/es/heatmap/models/index.d.ts +1 -1
- package/es/image/models/index.d.ts +1 -1
- package/es/line/index.js +3 -2
- package/es/line/models/index.d.ts +1 -1
- package/es/line/models/line.d.ts +1 -0
- package/es/line/models/line.js +34 -15
- package/es/mask/models/index.d.ts +1 -1
- package/es/point/models/index.d.ts +1 -1
- package/es/polygon/models/index.d.ts +1 -1
- package/es/raster/models/index.d.ts +1 -1
- package/es/tile/interface.d.ts +2 -2
- package/es/tile/tileFactory/index.d.ts +1 -1
- package/es/utils/grid-index.d.ts +1 -1
- package/es/utils/symbol-layout.d.ts +1 -1
- package/es/wind/models/index.d.ts +1 -1
- package/lib/core/BaseLayer.js +1 -2
- package/lib/line/index.js +3 -2
- package/lib/line/models/line.js +32 -15
- package/package.json +6 -6
- package/es/line/models/simpleTileLine.d.ts +0 -9
- package/es/line/models/simpleTileLine.js +0 -140
- package/lib/line/models/simpleTileLine.js +0 -157
package/es/core/BaseLayer.js
CHANGED
|
@@ -553,8 +553,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
553
553
|
_this4.source(new Source(data, options));
|
|
554
554
|
} else {
|
|
555
555
|
_this4.layerSource.setData(data, options);
|
|
556
|
-
}
|
|
557
|
-
|
|
556
|
+
}
|
|
558
557
|
});
|
|
559
558
|
}
|
|
560
559
|
|
package/es/core/BaseModel.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IAnimateOption, IAttribute, IBlendOptions, ICameraService, IElements, IEncodeFeature, IFontService, IGlobalConfigService, IIconService, ILayer, ILayerModel, ILayerService, IMapService, IModel, IModelUniform, IPickingService, IRendererService, IShaderModuleService, IStyleAttributeService, ITexture2D, ITexture2DInitializationOptions, Triangulation } from '@antv/l7-core';
|
|
2
|
-
export type styleSingle = number | string | [string, (single: any) => number] | [string, [number, number]];
|
|
3
|
-
export type styleOffset = string | [number, number] | [string, (single: any) => number];
|
|
4
|
-
export type styleColor = string | [string, (single: any) => string] | [string, [string, string]];
|
|
2
|
+
export declare type styleSingle = number | string | [string, (single: any) => number] | [string, [number, number]];
|
|
3
|
+
export declare type styleOffset = string | [number, number] | [string, (single: any) => number];
|
|
4
|
+
export declare type styleColor = string | [string, (single: any) => string] | [string, [string, string]];
|
|
5
5
|
export interface IDataTextureFrame {
|
|
6
6
|
data: number[];
|
|
7
7
|
width: number;
|
package/es/core/shape/Path.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type IPosition = [number, number, number] | [number, number];
|
|
2
|
-
export type IPath = IPosition[];
|
|
1
|
+
export declare type IPosition = [number, number, number] | [number, number];
|
|
2
|
+
export declare type IPath = IPosition[];
|
|
3
3
|
export declare enum ShapeType3D {
|
|
4
4
|
CYLINDER = "cylinder",
|
|
5
5
|
SQUARECOLUMN = "squareColumn",
|
package/es/earth/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ interface IEarthLayerStyleOptions {
|
|
|
4
4
|
opacity: number;
|
|
5
5
|
setEarthTime(time: number): void;
|
|
6
6
|
}
|
|
7
|
-
export type EarthModelType = 'base' | 'atomSphere' | 'bloomSphere';
|
|
7
|
+
export declare type EarthModelType = 'base' | 'atomSphere' | 'bloomSphere';
|
|
8
8
|
export default class EarthLayer extends BaseLayer<IEarthLayerStyleOptions> {
|
|
9
9
|
type: string;
|
|
10
10
|
defaultSourceConfig: {
|
package/es/line/index.js
CHANGED
|
@@ -68,9 +68,10 @@ var LineLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
68
68
|
case 0:
|
|
69
69
|
shape = this.getModelType();
|
|
70
70
|
this.layerModel = new LineModels[shape](this);
|
|
71
|
-
|
|
71
|
+
_context.next = 4;
|
|
72
|
+
return this.initLayerModels();
|
|
72
73
|
|
|
73
|
-
case
|
|
74
|
+
case 4:
|
|
74
75
|
case "end":
|
|
75
76
|
return _context.stop();
|
|
76
77
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type LineModelType = 'arc' | 'arc3d' | 'greatcircle' | 'wall' | 'simple' | 'line' | 'halfLine' | 'linearline' | 'tileLine' | 'earthArc3d';
|
|
1
|
+
export declare type LineModelType = 'arc' | 'arc3d' | 'greatcircle' | 'wall' | 'simple' | 'line' | 'halfLine' | 'linearline' | 'tileLine' | 'earthArc3d';
|
|
2
2
|
declare const LineModels: {
|
|
3
3
|
[key in LineModelType]: any;
|
|
4
4
|
};
|
package/es/line/models/line.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { IModel, IModelUniform, ITexture2D } from '@antv/l7-core';
|
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class LineModel extends BaseModel {
|
|
4
4
|
protected texture: ITexture2D;
|
|
5
|
+
protected dataTexture: ITexture2D;
|
|
5
6
|
getUninforms(): IModelUniform;
|
|
6
7
|
getAnimateUniforms(): IModelUniform;
|
|
7
8
|
initModels(): Promise<IModel[]>;
|
package/es/line/models/line.js
CHANGED
|
@@ -54,19 +54,39 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
54
54
|
|
|
55
55
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
56
56
|
|
|
57
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
58
|
-
|
|
57
|
+
_defineProperty(_assertThisInitialized(_this), "texture", _this.createTexture2D({
|
|
58
|
+
data: [0, 0, 0, 0],
|
|
59
|
+
mag: gl.NEAREST,
|
|
60
|
+
min: gl.NEAREST,
|
|
61
|
+
premultiplyAlpha: false,
|
|
62
|
+
width: 1,
|
|
63
|
+
height: 1
|
|
64
|
+
}));
|
|
65
|
+
|
|
66
|
+
_defineProperty(_assertThisInitialized(_this), "dataTexture", _this.createTexture2D({
|
|
67
|
+
flipY: true,
|
|
68
|
+
data: [1],
|
|
69
|
+
format: gl.LUMINANCE,
|
|
70
|
+
type: gl.FLOAT,
|
|
71
|
+
width: 1,
|
|
72
|
+
height: 1
|
|
73
|
+
}));
|
|
59
74
|
|
|
75
|
+
_defineProperty(_assertThisInitialized(_this), "updateTexture", function () {
|
|
60
76
|
if (_this.texture) {
|
|
61
|
-
_this.texture.update({
|
|
62
|
-
data: _this.iconService.getCanvas()
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
_this.layer.render();
|
|
66
|
-
|
|
67
77
|
return;
|
|
68
78
|
}
|
|
69
79
|
|
|
80
|
+
console.log(_this.texture);
|
|
81
|
+
var createTexture2D = _this.rendererService.createTexture2D; // if (this.texture) {
|
|
82
|
+
// this.texture.update({
|
|
83
|
+
// data: this.iconService.getCanvas(),
|
|
84
|
+
// });
|
|
85
|
+
// this.layer.render();
|
|
86
|
+
// return;
|
|
87
|
+
// }
|
|
88
|
+
|
|
89
|
+
console.log('update texture');
|
|
70
90
|
_this.texture = createTexture2D({
|
|
71
91
|
data: _this.iconService.getCanvas(),
|
|
72
92
|
mag: gl.NEAREST,
|
|
@@ -125,7 +145,7 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
125
145
|
}
|
|
126
146
|
|
|
127
147
|
if (this.rendererService.getDirty()) {
|
|
128
|
-
this.texture.bind();
|
|
148
|
+
this.texture && this.texture.bind();
|
|
129
149
|
} // 转化渐变色
|
|
130
150
|
|
|
131
151
|
|
|
@@ -140,7 +160,7 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
140
160
|
useLinearColor = 1;
|
|
141
161
|
}
|
|
142
162
|
|
|
143
|
-
if (this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
163
|
+
if (!this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
144
164
|
opacity: opacity
|
|
145
165
|
})) {
|
|
146
166
|
this.judgeStyleAttributes({
|
|
@@ -170,6 +190,7 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
170
190
|
width: 1,
|
|
171
191
|
height: 1
|
|
172
192
|
});
|
|
193
|
+
console.timeEnd('encodeData');
|
|
173
194
|
}
|
|
174
195
|
|
|
175
196
|
return {
|
|
@@ -227,15 +248,13 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
227
248
|
while (1) {
|
|
228
249
|
switch (_context.prev = _context.next) {
|
|
229
250
|
case 0:
|
|
230
|
-
|
|
231
|
-
this.iconService.on('imageUpdate', this.updateTexture);
|
|
232
|
-
_context.next = 4;
|
|
251
|
+
_context.next = 2;
|
|
233
252
|
return this.buildModels();
|
|
234
253
|
|
|
235
|
-
case
|
|
254
|
+
case 2:
|
|
236
255
|
return _context.abrupt("return", _context.sent);
|
|
237
256
|
|
|
238
|
-
case
|
|
257
|
+
case 3:
|
|
239
258
|
case "end":
|
|
240
259
|
return _context.stop();
|
|
241
260
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type PointType = 'fillImage' | 'fill' | 'radar' | 'image' | 'normal' | 'simplePoint' | 'extrude' | 'text' | 'tile' | 'tileText' | 'earthFill' | 'earthExtrude';
|
|
1
|
+
export declare type PointType = 'fillImage' | 'fill' | 'radar' | 'image' | 'normal' | 'simplePoint' | 'extrude' | 'text' | 'tile' | 'tileText' | 'earthFill' | 'earthExtrude';
|
|
2
2
|
declare const PointModels: {
|
|
3
3
|
[key in PointType]: any;
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type PolygonModelType = 'fill' | 'extrude' | 'line' | 'point_fill' | 'point_image' | 'point_normal' | 'point_extrude' | 'text' | 'water' | 'ocean' | 'tile';
|
|
1
|
+
export declare type PolygonModelType = 'fill' | 'extrude' | 'line' | 'point_fill' | 'point_image' | 'point_normal' | 'point_extrude' | 'text' | 'water' | 'ocean' | 'tile';
|
|
2
2
|
declare const PolygonModels: {
|
|
3
3
|
[key in PolygonModelType]: any;
|
|
4
4
|
};
|
package/es/tile/interface.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ILayer, IMapService, IRendererService, ISource, ISubLayerInitOptions } from '@antv/l7-core';
|
|
2
2
|
import { SourceTile } from '@antv/l7-utils';
|
|
3
|
-
export type Timeout = any;
|
|
4
|
-
export type CacheEvent = 'click' | 'mousemove' | 'mouseup' | 'mousedown' | 'contextmenu';
|
|
3
|
+
export declare type Timeout = any;
|
|
4
|
+
export declare type CacheEvent = 'click' | 'mousemove' | 'mouseup' | 'mousedown' | 'contextmenu';
|
|
5
5
|
export interface ITileFactoryOptions {
|
|
6
6
|
parent: ILayer;
|
|
7
7
|
mapService: IMapService;
|
|
@@ -6,7 +6,7 @@ import RasterTile from './RasterTile';
|
|
|
6
6
|
import RasterRGBTile from './RasterRGBTile';
|
|
7
7
|
import RasterTerrainRGBTile from './RasterTerrainRGBTile';
|
|
8
8
|
import MaskLayer from './MaskTile';
|
|
9
|
-
export type TileType = 'VectorTile' | 'DebugTile' | 'PolygonLayer' | 'PointLayer' | 'LineLayer' | 'RasterLayer' | 'image' | 'MaskLayer' | 'TileDebugLayer';
|
|
9
|
+
export declare type TileType = 'VectorTile' | 'DebugTile' | 'PolygonLayer' | 'PointLayer' | 'LineLayer' | 'RasterLayer' | 'image' | 'MaskLayer' | 'TileDebugLayer';
|
|
10
10
|
export declare function getTileFactory(layer: ILayer): typeof VectorTile | typeof DebugTile | typeof ImageTile | typeof RasterTile | typeof RasterRGBTile | typeof RasterTerrainRGBTile | typeof MaskLayer;
|
|
11
11
|
export * from '../interface';
|
|
12
12
|
export * from './Tile';
|
package/es/utils/grid-index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ interface IPoint {
|
|
|
2
2
|
x: number;
|
|
3
3
|
y: number;
|
|
4
4
|
}
|
|
5
|
-
export type anchorType = 'right' | 'top-right' | 'left' | 'bottom-right' | 'left' | 'top-left' | 'bottom-left' | 'bottom' | 'bottom-right' | 'bottom-left' | 'top' | 'top-right' | 'top-left' | 'center';
|
|
5
|
+
export declare type anchorType = 'right' | 'top-right' | 'left' | 'bottom-right' | 'left' | 'top-left' | 'bottom-left' | 'bottom' | 'bottom-right' | 'bottom-left' | 'top' | 'top-right' | 'top-left' | 'center';
|
|
6
6
|
export interface IGlyphQuad {
|
|
7
7
|
tr: IPoint;
|
|
8
8
|
tl: IPoint;
|
package/lib/core/BaseLayer.js
CHANGED
|
@@ -556,8 +556,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
556
556
|
_this4.source(new _l7Source.default(data, options));
|
|
557
557
|
} else {
|
|
558
558
|
_this4.layerSource.setData(data, options);
|
|
559
|
-
}
|
|
560
|
-
|
|
559
|
+
}
|
|
561
560
|
});
|
|
562
561
|
}
|
|
563
562
|
|
package/lib/line/index.js
CHANGED
|
@@ -83,9 +83,10 @@ var LineLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
83
83
|
case 0:
|
|
84
84
|
shape = this.getModelType();
|
|
85
85
|
this.layerModel = new _models.default[shape](this);
|
|
86
|
-
|
|
86
|
+
_context.next = 4;
|
|
87
|
+
return this.initLayerModels();
|
|
87
88
|
|
|
88
|
-
case
|
|
89
|
+
case 4:
|
|
89
90
|
case "end":
|
|
90
91
|
return _context.stop();
|
|
91
92
|
}
|
package/lib/line/models/line.js
CHANGED
|
@@ -75,19 +75,37 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
78
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "texture", _this.createTexture2D({
|
|
79
|
+
data: [0, 0, 0, 0],
|
|
80
|
+
mag: _l7Core.gl.NEAREST,
|
|
81
|
+
min: _l7Core.gl.NEAREST,
|
|
82
|
+
premultiplyAlpha: false,
|
|
83
|
+
width: 1,
|
|
84
|
+
height: 1
|
|
85
|
+
}));
|
|
86
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "dataTexture", _this.createTexture2D({
|
|
87
|
+
flipY: true,
|
|
88
|
+
data: [1],
|
|
89
|
+
format: _l7Core.gl.LUMINANCE,
|
|
90
|
+
type: _l7Core.gl.FLOAT,
|
|
91
|
+
width: 1,
|
|
92
|
+
height: 1
|
|
93
|
+
}));
|
|
78
94
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateTexture", function () {
|
|
79
|
-
var createTexture2D = _this.rendererService.createTexture2D;
|
|
80
|
-
|
|
81
95
|
if (_this.texture) {
|
|
82
|
-
_this.texture.update({
|
|
83
|
-
data: _this.iconService.getCanvas()
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
_this.layer.render();
|
|
87
|
-
|
|
88
96
|
return;
|
|
89
97
|
}
|
|
90
98
|
|
|
99
|
+
console.log(_this.texture);
|
|
100
|
+
var createTexture2D = _this.rendererService.createTexture2D; // if (this.texture) {
|
|
101
|
+
// this.texture.update({
|
|
102
|
+
// data: this.iconService.getCanvas(),
|
|
103
|
+
// });
|
|
104
|
+
// this.layer.render();
|
|
105
|
+
// return;
|
|
106
|
+
// }
|
|
107
|
+
|
|
108
|
+
console.log('update texture');
|
|
91
109
|
_this.texture = createTexture2D({
|
|
92
110
|
data: _this.iconService.getCanvas(),
|
|
93
111
|
mag: _l7Core.gl.NEAREST,
|
|
@@ -145,7 +163,7 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
145
163
|
}
|
|
146
164
|
|
|
147
165
|
if (this.rendererService.getDirty()) {
|
|
148
|
-
this.texture.bind();
|
|
166
|
+
this.texture && this.texture.bind();
|
|
149
167
|
} // 转化渐变色
|
|
150
168
|
|
|
151
169
|
|
|
@@ -160,7 +178,7 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
160
178
|
useLinearColor = 1;
|
|
161
179
|
}
|
|
162
180
|
|
|
163
|
-
if (this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
181
|
+
if (!this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
164
182
|
opacity: opacity
|
|
165
183
|
})) {
|
|
166
184
|
this.judgeStyleAttributes({
|
|
@@ -190,6 +208,7 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
190
208
|
width: 1,
|
|
191
209
|
height: 1
|
|
192
210
|
});
|
|
211
|
+
console.timeEnd('encodeData');
|
|
193
212
|
}
|
|
194
213
|
|
|
195
214
|
return {
|
|
@@ -247,15 +266,13 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
247
266
|
while (1) {
|
|
248
267
|
switch (_context.prev = _context.next) {
|
|
249
268
|
case 0:
|
|
250
|
-
|
|
251
|
-
this.iconService.on('imageUpdate', this.updateTexture);
|
|
252
|
-
_context.next = 4;
|
|
269
|
+
_context.next = 2;
|
|
253
270
|
return this.buildModels();
|
|
254
271
|
|
|
255
|
-
case
|
|
272
|
+
case 2:
|
|
256
273
|
return _context.abrupt("return", _context.sent);
|
|
257
274
|
|
|
258
|
-
case
|
|
275
|
+
case 3:
|
|
259
276
|
case "end":
|
|
260
277
|
return _context.stop();
|
|
261
278
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-layers",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.11",
|
|
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.9",
|
|
30
|
-
"@antv/l7-core": "2.10.
|
|
31
|
-
"@antv/l7-maps": "2.10.
|
|
32
|
-
"@antv/l7-source": "2.10.
|
|
33
|
-
"@antv/l7-utils": "2.10.
|
|
30
|
+
"@antv/l7-core": "2.10.11",
|
|
31
|
+
"@antv/l7-maps": "2.10.11",
|
|
32
|
+
"@antv/l7-source": "2.10.11",
|
|
33
|
+
"@antv/l7-utils": "2.10.11",
|
|
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": "a49e148b5fcb89f302e6bd53c1a628c07e006f43",
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IModel, IModelUniform } from '@antv/l7-core';
|
|
2
|
-
import BaseModel from '../../core/BaseModel';
|
|
3
|
-
export default class SimpleTileLineModel extends BaseModel {
|
|
4
|
-
getUninforms(): IModelUniform;
|
|
5
|
-
initModels(): Promise<IModel[]>;
|
|
6
|
-
clearModels(): void;
|
|
7
|
-
buildModels(): Promise<IModel[]>;
|
|
8
|
-
protected registerBuiltinAttributes(): void;
|
|
9
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
|
-
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
|
-
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; } }
|
|
12
|
-
|
|
13
|
-
import { gl } from '@antv/l7-core';
|
|
14
|
-
import { getMask, rgb2arr } from '@antv/l7-utils';
|
|
15
|
-
import { isNumber } from 'lodash';
|
|
16
|
-
import BaseModel from "../../core/BaseModel";
|
|
17
|
-
import { TileSimpleLineTriangulation } from "../../core/triangulation";
|
|
18
|
-
|
|
19
|
-
/* babel-plugin-inline-import '../../shader/minify_frag.glsl' */
|
|
20
|
-
var simple_line_frag = "uniform float u_opacity : 1.0;\nuniform vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n gl_FragColor.a *= u_opacity;\n}\n";
|
|
21
|
-
|
|
22
|
-
/* babel-plugin-inline-import '../shaders/tile/simpleline_vert.glsl' */
|
|
23
|
-
var simple_line_vert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n#pragma include \"projection\"\n\nvarying vec4 v_color;\n\nvoid main() {\n v_color = a_Color; \n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, 0.0, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0.0, 1.0));\n }\n}\n";
|
|
24
|
-
|
|
25
|
-
/* babel-plugin-inline-import '../../shader/minify_frag.glsl' */
|
|
26
|
-
var simple_line_map_frag = "uniform float u_opacity : 1.0;\nuniform vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n gl_FragColor.a *= u_opacity;\n}\n";
|
|
27
|
-
|
|
28
|
-
/* babel-plugin-inline-import '../shaders/tile/simpleline_map_vert.glsl' */
|
|
29
|
-
var simple_line_map_vert = "attribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n#pragma include \"projection\"\n\nvoid main() {\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, 0.0, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0.0, 1.0));\n }\n}";
|
|
30
|
-
|
|
31
|
-
var SimpleTileLineModel = /*#__PURE__*/function (_BaseModel) {
|
|
32
|
-
_inherits(SimpleTileLineModel, _BaseModel);
|
|
33
|
-
|
|
34
|
-
var _super = _createSuper(SimpleTileLineModel);
|
|
35
|
-
|
|
36
|
-
function SimpleTileLineModel() {
|
|
37
|
-
_classCallCheck(this, SimpleTileLineModel);
|
|
38
|
-
|
|
39
|
-
return _super.apply(this, arguments);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
_createClass(SimpleTileLineModel, [{
|
|
43
|
-
key: "getUninforms",
|
|
44
|
-
value: function getUninforms() {
|
|
45
|
-
var _ref = this.layer.getLayerConfig(),
|
|
46
|
-
_ref$opacity = _ref.opacity,
|
|
47
|
-
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
48
|
-
usage = _ref.usage,
|
|
49
|
-
_ref$color = _ref.color,
|
|
50
|
-
color = _ref$color === void 0 ? '#fff' : _ref$color;
|
|
51
|
-
|
|
52
|
-
return {
|
|
53
|
-
u_opacity: isNumber(opacity) ? opacity : 1.0,
|
|
54
|
-
u_color: usage === 'basemap' ? rgb2arr(color) : [0, 0, 0, 0]
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}, {
|
|
58
|
-
key: "initModels",
|
|
59
|
-
value: function () {
|
|
60
|
-
var _initModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
61
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
62
|
-
while (1) {
|
|
63
|
-
switch (_context.prev = _context.next) {
|
|
64
|
-
case 0:
|
|
65
|
-
_context.next = 2;
|
|
66
|
-
return this.buildModels();
|
|
67
|
-
|
|
68
|
-
case 2:
|
|
69
|
-
return _context.abrupt("return", _context.sent);
|
|
70
|
-
|
|
71
|
-
case 3:
|
|
72
|
-
case "end":
|
|
73
|
-
return _context.stop();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}, _callee, this);
|
|
77
|
-
}));
|
|
78
|
-
|
|
79
|
-
function initModels() {
|
|
80
|
-
return _initModels.apply(this, arguments);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return initModels;
|
|
84
|
-
}()
|
|
85
|
-
}, {
|
|
86
|
-
key: "clearModels",
|
|
87
|
-
value: function clearModels() {}
|
|
88
|
-
}, {
|
|
89
|
-
key: "buildModels",
|
|
90
|
-
value: function () {
|
|
91
|
-
var _buildModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
92
|
-
var _ref2, _ref2$mask, mask, _ref2$maskInside, maskInside, usage, model;
|
|
93
|
-
|
|
94
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
95
|
-
while (1) {
|
|
96
|
-
switch (_context2.prev = _context2.next) {
|
|
97
|
-
case 0:
|
|
98
|
-
_ref2 = this.layer.getLayerConfig(), _ref2$mask = _ref2.mask, mask = _ref2$mask === void 0 ? false : _ref2$mask, _ref2$maskInside = _ref2.maskInside, maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside, usage = _ref2.usage;
|
|
99
|
-
_context2.next = 3;
|
|
100
|
-
return this.layer.buildLayerModel({
|
|
101
|
-
moduleName: 'lineTileSimpleNormal_' + usage,
|
|
102
|
-
vertexShader: usage === 'basemap' ? simple_line_map_vert : simple_line_vert,
|
|
103
|
-
fragmentShader: usage === 'basemap' ? simple_line_map_frag : simple_line_frag,
|
|
104
|
-
triangulation: TileSimpleLineTriangulation,
|
|
105
|
-
primitive: gl.LINES,
|
|
106
|
-
depth: {
|
|
107
|
-
enable: false
|
|
108
|
-
},
|
|
109
|
-
blend: this.getBlend(),
|
|
110
|
-
stencil: getMask(mask, maskInside),
|
|
111
|
-
pick: false
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
case 3:
|
|
115
|
-
model = _context2.sent;
|
|
116
|
-
return _context2.abrupt("return", [model]);
|
|
117
|
-
|
|
118
|
-
case 5:
|
|
119
|
-
case "end":
|
|
120
|
-
return _context2.stop();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}, _callee2, this);
|
|
124
|
-
}));
|
|
125
|
-
|
|
126
|
-
function buildModels() {
|
|
127
|
-
return _buildModels.apply(this, arguments);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return buildModels;
|
|
131
|
-
}()
|
|
132
|
-
}, {
|
|
133
|
-
key: "registerBuiltinAttributes",
|
|
134
|
-
value: function registerBuiltinAttributes() {}
|
|
135
|
-
}]);
|
|
136
|
-
|
|
137
|
-
return SimpleTileLineModel;
|
|
138
|
-
}(BaseModel);
|
|
139
|
-
|
|
140
|
-
export { SimpleTileLineModel as default };
|
|
@@ -1,157 +0,0 @@
|
|
|
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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
|
-
var _l7Core = require("@antv/l7-core");
|
|
25
|
-
|
|
26
|
-
var _l7Utils = require("@antv/l7-utils");
|
|
27
|
-
|
|
28
|
-
var _lodash = require("lodash");
|
|
29
|
-
|
|
30
|
-
var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
|
|
31
|
-
|
|
32
|
-
var _triangulation = require("../../core/triangulation");
|
|
33
|
-
|
|
34
|
-
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); }; }
|
|
35
|
-
|
|
36
|
-
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; } }
|
|
37
|
-
|
|
38
|
-
/* babel-plugin-inline-import '../../shader/minify_frag.glsl' */
|
|
39
|
-
var simple_line_frag = "uniform float u_opacity : 1.0;\nuniform vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n gl_FragColor.a *= u_opacity;\n}\n";
|
|
40
|
-
|
|
41
|
-
/* babel-plugin-inline-import '../shaders/tile/simpleline_vert.glsl' */
|
|
42
|
-
var simple_line_vert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n#pragma include \"projection\"\n\nvarying vec4 v_color;\n\nvoid main() {\n v_color = a_Color; \n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, 0.0, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0.0, 1.0));\n }\n}\n";
|
|
43
|
-
|
|
44
|
-
/* babel-plugin-inline-import '../../shader/minify_frag.glsl' */
|
|
45
|
-
var simple_line_map_frag = "uniform float u_opacity : 1.0;\nuniform vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n gl_FragColor.a *= u_opacity;\n}\n";
|
|
46
|
-
|
|
47
|
-
/* babel-plugin-inline-import '../shaders/tile/simpleline_map_vert.glsl' */
|
|
48
|
-
var simple_line_map_vert = "attribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n#pragma include \"projection\"\n\nvoid main() {\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, 0.0, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0.0, 1.0));\n }\n}";
|
|
49
|
-
|
|
50
|
-
var SimpleTileLineModel = /*#__PURE__*/function (_BaseModel) {
|
|
51
|
-
(0, _inherits2.default)(SimpleTileLineModel, _BaseModel);
|
|
52
|
-
|
|
53
|
-
var _super = _createSuper(SimpleTileLineModel);
|
|
54
|
-
|
|
55
|
-
function SimpleTileLineModel() {
|
|
56
|
-
(0, _classCallCheck2.default)(this, SimpleTileLineModel);
|
|
57
|
-
return _super.apply(this, arguments);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
(0, _createClass2.default)(SimpleTileLineModel, [{
|
|
61
|
-
key: "getUninforms",
|
|
62
|
-
value: function getUninforms() {
|
|
63
|
-
var _ref = this.layer.getLayerConfig(),
|
|
64
|
-
_ref$opacity = _ref.opacity,
|
|
65
|
-
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
66
|
-
usage = _ref.usage,
|
|
67
|
-
_ref$color = _ref.color,
|
|
68
|
-
color = _ref$color === void 0 ? '#fff' : _ref$color;
|
|
69
|
-
|
|
70
|
-
return {
|
|
71
|
-
u_opacity: (0, _lodash.isNumber)(opacity) ? opacity : 1.0,
|
|
72
|
-
u_color: usage === 'basemap' ? (0, _l7Utils.rgb2arr)(color) : [0, 0, 0, 0]
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
}, {
|
|
76
|
-
key: "initModels",
|
|
77
|
-
value: function () {
|
|
78
|
-
var _initModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
79
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
80
|
-
while (1) {
|
|
81
|
-
switch (_context.prev = _context.next) {
|
|
82
|
-
case 0:
|
|
83
|
-
_context.next = 2;
|
|
84
|
-
return this.buildModels();
|
|
85
|
-
|
|
86
|
-
case 2:
|
|
87
|
-
return _context.abrupt("return", _context.sent);
|
|
88
|
-
|
|
89
|
-
case 3:
|
|
90
|
-
case "end":
|
|
91
|
-
return _context.stop();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}, _callee, this);
|
|
95
|
-
}));
|
|
96
|
-
|
|
97
|
-
function initModels() {
|
|
98
|
-
return _initModels.apply(this, arguments);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return initModels;
|
|
102
|
-
}()
|
|
103
|
-
}, {
|
|
104
|
-
key: "clearModels",
|
|
105
|
-
value: function clearModels() {}
|
|
106
|
-
}, {
|
|
107
|
-
key: "buildModels",
|
|
108
|
-
value: function () {
|
|
109
|
-
var _buildModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
110
|
-
var _ref2, _ref2$mask, mask, _ref2$maskInside, maskInside, usage, model;
|
|
111
|
-
|
|
112
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
113
|
-
while (1) {
|
|
114
|
-
switch (_context2.prev = _context2.next) {
|
|
115
|
-
case 0:
|
|
116
|
-
_ref2 = this.layer.getLayerConfig(), _ref2$mask = _ref2.mask, mask = _ref2$mask === void 0 ? false : _ref2$mask, _ref2$maskInside = _ref2.maskInside, maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside, usage = _ref2.usage;
|
|
117
|
-
_context2.next = 3;
|
|
118
|
-
return this.layer.buildLayerModel({
|
|
119
|
-
moduleName: 'lineTileSimpleNormal_' + usage,
|
|
120
|
-
vertexShader: usage === 'basemap' ? simple_line_map_vert : simple_line_vert,
|
|
121
|
-
fragmentShader: usage === 'basemap' ? simple_line_map_frag : simple_line_frag,
|
|
122
|
-
triangulation: _triangulation.TileSimpleLineTriangulation,
|
|
123
|
-
primitive: _l7Core.gl.LINES,
|
|
124
|
-
depth: {
|
|
125
|
-
enable: false
|
|
126
|
-
},
|
|
127
|
-
blend: this.getBlend(),
|
|
128
|
-
stencil: (0, _l7Utils.getMask)(mask, maskInside),
|
|
129
|
-
pick: false
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
case 3:
|
|
133
|
-
model = _context2.sent;
|
|
134
|
-
return _context2.abrupt("return", [model]);
|
|
135
|
-
|
|
136
|
-
case 5:
|
|
137
|
-
case "end":
|
|
138
|
-
return _context2.stop();
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}, _callee2, this);
|
|
142
|
-
}));
|
|
143
|
-
|
|
144
|
-
function buildModels() {
|
|
145
|
-
return _buildModels.apply(this, arguments);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return buildModels;
|
|
149
|
-
}()
|
|
150
|
-
}, {
|
|
151
|
-
key: "registerBuiltinAttributes",
|
|
152
|
-
value: function registerBuiltinAttributes() {}
|
|
153
|
-
}]);
|
|
154
|
-
return SimpleTileLineModel;
|
|
155
|
-
}(_BaseModel2.default);
|
|
156
|
-
|
|
157
|
-
exports.default = SimpleTileLineModel;
|