mirror of https://gitee.com/antv-l7/antv-l7
Shihui (#967)
* feat: 增加 bloomPass1.0、修改渲染流程,让 multiPass 有正确的渲染顺序 * style: lint style * feat: 取消 bloom 在 postprocessor 中的多次渲染(没有明显优化) * feat: polygon extrude 模式支持配置固定高度 * style: lint style * feat: 优化后处理 bloom 的效果 * feat: 修改交替绘制 bloom 的写法 * style: lint style * feat: 完善 iconService 加载渲染和销毁 * style: lint style * feat: 补全 mapbox 模式下等面积点 * style: lint style * fix: 修复 pointLayer animate 模式 opacity 失效 * style: lint style * feat: 拆分 pointLayer 的 shader * style: lint sytle * feat: 拆分 lineLayer 的 linear 模式 * style: lint style * feat: 优化点击的拾取判断 * style: lint style * feat: 取消圆柱 shader 中的三元表达式、增强健壮性 * feat: 点图层圆柱体支持固定高度配置 heightfixed * feat: 点图层圆柱体支持拾取高亮颜色的光照计算 * style: lint style * style: lint style * feat: 拆分 lintLayer line 模式下的 dash line * style: lint style * feat: lineLayer simpleline 的 linear shader 代码拆分 * style: lint style * feat: 拆分 lineLayer arcLine linear shader 代码 * style: line style * feat: lineLayer arc line 在 shader 中移除 linear 部分计算 * feat: 拆分 lineLayer arc dash 虚线的 shader 代码 * style: lint style * feat: 拆分 lineLayer arc3d linear 部分的 shader 代码 * style: lint style * style: lint style * feat: 完善 isMiniAli 的判断,兼容 smallfish H5+ 的模式 * style: lint style * style: adjust mulpass demo * feat: 提供 getScale 方法 * style: lint style
This commit is contained in:
parent
5757a760af
commit
878d398bdc
|
@ -166,6 +166,7 @@ export interface ILayer {
|
|||
): void;
|
||||
init(): ILayer;
|
||||
scale(field: string | number | IScaleOptions, cfg?: IScale): ILayer;
|
||||
getScale(name: string): any;
|
||||
size(field: StyleAttrField, value?: StyleAttributeOption): ILayer;
|
||||
color(field: StyleAttrField, value?: StyleAttributeOption): ILayer;
|
||||
texture(field: StyleAttrField, value?: StyleAttributeOption): ILayer;
|
||||
|
|
|
@ -890,6 +890,11 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|||
public getEncodedData() {
|
||||
return this.encodedData;
|
||||
}
|
||||
|
||||
public getScale(name: string): any {
|
||||
return this.styleAttributeService.getLayerAttributeScale(name);
|
||||
}
|
||||
|
||||
public getLegendItems(name: string): any {
|
||||
const scale = this.styleAttributeService.getLayerAttributeScale(name);
|
||||
if (scale) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// @ts-ignore
|
||||
import { PointLayer, Scene, LineLayer, PolygonLayer } from '@antv/l7';
|
||||
import { PointLayer, Scene, LineLayer, PolygonLayer, ILayer } from '@antv/l7';
|
||||
import { GaodeMap, GaodeMapV2, Mapbox } from '@antv/l7-maps';
|
||||
import * as React from 'react';
|
||||
import * as turf from '@turf/turf';
|
||||
|
@ -82,17 +82,20 @@ export default class GaodeMapComponent extends React.Component {
|
|||
let layer = new PointLayer({}) // blend: 'additive'
|
||||
.source(
|
||||
[
|
||||
{
|
||||
lng: 120,
|
||||
lat: 30.267069,
|
||||
},
|
||||
// {
|
||||
// lng: 120,
|
||||
// lat: 30.267069,
|
||||
// name: 'n1'
|
||||
// },
|
||||
{
|
||||
lng: 120.1025,
|
||||
lat: 30.264701434772807,
|
||||
name: 'n2',
|
||||
},
|
||||
{
|
||||
lng: 120.1019811630249,
|
||||
lat: 30.264701434772807,
|
||||
name: 'n3',
|
||||
},
|
||||
],
|
||||
{
|
||||
|
@ -103,14 +106,16 @@ export default class GaodeMapComponent extends React.Component {
|
|||
},
|
||||
},
|
||||
)
|
||||
// .shape('circle')
|
||||
.shape('cylinder')
|
||||
.shape('circle')
|
||||
// .shape('cylinder')
|
||||
// .color('#0f9')
|
||||
// .color('#4169E1')
|
||||
.color('#4cfd47')
|
||||
// .color('#4cfd47')
|
||||
.color('name', ['#f00', '#ff0'])
|
||||
// .size([100, 100, 1000])
|
||||
.size([100, 100, 1000])
|
||||
// .size(100)
|
||||
// .size([100, 100, 1000])
|
||||
// .size(10)
|
||||
.size('name', [20, 40])
|
||||
// .animate({
|
||||
// // enable: true,
|
||||
// enable: false,
|
||||
|
@ -140,10 +145,40 @@ export default class GaodeMapComponent extends React.Component {
|
|||
|
||||
this.scene = scene;
|
||||
|
||||
// console.log('layer', layer)
|
||||
|
||||
// let layer2 = new PointLayer({})
|
||||
// .source([
|
||||
// {
|
||||
// lng: 120.1025,
|
||||
// lat: 30.264701434772807,
|
||||
// name: 'n2'
|
||||
// }
|
||||
// ], {
|
||||
// parser: {
|
||||
// type: 'json',
|
||||
// x: 'lng',
|
||||
// y: 'lat',
|
||||
// },
|
||||
// })
|
||||
// .shape('circle')
|
||||
// .size(10)
|
||||
// .color('#00f')
|
||||
// .style({
|
||||
// opacity: 0.5
|
||||
// })
|
||||
|
||||
scene.on('loaded', () => {
|
||||
scene.addLayer(layer);
|
||||
|
||||
let scale = layer.getScale('size');
|
||||
console.log('scale n2', scale('n2'));
|
||||
console.log('scale n3', scale('n3'));
|
||||
|
||||
scene.addLayer(text);
|
||||
scene.addLayer(line);
|
||||
|
||||
// scene.addLayer(layer2);
|
||||
// scene.addLayer(trufCircle);
|
||||
// scene.on('movestart', e => console.log('e', e))
|
||||
// scene.on('mapmove', e => console.log('e', e))
|
||||
|
|
|
@ -99,8 +99,8 @@ export default class CustomPostProcessing extends React.Component {
|
|||
// 注册自定义后处理效果
|
||||
scene.registerPostProcessingPass(DotScreenEffect, 'dotScreenEffect');
|
||||
const layer = new PolygonLayer({
|
||||
enablePicking: true,
|
||||
enableHighlight: true,
|
||||
// enablePicking: true,
|
||||
// enableHighlight: true,
|
||||
enableMultiPassRenderer: true,
|
||||
passes: [
|
||||
[
|
||||
|
@ -124,6 +124,7 @@ export default class CustomPostProcessing extends React.Component {
|
|||
'#FF7A45',
|
||||
'#CF1D49',
|
||||
])
|
||||
.active(true)
|
||||
.shape('fill')
|
||||
.style({
|
||||
opacity: 0.8,
|
||||
|
|
Loading…
Reference in New Issue