@antv/l7-layers 2.9.14 → 2.9.17-alpha.0
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 +97 -58
- 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.js +1 -2
- 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/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 +14 -9
- 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 +11 -6
- 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 +27 -15
- 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 +33 -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 +15 -8
- 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 +108 -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 +4 -1
- 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/wind/index.js +12 -2
- package/es/wind/index.js.map +1 -1
- package/es/wind/models/wind.d.ts +2 -2
- package/es/wind/models/wind.js +14 -7
- package/es/wind/models/wind.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 +96 -57
- 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 +4 -6
- 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/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 +14 -9
- 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 +11 -6
- 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 +28 -17
- 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 +33 -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 +15 -8
- 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 +110 -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 +4 -1
- 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/wind/index.js +12 -2
- package/lib/wind/index.js.map +1 -1
- package/lib/wind/models/wind.js +14 -7
- package/lib/wind/models/wind.js.map +1 -1
- package/package.json +10 -9
- 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,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,KAA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JM,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,cAA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AAD,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 () {
|
|
@@ -415,8 +413,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
415
413
|
this.inited = true;
|
|
416
414
|
this.updateLayerConfig(_objectSpread(_objectSpread({}, this.getDefaultConfig()), this.rawConfig));
|
|
417
415
|
|
|
418
|
-
var _this$
|
|
419
|
-
animateOption = _this$
|
|
416
|
+
var _this$getLayerConfig2 = this.getLayerConfig(),
|
|
417
|
+
animateOption = _this$getLayerConfig2.animateOption;
|
|
420
418
|
|
|
421
419
|
if (animateOption !== null && animateOption !== void 0 && animateOption.enable) {
|
|
422
420
|
this.layerService.startAnimate();
|
|
@@ -567,7 +565,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
567
565
|
|
|
568
566
|
if (lastConfig && lastConfig.mask === true && options.mask === false) {
|
|
569
567
|
this.clearModels();
|
|
570
|
-
this.
|
|
568
|
+
this.layerModel.buildModels(function (models) {
|
|
569
|
+
_this5.models = models;
|
|
570
|
+
});
|
|
571
571
|
}
|
|
572
572
|
|
|
573
573
|
return this;
|
|
@@ -598,7 +598,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
598
598
|
return this;
|
|
599
599
|
}
|
|
600
600
|
|
|
601
|
-
if (this.getEncodedData().length !== 0) {
|
|
601
|
+
if (this.getEncodedData() && this.getEncodedData().length !== 0) {
|
|
602
602
|
this.renderModels();
|
|
603
603
|
}
|
|
604
604
|
|
|
@@ -612,7 +612,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
612
612
|
while (1) {
|
|
613
613
|
switch (_context.prev = _context.next) {
|
|
614
614
|
case 0:
|
|
615
|
-
if (!(this.getEncodedData().length !== 0)) {
|
|
615
|
+
if (!(this.getEncodedData() && this.getEncodedData().length !== 0)) {
|
|
616
616
|
_context.next = 7;
|
|
617
617
|
break;
|
|
618
618
|
}
|
|
@@ -823,12 +823,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
823
823
|
value: function isVisible() {
|
|
824
824
|
var zoom = this.mapService.getZoom();
|
|
825
825
|
|
|
826
|
-
var _this$
|
|
827
|
-
visible = _this$
|
|
828
|
-
_this$
|
|
829
|
-
minZoom = _this$
|
|
830
|
-
_this$
|
|
831
|
-
maxZoom = _this$
|
|
826
|
+
var _this$getLayerConfig3 = this.getLayerConfig(),
|
|
827
|
+
visible = _this$getLayerConfig3.visible,
|
|
828
|
+
_this$getLayerConfig4 = _this$getLayerConfig3.minZoom,
|
|
829
|
+
minZoom = _this$getLayerConfig4 === void 0 ? -Infinity : _this$getLayerConfig4,
|
|
830
|
+
_this$getLayerConfig5 = _this$getLayerConfig3.maxZoom,
|
|
831
|
+
maxZoom = _this$getLayerConfig5 === void 0 ? Infinity : _this$getLayerConfig5;
|
|
832
832
|
|
|
833
833
|
return !!visible && zoom >= minZoom && zoom <= maxZoom;
|
|
834
834
|
}
|
|
@@ -846,9 +846,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
846
846
|
}
|
|
847
847
|
|
|
848
848
|
if (enableMultiPass) {
|
|
849
|
-
var _this$
|
|
850
|
-
_this$
|
|
851
|
-
passes = _this$
|
|
849
|
+
var _this$getLayerConfig6 = this.getLayerConfig(),
|
|
850
|
+
_this$getLayerConfig7 = _this$getLayerConfig6.passes,
|
|
851
|
+
passes = _this$getLayerConfig7 === void 0 ? [] : _this$getLayerConfig7;
|
|
852
852
|
|
|
853
853
|
this.multiPassRenderer = createMultiPassRenderer(this, passes, this.postProcessingPassFactory, this.normalPassFactory);
|
|
854
854
|
this.multiPassRenderer.setRenderFlag(true);
|
|
@@ -873,16 +873,16 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
873
873
|
}, {
|
|
874
874
|
key: "getMinZoom",
|
|
875
875
|
value: function getMinZoom() {
|
|
876
|
-
var _this$
|
|
877
|
-
minZoom = _this$
|
|
876
|
+
var _this$getLayerConfig8 = this.getLayerConfig(),
|
|
877
|
+
minZoom = _this$getLayerConfig8.minZoom;
|
|
878
878
|
|
|
879
879
|
return minZoom;
|
|
880
880
|
}
|
|
881
881
|
}, {
|
|
882
882
|
key: "getMaxZoom",
|
|
883
883
|
value: function getMaxZoom() {
|
|
884
|
-
var _this$
|
|
885
|
-
maxZoom = _this$
|
|
884
|
+
var _this$getLayerConfig9 = this.getLayerConfig(),
|
|
885
|
+
maxZoom = _this$getLayerConfig9.maxZoom;
|
|
886
886
|
|
|
887
887
|
return maxZoom;
|
|
888
888
|
}
|
|
@@ -951,7 +951,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
951
951
|
});
|
|
952
952
|
this.masks = [];
|
|
953
953
|
this.hooks.beforeDestroy.call();
|
|
954
|
-
this.layerSource.off('
|
|
954
|
+
this.layerSource.off('sourceUpdate', this.sourceEvent);
|
|
955
955
|
this.multiPassRenderer.destroy();
|
|
956
956
|
this.styleAttributeService.clearAllAttributes();
|
|
957
957
|
this.hooks.afterDestroy.call();
|
|
@@ -977,10 +977,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
977
977
|
}, {
|
|
978
978
|
key: "clearModels",
|
|
979
979
|
value: function clearModels() {
|
|
980
|
+
var _this$layerModel2;
|
|
981
|
+
|
|
980
982
|
this.models.forEach(function (model) {
|
|
981
983
|
return model.destroy();
|
|
982
984
|
});
|
|
983
|
-
this.layerModel.clearModels();
|
|
985
|
+
(_this$layerModel2 = this.layerModel) === null || _this$layerModel2 === void 0 ? void 0 : _this$layerModel2.clearModels();
|
|
984
986
|
this.models = [];
|
|
985
987
|
}
|
|
986
988
|
}, {
|
|
@@ -993,8 +995,10 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
993
995
|
}, {
|
|
994
996
|
key: "setSource",
|
|
995
997
|
value: function setSource(source) {
|
|
998
|
+
var _this8 = this;
|
|
999
|
+
|
|
996
1000
|
if (this.layerSource) {
|
|
997
|
-
this.layerSource.off('
|
|
1001
|
+
this.layerSource.off('sourceUpdate', this.sourceEvent);
|
|
998
1002
|
}
|
|
999
1003
|
|
|
1000
1004
|
this.layerSource = source;
|
|
@@ -1005,7 +1009,13 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
1005
1009
|
this.layerSource.updateClusterData(zoom);
|
|
1006
1010
|
}
|
|
1007
1011
|
|
|
1008
|
-
this.layerSource.
|
|
1012
|
+
if (this.layerSource.inited) {
|
|
1013
|
+
this.sourceEvent();
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
this.layerSource.on('sourceUpdate', function () {
|
|
1017
|
+
_this8.sourceEvent();
|
|
1018
|
+
});
|
|
1009
1019
|
}
|
|
1010
1020
|
}, {
|
|
1011
1021
|
key: "getSource",
|
|
@@ -1088,11 +1098,16 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
1088
1098
|
}, {
|
|
1089
1099
|
key: "buildLayerModel",
|
|
1090
1100
|
value: function buildLayerModel(options) {
|
|
1101
|
+
var _this9 = this;
|
|
1102
|
+
|
|
1091
1103
|
var moduleName = options.moduleName,
|
|
1092
1104
|
vertexShader = options.vertexShader,
|
|
1093
1105
|
fragmentShader = options.fragmentShader,
|
|
1094
1106
|
triangulation = options.triangulation,
|
|
1095
1107
|
segmentNumber = options.segmentNumber,
|
|
1108
|
+
_options$workerEnable = options.workerEnabled,
|
|
1109
|
+
workerEnabled = _options$workerEnable === void 0 ? false : _options$workerEnable,
|
|
1110
|
+
workerOptions = options.workerOptions,
|
|
1096
1111
|
rest = _objectWithoutProperties(options, _excluded2);
|
|
1097
1112
|
|
|
1098
1113
|
this.shaderModuleService.registerModule(moduleName, {
|
|
@@ -1106,27 +1121,47 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
1106
1121
|
uniforms = _this$shaderModuleSer.uniforms;
|
|
1107
1122
|
|
|
1108
1123
|
var createModel = this.rendererService.createModel;
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1124
|
+
return new Promise(function (resolve, reject) {
|
|
1125
|
+
if (workerOptions && workerOptions.modelType in WorkerSourceMap && workerEnabled) {
|
|
1126
|
+
_this9.styleAttributeService.createAttributesAndIndicesAscy(_this9.encodedData, segmentNumber, workerOptions).then(function (_ref6) {
|
|
1127
|
+
var attributes = _ref6.attributes,
|
|
1128
|
+
elements = _ref6.elements;
|
|
1129
|
+
var m = createModel(_objectSpread({
|
|
1130
|
+
attributes: attributes,
|
|
1131
|
+
uniforms: uniforms,
|
|
1132
|
+
fs: fs,
|
|
1133
|
+
vs: vs,
|
|
1134
|
+
elements: elements,
|
|
1135
|
+
blend: BlendTypes[BlendType.normal]
|
|
1136
|
+
}, rest));
|
|
1137
|
+
resolve(m);
|
|
1138
|
+
}).catch(function (err) {
|
|
1139
|
+
return reject(err);
|
|
1140
|
+
});
|
|
1141
|
+
} else {
|
|
1142
|
+
var _this9$styleAttribute = _this9.styleAttributeService.createAttributesAndIndices(_this9.encodedData, triangulation, segmentNumber),
|
|
1143
|
+
attributes = _this9$styleAttribute.attributes,
|
|
1144
|
+
elements = _this9$styleAttribute.elements;
|
|
1145
|
+
|
|
1146
|
+
var m = createModel(_objectSpread({
|
|
1147
|
+
attributes: attributes,
|
|
1148
|
+
uniforms: uniforms,
|
|
1149
|
+
fs: fs,
|
|
1150
|
+
vs: vs,
|
|
1151
|
+
elements: elements,
|
|
1152
|
+
blend: BlendTypes[BlendType.normal]
|
|
1153
|
+
}, rest));
|
|
1154
|
+
resolve(m);
|
|
1155
|
+
}
|
|
1156
|
+
});
|
|
1122
1157
|
}
|
|
1123
1158
|
}, {
|
|
1124
1159
|
key: "createAttrubutes",
|
|
1125
1160
|
value: function createAttrubutes(options) {
|
|
1126
1161
|
var triangulation = options.triangulation;
|
|
1127
1162
|
|
|
1128
|
-
var _this$
|
|
1129
|
-
attributes = _this$
|
|
1163
|
+
var _this$styleAttributeS4 = this.styleAttributeService.createAttributes(this.encodedData, triangulation),
|
|
1164
|
+
attributes = _this$styleAttributeS4.attributes;
|
|
1130
1165
|
|
|
1131
1166
|
return attributes;
|
|
1132
1167
|
}
|
|
@@ -1161,11 +1196,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
1161
1196
|
}, {
|
|
1162
1197
|
key: "needPick",
|
|
1163
1198
|
value: function needPick(type) {
|
|
1164
|
-
var _this$
|
|
1165
|
-
_this$
|
|
1166
|
-
enableHighlight = _this$
|
|
1167
|
-
_this$
|
|
1168
|
-
enableSelect = _this$
|
|
1199
|
+
var _this$getLayerConfig10 = this.getLayerConfig(),
|
|
1200
|
+
_this$getLayerConfig11 = _this$getLayerConfig10.enableHighlight,
|
|
1201
|
+
enableHighlight = _this$getLayerConfig11 === void 0 ? true : _this$getLayerConfig11,
|
|
1202
|
+
_this$getLayerConfig12 = _this$getLayerConfig10.enableSelect,
|
|
1203
|
+
enableSelect = _this$getLayerConfig12 === void 0 ? true : _this$getLayerConfig12;
|
|
1169
1204
|
|
|
1170
1205
|
var isPick = this.eventNames().indexOf(type) !== -1 || this.eventNames().indexOf('un' + type) !== -1;
|
|
1171
1206
|
|
|
@@ -1217,13 +1252,17 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
1217
1252
|
}, {
|
|
1218
1253
|
key: "renderModels",
|
|
1219
1254
|
value: function renderModels(isPicking) {
|
|
1220
|
-
var
|
|
1255
|
+
var _this10 = this;
|
|
1221
1256
|
|
|
1222
|
-
if (this.getEncodedData().length > 0) {
|
|
1257
|
+
if (this.getEncodedData() && this.getEncodedData().length > 0) {
|
|
1223
1258
|
if (this.layerModelNeedUpdate && this.layerModel) {
|
|
1224
|
-
this.
|
|
1225
|
-
|
|
1226
|
-
|
|
1259
|
+
this.layerModel.buildModels(function (models) {
|
|
1260
|
+
_this10.models = models;
|
|
1261
|
+
|
|
1262
|
+
_this10.hooks.beforeRender.call();
|
|
1263
|
+
|
|
1264
|
+
_this10.layerModelNeedUpdate = false;
|
|
1265
|
+
});
|
|
1227
1266
|
}
|
|
1228
1267
|
|
|
1229
1268
|
if (this.layerModel.renderUpdate) {
|
|
@@ -1232,7 +1271,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
1232
1271
|
|
|
1233
1272
|
this.models.forEach(function (model) {
|
|
1234
1273
|
model.draw({
|
|
1235
|
-
uniforms:
|
|
1274
|
+
uniforms: _this10.layerModel.getUninforms()
|
|
1236
1275
|
}, isPicking);
|
|
1237
1276
|
});
|
|
1238
1277
|
}
|