城市建筑

使用

  1. import { CityBuildingLayer } from '@antv/l7';

source

PolygonLayer

size

PolygonLayer

color

PolygonLayer

animate

开启动画效果

  1. layer.animate(true);

style

  • baseColor 楼房颜色,
  • windowColor: 窗户颜色,
  • brightColor: 点亮窗户颜色

其他 style 配置项同

layer#style

完整代码

  1. const pointLayer = new CityBuildingLayer();
  2. pointLayer
  3. .source(await response.json())
  4. .size('floor', [0, 500])
  5. .color('rgba(242,246,250,1.0)')
  6. .animate({
  7. enable: true,
  8. })
  9. .style({
  10. opacity: 1.0,
  11. baseColor: 'rgb(16,16,16)',
  12. windowColor: 'rgb(30,60,89)',
  13. brightColor: 'rgb(255,176,38)',
  14. });
  15. scene.addLayer(pointLayer);