@antv/l7-layers 2.9.17 → 2.9.20
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/index.js +12 -2
- package/es/Geometry/index.js.map +1 -1
- package/es/Geometry/models/billboard.d.ts +3 -3
- package/es/Geometry/models/billboard.js +11 -6
- package/es/Geometry/models/billboard.js.map +1 -1
- package/es/Geometry/models/plane.d.ts +3 -3
- package/es/Geometry/models/plane.js +12 -7
- package/es/Geometry/models/plane.js.map +1 -1
- package/es/Geometry/models/sprite.d.ts +3 -3
- package/es/Geometry/models/sprite.js +11 -6
- package/es/Geometry/models/sprite.js.map +1 -1
- package/es/canvas/index.js +12 -2
- package/es/canvas/index.js.map +1 -1
- package/es/citybuliding/building.js +12 -2
- package/es/citybuliding/building.js.map +1 -1
- package/es/citybuliding/models/build.d.ts +2 -1
- package/es/citybuliding/models/build.js +16 -3
- package/es/citybuliding/models/build.js.map +1 -1
- package/es/core/BaseLayer.d.ts +1 -1
- package/es/core/BaseLayer.js +105 -62
- package/es/core/BaseLayer.js.map +1 -1
- package/es/core/BaseModel.d.ts +2 -2
- package/es/core/BaseModel.js +2 -2
- package/es/core/BaseModel.js.map +1 -1
- package/es/core/interface.d.ts +2 -0
- package/es/core/interface.js.map +1 -1
- package/es/core/triangulation.d.ts +1 -0
- package/es/core/triangulation.js +37 -11
- package/es/core/triangulation.js.map +1 -1
- package/es/earth/index.js +8 -2
- package/es/earth/index.js.map +1 -1
- package/es/earth/models/atmosphere.d.ts +2 -2
- package/es/earth/models/atmosphere.js +11 -6
- package/es/earth/models/atmosphere.js.map +1 -1
- package/es/earth/models/base.d.ts +2 -2
- package/es/earth/models/base.js +11 -6
- package/es/earth/models/base.js.map +1 -1
- package/es/earth/models/bloomsphere.d.ts +2 -2
- package/es/earth/models/bloomsphere.js +11 -6
- package/es/earth/models/bloomsphere.js.map +1 -1
- package/es/heatmap/index.js +17 -5
- package/es/heatmap/index.js.map +1 -1
- package/es/heatmap/models/grid.d.ts +2 -2
- package/es/heatmap/models/grid.js +12 -8
- package/es/heatmap/models/grid.js.map +1 -1
- package/es/heatmap/models/grid3d.d.ts +2 -2
- package/es/heatmap/models/grid3d.js +12 -6
- package/es/heatmap/models/grid3d.js.map +1 -1
- package/es/heatmap/models/heatmap.d.ts +2 -2
- package/es/heatmap/models/heatmap.js +112 -62
- package/es/heatmap/models/heatmap.js.map +1 -1
- package/es/heatmap/models/hexagon.d.ts +2 -2
- package/es/heatmap/models/hexagon.js +11 -6
- package/es/heatmap/models/hexagon.js.map +1 -1
- package/es/image/index.js +12 -2
- package/es/image/index.js.map +1 -1
- package/es/image/models/dataImage.d.ts +3 -3
- package/es/image/models/dataImage.js +10 -5
- package/es/image/models/dataImage.js.map +1 -1
- package/es/image/models/image.d.ts +3 -3
- package/es/image/models/image.js +11 -7
- package/es/image/models/image.js.map +1 -1
- package/es/line/index.d.ts +0 -2
- package/es/line/index.js +12 -5
- package/es/line/index.js.map +1 -1
- package/es/line/models/arc.d.ts +2 -2
- package/es/line/models/arc.js +15 -10
- package/es/line/models/arc.js.map +1 -1
- package/es/line/models/arc_3d.d.ts +2 -2
- package/es/line/models/arc_3d.js +13 -8
- package/es/line/models/arc_3d.js.map +1 -1
- package/es/line/models/earthArc_3d.d.ts +2 -2
- package/es/line/models/earthArc_3d.js +17 -9
- package/es/line/models/earthArc_3d.js.map +1 -1
- package/es/line/models/great_circle.d.ts +2 -2
- package/es/line/models/great_circle.js +12 -7
- package/es/line/models/great_circle.js.map +1 -1
- package/es/line/models/half.d.ts +2 -2
- package/es/line/models/half.js +46 -29
- package/es/line/models/half.js.map +1 -1
- package/es/line/models/index.d.ts +1 -1
- package/es/line/models/index.js +0 -2
- package/es/line/models/index.js.map +1 -1
- package/es/line/models/line.d.ts +2 -2
- package/es/line/models/line.js +28 -16
- package/es/line/models/line.js.map +1 -1
- package/es/line/models/linearline.d.ts +2 -11
- package/es/line/models/linearline.js +14 -24
- package/es/line/models/linearline.js.map +1 -1
- package/es/line/models/simpleLine.d.ts +2 -2
- package/es/line/models/simpleLine.js +13 -8
- package/es/line/models/simpleLine.js.map +1 -1
- package/es/line/models/tile.d.ts +2 -11
- package/es/line/models/tile.js +45 -39
- package/es/line/models/tile.js.map +1 -1
- package/es/line/models/wall.d.ts +2 -2
- package/es/line/models/wall.js +13 -9
- package/es/line/models/wall.js.map +1 -1
- package/es/mask/index.js +12 -2
- package/es/mask/index.js.map +1 -1
- package/es/mask/models/fill.d.ts +2 -2
- package/es/mask/models/fill.js +53 -27
- package/es/mask/models/fill.js.map +1 -1
- package/es/plugins/DataMappingPlugin.js +29 -8
- package/es/plugins/DataMappingPlugin.js.map +1 -1
- package/es/plugins/DataSourcePlugin.js +14 -5
- package/es/plugins/DataSourcePlugin.js.map +1 -1
- package/es/plugins/LayerModelPlugin.d.ts +2 -0
- package/es/plugins/LayerModelPlugin.js +35 -7
- package/es/plugins/LayerModelPlugin.js.map +1 -1
- package/es/plugins/PixelPickingPlugin.js +16 -13
- package/es/plugins/PixelPickingPlugin.js.map +1 -1
- package/es/point/index.d.ts +1 -1
- package/es/point/index.js +26 -15
- package/es/point/index.js.map +1 -1
- package/es/point/models/earthExtrude.d.ts +2 -2
- package/es/point/models/earthExtrude.js +16 -14
- package/es/point/models/earthExtrude.js.map +1 -1
- package/es/point/models/earthFill.d.ts +2 -11
- package/es/point/models/earthFill.js +13 -22
- package/es/point/models/earthFill.js.map +1 -1
- package/es/point/models/extrude.d.ts +2 -2
- package/es/point/models/extrude.js +49 -27
- package/es/point/models/extrude.js.map +1 -1
- package/es/point/models/fill.d.ts +2 -2
- package/es/point/models/fill.js +59 -41
- package/es/point/models/fill.js.map +1 -1
- package/es/point/models/fillmage.d.ts +2 -7
- package/es/point/models/fillmage.js +13 -22
- package/es/point/models/fillmage.js.map +1 -1
- package/es/point/models/image.d.ts +2 -2
- package/es/point/models/image.js +11 -6
- package/es/point/models/image.js.map +1 -1
- package/es/point/models/index.d.ts +1 -1
- package/es/point/models/index.js +0 -2
- package/es/point/models/index.js.map +1 -1
- package/es/point/models/normal.d.ts +2 -2
- package/es/point/models/normal.js +11 -6
- package/es/point/models/normal.js.map +1 -1
- package/es/point/models/radar.d.ts +2 -11
- package/es/point/models/radar.js +13 -22
- package/es/point/models/radar.js.map +1 -1
- package/es/point/models/simplePoint.d.ts +2 -2
- package/es/point/models/simplePoint.js +11 -6
- package/es/point/models/simplePoint.js.map +1 -1
- package/es/point/models/text.d.ts +3 -2
- package/es/point/models/text.js +110 -75
- package/es/point/models/text.js.map +1 -1
- package/es/point/models/tile.d.ts +2 -11
- package/es/point/models/tile.js +22 -25
- package/es/point/models/tile.js.map +1 -1
- package/es/polygon/index.js +12 -2
- package/es/polygon/index.js.map +1 -1
- package/es/polygon/models/extrude.d.ts +2 -2
- package/es/polygon/models/extrude.js +10 -5
- package/es/polygon/models/extrude.js.map +1 -1
- package/es/polygon/models/fill.d.ts +2 -2
- package/es/polygon/models/fill.js +27 -13
- package/es/polygon/models/fill.js.map +1 -1
- package/es/polygon/models/ocean.d.ts +2 -2
- package/es/polygon/models/ocean.js +12 -6
- package/es/polygon/models/ocean.js.map +1 -1
- package/es/polygon/models/tile.d.ts +2 -3
- package/es/polygon/models/tile.js +17 -27
- package/es/polygon/models/tile.js.map +1 -1
- package/es/polygon/models/water.d.ts +2 -2
- package/es/polygon/models/water.js +12 -6
- package/es/polygon/models/water.js.map +1 -1
- package/es/raster/index.js +12 -2
- package/es/raster/index.js.map +1 -1
- package/es/raster/models/raster.d.ts +3 -3
- package/es/raster/models/raster.js +11 -7
- package/es/raster/models/raster.js.map +1 -1
- package/es/tile/manager/tileLayerManager.js +3 -0
- package/es/tile/manager/tileLayerManager.js.map +1 -1
- package/es/tile/manager/tilePickerManager.js +1 -0
- package/es/tile/manager/tilePickerManager.js.map +1 -1
- package/es/tile/tileFactory/base.js.map +1 -1
- package/es/tile/tileFactory/point.js.map +1 -1
- package/es/tile/tileFactory/rasterDataLayer.js +12 -2
- package/es/tile/tileFactory/rasterDataLayer.js.map +1 -1
- package/es/tile/tileFactory/vectorLayer.js +12 -2
- package/es/tile/tileFactory/vectorLayer.js.map +1 -1
- package/es/utils/extrude_polyline.d.ts +15 -0
- package/es/utils/extrude_polyline.js +146 -14
- package/es/utils/extrude_polyline.js.map +1 -1
- package/es/wind/index.js +12 -2
- package/es/wind/index.js.map +1 -1
- package/es/wind/models/wind.d.ts +4 -2
- package/es/wind/models/wind.js +50 -18
- package/es/wind/models/wind.js.map +1 -1
- package/es/wind/models/windRender.js +1 -1
- package/es/wind/models/windRender.js.map +1 -1
- package/lib/Geometry/index.js +12 -2
- package/lib/Geometry/index.js.map +1 -1
- package/lib/Geometry/models/billboard.js +11 -6
- package/lib/Geometry/models/billboard.js.map +1 -1
- package/lib/Geometry/models/plane.js +12 -7
- package/lib/Geometry/models/plane.js.map +1 -1
- package/lib/Geometry/models/sprite.js +11 -6
- package/lib/Geometry/models/sprite.js.map +1 -1
- package/lib/canvas/index.js +12 -2
- package/lib/canvas/index.js.map +1 -1
- package/lib/citybuliding/building.js +12 -2
- package/lib/citybuliding/building.js.map +1 -1
- package/lib/citybuliding/models/build.js +16 -3
- package/lib/citybuliding/models/build.js.map +1 -1
- package/lib/core/BaseLayer.js +104 -61
- package/lib/core/BaseLayer.js.map +1 -1
- package/lib/core/BaseModel.js +2 -2
- package/lib/core/BaseModel.js.map +1 -1
- package/lib/core/interface.js.map +1 -1
- package/lib/core/triangulation.js +40 -16
- package/lib/core/triangulation.js.map +1 -1
- package/lib/earth/index.js +8 -2
- package/lib/earth/index.js.map +1 -1
- package/lib/earth/models/atmosphere.js +11 -6
- package/lib/earth/models/atmosphere.js.map +1 -1
- package/lib/earth/models/base.js +11 -6
- package/lib/earth/models/base.js.map +1 -1
- package/lib/earth/models/bloomsphere.js +11 -6
- package/lib/earth/models/bloomsphere.js.map +1 -1
- package/lib/heatmap/index.js +17 -5
- package/lib/heatmap/index.js.map +1 -1
- package/lib/heatmap/models/grid.js +12 -8
- package/lib/heatmap/models/grid.js.map +1 -1
- package/lib/heatmap/models/grid3d.js +12 -6
- package/lib/heatmap/models/grid3d.js.map +1 -1
- package/lib/heatmap/models/heatmap.js +113 -62
- package/lib/heatmap/models/heatmap.js.map +1 -1
- package/lib/heatmap/models/hexagon.js +11 -6
- package/lib/heatmap/models/hexagon.js.map +1 -1
- package/lib/image/index.js +12 -2
- package/lib/image/index.js.map +1 -1
- package/lib/image/models/dataImage.js +10 -5
- package/lib/image/models/dataImage.js.map +1 -1
- package/lib/image/models/image.js +11 -7
- package/lib/image/models/image.js.map +1 -1
- package/lib/line/index.js +12 -5
- package/lib/line/index.js.map +1 -1
- package/lib/line/models/arc.js +15 -10
- package/lib/line/models/arc.js.map +1 -1
- package/lib/line/models/arc_3d.js +13 -8
- package/lib/line/models/arc_3d.js.map +1 -1
- package/lib/line/models/earthArc_3d.js +17 -9
- package/lib/line/models/earthArc_3d.js.map +1 -1
- package/lib/line/models/great_circle.js +12 -7
- package/lib/line/models/great_circle.js.map +1 -1
- package/lib/line/models/half.js +48 -29
- package/lib/line/models/half.js.map +1 -1
- package/lib/line/models/index.js +0 -3
- package/lib/line/models/index.js.map +1 -1
- package/lib/line/models/line.js +29 -18
- package/lib/line/models/line.js.map +1 -1
- package/lib/line/models/linearline.js +14 -24
- package/lib/line/models/linearline.js.map +1 -1
- package/lib/line/models/simpleLine.js +13 -8
- package/lib/line/models/simpleLine.js.map +1 -1
- package/lib/line/models/tile.js +47 -39
- package/lib/line/models/tile.js.map +1 -1
- package/lib/line/models/wall.js +13 -9
- package/lib/line/models/wall.js.map +1 -1
- package/lib/mask/index.js +12 -2
- package/lib/mask/index.js.map +1 -1
- package/lib/mask/models/fill.js +55 -27
- package/lib/mask/models/fill.js.map +1 -1
- package/lib/plugins/DataMappingPlugin.js +29 -8
- package/lib/plugins/DataMappingPlugin.js.map +1 -1
- package/lib/plugins/DataSourcePlugin.js +13 -4
- package/lib/plugins/DataSourcePlugin.js.map +1 -1
- package/lib/plugins/LayerModelPlugin.js +35 -7
- package/lib/plugins/LayerModelPlugin.js.map +1 -1
- package/lib/plugins/PixelPickingPlugin.js +16 -13
- package/lib/plugins/PixelPickingPlugin.js.map +1 -1
- package/lib/point/index.js +26 -15
- package/lib/point/index.js.map +1 -1
- package/lib/point/models/earthExtrude.js +16 -15
- package/lib/point/models/earthExtrude.js.map +1 -1
- package/lib/point/models/earthFill.js +13 -22
- package/lib/point/models/earthFill.js.map +1 -1
- package/lib/point/models/extrude.js +51 -28
- package/lib/point/models/extrude.js.map +1 -1
- package/lib/point/models/fill.js +61 -42
- package/lib/point/models/fill.js.map +1 -1
- package/lib/point/models/fillmage.js +13 -22
- package/lib/point/models/fillmage.js.map +1 -1
- package/lib/point/models/image.js +11 -6
- package/lib/point/models/image.js.map +1 -1
- package/lib/point/models/index.js +0 -3
- package/lib/point/models/index.js.map +1 -1
- package/lib/point/models/normal.js +11 -6
- package/lib/point/models/normal.js.map +1 -1
- package/lib/point/models/radar.js +13 -22
- package/lib/point/models/radar.js.map +1 -1
- package/lib/point/models/simplePoint.js +11 -6
- package/lib/point/models/simplePoint.js.map +1 -1
- package/lib/point/models/text.js +112 -78
- package/lib/point/models/text.js.map +1 -1
- package/lib/point/models/tile.js +22 -25
- package/lib/point/models/tile.js.map +1 -1
- package/lib/polygon/index.js +12 -2
- package/lib/polygon/index.js.map +1 -1
- package/lib/polygon/models/extrude.js +10 -5
- package/lib/polygon/models/extrude.js.map +1 -1
- package/lib/polygon/models/fill.js +25 -11
- package/lib/polygon/models/fill.js.map +1 -1
- package/lib/polygon/models/ocean.js +12 -6
- package/lib/polygon/models/ocean.js.map +1 -1
- package/lib/polygon/models/tile.js +17 -27
- package/lib/polygon/models/tile.js.map +1 -1
- package/lib/polygon/models/water.js +12 -6
- package/lib/polygon/models/water.js.map +1 -1
- package/lib/raster/index.js +12 -2
- package/lib/raster/index.js.map +1 -1
- package/lib/raster/models/raster.js +11 -7
- package/lib/raster/models/raster.js.map +1 -1
- package/lib/tile/manager/tileLayerManager.js +3 -0
- package/lib/tile/manager/tileLayerManager.js.map +1 -1
- package/lib/tile/manager/tilePickerManager.js +1 -0
- package/lib/tile/manager/tilePickerManager.js.map +1 -1
- package/lib/tile/tileFactory/base.js.map +1 -1
- package/lib/tile/tileFactory/point.js.map +1 -1
- package/lib/tile/tileFactory/rasterDataLayer.js +12 -2
- package/lib/tile/tileFactory/rasterDataLayer.js.map +1 -1
- package/lib/tile/tileFactory/vectorLayer.js +12 -2
- package/lib/tile/tileFactory/vectorLayer.js.map +1 -1
- package/lib/utils/extrude_polyline.js +148 -14
- package/lib/utils/extrude_polyline.js.map +1 -1
- package/lib/wind/index.js +12 -2
- package/lib/wind/index.js.map +1 -1
- package/lib/wind/models/wind.js +49 -18
- package/lib/wind/models/wind.js.map +1 -1
- package/lib/wind/models/windRender.js +1 -1
- package/lib/wind/models/windRender.js.map +1 -1
- package/package.json +9 -8
- package/es/line/models/arcmini.d.ts +0 -9
- package/es/line/models/arcmini.js +0 -145
- package/es/line/models/arcmini.js.map +0 -1
- package/es/point/models/icon-font.d.ts +0 -11
- package/es/point/models/icon-font.js +0 -181
- package/es/point/models/icon-font.js.map +0 -1
- package/es/raster/image.d.ts +0 -0
- package/es/raster/image.js +0 -2
- package/es/raster/image.js.map +0 -1
- package/es/raster/raster2d.d.ts +0 -27
- package/es/raster/raster2d.js +0 -158
- package/es/raster/raster2d.js.map +0 -1
- package/es/utils/geo.d.ts +0 -12
- package/es/utils/geo.js +0 -53
- package/es/utils/geo.js.map +0 -1
- package/lib/line/models/arcmini.js +0 -161
- package/lib/line/models/arcmini.js.map +0 -1
- package/lib/point/models/icon-font.js +0 -196
- package/lib/point/models/icon-font.js.map +0 -1
- package/lib/raster/image.js +0 -2
- package/lib/raster/image.js.map +0 -1
- package/lib/raster/raster2d.js +0 -172
- package/lib/raster/raster2d.js.map +0 -1
- package/lib/utils/geo.js +0 -65
- package/lib/utils/geo.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/citybuliding/models/build.ts"],"names":["AttributeType","gl","rgb2arr","BaseModel","PolygonExtrudeTriangulation","CityBuildModel","layer","getLayerConfig","opacity","baseColor","brightColor","windowColor","time","sweep","enable","sweepRadius","sweepColor","sweepSpeed","sweepCenter","cityCenter","u_cityCenter","u_cityMinSize","cityMinSize","u_circleSweep","u_circleSweepColor","slice","u_circleSweepSpeed","u_opacity","u_baseColor","u_brightColor","u_windowColor","u_time","getLayerAnimateTime","getSource","extent","minLng","minLat","maxLng","maxLat","mapService","version","lngLatToCoord","l1","l2","Math","sqrt","pow","w","h","calCityGeo","startModelAnimate","buildLayerModel","moduleName","vertexShader","buildVert","fragmentShader","buildFrag","triangulation","cull","face","BACK","styleAttributeService","registerStyleAttribute","name","type","Attribute","descriptor","buffer","usage","STATIC_DRAW","data","FLOAT","size","update","feature","featureIdx","vertex","attributeIdx","normal","DYNAMIC_DRAW","Array","isArray"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,aAAT,EAAwBC,EAAxB,QAA0D,eAA1D;AACA,SAASC,OAAT,QAAwB,gBAAxB;AACA,OAAOC,SAAP,MAAsB,sBAAtB;AACA,SAASC,2BAAT,QAA4C,0BAA5C;;;;IAiBqBC,c;;;;;;;;;;;;;;;;;;;;;;;;;WAInB,wBAAsB;AACpB,iBAaI,KAAKC,KAAL,CAAWC,cAAX,EAbJ;AAAA,8BACEC,OADF;AAAA,UACEA,OADF,6BACY,CADZ;AAAA,gCAEEC,SAFF;AAAA,UAEEA,SAFF,+BAEc,eAFd;AAAA,kCAGEC,WAHF;AAAA,UAGEA,WAHF,iCAGgB,iBAHhB;AAAA,kCAIEC,WAJF;AAAA,UAIEA,WAJF,iCAIgB,eAJhB;AAAA,2BAKEC,IALF;AAAA,UAKEA,IALF,0BAKS,CALT;AAAA,4BAMEC,KANF;AAAA,UAMEA,KANF,2BAMU;AACNC,QAAAA,MAAM,EAAE,KADF;AAENC,QAAAA,WAAW,EAA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,CAAkD;AAChDC,QAAAA,IAAI,EAAE,IAD0C;AAEhDC,QAAAA,IAAI,EAAEhE,aAAa,CAACiE,SAF4B;AAGhDC,QAAAA,UAAU,EAAE;AACVH,UAAAA,IAAI,EAAE,MADI;AAEVI,UAAAA,MAAM,EAAE;AAENC,YAAAA,KAAK,EAAEnE,EAAE,CAAC8E,YAFJ;AAGNT,YAAAA,IAAI,EAAE,EAHA;AAINN,YAAAA,IAAI,EAAE/D,EAAE,CAACsE;AAJH,WAFE;AAQVC,UAAAA,IAAI,EAAE,CARI;AASVC,UAAAA,MAAM,EAAE,gBACNC,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,gBAAQL,IAAR,GAAiBE,OAAjB,CAAQF,IAAR;AACA,mBAAO,CAACI,MAAM,CAAC,CAAD,CAAP,EAAYA,MAAM,CAAC,CAAD,CAAlB,CAAP;AACD;AAjBS;AAHoC,OAAlD;AAuBD;;;;EAnJyCzE,S;;SAAvBE,c","sourcesContent":["import { AttributeType, gl, IEncodeFeature, IModel } from '@antv/l7-core';\nimport { rgb2arr } from '@antv/l7-utils';\nimport BaseModel from '../../core/BaseModel';\nimport { PolygonExtrudeTriangulation } from '../../core/triangulation';\nimport buildFrag from '../shaders/build_frag.glsl';\nimport buildVert from '../shaders/build_vert.glsl';\ninterface ICityBuildLayerStyleOptions {\n opacity: number;\n baseColor: string;\n brightColor: string;\n windowColor: string;\n time: number;\n sweep: {\n enable: boolean;\n sweepRadius: number;\n sweepColor: string;\n sweepSpeed: number;\n sweepCenter?: [number, number];\n };\n}\nexport default class CityBuildModel extends BaseModel {\n private cityCenter: [number, number];\n private cityMinSize: number;\n\n public getUninforms() {\n const {\n opacity = 1,\n baseColor = 'rgb(16,16,16)',\n brightColor = 'rgb(255,176,38)',\n windowColor = 'rgb(30,60,89)',\n time = 0,\n sweep = {\n enable: false,\n sweepRadius: 1,\n sweepColor: 'rgb(255, 255, 255)',\n sweepSpeed: 0.4,\n sweepCenter: this.cityCenter,\n },\n } = this.layer.getLayerConfig() as ICityBuildLayerStyleOptions;\n return {\n u_cityCenter: sweep.sweepCenter || this.cityCenter,\n u_cityMinSize: this.cityMinSize * sweep.sweepRadius,\n u_circleSweep: sweep.enable ? 1.0 : 0.0,\n u_circleSweepColor: rgb2arr(sweep.sweepColor).slice(0, 3),\n u_circleSweepSpeed: sweep.sweepSpeed,\n\n u_opacity: opacity,\n u_baseColor: rgb2arr(baseColor),\n u_brightColor: rgb2arr(brightColor),\n u_windowColor: rgb2arr(windowColor),\n u_time: this.layer.getLayerAnimateTime() || time,\n };\n }\n\n public calCityGeo() {\n // @ts-ignore\n const [minLng, minLat, maxLng, maxLat] = this.layer.getSource().extent;\n if (this.mapService.version === 'GAODE2.x') {\n // @ts-ignore\n this.cityCenter = this.mapService.lngLatToCoord([\n (maxLng + minLng) / 2,\n (maxLat + minLat) / 2,\n ]);\n // @ts-ignore\n const l1 = this.mapService.lngLatToCoord([maxLng, maxLat]);\n // @ts-ignore\n const l2 = this.mapService.lngLatToCoord([minLng, minLat]);\n this.cityMinSize =\n Math.sqrt(Math.pow(l1[0] - l2[0], 2) + Math.pow(l1[1] - l2[1], 2)) / 4;\n } else {\n const w = maxLng - minLng;\n const h = maxLat - minLat;\n this.cityCenter = [(maxLng + minLng) / 2, (maxLat + minLat) / 2];\n this.cityMinSize = Math.sqrt(Math.pow(w, 2) + Math.pow(h, 2)) / 4;\n }\n }\n\n public initModels(): IModel[] {\n this.calCityGeo();\n\n this.startModelAnimate();\n return [\n this.layer.buildLayerModel({\n moduleName: 'cityBuilding',\n vertexShader: buildVert,\n fragmentShader: buildFrag,\n triangulation: PolygonExtrudeTriangulation,\n cull: {\n enable: true,\n face: gl.BACK,\n },\n }),\n ];\n }\n\n protected registerBuiltinAttributes() {\n // point layer size;\n this.styleAttributeService.registerStyleAttribute({\n name: 'normal',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Normal',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 3,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n normal: number[],\n ) => {\n return normal;\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'size',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Size',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 1,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size = 10 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Uv',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 2,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size } = feature;\n return [vertex[3], vertex[4]];\n },\n },\n });\n }\n}\n"],"file":"build.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/citybuliding/models/build.ts"],"names":["AttributeType","gl","rgb2arr","BaseModel","PolygonExtrudeTriangulation","CityBuildModel","layer","getLayerConfig","opacity","baseColor","brightColor","windowColor","time","sweep","enable","sweepRadius","sweepColor","sweepSpeed","sweepCenter","cityCenter","u_cityCenter","u_cityMinSize","cityMinSize","u_circleSweep","u_circleSweepColor","slice","u_circleSweepSpeed","u_opacity","u_baseColor","u_brightColor","u_windowColor","u_time","getLayerAnimateTime","getSource","extent","minLng","minLat","maxLng","maxLat","mapService","version","lngLatToCoord","l1","l2","Math","sqrt","pow","w","h","callbackModel","calCityGeo","startModelAnimate","buildModels","buildLayerModel","moduleName","vertexShader","buildVert","fragmentShader","buildFrag","triangulation","depth","cull","face","BACK","then","model","catch","err","console","warn","styleAttributeService","registerStyleAttribute","name","type","Attribute","descriptor","buffer","usage","STATIC_DRAW","data","FLOAT","size","update","feature","featureIdx","vertex","attributeIdx","normal","DYNAMIC_DRAW","Array","isArray"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,aAAT,EAAwBC,EAAxB,QAA0D,eAA1D;AACA,SAASC,OAAT,QAAwB,gBAAxB;AACA,OAAOC,SAAP,MAAsB,sBAAtB;AACA,SAASC,2BAAT,QAA4C,0BAA5C;;;;IAiBqBC,c;;;;;;;;;;;;;;;;;;;;;;;;;WAInB,wBAAsB;AACpB,iBAaI,KAAKC,KAAL,CAAWC,cAAX,EAbJ;AAAA,8BACEC,OADF;AAAA,UACEA,OADF,6BACY,CADZ;AAAA,gCAEEC,SAFF;AAAA,UAEEA,SAFF,+BAEc,eAFd;AAAA,kCAGEC,WAHF;AAAA,UAGEA,WAHF,iCAGgB,iBAHhB;AAAA,kCAIEC,WAJF;AAAA,UAIEA,WAJF,iCAIgB,eAJhB;AAAA,2BAKEC,IALF;AAAA,UAKEA,IALF,0BAKS,CALT;AAAA,4BAMEC,KANF;AAAA,UAMEA,KANF,2BAMU;AACNC,QAAAA,MAAM,EAAE,KADF;AAENC,QAAAA,WAAW,EAAE,CAFP;AAGNC,QAAAA,UAAU,EAAE,oBAHN;AAINC,QAAAA,UAAU,EAAE,GAJN;AAKNC,QAAAA,WAAW,EAAE,KAAKC;AALZ,OANV;;AAcA,aAAO;AACLC,QAAAA,YAAY,EAAEP,KAAK,CAACK,WAAN,IAAqB,KAAKC,UADnC;AAELE,QAAAA,aAAa,EAAE,KAAKC,WAAL,GAAmBT,KAAK,CAACE,WAFnC;AAGLQ,QAAAA,aAAa,EAAEV,KAAK,CAACC,MAAN,GAAe,GAAf,GAAqB,GAH/B;AAILU,QAAAA,kBAAkB,EAAEtB,OAAO,CAACW,KAAK,CAACG,UAAP,CAAP,CAA0BS,KAA1B,CAAgC,CAAhC,EAAmC,CAAnC,CAJ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F4B;AAGhDC,QAAAA,UAAU,EAAE;AACVH,UAAAA,IAAI,EAAE,MADI;AAEVI,UAAAA,MAAM,EAAE;AAENC,YAAAA,KAAK,EAAE5E,EAAE,CAACuF,YAFJ;AAGNT,YAAAA,IAAI,EAAE,EAHA;AAINN,YAAAA,IAAI,EAAExE,EAAE,CAAC+E;AAJH,WAFE;AAQVC,UAAAA,IAAI,EAAE,CARI;AASVC,UAAAA,MAAM,EAAE,gBACNC,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,gBAAQL,IAAR,GAAiBE,OAAjB,CAAQF,IAAR;AACA,mBAAO,CAACI,MAAM,CAAC,CAAD,CAAP,EAAYA,MAAM,CAAC,CAAD,CAAlB,CAAP;AACD;AAjBS;AAHoC,OAAlD;AAuBD;;;;EA/JyClF,S;;SAAvBE,c","sourcesContent":["import { AttributeType, gl, IEncodeFeature, IModel } from '@antv/l7-core';\nimport { rgb2arr } from '@antv/l7-utils';\nimport BaseModel from '../../core/BaseModel';\nimport { PolygonExtrudeTriangulation } from '../../core/triangulation';\nimport buildFrag from '../shaders/build_frag.glsl';\nimport buildVert from '../shaders/build_vert.glsl';\ninterface ICityBuildLayerStyleOptions {\n opacity: number;\n baseColor: string;\n brightColor: string;\n windowColor: string;\n time: number;\n sweep: {\n enable: boolean;\n sweepRadius: number;\n sweepColor: string;\n sweepSpeed: number;\n sweepCenter?: [number, number];\n };\n}\nexport default class CityBuildModel extends BaseModel {\n private cityCenter: [number, number];\n private cityMinSize: number;\n\n public getUninforms() {\n const {\n opacity = 1,\n baseColor = 'rgb(16,16,16)',\n brightColor = 'rgb(255,176,38)',\n windowColor = 'rgb(30,60,89)',\n time = 0,\n sweep = {\n enable: false,\n sweepRadius: 1,\n sweepColor: 'rgb(255, 255, 255)',\n sweepSpeed: 0.4,\n sweepCenter: this.cityCenter,\n },\n } = this.layer.getLayerConfig() as ICityBuildLayerStyleOptions;\n return {\n u_cityCenter: sweep.sweepCenter || this.cityCenter,\n u_cityMinSize: this.cityMinSize * sweep.sweepRadius,\n u_circleSweep: sweep.enable ? 1.0 : 0.0,\n u_circleSweepColor: rgb2arr(sweep.sweepColor).slice(0, 3),\n u_circleSweepSpeed: sweep.sweepSpeed,\n\n u_opacity: opacity,\n u_baseColor: rgb2arr(baseColor),\n u_brightColor: rgb2arr(brightColor),\n u_windowColor: rgb2arr(windowColor),\n u_time: this.layer.getLayerAnimateTime() || time,\n };\n }\n\n public calCityGeo() {\n // @ts-ignore\n const [minLng, minLat, maxLng, maxLat] = this.layer.getSource().extent;\n if (this.mapService.version === 'GAODE2.x') {\n // @ts-ignore\n this.cityCenter = this.mapService.lngLatToCoord([\n (maxLng + minLng) / 2,\n (maxLat + minLat) / 2,\n ]);\n // @ts-ignore\n const l1 = this.mapService.lngLatToCoord([maxLng, maxLat]);\n // @ts-ignore\n const l2 = this.mapService.lngLatToCoord([minLng, minLat]);\n this.cityMinSize =\n Math.sqrt(Math.pow(l1[0] - l2[0], 2) + Math.pow(l1[1] - l2[1], 2)) / 4;\n } else {\n const w = maxLng - minLng;\n const h = maxLat - minLat;\n this.cityCenter = [(maxLng + minLng) / 2, (maxLat + minLat) / 2];\n this.cityMinSize = Math.sqrt(Math.pow(w, 2) + Math.pow(h, 2)) / 4;\n }\n }\n\n public initModels(callbackModel: (models: IModel[]) => void) {\n this.calCityGeo();\n\n this.startModelAnimate();\n\n this.buildModels(callbackModel);\n }\n\n public buildModels(callbackModel: (models: IModel[]) => void) {\n this.layer\n .buildLayerModel({\n moduleName: 'cityBuilding',\n vertexShader: buildVert,\n fragmentShader: buildFrag,\n triangulation: PolygonExtrudeTriangulation,\n depth: { enable: true },\n cull: {\n enable: true,\n face: gl.BACK,\n },\n })\n .then((model) => {\n callbackModel([model]);\n })\n .catch((err) => {\n console.warn(err);\n callbackModel([]);\n });\n }\n\n protected registerBuiltinAttributes() {\n // point layer size;\n this.styleAttributeService.registerStyleAttribute({\n name: 'normal',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Normal',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 3,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n normal: number[],\n ) => {\n return normal;\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'size',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Size',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 1,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size = 10 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Uv',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 2,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size } = feature;\n return [vertex[3], vertex[4]];\n },\n },\n });\n }\n}\n"],"file":"build.js"}
|
package/es/core/BaseLayer.d.ts
CHANGED
|
@@ -181,7 +181,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|
|
181
181
|
y: number;
|
|
182
182
|
}): void;
|
|
183
183
|
boxSelect(box: [number, number, number, number], cb: (...args: any[]) => void): void;
|
|
184
|
-
buildLayerModel(options: ILayerModelInitializationOptions & Partial<IModelInitializationOptions>): IModel
|
|
184
|
+
buildLayerModel(options: ILayerModelInitializationOptions & Partial<IModelInitializationOptions>): Promise<IModel>;
|
|
185
185
|
createAttrubutes(options: ILayerModelInitializationOptions & Partial<IModelInitializationOptions>): any;
|
|
186
186
|
getTime(): number;
|
|
187
187
|
setAnimateStartTime(): void;
|
package/es/core/BaseLayer.js
CHANGED
|
@@ -14,7 +14,7 @@ import _isUndefined from "lodash/isUndefined";
|
|
|
14
14
|
import _isObject from "lodash/isObject";
|
|
15
15
|
import _isFunction from "lodash/isFunction";
|
|
16
16
|
var _excluded = ["passes"],
|
|
17
|
-
_excluded2 = ["moduleName", "vertexShader", "fragmentShader", "triangulation", "segmentNumber"];
|
|
17
|
+
_excluded2 = ["moduleName", "vertexShader", "fragmentShader", "triangulation", "segmentNumber", "workerEnabled", "workerOptions"];
|
|
18
18
|
|
|
19
19
|
var _dec, _class, _descriptor;
|
|
20
20
|
|
|
@@ -37,7 +37,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
37
37
|
import { SyncBailHook, SyncHook, SyncWaterfallHook } from '@antv/async-hook';
|
|
38
38
|
import { BlendType, lazyInject, TYPES } from '@antv/l7-core';
|
|
39
39
|
import Source from '@antv/l7-source';
|
|
40
|
-
import { encodePickingColor } from '@antv/l7-utils';
|
|
40
|
+
import { encodePickingColor, WorkerSourceMap } from '@antv/l7-utils';
|
|
41
41
|
import { EventEmitter } from 'eventemitter3';
|
|
42
42
|
import { BlendTypes } from '../utils/blend';
|
|
43
43
|
import { handleStyleDataMapping } from '../utils/dataMappingStyle';
|
|
@@ -198,12 +198,10 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
198
198
|
_defineProperty(_assertThisInitialized(_this), "sourceEvent", function () {
|
|
199
199
|
_this.dataState.dataSourceNeedUpdate = true;
|
|
200
200
|
|
|
201
|
-
var
|
|
202
|
-
autoFit = _this$getLayerConfig.autoFit,
|
|
203
|
-
fitBoundsOptions = _this$getLayerConfig.fitBoundsOptions;
|
|
201
|
+
var layerConfig = _this.getLayerConfig();
|
|
204
202
|
|
|
205
|
-
if (autoFit) {
|
|
206
|
-
_this.fitBounds(fitBoundsOptions);
|
|
203
|
+
if (layerConfig && layerConfig.autoFit) {
|
|
204
|
+
_this.fitBounds(layerConfig.fitBoundsOptions);
|
|
207
205
|
}
|
|
208
206
|
|
|
209
207
|
_this.reRender();
|
|
@@ -304,9 +302,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
304
302
|
this.pickingService = this.container.get(TYPES.IPickingService);
|
|
305
303
|
this.mapService = this.container.get(TYPES.IMapService);
|
|
306
304
|
|
|
307
|
-
var _this$
|
|
308
|
-
enableMultiPassRenderer = _this$
|
|
309
|
-
passes = _this$
|
|
305
|
+
var _this$getLayerConfig = this.getLayerConfig(),
|
|
306
|
+
enableMultiPassRenderer = _this$getLayerConfig.enableMultiPassRenderer,
|
|
307
|
+
passes = _this$getLayerConfig.passes;
|
|
310
308
|
|
|
311
309
|
if (enableMultiPassRenderer && passes !== null && passes !== void 0 && passes.length && passes.length > 0) {
|
|
312
310
|
this.mapService.on('mapAfterFrameChange', function () {
|
|
@@ -383,7 +381,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
383
381
|
}, {
|
|
384
382
|
key: "createModelData",
|
|
385
383
|
value: function createModelData(data, option) {
|
|
386
|
-
|
|
384
|
+
var _this$layerModel;
|
|
385
|
+
|
|
386
|
+
if ((_this$layerModel = this.layerModel) !== null && _this$layerModel !== void 0 && _this$layerModel.createModelData) {
|
|
387
387
|
return this.layerModel.createModelData(option);
|
|
388
388
|
}
|
|
389
389
|
|
|
@@ -415,8 +415,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
415
415
|
this.inited = true;
|
|
416
416
|
this.updateLayerConfig(_objectSpread(_objectSpread({}, this.getDefaultConfig()), this.rawConfig));
|
|
417
417
|
|
|
418
|
-
var _this$
|
|
419
|
-
animateOption = _this$
|
|
418
|
+
var _this$getLayerConfig2 = this.getLayerConfig(),
|
|
419
|
+
animateOption = _this$getLayerConfig2.animateOption;
|
|
420
420
|
|
|
421
421
|
if (animateOption !== null && animateOption !== void 0 && animateOption.enable) {
|
|
422
422
|
this.layerService.startAnimate();
|
|
@@ -567,7 +567,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
567
567
|
|
|
568
568
|
if (lastConfig && lastConfig.mask === true && options.mask === false) {
|
|
569
569
|
this.clearModels();
|
|
570
|
-
this.
|
|
570
|
+
this.layerModel.buildModels(function (models) {
|
|
571
|
+
_this5.models = models;
|
|
572
|
+
});
|
|
571
573
|
}
|
|
572
574
|
|
|
573
575
|
return this;
|
|
@@ -598,7 +600,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
598
600
|
return this;
|
|
599
601
|
}
|
|
600
602
|
|
|
601
|
-
if (this.getEncodedData().length !== 0) {
|
|
603
|
+
if (this.getEncodedData() && this.getEncodedData().length !== 0) {
|
|
602
604
|
this.renderModels();
|
|
603
605
|
}
|
|
604
606
|
|
|
@@ -612,7 +614,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
612
614
|
while (1) {
|
|
613
615
|
switch (_context.prev = _context.next) {
|
|
614
616
|
case 0:
|
|
615
|
-
if (!(this.getEncodedData().length !== 0)) {
|
|
617
|
+
if (!(this.getEncodedData() && this.getEncodedData().length !== 0)) {
|
|
616
618
|
_context.next = 7;
|
|
617
619
|
break;
|
|
618
620
|
}
|
|
@@ -823,12 +825,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
823
825
|
value: function isVisible() {
|
|
824
826
|
var zoom = this.mapService.getZoom();
|
|
825
827
|
|
|
826
|
-
var _this$
|
|
827
|
-
visible = _this$
|
|
828
|
-
_this$
|
|
829
|
-
minZoom = _this$
|
|
830
|
-
_this$
|
|
831
|
-
maxZoom = _this$
|
|
828
|
+
var _this$getLayerConfig3 = this.getLayerConfig(),
|
|
829
|
+
visible = _this$getLayerConfig3.visible,
|
|
830
|
+
_this$getLayerConfig4 = _this$getLayerConfig3.minZoom,
|
|
831
|
+
minZoom = _this$getLayerConfig4 === void 0 ? -Infinity : _this$getLayerConfig4,
|
|
832
|
+
_this$getLayerConfig5 = _this$getLayerConfig3.maxZoom,
|
|
833
|
+
maxZoom = _this$getLayerConfig5 === void 0 ? Infinity : _this$getLayerConfig5;
|
|
832
834
|
|
|
833
835
|
return !!visible && zoom >= minZoom && zoom <= maxZoom;
|
|
834
836
|
}
|
|
@@ -846,9 +848,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
846
848
|
}
|
|
847
849
|
|
|
848
850
|
if (enableMultiPass) {
|
|
849
|
-
var _this$
|
|
850
|
-
_this$
|
|
851
|
-
passes = _this$
|
|
851
|
+
var _this$getLayerConfig6 = this.getLayerConfig(),
|
|
852
|
+
_this$getLayerConfig7 = _this$getLayerConfig6.passes,
|
|
853
|
+
passes = _this$getLayerConfig7 === void 0 ? [] : _this$getLayerConfig7;
|
|
852
854
|
|
|
853
855
|
this.multiPassRenderer = createMultiPassRenderer(this, passes, this.postProcessingPassFactory, this.normalPassFactory);
|
|
854
856
|
this.multiPassRenderer.setRenderFlag(true);
|
|
@@ -873,16 +875,16 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
873
875
|
}, {
|
|
874
876
|
key: "getMinZoom",
|
|
875
877
|
value: function getMinZoom() {
|
|
876
|
-
var _this$
|
|
877
|
-
minZoom = _this$
|
|
878
|
+
var _this$getLayerConfig8 = this.getLayerConfig(),
|
|
879
|
+
minZoom = _this$getLayerConfig8.minZoom;
|
|
878
880
|
|
|
879
881
|
return minZoom;
|
|
880
882
|
}
|
|
881
883
|
}, {
|
|
882
884
|
key: "getMaxZoom",
|
|
883
885
|
value: function getMaxZoom() {
|
|
884
|
-
var _this$
|
|
885
|
-
maxZoom = _this$
|
|
886
|
+
var _this$getLayerConfig9 = this.getLayerConfig(),
|
|
887
|
+
maxZoom = _this$getLayerConfig9.maxZoom;
|
|
886
888
|
|
|
887
889
|
return maxZoom;
|
|
888
890
|
}
|
|
@@ -934,7 +936,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
934
936
|
}, {
|
|
935
937
|
key: "destroy",
|
|
936
938
|
value: function destroy() {
|
|
937
|
-
var _this$
|
|
939
|
+
var _this$layerModel2;
|
|
938
940
|
|
|
939
941
|
var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
940
942
|
|
|
@@ -951,11 +953,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
951
953
|
});
|
|
952
954
|
this.masks = [];
|
|
953
955
|
this.hooks.beforeDestroy.call();
|
|
954
|
-
this.layerSource.off('
|
|
956
|
+
this.layerSource.off('sourceUpdate', this.sourceEvent);
|
|
955
957
|
this.multiPassRenderer.destroy();
|
|
956
958
|
this.styleAttributeService.clearAllAttributes();
|
|
957
959
|
this.hooks.afterDestroy.call();
|
|
958
|
-
(_this$
|
|
960
|
+
(_this$layerModel2 = this.layerModel) === null || _this$layerModel2 === void 0 ? void 0 : _this$layerModel2.clearModels();
|
|
959
961
|
this.models = [];
|
|
960
962
|
this.layerService.cleanRemove(this, refresh);
|
|
961
963
|
this.emit('remove', {
|
|
@@ -977,10 +979,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
977
979
|
}, {
|
|
978
980
|
key: "clearModels",
|
|
979
981
|
value: function clearModels() {
|
|
982
|
+
var _this$layerModel3;
|
|
983
|
+
|
|
980
984
|
this.models.forEach(function (model) {
|
|
981
985
|
return model.destroy();
|
|
982
986
|
});
|
|
983
|
-
this.layerModel.clearModels();
|
|
987
|
+
(_this$layerModel3 = this.layerModel) === null || _this$layerModel3 === void 0 ? void 0 : _this$layerModel3.clearModels();
|
|
984
988
|
this.models = [];
|
|
985
989
|
}
|
|
986
990
|
}, {
|
|
@@ -993,8 +997,10 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
993
997
|
}, {
|
|
994
998
|
key: "setSource",
|
|
995
999
|
value: function setSource(source) {
|
|
1000
|
+
var _this8 = this;
|
|
1001
|
+
|
|
996
1002
|
if (this.layerSource) {
|
|
997
|
-
this.layerSource.off('
|
|
1003
|
+
this.layerSource.off('sourceUpdate', this.sourceEvent);
|
|
998
1004
|
}
|
|
999
1005
|
|
|
1000
1006
|
this.layerSource = source;
|
|
@@ -1005,7 +1011,13 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
1005
1011
|
this.layerSource.updateClusterData(zoom);
|
|
1006
1012
|
}
|
|
1007
1013
|
|
|
1008
|
-
this.layerSource.
|
|
1014
|
+
if (this.layerSource.inited) {
|
|
1015
|
+
this.sourceEvent();
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
this.layerSource.on('sourceUpdate', function () {
|
|
1019
|
+
_this8.sourceEvent();
|
|
1020
|
+
});
|
|
1009
1021
|
}
|
|
1010
1022
|
}, {
|
|
1011
1023
|
key: "getSource",
|
|
@@ -1088,11 +1100,16 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
1088
1100
|
}, {
|
|
1089
1101
|
key: "buildLayerModel",
|
|
1090
1102
|
value: function buildLayerModel(options) {
|
|
1103
|
+
var _this9 = this;
|
|
1104
|
+
|
|
1091
1105
|
var moduleName = options.moduleName,
|
|
1092
1106
|
vertexShader = options.vertexShader,
|
|
1093
1107
|
fragmentShader = options.fragmentShader,
|
|
1094
1108
|
triangulation = options.triangulation,
|
|
1095
1109
|
segmentNumber = options.segmentNumber,
|
|
1110
|
+
_options$workerEnable = options.workerEnabled,
|
|
1111
|
+
workerEnabled = _options$workerEnable === void 0 ? false : _options$workerEnable,
|
|
1112
|
+
workerOptions = options.workerOptions,
|
|
1096
1113
|
rest = _objectWithoutProperties(options, _excluded2);
|
|
1097
1114
|
|
|
1098
1115
|
this.shaderModuleService.registerModule(moduleName, {
|
|
@@ -1106,27 +1123,47 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
1106
1123
|
uniforms = _this$shaderModuleSer.uniforms;
|
|
1107
1124
|
|
|
1108
1125
|
var createModel = this.rendererService.createModel;
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1126
|
+
return new Promise(function (resolve, reject) {
|
|
1127
|
+
if (workerOptions && workerOptions.modelType in WorkerSourceMap && workerEnabled) {
|
|
1128
|
+
_this9.styleAttributeService.createAttributesAndIndicesAscy(_this9.encodedData, segmentNumber, workerOptions).then(function (_ref6) {
|
|
1129
|
+
var attributes = _ref6.attributes,
|
|
1130
|
+
elements = _ref6.elements;
|
|
1131
|
+
var m = createModel(_objectSpread({
|
|
1132
|
+
attributes: attributes,
|
|
1133
|
+
uniforms: uniforms,
|
|
1134
|
+
fs: fs,
|
|
1135
|
+
vs: vs,
|
|
1136
|
+
elements: elements,
|
|
1137
|
+
blend: BlendTypes[BlendType.normal]
|
|
1138
|
+
}, rest));
|
|
1139
|
+
resolve(m);
|
|
1140
|
+
}).catch(function (err) {
|
|
1141
|
+
return reject(err);
|
|
1142
|
+
});
|
|
1143
|
+
} else {
|
|
1144
|
+
var _this9$styleAttribute = _this9.styleAttributeService.createAttributesAndIndices(_this9.encodedData, triangulation, segmentNumber),
|
|
1145
|
+
attributes = _this9$styleAttribute.attributes,
|
|
1146
|
+
elements = _this9$styleAttribute.elements;
|
|
1147
|
+
|
|
1148
|
+
var m = createModel(_objectSpread({
|
|
1149
|
+
attributes: attributes,
|
|
1150
|
+
uniforms: uniforms,
|
|
1151
|
+
fs: fs,
|
|
1152
|
+
vs: vs,
|
|
1153
|
+
elements: elements,
|
|
1154
|
+
blend: BlendTypes[BlendType.normal]
|
|
1155
|
+
}, rest));
|
|
1156
|
+
resolve(m);
|
|
1157
|
+
}
|
|
1158
|
+
});
|
|
1122
1159
|
}
|
|
1123
1160
|
}, {
|
|
1124
1161
|
key: "createAttrubutes",
|
|
1125
1162
|
value: function createAttrubutes(options) {
|
|
1126
1163
|
var triangulation = options.triangulation;
|
|
1127
1164
|
|
|
1128
|
-
var _this$
|
|
1129
|
-
attributes = _this$
|
|
1165
|
+
var _this$styleAttributeS4 = this.styleAttributeService.createAttributes(this.encodedData, triangulation),
|
|
1166
|
+
attributes = _this$styleAttributeS4.attributes;
|
|
1130
1167
|
|
|
1131
1168
|
return attributes;
|
|
1132
1169
|
}
|
|
@@ -1161,11 +1198,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
1161
1198
|
}, {
|
|
1162
1199
|
key: "needPick",
|
|
1163
1200
|
value: function needPick(type) {
|
|
1164
|
-
var _this$
|
|
1165
|
-
_this$
|
|
1166
|
-
enableHighlight = _this$
|
|
1167
|
-
_this$
|
|
1168
|
-
enableSelect = _this$
|
|
1201
|
+
var _this$getLayerConfig10 = this.getLayerConfig(),
|
|
1202
|
+
_this$getLayerConfig11 = _this$getLayerConfig10.enableHighlight,
|
|
1203
|
+
enableHighlight = _this$getLayerConfig11 === void 0 ? true : _this$getLayerConfig11,
|
|
1204
|
+
_this$getLayerConfig12 = _this$getLayerConfig10.enableSelect,
|
|
1205
|
+
enableSelect = _this$getLayerConfig12 === void 0 ? true : _this$getLayerConfig12;
|
|
1169
1206
|
|
|
1170
1207
|
var isPick = this.eventNames().indexOf(type) !== -1 || this.eventNames().indexOf('un' + type) !== -1;
|
|
1171
1208
|
|
|
@@ -1217,22 +1254,28 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
1217
1254
|
}, {
|
|
1218
1255
|
key: "renderModels",
|
|
1219
1256
|
value: function renderModels(isPicking) {
|
|
1220
|
-
var
|
|
1257
|
+
var _this10 = this;
|
|
1258
|
+
|
|
1259
|
+
if (this.getEncodedData() && this.getEncodedData().length > 0) {
|
|
1260
|
+
var _this$layerModel4;
|
|
1221
1261
|
|
|
1222
|
-
if (this.getEncodedData().length > 0) {
|
|
1223
1262
|
if (this.layerModelNeedUpdate && this.layerModel) {
|
|
1224
|
-
this.
|
|
1225
|
-
|
|
1226
|
-
|
|
1263
|
+
this.layerModel.buildModels(function (models) {
|
|
1264
|
+
_this10.models = models;
|
|
1265
|
+
|
|
1266
|
+
_this10.hooks.beforeRender.call();
|
|
1267
|
+
|
|
1268
|
+
_this10.layerModelNeedUpdate = false;
|
|
1269
|
+
});
|
|
1227
1270
|
}
|
|
1228
1271
|
|
|
1229
|
-
if (this.layerModel.renderUpdate) {
|
|
1272
|
+
if (this !== null && this !== void 0 && (_this$layerModel4 = this.layerModel) !== null && _this$layerModel4 !== void 0 && _this$layerModel4.renderUpdate) {
|
|
1230
1273
|
this.layerModel.renderUpdate();
|
|
1231
1274
|
}
|
|
1232
1275
|
|
|
1233
1276
|
this.models.forEach(function (model) {
|
|
1234
1277
|
model.draw({
|
|
1235
|
-
uniforms:
|
|
1278
|
+
uniforms: _this10.layerModel.getUninforms()
|
|
1236
1279
|
}, isPicking);
|
|
1237
1280
|
});
|
|
1238
1281
|
}
|