@antv/l7-layers 2.21.0 → 2.21.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.d.ts +1 -0
- package/es/core/BaseLayer.js +50 -43
- package/es/core/BaseModel.js +0 -2
- package/es/core/LayerPickService.js +0 -1
- package/es/core/shape/Path.js +1 -2
- package/es/core/shape/extrude.js +0 -1
- package/es/core/triangulation.js +2 -2
- package/es/earth/models/base.js +0 -1
- package/es/heatmap/index.js +0 -1
- package/es/line/models/arc_3d.js +0 -1
- package/es/line/models/line.js +3 -4
- package/es/line/models/wall.js +1 -1
- package/es/line/shaders/line/line_vert.glsl +0 -2
- package/es/line/shaders/wall/wall_vert.glsl +15 -0
- package/es/plugins/DataMappingPlugin.js +0 -2
- package/es/plugins/FeatureScalePlugin.js +1 -1
- package/es/plugins/PixelPickingPlugin.js +2 -3
- package/es/plugins/ShaderUniformPlugin.js +1 -1
- package/es/point/models/fill.js +1 -1
- package/es/polygon/models/fill.js +2 -3
- package/es/polygon/models/index.js +0 -1
- package/es/tile/interaction/getRasterData.js +0 -1
- package/es/utils/blend.js +7 -8
- package/es/utils/polylineNormal.js +0 -1
- package/es/utils/rampcolor_legend.js +1 -2
- package/es/wind/index.js +0 -1
- package/lib/core/BaseLayer.js +50 -43
- package/lib/core/BaseModel.js +0 -2
- package/lib/core/LayerPickService.js +0 -1
- package/lib/core/shape/Path.js +1 -2
- package/lib/core/shape/extrude.js +0 -1
- package/lib/core/triangulation.js +2 -2
- package/lib/earth/models/base.js +0 -1
- package/lib/heatmap/index.js +0 -1
- package/lib/line/models/arc_3d.js +0 -1
- package/lib/line/models/line.js +5 -4
- package/lib/line/models/wall.js +1 -1
- package/lib/line/shaders/line/line_vert.glsl +0 -2
- package/lib/line/shaders/wall/wall_vert.glsl +15 -0
- package/lib/plugins/DataMappingPlugin.js +0 -2
- package/lib/plugins/FeatureScalePlugin.js +1 -1
- package/lib/plugins/PixelPickingPlugin.js +2 -3
- package/lib/plugins/ShaderUniformPlugin.js +1 -1
- package/lib/point/models/fill.js +4 -4
- package/lib/polygon/models/fill.js +1 -2
- package/lib/tile/interaction/getRasterData.js +0 -1
- package/lib/utils/blend.js +7 -8
- package/lib/utils/polylineNormal.js +0 -1
- package/lib/utils/rampcolor_legend.js +1 -2
- package/lib/wind/index.js +0 -1
- package/package.json +7 -7
package/es/core/BaseLayer.d.ts
CHANGED
|
@@ -149,6 +149,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|
|
149
149
|
animate(options: IAnimateOption | boolean): this;
|
|
150
150
|
source(data: any, options?: ISourceCFG): ILayer;
|
|
151
151
|
setData(data: any, options?: ISourceCFG): this;
|
|
152
|
+
private dataUpdatelog;
|
|
152
153
|
style(options: Partial<ChildLayerStyleOptions> & Partial<ILayerConfig>): ILayer;
|
|
153
154
|
private encodeStyle;
|
|
154
155
|
scale(field: string | number | IScaleOptions, cfg?: IScale): this;
|
package/es/core/BaseLayer.js
CHANGED
|
@@ -558,29 +558,36 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
558
558
|
key: "setData",
|
|
559
559
|
value: function setData(data, options) {
|
|
560
560
|
var _this4 = this;
|
|
561
|
-
this.log(IDebugLog.SourceInitStart, ILayerStage.UPDATE);
|
|
562
561
|
if (this.inited) {
|
|
562
|
+
this.dataUpdatelog();
|
|
563
563
|
this.layerSource.setData(data, options);
|
|
564
564
|
} else {
|
|
565
565
|
this.on('inited', function () {
|
|
566
|
+
_this4.dataUpdatelog();
|
|
566
567
|
_this4.layerSource.setData(data, options);
|
|
567
568
|
});
|
|
568
569
|
}
|
|
570
|
+
return this;
|
|
571
|
+
}
|
|
572
|
+
}, {
|
|
573
|
+
key: "dataUpdatelog",
|
|
574
|
+
value: function dataUpdatelog() {
|
|
575
|
+
var _this5 = this;
|
|
576
|
+
this.log(IDebugLog.SourceInitStart, ILayerStage.UPDATE);
|
|
569
577
|
this.layerSource.once('update', function () {
|
|
570
|
-
|
|
578
|
+
_this5.log(IDebugLog.SourceInitEnd, ILayerStage.UPDATE);
|
|
571
579
|
});
|
|
572
|
-
return this;
|
|
573
580
|
}
|
|
574
581
|
}, {
|
|
575
582
|
key: "style",
|
|
576
583
|
value: function style(options) {
|
|
577
|
-
var
|
|
584
|
+
var _this6 = this;
|
|
578
585
|
var passes = options.passes,
|
|
579
586
|
rest = _objectWithoutProperties(options, _excluded);
|
|
580
587
|
// passes 特殊处理
|
|
581
588
|
if (passes) {
|
|
582
589
|
normalizePasses(passes).forEach(function (pass) {
|
|
583
|
-
var postProcessingPass =
|
|
590
|
+
var postProcessingPass = _this6.multiPassRenderer.getPostProcessor().getPostProcessingPassByName(pass[0]);
|
|
584
591
|
if (postProcessingPass) {
|
|
585
592
|
postProcessingPass.updateOptions(pass[1]);
|
|
586
593
|
}
|
|
@@ -619,22 +626,22 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
619
626
|
}, {
|
|
620
627
|
key: "encodeStyle",
|
|
621
628
|
value: function encodeStyle(options) {
|
|
622
|
-
var
|
|
629
|
+
var _this7 = this;
|
|
623
630
|
Object.keys(options).forEach(function (key) {
|
|
624
631
|
if (
|
|
625
632
|
// 需要数据映射
|
|
626
|
-
[].concat(_toConsumableArray(
|
|
633
|
+
[].concat(_toConsumableArray(_this7.enableShaderEncodeStyles), _toConsumableArray(_this7.enableDataEncodeStyles)).includes(key) && isPlainObject(options[key]) && (options[key].field || options[key].value) && !isEqual(_this7.encodeStyleAttribute[key], options[key]) // 防止计算属性重复计算
|
|
627
634
|
) {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
if (
|
|
631
|
-
|
|
635
|
+
_this7.encodeStyleAttribute[key] = options[key];
|
|
636
|
+
_this7.updateStyleAttribute(key, options[key].field, options[key].value);
|
|
637
|
+
if (_this7.inited) {
|
|
638
|
+
_this7.dataState.dataMappingNeedUpdate = true;
|
|
632
639
|
}
|
|
633
640
|
} else {
|
|
634
641
|
// 不需要数据映射
|
|
635
|
-
if (
|
|
636
|
-
delete
|
|
637
|
-
|
|
642
|
+
if (_this7.encodeStyleAttribute[key]) {
|
|
643
|
+
delete _this7.encodeStyleAttribute[key]; // 删除已经存在的属性
|
|
644
|
+
_this7.dataState.dataSourceNeedUpdate = true;
|
|
638
645
|
}
|
|
639
646
|
}
|
|
640
647
|
});
|
|
@@ -691,7 +698,7 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
691
698
|
*/
|
|
692
699
|
}, {
|
|
693
700
|
key: "renderMultiPass",
|
|
694
|
-
value: function () {
|
|
701
|
+
value: (function () {
|
|
695
702
|
var _renderMultiPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
696
703
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
697
704
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -728,7 +735,7 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
728
735
|
return _renderMultiPass.apply(this, arguments);
|
|
729
736
|
}
|
|
730
737
|
return renderMultiPass;
|
|
731
|
-
}()
|
|
738
|
+
}())
|
|
732
739
|
}, {
|
|
733
740
|
key: "active",
|
|
734
741
|
value: function active(options) {
|
|
@@ -751,7 +758,7 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
751
758
|
}, {
|
|
752
759
|
key: "setActive",
|
|
753
760
|
value: function setActive(id, options) {
|
|
754
|
-
var
|
|
761
|
+
var _this8 = this;
|
|
755
762
|
if (isObject(id)) {
|
|
756
763
|
var _id$x = id.x,
|
|
757
764
|
x = _id$x === void 0 ? 0 : _id$x,
|
|
@@ -775,7 +782,7 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
775
782
|
// @ts-ignore
|
|
776
783
|
.then(function () {
|
|
777
784
|
setTimeout(function () {
|
|
778
|
-
|
|
785
|
+
_this8.reRender();
|
|
779
786
|
}, 1);
|
|
780
787
|
});
|
|
781
788
|
}
|
|
@@ -802,7 +809,7 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
802
809
|
}, {
|
|
803
810
|
key: "setSelect",
|
|
804
811
|
value: function setSelect(id, options) {
|
|
805
|
-
var
|
|
812
|
+
var _this9 = this;
|
|
806
813
|
if (isObject(id)) {
|
|
807
814
|
var _id$x2 = id.x,
|
|
808
815
|
x = _id$x2 === void 0 ? 0 : _id$x2,
|
|
@@ -826,7 +833,7 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
826
833
|
// @ts-ignore
|
|
827
834
|
.then(function () {
|
|
828
835
|
setTimeout(function () {
|
|
829
|
-
|
|
836
|
+
_this9.reRender();
|
|
830
837
|
}, 1);
|
|
831
838
|
});
|
|
832
839
|
}
|
|
@@ -1079,7 +1086,7 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
1079
1086
|
}, {
|
|
1080
1087
|
key: "setSource",
|
|
1081
1088
|
value: function setSource(source) {
|
|
1082
|
-
var
|
|
1089
|
+
var _this10 = this;
|
|
1083
1090
|
// 解除原 sources 事件
|
|
1084
1091
|
if (this.layerSource) {
|
|
1085
1092
|
this.layerSource.off('update', this.sourceEvent);
|
|
@@ -1098,22 +1105,22 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
1098
1105
|
// this.layerSource.inited 为 true update 事件不会再触发
|
|
1099
1106
|
this.layerSource.on('update', function (_ref4) {
|
|
1100
1107
|
var type = _ref4.type;
|
|
1101
|
-
if (
|
|
1102
|
-
var
|
|
1103
|
-
var layerCenter =
|
|
1104
|
-
|
|
1105
|
-
if ((
|
|
1106
|
-
|
|
1108
|
+
if (_this10.coordCenter === undefined) {
|
|
1109
|
+
var _this10$mapService;
|
|
1110
|
+
var layerCenter = _this10.layerSource.center;
|
|
1111
|
+
_this10.coordCenter = layerCenter;
|
|
1112
|
+
if ((_this10$mapService = _this10.mapService) !== null && _this10$mapService !== void 0 && _this10$mapService.setCoordCenter) {
|
|
1113
|
+
_this10.mapService.setCoordCenter(layerCenter);
|
|
1107
1114
|
}
|
|
1108
1115
|
}
|
|
1109
1116
|
if (type === 'update') {
|
|
1110
|
-
if (
|
|
1117
|
+
if (_this10.tileLayer) {
|
|
1111
1118
|
// 瓦片图层独立更新
|
|
1112
|
-
|
|
1119
|
+
_this10.tileLayer.reload();
|
|
1113
1120
|
return;
|
|
1114
1121
|
}
|
|
1115
1122
|
// source 初始化不需要处理
|
|
1116
|
-
|
|
1123
|
+
_this10.sourceEvent();
|
|
1117
1124
|
}
|
|
1118
1125
|
});
|
|
1119
1126
|
}
|
|
@@ -1211,7 +1218,7 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
1211
1218
|
key: "buildLayerModel",
|
|
1212
1219
|
value: function () {
|
|
1213
1220
|
var _buildLayerModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(options) {
|
|
1214
|
-
var
|
|
1221
|
+
var _this11 = this;
|
|
1215
1222
|
var moduleName, vertexShader, fragmentShader, inject, triangulation, styleOption, _options$pickingEnabl, pickingEnabled, rest, _this$shaderModuleSer, vs, fs, uniforms, createModel;
|
|
1216
1223
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
1217
1224
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -1225,13 +1232,13 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
1225
1232
|
_this$shaderModuleSer = this.shaderModuleService.getModule(moduleName), vs = _this$shaderModuleSer.vs, fs = _this$shaderModuleSer.fs, uniforms = _this$shaderModuleSer.uniforms;
|
|
1226
1233
|
createModel = this.rendererService.createModel;
|
|
1227
1234
|
return _context3.abrupt("return", new Promise(function (resolve) {
|
|
1228
|
-
var
|
|
1229
|
-
attributes =
|
|
1230
|
-
elements =
|
|
1231
|
-
count =
|
|
1232
|
-
var uniformBuffers = [].concat(_toConsumableArray(
|
|
1235
|
+
var _this11$styleAttribut = _this11.styleAttributeService.createAttributesAndIndices(_this11.encodedData, triangulation, styleOption, _this11),
|
|
1236
|
+
attributes = _this11$styleAttribut.attributes,
|
|
1237
|
+
elements = _this11$styleAttribut.elements,
|
|
1238
|
+
count = _this11$styleAttribut.count;
|
|
1239
|
+
var uniformBuffers = [].concat(_toConsumableArray(_this11.layerModel.uniformBuffers), _toConsumableArray(_this11.rendererService.uniformBuffers), [_this11.getLayerUniformBuffer()]);
|
|
1233
1240
|
if (pickingEnabled) {
|
|
1234
|
-
uniformBuffers.push(
|
|
1241
|
+
uniformBuffers.push(_this11.getPickingUniformBuffer());
|
|
1235
1242
|
}
|
|
1236
1243
|
var modelOptions = _objectSpread({
|
|
1237
1244
|
attributes: attributes,
|
|
@@ -1241,7 +1248,7 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
1241
1248
|
elements: elements,
|
|
1242
1249
|
blend: BlendTypes[BlendType.normal],
|
|
1243
1250
|
uniformBuffers: uniformBuffers,
|
|
1244
|
-
textures:
|
|
1251
|
+
textures: _this11.layerModel.textures
|
|
1245
1252
|
}, rest);
|
|
1246
1253
|
if (count) {
|
|
1247
1254
|
modelOptions.count = count;
|
|
@@ -1377,7 +1384,7 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
1377
1384
|
}, {
|
|
1378
1385
|
key: "renderModels",
|
|
1379
1386
|
value: function renderModels() {
|
|
1380
|
-
var
|
|
1387
|
+
var _this12 = this;
|
|
1381
1388
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1382
1389
|
// TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
|
|
1383
1390
|
if (this.encodeDataLength <= 0 && !this.forceRender) {
|
|
@@ -1388,10 +1395,10 @@ var BaseLayer = /*#__PURE__*/function (_ref) {
|
|
|
1388
1395
|
this.hooks.beforeRender.call();
|
|
1389
1396
|
this.models.forEach(function (model) {
|
|
1390
1397
|
model.draw({
|
|
1391
|
-
uniforms:
|
|
1392
|
-
blend:
|
|
1393
|
-
stencil:
|
|
1394
|
-
textures:
|
|
1398
|
+
uniforms: _this12.layerModel.getUninforms(),
|
|
1399
|
+
blend: _this12.layerModel.getBlend(),
|
|
1400
|
+
stencil: _this12.layerModel.getStencil(options),
|
|
1401
|
+
textures: _this12.layerModel.textures
|
|
1395
1402
|
}, (options === null || options === void 0 ? void 0 : options.ispick) || false);
|
|
1396
1403
|
});
|
|
1397
1404
|
this.hooks.afterRender.call();
|
package/es/core/BaseModel.js
CHANGED
|
@@ -86,13 +86,11 @@ var BaseModel = /*#__PURE__*/function () {
|
|
|
86
86
|
stencilType: StencilType.SINGLE
|
|
87
87
|
}); // 用于遮罩的stencil 参数
|
|
88
88
|
}
|
|
89
|
-
|
|
90
89
|
if (option.isStencil) {
|
|
91
90
|
return getStencilMask(_objectSpread(_objectSpread({}, option), {}, {
|
|
92
91
|
maskOperation: maskOperation
|
|
93
92
|
})); // 用于遮罩的stencil 参数
|
|
94
93
|
}
|
|
95
|
-
|
|
96
94
|
var maskflag = mask ||
|
|
97
95
|
// mask 兼容历史写法
|
|
98
96
|
enableMask && this.layer.masks.length !== 0 ||
|
|
@@ -109,7 +109,6 @@ var BaseLayerPickService = /*#__PURE__*/function () {
|
|
|
109
109
|
// x
|
|
110
110
|
(y - tileMaxXY.y) / tilePixelHeight // y
|
|
111
111
|
];
|
|
112
|
-
|
|
113
112
|
var tileWidth = rasterData.width || 1;
|
|
114
113
|
var tileHeight = rasterData.height || 1;
|
|
115
114
|
var indexX = Math.floor(pos[0] * tileWidth);
|
package/es/core/shape/Path.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
var _geometryShape;
|
|
3
2
|
export var ShapeType3D = /*#__PURE__*/function (ShapeType3D) {
|
|
4
3
|
ShapeType3D["CYLINDER"] = "cylinder";
|
|
5
4
|
ShapeType3D["SQUARECOLUMN"] = "squareColumn";
|
|
@@ -52,4 +51,4 @@ export function hexagon() {
|
|
|
52
51
|
export function pentagon() {
|
|
53
52
|
return polygonPath(5);
|
|
54
53
|
}
|
|
55
|
-
export var geometryShape = (
|
|
54
|
+
export var geometryShape = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ShapeType2D.CIRCLE, circle), ShapeType2D.HEXAGON, hexagon), ShapeType2D.TRIANGLE, triangle), ShapeType2D.SQUARE, square), ShapeType2D.PENTAGON, pentagon), ShapeType3D.CYLINDER, circle), ShapeType3D.HEXAGONCOLUMN, hexagon), ShapeType3D.TRIANGLECOLUMN, triangle), ShapeType3D.SQUARECOLUMN, square), ShapeType3D.PENTAGONCOLUMN, pentagon);
|
package/es/core/shape/extrude.js
CHANGED
package/es/core/triangulation.js
CHANGED
|
@@ -354,8 +354,8 @@ export function HeatmapGridTriangulation(feature) {
|
|
|
354
354
|
export function RasterImageTriangulation(feature) {
|
|
355
355
|
var coordinates = feature.coordinates;
|
|
356
356
|
// [ x, y, z. uv.x, uv.y]
|
|
357
|
-
var positions = [].concat(_toConsumableArray(coordinates[0]), [0, 0,
|
|
358
|
-
var indexs = [0, 1, 2,
|
|
357
|
+
var positions = [].concat(_toConsumableArray(coordinates[0]), [0, 0, 0], _toConsumableArray(coordinates[1]), [0, 1, 0], _toConsumableArray(coordinates[2]), [0, 1, 1], _toConsumableArray(coordinates[3]), [0, 0, 1]);
|
|
358
|
+
var indexs = [0, 1, 2, 0, 2, 3];
|
|
359
359
|
return {
|
|
360
360
|
vertices: positions,
|
|
361
361
|
indices: indexs,
|
package/es/earth/models/base.js
CHANGED
|
@@ -61,7 +61,6 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
61
61
|
u_specularRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.specularRatio) || 0.1 // 高光反射
|
|
62
62
|
// u_texture: this.texture,
|
|
63
63
|
};
|
|
64
|
-
|
|
65
64
|
this.textures = [this.texture];
|
|
66
65
|
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
67
66
|
return commonBufferInfo;
|
package/es/heatmap/index.js
CHANGED
package/es/line/models/arc_3d.js
CHANGED
|
@@ -114,7 +114,6 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
114
114
|
u_time: this.layer.getLayerAnimateTime() || 0,
|
|
115
115
|
u_linearColor: useLinearColor //是否使用渐变色
|
|
116
116
|
};
|
|
117
|
-
|
|
118
117
|
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
119
118
|
return commonBufferInfo;
|
|
120
119
|
}
|
package/es/line/models/line.js
CHANGED
|
@@ -11,16 +11,15 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
11
11
|
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); }; }
|
|
12
12
|
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; } }
|
|
13
13
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
14
|
-
import {
|
|
14
|
+
import { rgb2arr } from '@antv/l7-utils';
|
|
15
15
|
import BaseModel from "../../core/BaseModel";
|
|
16
16
|
import { LinearDir, TextureBlend } from "../../core/interface";
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
import { LineTriangulation } from "../../core/triangulation";
|
|
19
18
|
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
20
19
|
/* babel-plugin-inline-import '../shaders/line/line_frag.glsl' */
|
|
21
20
|
var line_frag = "// #extension GL_OES_standard_derivatives : enable\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array;\n vec4 u_blur;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed: 0.0;\n float u_vertexScale: 1.0;\n float u_raisingHeight: 0.0;\n float u_strokeWidth: 0.0;\n float u_textureBlend;\n float u_line_texture;\n float u_linearDir: 1.0;\n float u_linearColor: 0;\n float u_time;\n};\n\nin vec4 v_color;\nin vec4 v_stroke;\n// dash\nin vec4 v_dash_array;\nin float v_d_distance_ratio;\nin vec2 v_iconMapUV;\nin vec4 v_texture_data;\n\nout vec4 outputColor;\n#pragma include \"picking\"\n\n// [animate, duration, interval, trailLength],\nvoid main() {\n if(u_dash_array!=vec4(0.0)){\n float dashLength = mod(v_d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) {\n // \u865A\u7EBF\u90E8\u5206\n discard;\n };\n }\n float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6\n float d_distance_ratio = v_texture_data.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n if(u_linearDir < 1.0) {\n d_distance_ratio = v_texture_data.a;\n }\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n outputColor = mix(u_sourceColor, u_targetColor, d_distance_ratio);\n outputColor.a *= v_color.a;\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n outputColor = v_color;\n }\n // anti-alias\n // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n outputColor.a *= alpha;\n }\n\n if(u_line_texture == LineTexture) { // while load texture\n float aDistance = v_texture_data.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n float d_texPixelLen = v_texture_data.b; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);\n float v = v_texture_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n // v = max(smoothstep(0.95, 1.0, v), v);\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture(SAMPLER_2D(u_texture), uv);\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n outputColor += pattern;\n } else { // replace\n pattern.a *= v_color.a;\n if(outputColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n outputColor = pattern;\n }\n } \n\n float v = v_texture_data.a;\n float strokeWidth = min(0.5, u_strokeWidth);\n // \u7ED8\u5236 border\n if(strokeWidth > 0.01) {\n float borderOuterWidth = strokeWidth / 2.0;\n\n\n if(v >= 1.0 - strokeWidth || v <= strokeWidth) {\n if(v > strokeWidth) { // \u5916\u4FA7\n float linear = smoothstep(0.0, 1.0, (v - (1.0 - strokeWidth))/strokeWidth);\n // float linear = step(0.0, (v - (1.0 - borderWidth))/borderWidth);\n outputColor.rgb = mix(outputColor.rgb, v_stroke.rgb, linear);\n } else if(v <= strokeWidth) {\n float linear = smoothstep(0.0, 1.0, v/strokeWidth);\n outputColor.rgb = mix(v_stroke.rgb, outputColor.rgb, linear);\n }\n }\n\n if(v < borderOuterWidth) {\n outputColor.a = mix(0.0, outputColor.a, v/borderOuterWidth);\n } else if(v > 1.0 - borderOuterWidth) {\n outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth);\n }\n }\n\n // blur\n float blurV = v_texture_data.a;\n if(blurV < 0.5) {\n outputColor.a *= mix(u_blur.r, u_blur.g, blurV/0.5);\n } else {\n outputColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5);\n }\n \n outputColor = filterColor(outputColor);\n}\n";
|
|
22
21
|
/* babel-plugin-inline-import '../shaders/line/line_vert.glsl' */
|
|
23
|
-
var line_vert = "\n#define Animate 0.0\n\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in vec2 a_Size;\nlayout(location = 10) in vec3 a_DistanceAndIndexAndMiter;\nlayout(location = 13) in vec4 a_Normal_Total_Distance;\nlayout(location = 14) in vec2 a_iconMapUV;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array;\n vec4 u_blur;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed: 0.0;\n float u_vertexScale: 1.0;\n float u_raisingHeight: 0.0;\n float u_strokeWidth: 0.0;\n float u_textureBlend;\n float u_line_texture;\n float u_linearDir: 1.0;\n float u_linearColor: 0;\n float u_time;\n};\n\n\nout vec4 v_color;\nout vec4 v_stroke;\n//dash\nout vec4 v_dash_array;\nout float v_d_distance_ratio;\n// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09\nout vec2 v_iconMapUV;\nout vec4 v_texture_data;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec2 a_DistanceAndIndex = a_DistanceAndIndexAndMiter.xy;\n float a_Miter = a_DistanceAndIndexAndMiter.z;\n vec3 a_Normal = a_Normal_Total_Distance.xyz;\n float a_Total_Distance = a_Normal_Total_Distance.w;\n //dash\u8F93\u51FA\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;\n v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance;\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n v_iconMapUV = a_iconMapUV;\n d_texPixelLen = project_float_pixel(u_icon_step);\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n d_texPixelLen *= 10.0;\n }\n\n v_color = a_Color;\n v_color.a *= opacity;\n v_stroke = stroke;\n\n vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);\n \n vec2 offset = project_pixel(size.xy);\n\n float lineDistance = a_DistanceAndIndex.x;\n float currentLinePointRatio = lineDistance / a_Total_Distance;\n \n\n float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\uFF08\u5411\u4E24\u4FA7\u504F\u79FB\u7684\u548C\uFF09\n float linePixelSize = project_pixel(a_Size.x) * 2.0; // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB \u5355\u4FA7 * 2\n float texV = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n \n v_texture_data = vec4(currentLinePointRatio, lineDistance, d_texPixelLen, texV);\n // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));\n\n float h = float(a_Position.z) * u_vertexScale; // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5 vertex height\n float lineHeight = a_Size.y; // size \u7B2C\u4E8C\u4E2A\u53C2\u6570\u4EE3\u8868\u7684\u9AD8\u5EA6 [linewidth, lineheight]\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n lineHeight *= 0.2; // \u4FDD\u6301\u548C amap/mapbox \u4E00\u81F4\u7684\u6548\u679C\n h *= 0.2;\n if(u_heightfixed < 1.0) {\n lineHeight = project_pixel(a_Size.y);\n }\n gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight + h + u_raisingHeight, 1.0));\n } else {\n //
|
|
22
|
+
var line_vert = "\n#define Animate 0.0\n\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in vec2 a_Size;\nlayout(location = 10) in vec3 a_DistanceAndIndexAndMiter;\nlayout(location = 13) in vec4 a_Normal_Total_Distance;\nlayout(location = 14) in vec2 a_iconMapUV;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array;\n vec4 u_blur;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed: 0.0;\n float u_vertexScale: 1.0;\n float u_raisingHeight: 0.0;\n float u_strokeWidth: 0.0;\n float u_textureBlend;\n float u_line_texture;\n float u_linearDir: 1.0;\n float u_linearColor: 0;\n float u_time;\n};\n\n\nout vec4 v_color;\nout vec4 v_stroke;\n//dash\nout vec4 v_dash_array;\nout float v_d_distance_ratio;\n// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09\nout vec2 v_iconMapUV;\nout vec4 v_texture_data;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec2 a_DistanceAndIndex = a_DistanceAndIndexAndMiter.xy;\n float a_Miter = a_DistanceAndIndexAndMiter.z;\n vec3 a_Normal = a_Normal_Total_Distance.xyz;\n float a_Total_Distance = a_Normal_Total_Distance.w;\n //dash\u8F93\u51FA\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;\n v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance;\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n v_iconMapUV = a_iconMapUV;\n d_texPixelLen = project_float_pixel(u_icon_step);\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n d_texPixelLen *= 10.0;\n }\n\n v_color = a_Color;\n v_color.a *= opacity;\n v_stroke = stroke;\n\n vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);\n \n vec2 offset = project_pixel(size.xy);\n\n float lineDistance = a_DistanceAndIndex.x;\n float currentLinePointRatio = lineDistance / a_Total_Distance;\n \n\n float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\uFF08\u5411\u4E24\u4FA7\u504F\u79FB\u7684\u548C\uFF09\n float linePixelSize = project_pixel(a_Size.x) * 2.0; // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB \u5355\u4FA7 * 2\n float texV = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n \n v_texture_data = vec4(currentLinePointRatio, lineDistance, d_texPixelLen, texV);\n // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));\n\n float h = float(a_Position.z) * u_vertexScale; // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5 vertex height\n float lineHeight = a_Size.y; // size \u7B2C\u4E8C\u4E2A\u53C2\u6570\u4EE3\u8868\u7684\u9AD8\u5EA6 [linewidth, lineheight]\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n lineHeight *= 0.2; // \u4FDD\u6301\u548C amap/mapbox \u4E00\u81F4\u7684\u6548\u679C\n h *= 0.2;\n if(u_heightfixed < 1.0) {\n lineHeight = project_pixel(a_Size.y);\n }\n gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight + h + u_raisingHeight, 1.0));\n } else {\n // \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // mapbox\n // \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n h *= mapboxZoomScale;\n h += u_raisingHeight * mapboxZoomScale;\n if(u_heightfixed > 0.0) {\n lineHeight *= mapboxZoomScale;\n }\n \n } else {\n // amap\n h += u_raisingHeight;\n // lineHeight \u9876\u70B9\u504F\u79FB\u9AD8\u5EA6\n if(u_heightfixed < 1.0) {\n lineHeight *= pow(2.0, 20.0 - u_Zoom);\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight + h, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
24
23
|
var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
25
24
|
_inherits(LineModel, _BaseModel);
|
|
26
25
|
var _super = _createSuper(LineModel);
|
package/es/line/models/wall.js
CHANGED
|
@@ -17,7 +17,7 @@ import { LineTriangulation } from "../../core/triangulation";
|
|
|
17
17
|
/* babel-plugin-inline-import '../shaders/wall/wall_frag.glsl' */
|
|
18
18
|
var line_frag = "#define Animate 0.0\n#define LineTexture 1.0\n\n// line texture\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed;\n float u_linearColor: 0;\n float u_line_texture;\n float u_textureBlend;\n float u_iconStepCount;\n float u_time;\n};\nin vec2 v_iconMapUV;\nin float v_blur;\nin float v_radio;\nin vec4 v_color;\nin vec4 v_dataset;\n\nout vec4 outputColor;\n#pragma include \"picking\"\n\nvoid main() {\n float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6\n float d_distance_ratio = v_dataset.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n float v = v_dataset.a;\n\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n outputColor = mix(u_sourceColor, u_targetColor, v);\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n outputColor = v_color;\n }\n\n outputColor.a *= v_color.a; // \u5168\u5C40\u900F\u660E\u5EA6\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n outputColor.a *= alpha;\n }\n\n if(u_line_texture == LineTexture) { // while load texture\n float aDistance = v_dataset.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n float d_texPixelLen = v_dataset.b; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);\n float v = v_dataset.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n // \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 start\n float flag = 0.0;\n if(u > 1.0/u_iconStepCount) {\n flag = 1.0;\n }\n u = fract(u*u_iconStepCount);\n // \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 end\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture(SAMPLER_2D(u_texture), uv);\n\n // Tip: \u5224\u65AD\u7EB9\u7406\u95F4\u9694\n if(flag > 0.0) {\n pattern = vec4(0.0);\n }\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n outputColor = filterColor(outputColor + pattern);\n } else { // replace\n pattern.a *= v_color.a;\n if(outputColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n outputColor = filterColor(pattern);\n }\n }\n \n\n // blur - AA\n if(v < v_blur) {\n outputColor.a = mix(0.0, outputColor.a, v/v_blur);\n } else if(v > 1.0 - v_blur) {\n outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - v_blur))/v_blur);\n }\n\n outputColor = filterColor(outputColor);\n}\n";
|
|
19
19
|
/* babel-plugin-inline-import '../shaders/wall/wall_vert.glsl' */
|
|
20
|
-
var line_vert = "#define Animate 0.0\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in vec2 a_Size;\nlayout(location = 10) in float a_Miter;\nlayout(location = 11) in float a_Total_Distance;\nlayout(location = 12) in vec4 a_Instance;\nlayout(location = 13) in vec3 a_Normal;\nlayout(location = 14) in vec2 a_iconMapUV;\nlayout(location = 15) in float a_Distance;\n\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed;\n float u_linearColor: 0;\n float u_line_texture;\n float u_textureBlend;\n float u_iconStepCount;\n float u_time;\n};\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09\nout vec2 v_iconMapUV;\nout vec4 v_color;\nout float v_blur;\nout float v_radio;\nout vec4 v_dataset;\n\nvoid main() {\n\n\n float d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n\n v_iconMapUV = a_iconMapUV;\n if(u_heightfixed < 1.0) { // \u9AD8\u5EA6\u968F zoom \u8C03\u6574\n d_texPixelLen = project_pixel(u_icon_step);\n } else {\n d_texPixelLen = u_icon_step;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n d_texPixelLen *= 10.0;\n }\n\n if(u_animate.x == Animate || u_linearColor == 1.0) {\n d_distance_ratio = a_Distance / a_Total_Distance;\n }\n\n float miter = (a_Miter + 1.0)/2.0;\n // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570\n v_dataset[0] = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n v_dataset[1] = a_Distance; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n v_dataset[2] = d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n v_dataset[3] = miter; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C 0 - 1\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n float originSize = a_Size.x; // \u56FA\u5B9A\u9AD8\u5EA6\n if(u_heightfixed < 1.0) { \n originSize = project_float_meter(a_Size.x); // \u9AD8\u5EA6\u968F zoom \u8C03\u6574\n }\n\n\n float wallHeight = originSize * miter;\n float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0));\n\n v_blur = min(project_float_pixel(2.0) / originSize, 0.05);\n v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
20
|
+
var line_vert = "#define Animate 0.0\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in vec2 a_Size;\nlayout(location = 10) in float a_Miter;\nlayout(location = 11) in float a_Total_Distance;\nlayout(location = 12) in vec4 a_Instance;\nlayout(location = 13) in vec3 a_Normal;\nlayout(location = 14) in vec2 a_iconMapUV;\nlayout(location = 15) in float a_Distance;\n\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed;\n float u_linearColor: 0;\n float u_line_texture;\n float u_textureBlend;\n float u_iconStepCount;\n float u_time;\n};\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09\nout vec2 v_iconMapUV;\nout vec4 v_color;\nout float v_blur;\nout float v_radio;\nout vec4 v_dataset;\n\nvoid main() {\n\n\n float d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n\n v_iconMapUV = a_iconMapUV;\n if(u_heightfixed < 1.0) { // \u9AD8\u5EA6\u968F zoom \u8C03\u6574\n d_texPixelLen = project_pixel(u_icon_step);\n } else {\n d_texPixelLen = u_icon_step;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n d_texPixelLen *= 10.0;\n }\n\n if(u_animate.x == Animate || u_linearColor == 1.0) {\n d_distance_ratio = a_Distance / a_Total_Distance;\n }\n\n float miter = (a_Miter + 1.0)/2.0;\n // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570\n v_dataset[0] = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n v_dataset[1] = a_Distance; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n v_dataset[2] = d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n v_dataset[3] = miter; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C 0 - 1\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n float originSize = a_Size.x; // \u56FA\u5B9A\u9AD8\u5EA6\n if(u_heightfixed < 1.0) { \n originSize = project_float_meter(a_Size.x); // \u9AD8\u5EA6\u968F zoom \u8C03\u6574\n }\n\n\n float wallHeight = originSize * miter;\n float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0));\n\n v_blur = min(project_float_pixel(2.0) / originSize, 0.05);\n v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0));\n } else {\n// \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // mapbox\n // \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8\n float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);\n if(u_heightfixed > 0.0) {\n wallHeight *= mapboxZoomScale;\n }\n \n } else {\n // lineHeight \u9876\u70B9\u504F\u79FB\u9AD8\u5EA6\n if(u_heightfixed < 1.0) {\n wallHeight *= pow(2.0, 20.0 - u_Zoom);\n }\n }\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
21
21
|
var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
22
22
|
_inherits(LineWallModel, _BaseModel);
|
|
23
23
|
var _super = _createSuper(LineWallModel);
|
|
@@ -91,8 +91,6 @@ void main() {
|
|
|
91
91
|
}
|
|
92
92
|
gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight + h + u_raisingHeight, 1.0));
|
|
93
93
|
} else {
|
|
94
|
-
// mapbox - amap
|
|
95
|
-
|
|
96
94
|
// 兼容 mapbox 在线高度上的效果表现基本一致
|
|
97
95
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
98
96
|
// mapbox
|
|
@@ -78,6 +78,21 @@ void main() {
|
|
|
78
78
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
79
79
|
gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0));
|
|
80
80
|
} else {
|
|
81
|
+
// 兼容 mapbox 在线高度上的效果表现基本一致
|
|
82
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
83
|
+
// mapbox
|
|
84
|
+
// 保持高度相对不变
|
|
85
|
+
float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);
|
|
86
|
+
if(u_heightfixed > 0.0) {
|
|
87
|
+
wallHeight *= mapboxZoomScale;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
} else {
|
|
91
|
+
// lineHeight 顶点偏移高度
|
|
92
|
+
if(u_heightfixed < 1.0) {
|
|
93
|
+
wallHeight *= pow(2.0, 20.0 - u_Zoom);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
81
96
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));
|
|
82
97
|
}
|
|
83
98
|
|
|
@@ -82,7 +82,6 @@ var DataMappingPlugin = /*#__PURE__*/function () {
|
|
|
82
82
|
return attribute.needRemapping;
|
|
83
83
|
} // 如果filter变化
|
|
84
84
|
);
|
|
85
|
-
|
|
86
85
|
var filterData = dataArray;
|
|
87
86
|
// 数据过滤完 再执行数据映射
|
|
88
87
|
if (filter !== null && filter !== void 0 && filter.needRemapping && filter !== null && filter !== void 0 && filter.scale) {
|
|
@@ -94,7 +93,6 @@ var DataMappingPlugin = /*#__PURE__*/function () {
|
|
|
94
93
|
// 过滤数据
|
|
95
94
|
var encodeData = _this.mapping(layer, attributesToRemapping, filterData, layer.getEncodedData() // TODO 优化
|
|
96
95
|
);
|
|
97
|
-
|
|
98
96
|
layer.setEncodedData(encodeData);
|
|
99
97
|
}
|
|
100
98
|
|
|
@@ -15,7 +15,7 @@ var isNil = lodashUtil.isNil,
|
|
|
15
15
|
isString = lodashUtil.isString,
|
|
16
16
|
uniq = lodashUtil.uniq;
|
|
17
17
|
var dateRegex = /^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;
|
|
18
|
-
var scaleMap = (_scaleMap = {}, _defineProperty(_scaleMap, ScaleTypes.LINEAR, d3.scaleLinear),
|
|
18
|
+
var scaleMap = (_scaleMap = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_scaleMap, ScaleTypes.LINEAR, d3.scaleLinear), ScaleTypes.POWER, d3.scalePow), ScaleTypes.LOG, d3.scaleLog), ScaleTypes.IDENTITY, identity), ScaleTypes.SEQUENTIAL, d3.scaleSequential), ScaleTypes.TIME, d3.scaleTime), ScaleTypes.QUANTILE, d3.scaleQuantile), ScaleTypes.QUANTIZE, d3.scaleQuantize), ScaleTypes.THRESHOLD, d3.scaleThreshold), ScaleTypes.CAT, d3.scaleOrdinal), _defineProperty(_scaleMap, ScaleTypes.DIVERGING, d3.scaleDiverging));
|
|
19
19
|
/**
|
|
20
20
|
* 根据 Source 原始数据为指定字段创建 Scale,保存在 StyleAttribute 上,供下游插件使用
|
|
21
21
|
*/
|
|
@@ -56,7 +56,7 @@ var PixelPickingPlugin = /*#__PURE__*/function () {
|
|
|
56
56
|
value: function apply(layer, _ref) {
|
|
57
57
|
var _this2 = this;
|
|
58
58
|
var styleAttributeService = _ref.styleAttributeService;
|
|
59
|
-
this.pickingUniformMap = new Map([['u_HighlightColor', [1, 0, 0, 1]], ['u_SelectColor', [1, 0, 0, 1]], ['u_PickingColor', [0, 0, 0]], ['u_PickingStage', 0], ['u_CurrentSelectedId', [0, 0, 0]], ['u_PickingThreshold', 10], ['u_PickingBuffer', 0], ['u_shaderPick', 0], ['
|
|
59
|
+
this.pickingUniformMap = new Map([['u_HighlightColor', [1, 0, 0, 1]], ['u_SelectColor', [1, 0, 0, 1]], ['u_PickingColor', [0, 0, 0]], ['u_PickingStage', 0], ['u_CurrentSelectedId', [0, 0, 0]], ['u_PickingThreshold', 10], ['u_PickingBuffer', 0], ['u_shaderPick', 0], ['u_activeMix', 0]]);
|
|
60
60
|
|
|
61
61
|
// TODO: 由于 Shader 目前无法根据是否开启拾取进行内容修改,因此即使不开启也需要生成 a_PickingColor
|
|
62
62
|
layer.hooks.init.tapPromise('PixelPickingPlugin', function () {
|
|
@@ -153,8 +153,7 @@ var PixelPickingPlugin = /*#__PURE__*/function () {
|
|
|
153
153
|
u_CurrentSelectedId: pickedColor,
|
|
154
154
|
u_SelectColor: highlightColorInArray.map(function (c) {
|
|
155
155
|
return c * 255;
|
|
156
|
-
})
|
|
157
|
-
u_EnableSelect: 1
|
|
156
|
+
})
|
|
158
157
|
};
|
|
159
158
|
_this2.updatePickOption(option, layer);
|
|
160
159
|
layer.models.forEach(function (model) {
|
|
@@ -139,7 +139,7 @@ var ShaderUniformPlugin = /*#__PURE__*/function () {
|
|
|
139
139
|
0, 0, 0]);
|
|
140
140
|
return {
|
|
141
141
|
data: data,
|
|
142
|
-
uniforms: (_uniforms = {}, _defineProperty(_uniforms, CameraUniform.ProjectionMatrix, u_ProjectionMatrix),
|
|
142
|
+
uniforms: (_uniforms = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_uniforms, CameraUniform.ProjectionMatrix, u_ProjectionMatrix), CameraUniform.ViewMatrix, u_ViewMatrix), CameraUniform.ViewProjectionMatrix, u_ViewProjectionMatrix), CameraUniform.Zoom, u_Zoom), CameraUniform.ZoomScale, u_ZoomScale), CameraUniform.FocalDistance, u_FocalDistance), CameraUniform.CameraPosition, u_CameraPosition), CoordinateUniform.CoordinateSystem, u_CoordinateSystem), CoordinateUniform.ViewportCenter, u_ViewportCenter), CoordinateUniform.ViewportCenterProjection, u_ViewportCenterProjection), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_uniforms, CoordinateUniform.PixelsPerDegree, u_PixelsPerDegree), CoordinateUniform.PixelsPerDegree2, u_PixelsPerDegree2), CoordinateUniform.PixelsPerMeter, u_PixelsPerMeter), CoordinateUniform.Mvp, u_Mvp), "u_sceneCenterMercator", sceneCenterMercator), "u_ViewportSize", u_ViewportSize), "u_ModelMatrix", u_ModelMatrix), "u_DevicePixelRatio", u_DevicePixelRatio))
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
}]);
|
package/es/point/models/fill.js
CHANGED
|
@@ -8,7 +8,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
8
8
|
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); }; }
|
|
9
9
|
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; } }
|
|
10
10
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
11
|
-
import { PointFillTriangulation } from
|
|
11
|
+
import { PointFillTriangulation } from "../../core/triangulation";
|
|
12
12
|
import BaseModel from "../../core/BaseModel";
|
|
13
13
|
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
14
14
|
/* babel-plugin-inline-import '../shaders/fill/fill_frag.glsl' */
|
|
@@ -9,9 +9,8 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
9
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
10
|
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; } }
|
|
11
11
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
12
|
-
import { polygonFillTriangulation } from '@antv/l7-utils';
|
|
13
12
|
import BaseModel from "../../core/BaseModel";
|
|
14
|
-
import { polygonTriangulationWithCenter } from "../../core/triangulation";
|
|
13
|
+
import { polygonTriangulationWithCenter, polygonTriangulation } from "../../core/triangulation";
|
|
15
14
|
/* babel-plugin-inline-import '../shaders/fill/fill_frag.glsl' */
|
|
16
15
|
var polygon_frag = "in vec4 v_color;\n#pragma include \"scene_uniforms\"\n#pragma include \"picking\"\nout vec4 outputColor;\nvoid main() {\n outputColor = v_color;\n outputColor = filterColor(outputColor);\n}\n";
|
|
17
16
|
/* babel-plugin-inline-import '../shaders/fill/fill_linear_frag.glsl' */
|
|
@@ -161,7 +160,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
161
160
|
frag: polygon_frag,
|
|
162
161
|
vert: polygon_vert,
|
|
163
162
|
type: 'polygonFill',
|
|
164
|
-
triangulation:
|
|
163
|
+
triangulation: polygonTriangulation
|
|
165
164
|
};
|
|
166
165
|
}
|
|
167
166
|
}
|
|
@@ -20,7 +20,6 @@ export function readRasterValue(tile, mapService, x, y) {
|
|
|
20
20
|
// x
|
|
21
21
|
(y - tileMaxXY.y) / tilePixelHeight // y
|
|
22
22
|
];
|
|
23
|
-
|
|
24
23
|
var tileWidth = (tile === null || tile === void 0 || (_tile$data = tile.data) === null || _tile$data === void 0 ? void 0 : _tile$data.width) || 1;
|
|
25
24
|
var tileHeight = (tile === null || tile === void 0 || (_tile$data2 = tile.data) === null || _tile$data2 === void 0 ? void 0 : _tile$data2.height) || 1;
|
|
26
25
|
var indexX = Math.floor(pos[0] * tileWidth);
|
package/es/utils/blend.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
var _BlendTypes;
|
|
3
2
|
import { BlendType, gl } from '@antv/l7-core';
|
|
4
|
-
export var BlendTypes = (
|
|
3
|
+
export var BlendTypes = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, BlendType.additive, {
|
|
5
4
|
enable: true,
|
|
6
5
|
func: {
|
|
7
6
|
srcRGB: gl.ONE,
|
|
@@ -9,9 +8,9 @@ export var BlendTypes = (_BlendTypes = {}, _defineProperty(_BlendTypes, BlendTyp
|
|
|
9
8
|
srcAlpha: 1,
|
|
10
9
|
dstAlpha: 1
|
|
11
10
|
}
|
|
12
|
-
}),
|
|
11
|
+
}), BlendType.none, {
|
|
13
12
|
enable: false
|
|
14
|
-
}),
|
|
13
|
+
}), BlendType.normal, {
|
|
15
14
|
enable: true,
|
|
16
15
|
func: {
|
|
17
16
|
srcRGB: gl.SRC_ALPHA,
|
|
@@ -19,7 +18,7 @@ export var BlendTypes = (_BlendTypes = {}, _defineProperty(_BlendTypes, BlendTyp
|
|
|
19
18
|
srcAlpha: 1,
|
|
20
19
|
dstAlpha: 1
|
|
21
20
|
}
|
|
22
|
-
}),
|
|
21
|
+
}), BlendType.subtractive, {
|
|
23
22
|
enable: true,
|
|
24
23
|
func: {
|
|
25
24
|
srcRGB: gl.ONE,
|
|
@@ -31,7 +30,7 @@ export var BlendTypes = (_BlendTypes = {}, _defineProperty(_BlendTypes, BlendTyp
|
|
|
31
30
|
rgb: gl.FUNC_SUBTRACT,
|
|
32
31
|
alpha: gl.FUNC_SUBTRACT
|
|
33
32
|
}
|
|
34
|
-
}),
|
|
33
|
+
}), BlendType.max, {
|
|
35
34
|
enable: true,
|
|
36
35
|
func: {
|
|
37
36
|
srcRGB: gl.ONE,
|
|
@@ -40,7 +39,7 @@ export var BlendTypes = (_BlendTypes = {}, _defineProperty(_BlendTypes, BlendTyp
|
|
|
40
39
|
equation: {
|
|
41
40
|
rgb: gl.MAX_EXT
|
|
42
41
|
}
|
|
43
|
-
}),
|
|
42
|
+
}), BlendType.min, {
|
|
44
43
|
enable: true,
|
|
45
44
|
func: {
|
|
46
45
|
srcRGB: gl.ONE,
|
|
@@ -49,4 +48,4 @@ export var BlendTypes = (_BlendTypes = {}, _defineProperty(_BlendTypes, BlendTyp
|
|
|
49
48
|
equation: {
|
|
50
49
|
rgb: gl.MIN_EXT
|
|
51
50
|
}
|
|
52
|
-
})
|
|
51
|
+
});
|
|
@@ -4,8 +4,7 @@ export function rampColor2legend(rampColors, name) {
|
|
|
4
4
|
type: rampColors.type,
|
|
5
5
|
field: 'value',
|
|
6
6
|
items: rampColors.positions.map(function (value, index) {
|
|
7
|
-
|
|
8
|
-
return _ref = {}, _defineProperty(_ref, name, index >= rampColors.colors.length ? null : rampColors.colors[index]), _defineProperty(_ref, "value", value), _ref;
|
|
7
|
+
return _defineProperty(_defineProperty({}, name, index >= rampColors.colors.length ? null : rampColors.colors[index]), "value", value);
|
|
9
8
|
})
|
|
10
9
|
};
|
|
11
10
|
}
|