@antv/l7-layers 2.10.5 → 2.10.7
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.d.ts +2 -3
- package/es/Geometry/index.js +27 -17
- package/es/Geometry/models/billboard.d.ts +2 -2
- package/es/Geometry/models/billboard.js +77 -37
- package/es/Geometry/models/plane.d.ts +2 -2
- package/es/Geometry/models/plane.js +80 -40
- package/es/Geometry/models/sprite.d.ts +2 -2
- package/es/Geometry/models/sprite.js +83 -45
- package/es/canvas/index.d.ts +2 -3
- package/es/canvas/index.js +29 -19
- package/es/canvas/models/canvas.d.ts +2 -2
- package/es/canvas/models/canvas.js +54 -15
- package/es/citybuliding/building.d.ts +2 -3
- package/es/citybuliding/building.js +26 -17
- package/es/citybuliding/models/build.d.ts +2 -2
- package/es/citybuliding/models/build.js +70 -25
- package/es/core/BaseLayer.d.ts +22 -18
- package/es/core/BaseLayer.js +387 -266
- package/es/core/BaseModel.d.ts +2 -2
- package/es/core/BaseModel.js +47 -6
- package/es/core/LayerPickService.d.ts +12 -0
- package/es/core/LayerPickService.js +165 -0
- package/es/core/TextureService.d.ts +14 -0
- package/es/core/TextureService.js +67 -0
- package/es/core/triangulation.js +8 -1
- package/es/earth/index.d.ts +2 -2
- package/es/earth/index.js +28 -9
- package/es/earth/models/atmosphere.d.ts +2 -2
- package/es/earth/models/atmosphere.js +67 -22
- package/es/earth/models/base.d.ts +2 -2
- package/es/earth/models/base.js +89 -43
- package/es/earth/models/bloomsphere.d.ts +2 -2
- package/es/earth/models/bloomsphere.js +67 -22
- package/es/heatmap/index.d.ts +2 -3
- package/es/heatmap/index.js +33 -24
- package/es/heatmap/models/grid.d.ts +2 -2
- package/es/heatmap/models/grid.js +68 -27
- package/es/heatmap/models/grid3d.d.ts +2 -2
- package/es/heatmap/models/grid3d.js +70 -29
- package/es/heatmap/models/heatmap.d.ts +2 -2
- package/es/heatmap/models/heatmap.js +40 -14
- package/es/heatmap/models/hexagon.d.ts +2 -2
- package/es/heatmap/models/hexagon.js +69 -28
- package/es/heatmap/shaders/hexagon_3d_vert.glsl +2 -13
- package/es/image/index.d.ts +3 -4
- package/es/image/index.js +29 -34
- package/es/image/models/image.d.ts +2 -2
- package/es/image/models/image.js +117 -67
- package/es/image/models/index.d.ts +1 -1
- package/es/image/models/index.js +1 -5
- package/es/image/shaders/dataImage_frag.glsl +10 -16
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/line/index.d.ts +5 -4
- package/es/line/index.js +51 -25
- package/es/line/models/arc.d.ts +2 -2
- package/es/line/models/arc.js +73 -38
- package/es/line/models/arc_3d.d.ts +2 -2
- package/es/line/models/arc_3d.js +69 -34
- package/es/line/models/earthArc_3d.d.ts +2 -2
- package/es/line/models/earthArc_3d.js +72 -37
- package/es/line/models/great_circle.d.ts +2 -2
- package/es/line/models/great_circle.js +70 -29
- package/es/line/models/half.d.ts +2 -2
- package/es/line/models/half.js +40 -17
- package/es/line/models/index.d.ts +1 -1
- package/es/line/models/index.js +0 -2
- package/es/line/models/line.d.ts +2 -2
- package/es/line/models/line.js +79 -47
- package/es/line/models/linearline.d.ts +2 -2
- package/es/line/models/linearline.js +70 -31
- package/es/line/models/simpleLine.d.ts +2 -2
- package/es/line/models/simpleLine.js +71 -34
- package/es/line/models/simpleTileLine.d.ts +2 -2
- package/es/line/models/simpleTileLine.js +70 -30
- package/es/line/models/tile.d.ts +2 -2
- package/es/line/models/tile.js +40 -17
- package/es/line/models/wall.d.ts +2 -2
- package/es/line/models/wall.js +67 -22
- package/es/mask/index.d.ts +2 -4
- package/es/mask/index.js +27 -97
- package/es/mask/models/fill.d.ts +2 -2
- package/es/mask/models/fill.js +40 -16
- package/es/mask/models/index.d.ts +1 -1
- package/es/mask/models/index.js +1 -3
- package/es/plugins/DataMappingPlugin.d.ts +0 -2
- package/es/plugins/DataMappingPlugin.js +90 -152
- package/es/plugins/DataSourcePlugin.js +67 -30
- package/es/plugins/FeatureScalePlugin.d.ts +0 -1
- package/es/plugins/FeatureScalePlugin.js +85 -61
- package/es/plugins/LayerModelPlugin.d.ts +2 -2
- package/es/plugins/LayerModelPlugin.js +121 -37
- package/es/plugins/LayerStylePlugin.js +1 -6
- package/es/plugins/MultiPassRendererPlugin.js +1 -1
- package/es/plugins/PixelPickingPlugin.js +1 -1
- package/es/plugins/RegisterStyleAttributePlugin.js +1 -16
- package/es/plugins/UpdateModelPlugin.js +3 -0
- package/es/plugins/UpdateStyleAttributePlugin.js +3 -6
- package/es/point/index.d.ts +4 -4
- package/es/point/index.js +55 -23
- package/es/point/models/earthExtrude.d.ts +2 -2
- package/es/point/models/earthExtrude.js +73 -30
- package/es/point/models/earthFill.d.ts +2 -2
- package/es/point/models/earthFill.js +66 -21
- package/es/point/models/extrude.d.ts +2 -2
- package/es/point/models/extrude.js +40 -17
- package/es/point/models/fill.d.ts +2 -2
- package/es/point/models/fill.js +43 -20
- package/es/point/models/fillmage.d.ts +2 -2
- package/es/point/models/fillmage.js +82 -43
- package/es/point/models/image.d.ts +2 -2
- package/es/point/models/image.js +72 -31
- package/es/point/models/index.d.ts +1 -1
- package/es/point/models/index.js +0 -2
- package/es/point/models/normal.d.ts +2 -2
- package/es/point/models/normal.js +71 -30
- package/es/point/models/radar.d.ts +2 -2
- package/es/point/models/radar.js +75 -35
- package/es/point/models/simplePoint.d.ts +2 -2
- package/es/point/models/simplePoint.js +70 -29
- package/es/point/models/text.d.ts +3 -2
- package/es/point/models/text.js +185 -112
- package/es/point/models/tile.d.ts +2 -2
- package/es/point/models/tile.js +77 -35
- package/es/point/models/tileText.d.ts +2 -2
- package/es/point/models/tileText.js +151 -116
- package/es/polygon/index.d.ts +2 -3
- package/es/polygon/index.js +27 -24
- package/es/polygon/models/extrude.d.ts +2 -2
- package/es/polygon/models/extrude.js +69 -32
- package/es/polygon/models/fill.d.ts +2 -2
- package/es/polygon/models/fill.js +76 -43
- package/es/polygon/models/index.d.ts +1 -1
- package/es/polygon/models/index.js +0 -2
- package/es/polygon/models/ocean.d.ts +2 -2
- package/es/polygon/models/ocean.js +69 -28
- package/es/polygon/models/tile.d.ts +2 -2
- package/es/polygon/models/tile.js +70 -30
- package/es/polygon/models/water.d.ts +2 -2
- package/es/polygon/models/water.js +69 -28
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +1 -2
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +1 -2
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +1 -2
- package/es/raster/index.d.ts +2 -3
- package/es/raster/index.js +30 -20
- package/es/raster/models/index.d.ts +1 -1
- package/es/raster/models/index.js +2 -2
- package/es/raster/models/raster.d.ts +2 -2
- package/es/raster/models/raster.js +39 -28
- package/es/raster/models/rasterRgb.d.ts +7 -8
- package/es/raster/models/rasterRgb.js +75 -45
- package/es/{image/models/tileDataImage.d.ts → raster/models/rasterTerrainRgb.d.ts} +3 -3
- package/es/raster/models/rasterTerrainRgb.js +184 -0
- package/es/raster/models/rasterTile.d.ts +2 -2
- package/es/raster/models/rasterTile.js +78 -37
- package/es/raster/shaders/raster_2d_frag.glsl +2 -38
- package/es/raster/shaders/raster_rgb_frag.glsl +10 -4
- package/es/raster/shaders/raster_terrain_rgb_frag.glsl +31 -0
- package/es/raster/shaders/rater_terrain_rgb_vert.glsl +17 -0
- package/es/tile/interaction/getRasterData.d.ts +2 -2
- package/es/tile/interaction/utils.js +3 -11
- package/es/tile/interface.d.ts +5 -4
- package/es/tile/manager/base.d.ts +17 -12
- package/es/tile/manager/base.js +212 -47
- package/es/tile/service/TileLayerService.d.ts +34 -0
- package/es/tile/service/TileLayerService.js +220 -0
- package/es/tile/service/TilePickService.d.ts +26 -0
- package/es/tile/service/TilePickService.js +174 -0
- package/es/tile/service/TileSourceService.d.ts +7 -0
- package/es/tile/service/TileSourceService.js +39 -0
- package/es/tile/style/constants.d.ts +1 -13
- package/es/tile/style/constants.js +6 -15
- package/es/tile/style/utils.d.ts +1 -8
- package/es/tile/style/utils.js +0 -126
- package/es/tile/tileFactory/DebugTile.d.ts +16 -0
- package/es/tile/tileFactory/DebugTile.js +100 -0
- package/es/tile/tileFactory/ImageTile.d.ts +14 -0
- package/es/tile/tileFactory/ImageTile.js +89 -0
- package/es/tile/tileFactory/MaskTile.d.ts +18 -0
- package/es/tile/tileFactory/MaskTile.js +105 -0
- package/es/tile/tileFactory/RasterRGBTile.d.ts +11 -0
- package/es/tile/tileFactory/RasterRGBTile.js +98 -0
- package/es/tile/tileFactory/RasterTerrainRGBTile.d.ts +14 -0
- package/es/tile/tileFactory/RasterTerrainRGBTile.js +89 -0
- package/es/tile/tileFactory/RasterTile.d.ts +18 -0
- package/es/tile/tileFactory/RasterTile.js +133 -0
- package/es/tile/tileFactory/Tile.d.ts +34 -0
- package/es/tile/tileFactory/Tile.js +161 -0
- package/es/tile/tileFactory/VectorTile.d.ts +27 -0
- package/es/tile/tileFactory/VectorTile.js +198 -0
- package/es/tile/tileFactory/index.d.ts +11 -4
- package/es/tile/tileFactory/index.js +34 -23
- package/es/tile/tileFactory/layers/{rasterDataLayer.d.ts → RasterDataLayer.d.ts} +3 -3
- package/es/tile/tileFactory/layers/{rasterDataLayer.js → RasterDataLayer.js} +34 -22
- package/es/tile/tileFactory/layers/{tileTest.d.ts → TileDebugLayer.d.ts} +2 -2
- package/es/tile/tileFactory/layers/{tileTest.js → TileDebugLayer.js} +23 -10
- package/es/tile/tileFactory/util.d.ts +5 -0
- package/es/tile/tileFactory/util.js +21 -0
- package/es/tile/tileLayer/BaseLayer.d.ts +45 -0
- package/es/tile/tileLayer/BaseLayer.js +348 -0
- package/es/tile/utils.d.ts +1 -11
- package/es/tile/utils.js +0 -129
- package/es/utils/dataMappingStyle.d.ts +4 -4
- package/es/utils/dataMappingStyle.js +16 -18
- package/es/utils/layerData.js +5 -11
- package/es/wind/index.d.ts +2 -3
- package/es/wind/index.js +27 -17
- package/es/wind/models/wind.d.ts +2 -2
- package/es/wind/models/wind.js +123 -104
- package/lib/Geometry/index.js +29 -17
- package/lib/Geometry/models/billboard.js +79 -37
- package/lib/Geometry/models/plane.js +82 -40
- package/lib/Geometry/models/sprite.js +85 -45
- package/lib/canvas/index.js +31 -19
- package/lib/canvas/models/canvas.js +56 -15
- package/lib/citybuliding/building.js +28 -17
- package/lib/citybuliding/models/build.js +72 -25
- package/lib/core/BaseLayer.js +388 -261
- package/lib/core/BaseModel.js +48 -6
- package/lib/core/LayerPickService.js +179 -0
- package/lib/core/TextureService.js +77 -0
- package/lib/core/triangulation.js +8 -1
- package/lib/earth/index.js +30 -9
- package/lib/earth/models/atmosphere.js +69 -22
- package/lib/earth/models/base.js +90 -42
- package/lib/earth/models/bloomsphere.js +69 -22
- package/lib/heatmap/index.js +35 -24
- package/lib/heatmap/models/grid.js +70 -27
- package/lib/heatmap/models/grid3d.js +72 -29
- package/lib/heatmap/models/heatmap.js +40 -14
- package/lib/heatmap/models/hexagon.js +71 -28
- package/lib/heatmap/shaders/hexagon_3d_vert.glsl +2 -13
- package/lib/image/index.js +31 -34
- package/lib/image/models/image.js +119 -67
- package/lib/image/models/index.js +1 -7
- package/lib/image/shaders/dataImage_frag.glsl +10 -16
- package/lib/index.js +5 -5
- package/lib/line/index.js +53 -26
- package/lib/line/models/arc.js +75 -38
- package/lib/line/models/arc_3d.js +71 -34
- package/lib/line/models/earthArc_3d.js +74 -37
- package/lib/line/models/great_circle.js +72 -29
- package/lib/line/models/half.js +40 -17
- package/lib/line/models/index.js +0 -3
- package/lib/line/models/line.js +81 -47
- package/lib/line/models/linearline.js +72 -31
- package/lib/line/models/simpleLine.js +73 -34
- package/lib/line/models/simpleTileLine.js +72 -30
- package/lib/line/models/tile.js +40 -17
- package/lib/line/models/wall.js +69 -22
- package/lib/mask/index.js +28 -99
- package/lib/mask/models/fill.js +40 -16
- package/lib/mask/models/index.js +1 -4
- package/lib/plugins/DataMappingPlugin.js +91 -149
- package/lib/plugins/DataSourcePlugin.js +69 -30
- package/lib/plugins/FeatureScalePlugin.js +87 -61
- package/lib/plugins/LayerModelPlugin.js +128 -41
- package/lib/plugins/LayerStylePlugin.js +1 -6
- package/lib/plugins/MultiPassRendererPlugin.js +1 -1
- package/lib/plugins/PixelPickingPlugin.js +1 -1
- package/lib/plugins/RegisterStyleAttributePlugin.js +1 -16
- package/lib/plugins/UpdateModelPlugin.js +3 -0
- package/lib/plugins/UpdateStyleAttributePlugin.js +3 -6
- package/lib/point/index.js +56 -24
- package/lib/point/models/earthExtrude.js +75 -30
- package/lib/point/models/earthFill.js +68 -21
- package/lib/point/models/extrude.js +40 -17
- package/lib/point/models/fill.js +44 -21
- package/lib/point/models/fillmage.js +84 -43
- package/lib/point/models/image.js +74 -31
- package/lib/point/models/index.js +0 -3
- package/lib/point/models/normal.js +73 -30
- package/lib/point/models/radar.js +77 -35
- package/lib/point/models/simplePoint.js +72 -29
- package/lib/point/models/text.js +185 -111
- package/lib/point/models/tile.js +79 -35
- package/lib/point/models/tileText.js +151 -115
- package/lib/polygon/index.js +29 -25
- package/lib/polygon/models/extrude.js +71 -32
- package/lib/polygon/models/fill.js +78 -43
- package/lib/polygon/models/index.js +0 -3
- package/lib/polygon/models/ocean.js +71 -28
- package/lib/polygon/models/tile.js +72 -30
- package/lib/polygon/models/water.js +71 -28
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +1 -2
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +1 -2
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +1 -2
- package/lib/raster/index.js +32 -20
- package/lib/raster/models/index.js +3 -3
- package/lib/raster/models/raster.js +39 -29
- package/lib/raster/models/rasterRgb.js +78 -43
- package/lib/raster/models/rasterTerrainRgb.js +200 -0
- package/lib/raster/models/rasterTile.js +80 -37
- package/lib/raster/shaders/raster_2d_frag.glsl +2 -38
- package/lib/raster/shaders/raster_rgb_frag.glsl +10 -4
- package/lib/raster/shaders/raster_terrain_rgb_frag.glsl +31 -0
- package/lib/raster/shaders/rater_terrain_rgb_vert.glsl +17 -0
- package/lib/tile/interaction/utils.js +3 -11
- package/lib/tile/manager/base.js +213 -47
- package/lib/tile/service/TileLayerService.js +233 -0
- package/lib/tile/service/TilePickService.js +190 -0
- package/lib/tile/service/TileSourceService.js +59 -0
- package/lib/tile/style/constants.js +8 -19
- package/lib/tile/style/utils.js +0 -140
- package/lib/tile/tileFactory/DebugTile.js +115 -0
- package/lib/tile/tileFactory/ImageTile.js +104 -0
- package/lib/tile/tileFactory/MaskTile.js +120 -0
- package/lib/tile/tileFactory/RasterRGBTile.js +112 -0
- package/lib/tile/tileFactory/RasterTerrainRGBTile.js +104 -0
- package/lib/tile/tileFactory/RasterTile.js +149 -0
- package/lib/tile/tileFactory/Tile.js +171 -0
- package/lib/tile/tileFactory/VectorTile.js +214 -0
- package/lib/tile/tileFactory/index.js +46 -23
- package/lib/tile/tileFactory/layers/{rasterDataLayer.js → RasterDataLayer.js} +36 -22
- package/lib/tile/tileFactory/layers/{tileTest.js → TileDebugLayer.js} +24 -11
- package/lib/tile/tileFactory/util.js +35 -0
- package/lib/tile/tileLayer/BaseLayer.js +363 -0
- package/lib/tile/utils.js +0 -148
- package/lib/utils/dataMappingStyle.js +18 -20
- package/lib/utils/layerData.js +4 -10
- package/lib/wind/index.js +29 -17
- package/lib/wind/models/wind.js +125 -104
- package/package.json +7 -7
- package/es/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/es/image/models/dataImage.d.ts +0 -13
- package/es/image/models/dataImage.js +0 -186
- package/es/image/models/tileDataImage.js +0 -160
- package/es/raster/raster.d.ts +0 -21
- package/es/raster/raster.js +0 -161
- package/es/tile/interaction/TilePickService.d.ts +0 -16
- package/es/tile/interaction/TilePickService.js +0 -129
- package/es/tile/manager/layerManager.d.ts +0 -19
- package/es/tile/manager/layerManager.js +0 -254
- package/es/tile/manager/mapLayerManager.d.ts +0 -7
- package/es/tile/manager/mapLayerManager.js +0 -119
- package/es/tile/models/tileModel.d.ts +0 -10
- package/es/tile/models/tileModel.js +0 -81
- package/es/tile/render/TileRenderService.d.ts +0 -10
- package/es/tile/render/TileRenderService.js +0 -68
- package/es/tile/style/TileStyleService.d.ts +0 -17
- package/es/tile/style/TileStyleService.js +0 -118
- package/es/tile/tileFactory/base.d.ts +0 -45
- package/es/tile/tileFactory/base.js +0 -403
- package/es/tile/tileFactory/layers/vectorLayer.d.ts +0 -30
- package/es/tile/tileFactory/layers/vectorLayer.js +0 -253
- package/es/tile/tileFactory/line.d.ts +0 -12
- package/es/tile/tileFactory/line.js +0 -59
- package/es/tile/tileFactory/mask.d.ts +0 -12
- package/es/tile/tileFactory/mask.js +0 -60
- package/es/tile/tileFactory/point.d.ts +0 -12
- package/es/tile/tileFactory/point.js +0 -60
- package/es/tile/tileFactory/polygon.d.ts +0 -12
- package/es/tile/tileFactory/polygon.js +0 -59
- package/es/tile/tileFactory/raster.d.ts +0 -12
- package/es/tile/tileFactory/raster.js +0 -55
- package/es/tile/tileFactory/rasterData.d.ts +0 -12
- package/es/tile/tileFactory/rasterData.js +0 -81
- package/es/tile/tileFactory/test.d.ts +0 -12
- package/es/tile/tileFactory/test.js +0 -94
- package/es/tile/tileLayer/MapTileLayer.d.ts +0 -6
- package/es/tile/tileLayer/MapTileLayer.js +0 -48
- package/es/tile/tileLayer/TileLayer.d.ts +0 -22
- package/es/tile/tileLayer/TileLayer.js +0 -198
- package/es/tile/tileLayer/base.d.ts +0 -33
- package/es/tile/tileLayer/base.js +0 -212
- package/lib/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/lib/image/models/dataImage.js +0 -201
- package/lib/image/models/tileDataImage.js +0 -174
- package/lib/raster/raster.js +0 -178
- package/lib/tile/interaction/TilePickService.js +0 -143
- package/lib/tile/manager/layerManager.js +0 -275
- package/lib/tile/manager/mapLayerManager.js +0 -134
- package/lib/tile/models/tileModel.js +0 -94
- package/lib/tile/render/TileRenderService.js +0 -78
- package/lib/tile/style/TileStyleService.js +0 -133
- package/lib/tile/tileFactory/base.js +0 -427
- package/lib/tile/tileFactory/layers/vectorLayer.js +0 -268
- package/lib/tile/tileFactory/line.js +0 -70
- package/lib/tile/tileFactory/mask.js +0 -71
- package/lib/tile/tileFactory/point.js +0 -71
- package/lib/tile/tileFactory/polygon.js +0 -70
- package/lib/tile/tileFactory/raster.js +0 -68
- package/lib/tile/tileFactory/rasterData.js +0 -93
- package/lib/tile/tileFactory/test.js +0 -106
- package/lib/tile/tileLayer/MapTileLayer.js +0 -63
- package/lib/tile/tileLayer/TileLayer.js +0 -215
- package/lib/tile/tileLayer/base.js +0 -225
package/es/tile/manager/base.js
CHANGED
|
@@ -1,55 +1,143 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
+
import { createLayerContainer } from '@antv/l7-core';
|
|
8
|
+
import { updateLayersConfig } from "../style/utils";
|
|
7
9
|
export var Base = /*#__PURE__*/function () {
|
|
8
10
|
function Base() {
|
|
9
11
|
_classCallCheck(this, Base);
|
|
10
12
|
|
|
11
13
|
_defineProperty(this, "tileCache", new Map());
|
|
14
|
+
|
|
15
|
+
_defineProperty(this, "tileLayerCache", new Map());
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
_createClass(Base, [{
|
|
19
|
+
key: "initTileLayers",
|
|
20
|
+
value: function () {
|
|
21
|
+
var _initTileLayers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(layers, tile) {
|
|
22
|
+
var _this = this;
|
|
23
|
+
|
|
24
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
25
|
+
while (1) {
|
|
26
|
+
switch (_context2.prev = _context2.next) {
|
|
27
|
+
case 0:
|
|
28
|
+
return _context2.abrupt("return", Promise.all(layers.map( /*#__PURE__*/function () {
|
|
29
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(layer) {
|
|
30
|
+
var container;
|
|
31
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
32
|
+
while (1) {
|
|
33
|
+
switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
container = createLayerContainer(_this.parent.sceneContainer);
|
|
36
|
+
layer.setContainer(container, _this.parent.sceneContainer);
|
|
37
|
+
_context.next = 4;
|
|
38
|
+
return layer.init();
|
|
39
|
+
|
|
40
|
+
case 4:
|
|
41
|
+
_this.addChild(layer);
|
|
42
|
+
|
|
43
|
+
tile.layerLoad();
|
|
44
|
+
|
|
45
|
+
_this.render();
|
|
46
|
+
|
|
47
|
+
case 7:
|
|
48
|
+
case "end":
|
|
49
|
+
return _context.stop();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}, _callee);
|
|
53
|
+
}));
|
|
54
|
+
|
|
55
|
+
return function (_x3) {
|
|
56
|
+
return _ref.apply(this, arguments);
|
|
57
|
+
};
|
|
58
|
+
}())));
|
|
59
|
+
|
|
60
|
+
case 1:
|
|
61
|
+
case "end":
|
|
62
|
+
return _context2.stop();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}, _callee2);
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
function initTileLayers(_x, _x2) {
|
|
69
|
+
return _initTileLayers.apply(this, arguments);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return initTileLayers;
|
|
73
|
+
}()
|
|
74
|
+
}, {
|
|
75
|
+
key: "render",
|
|
76
|
+
value: function render() {
|
|
77
|
+
this.parent.renderLayers();
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
15
80
|
key: "hasTile",
|
|
16
81
|
value: function hasTile(tile) {
|
|
17
|
-
return
|
|
18
|
-
}
|
|
82
|
+
return this.tileCache.has(tile.key);
|
|
83
|
+
} // 添加图层
|
|
84
|
+
|
|
19
85
|
}, {
|
|
20
86
|
key: "addTile",
|
|
21
|
-
value: function
|
|
22
|
-
var
|
|
87
|
+
value: function () {
|
|
88
|
+
var _addTile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(tile) {
|
|
89
|
+
var layerCollections;
|
|
90
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
91
|
+
while (1) {
|
|
92
|
+
switch (_context3.prev = _context3.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
if (!this.hasTile(tile)) {
|
|
95
|
+
_context3.next = 2;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
23
98
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
layers: [],
|
|
28
|
-
layerIDList: []
|
|
29
|
-
}; // 存储当前 tile
|
|
99
|
+
return _context3.abrupt("return", {
|
|
100
|
+
layers: []
|
|
101
|
+
});
|
|
30
102
|
|
|
31
|
-
|
|
103
|
+
case 2:
|
|
104
|
+
// 存储当前 tile
|
|
105
|
+
this.tileCache.set(tile.key, tile); // 创建 tile 对应的 layers
|
|
32
106
|
|
|
33
|
-
|
|
107
|
+
layerCollections = this.tileFactory.createTile(tile, this.initOptions); // // 初始化图层
|
|
34
108
|
|
|
35
|
-
|
|
109
|
+
_context3.next = 6;
|
|
110
|
+
return this.initTileLayers(layerCollections.layers, tile);
|
|
36
111
|
|
|
37
|
-
|
|
112
|
+
case 6:
|
|
113
|
+
this.tileLayerCache.set(tile.key, layerCollections.layers); // const visible = tile.parent ? tile.parent.children.every(t=>this.tileLayerCache.has(t.key)) : true
|
|
114
|
+
// tile.parent?.children.forEach((t)=>{
|
|
115
|
+
// updateLayersConfig(this.getLayers(t),'visible',visible)
|
|
116
|
+
// })
|
|
38
117
|
|
|
118
|
+
return _context3.abrupt("return", layerCollections);
|
|
39
119
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
120
|
+
case 8:
|
|
121
|
+
case "end":
|
|
122
|
+
return _context3.stop();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}, _callee3, this);
|
|
126
|
+
}));
|
|
127
|
+
|
|
128
|
+
function addTile(_x4) {
|
|
129
|
+
return _addTile.apply(this, arguments);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return addTile;
|
|
133
|
+
}()
|
|
48
134
|
}, {
|
|
49
135
|
key: "removeTile",
|
|
50
136
|
value: function removeTile(tile) {
|
|
51
137
|
this.tileCache.delete(tile.key);
|
|
52
|
-
this.
|
|
138
|
+
var layers = this.tileLayerCache.get(tile.key);
|
|
139
|
+
this.tileLayerCache.delete(tile.key);
|
|
140
|
+
this.removeLayers(layers, false);
|
|
53
141
|
}
|
|
54
142
|
}, {
|
|
55
143
|
key: "addChild",
|
|
@@ -64,18 +152,16 @@ export var Base = /*#__PURE__*/function () {
|
|
|
64
152
|
(_this$children = this.children).push.apply(_this$children, _toConsumableArray(layers));
|
|
65
153
|
}
|
|
66
154
|
}, {
|
|
67
|
-
key: "
|
|
68
|
-
value: function
|
|
155
|
+
key: "removeLayers",
|
|
156
|
+
value: function removeLayers() {
|
|
157
|
+
var layers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
69
158
|
var refresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.children.filter(function (child) {
|
|
73
|
-
layerIDList.includes(child.id) ? remveLayerList.push(child) : cacheLayerList.push(child);
|
|
159
|
+
this.children = this.children.filter(function (child) {
|
|
160
|
+
return !layers.includes(child);
|
|
74
161
|
});
|
|
75
|
-
|
|
162
|
+
layers.map(function (layer) {
|
|
76
163
|
return layer.destroy(refresh);
|
|
77
164
|
});
|
|
78
|
-
this.children = cacheLayerList;
|
|
79
165
|
}
|
|
80
166
|
}, {
|
|
81
167
|
key: "removeChild",
|
|
@@ -89,11 +175,10 @@ export var Base = /*#__PURE__*/function () {
|
|
|
89
175
|
layer.destroy();
|
|
90
176
|
}
|
|
91
177
|
}, {
|
|
92
|
-
key: "
|
|
93
|
-
value: function
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
});
|
|
178
|
+
key: "getLayers",
|
|
179
|
+
value: function getLayers(tile) {
|
|
180
|
+
if (!tile) return [];
|
|
181
|
+
return this.tileLayerCache.get(tile.key) || [];
|
|
97
182
|
}
|
|
98
183
|
}, {
|
|
99
184
|
key: "getChild",
|
|
@@ -117,14 +202,11 @@ export var Base = /*#__PURE__*/function () {
|
|
|
117
202
|
}
|
|
118
203
|
}, {
|
|
119
204
|
key: "initTileFactory",
|
|
120
|
-
value: function initTileFactory() {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
this.
|
|
124
|
-
|
|
125
|
-
mapService: this.mapService,
|
|
126
|
-
rendererService: this.rendererService
|
|
127
|
-
});
|
|
205
|
+
value: function initTileFactory() {// this.tileFactory = new TileFactory({
|
|
206
|
+
// parent: this.parent,
|
|
207
|
+
// mapService: this.mapService,
|
|
208
|
+
// rendererService: this.rendererService,
|
|
209
|
+
// });
|
|
128
210
|
}
|
|
129
211
|
}, {
|
|
130
212
|
key: "getSourceLayer",
|
|
@@ -137,9 +219,92 @@ export var Base = /*#__PURE__*/function () {
|
|
|
137
219
|
return sourceLayer;
|
|
138
220
|
}
|
|
139
221
|
}
|
|
222
|
+
}, {
|
|
223
|
+
key: "updateTileVisible",
|
|
224
|
+
value: function updateTileVisible(tile, layerService) {
|
|
225
|
+
var layers = this.getLayers(tile);
|
|
226
|
+
if (layers.length === 0) return;
|
|
227
|
+
|
|
228
|
+
if (tile.isVisible) {
|
|
229
|
+
// 如果可见直接进行渲染,父级发
|
|
230
|
+
updateLayersConfig(layers, 'visible', tile.isVisible);
|
|
231
|
+
} else {
|
|
232
|
+
// 如果不可见,放大,等到子瓦片渲染完成,缩小:父级渲染成功
|
|
233
|
+
// console.log('updateTileVisible',`${tile.x}_${tile.y}_${tile.z}`,tile.isVisible)
|
|
234
|
+
// console.log(tile);
|
|
235
|
+
// console.log(`子瓦片${tile.x}/${tile.y}/${tile.z}`,tile.children.length)
|
|
236
|
+
// tile.children.forEach((t)=>{
|
|
237
|
+
// console.log(`${t.x}/${t.y}/${t.z}`)
|
|
238
|
+
// })
|
|
239
|
+
updateLayersConfig(layers, 'visible', tile.isVisible);
|
|
240
|
+
} // this.listenLoad(tile, () => {
|
|
241
|
+
// this.isTileAllLoad(tile) && updateLayersConfig(layers, 'visible', tile.isVisible);
|
|
242
|
+
// })
|
|
243
|
+
|
|
244
|
+
}
|
|
245
|
+
}, {
|
|
246
|
+
key: "listenLoad",
|
|
247
|
+
value: function listenLoad(tile, callback) {
|
|
248
|
+
var _tile$parent;
|
|
249
|
+
|
|
250
|
+
tile.once('layerLoaded', function () {
|
|
251
|
+
callback();
|
|
252
|
+
});
|
|
253
|
+
tile.children.map(function (childTile) {
|
|
254
|
+
childTile.once('layerLoaded', function () {
|
|
255
|
+
callback();
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
(_tile$parent = tile.parent) === null || _tile$parent === void 0 ? void 0 : _tile$parent.once('layerLoaded', function () {
|
|
259
|
+
callback();
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}, {
|
|
263
|
+
key: "isTileLoaded",
|
|
264
|
+
value: function isTileLoaded(tile) {
|
|
265
|
+
if (tile.isLoad) return true;
|
|
266
|
+
var isLoad = this.getLayers(tile).length === tile.loadedLayers;
|
|
267
|
+
tile.isLoad = isLoad;
|
|
268
|
+
return isLoad;
|
|
269
|
+
}
|
|
270
|
+
}, {
|
|
271
|
+
key: "isTileChildLoaded",
|
|
272
|
+
value: function isTileChildLoaded(tile) {
|
|
273
|
+
var _this2 = this;
|
|
274
|
+
|
|
275
|
+
if (tile.isChildLoad) return true;
|
|
276
|
+
var children = tile.children;
|
|
277
|
+
var isLoad = children.filter(function (child) {
|
|
278
|
+
return _this2.isTileLoaded(child);
|
|
279
|
+
}).length === children.length;
|
|
280
|
+
tile.isChildLoad = isLoad;
|
|
281
|
+
return isLoad;
|
|
282
|
+
}
|
|
283
|
+
}, {
|
|
284
|
+
key: "isTileParentLoaded",
|
|
285
|
+
value: function isTileParentLoaded(tile) {
|
|
286
|
+
var parent = tile.parent;
|
|
287
|
+
|
|
288
|
+
if (!parent) {
|
|
289
|
+
return true;
|
|
290
|
+
} else {
|
|
291
|
+
return this.isTileLoaded(parent);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}, {
|
|
295
|
+
key: "isTileAllLoad",
|
|
296
|
+
value: function isTileAllLoad(tile) {
|
|
297
|
+
var tileLoaded = this.isTileLoaded(tile);
|
|
298
|
+
var tileChildLoaded = this.isTileChildLoaded(tile);
|
|
299
|
+
var tileParentLoaded = this.isTileParentLoaded(tile);
|
|
300
|
+
return tileLoaded && tileChildLoaded && tileParentLoaded;
|
|
301
|
+
}
|
|
140
302
|
}, {
|
|
141
303
|
key: "destroy",
|
|
142
|
-
value: function destroy() {
|
|
304
|
+
value: function destroy() {
|
|
305
|
+
this.tileCache.clear();
|
|
306
|
+
this.tileLayerCache.clear();
|
|
307
|
+
}
|
|
143
308
|
}]);
|
|
144
309
|
|
|
145
310
|
return Base;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ILayer, ILayerService, ILngLat, IRendererService, ITile } from '@antv/l7-core';
|
|
2
|
+
import { SourceTile } from '@antv/l7-utils';
|
|
3
|
+
import 'reflect-metadata';
|
|
4
|
+
interface TileLayerServiceOptions {
|
|
5
|
+
rendererService: IRendererService;
|
|
6
|
+
layerService: ILayerService;
|
|
7
|
+
parent: ILayer;
|
|
8
|
+
}
|
|
9
|
+
export declare class TileLayerService {
|
|
10
|
+
/**
|
|
11
|
+
* tileResource 用于存储瓦片的全局资源
|
|
12
|
+
*/
|
|
13
|
+
tileResource: Map<any, any>;
|
|
14
|
+
private rendererService;
|
|
15
|
+
private layerService;
|
|
16
|
+
private parent;
|
|
17
|
+
private _tiles;
|
|
18
|
+
constructor({ rendererService, layerService, parent }: TileLayerServiceOptions);
|
|
19
|
+
get tiles(): ITile[];
|
|
20
|
+
hasTile(tileKey: string): boolean;
|
|
21
|
+
addTile(tile: ITile): void;
|
|
22
|
+
getTile(tileKey: string): ITile | undefined;
|
|
23
|
+
getVisibleTileBylngLat(lngLat: ILngLat): ITile | undefined;
|
|
24
|
+
removeTile(tileKey: string): void;
|
|
25
|
+
updateTileVisible(sourceTile: SourceTile): void;
|
|
26
|
+
isParentLoaded(sourceTile: SourceTile): boolean;
|
|
27
|
+
isChildrenLoaded(sourceTile: SourceTile): boolean;
|
|
28
|
+
render(): Promise<void>;
|
|
29
|
+
getRenderLayers(): ILayer[];
|
|
30
|
+
getLayers(): ILayer[];
|
|
31
|
+
getTiles(): ITile[];
|
|
32
|
+
destroy(): void;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
+
import 'reflect-metadata';
|
|
8
|
+
export var TileLayerService = /*#__PURE__*/function () {
|
|
9
|
+
/**
|
|
10
|
+
* tileResource 用于存储瓦片的全局资源
|
|
11
|
+
*/
|
|
12
|
+
function TileLayerService(_ref) {
|
|
13
|
+
var rendererService = _ref.rendererService,
|
|
14
|
+
layerService = _ref.layerService,
|
|
15
|
+
parent = _ref.parent;
|
|
16
|
+
|
|
17
|
+
_classCallCheck(this, TileLayerService);
|
|
18
|
+
|
|
19
|
+
_defineProperty(this, "tileResource", new Map());
|
|
20
|
+
|
|
21
|
+
_defineProperty(this, "_tiles", []);
|
|
22
|
+
|
|
23
|
+
this.rendererService = rendererService;
|
|
24
|
+
this.layerService = layerService;
|
|
25
|
+
this.parent = parent;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_createClass(TileLayerService, [{
|
|
29
|
+
key: "tiles",
|
|
30
|
+
get: function get() {
|
|
31
|
+
return this._tiles;
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
key: "hasTile",
|
|
35
|
+
value: function hasTile(tileKey) {
|
|
36
|
+
return this._tiles.some(function (tile) {
|
|
37
|
+
return tile.key === tileKey;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "addTile",
|
|
42
|
+
value: function addTile(tile) {
|
|
43
|
+
this._tiles.push(tile);
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
46
|
+
key: "getTile",
|
|
47
|
+
value: function getTile(tileKey) {
|
|
48
|
+
return this._tiles.find(function (tile) {
|
|
49
|
+
return tile.key === tileKey;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
key: "getVisibleTileBylngLat",
|
|
54
|
+
value: function getVisibleTileBylngLat(lngLat) {
|
|
55
|
+
// 加载完成 & 可见 & 鼠标选中
|
|
56
|
+
return this._tiles.find(function (tile) {
|
|
57
|
+
return tile.isLoaded && tile.visible && tile.lnglatInBounds(lngLat);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "removeTile",
|
|
62
|
+
value: function removeTile(tileKey) {
|
|
63
|
+
var index = this._tiles.findIndex(function (tile) {
|
|
64
|
+
return tile.key === tileKey;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
var tile = this._tiles.splice(index, 1);
|
|
68
|
+
|
|
69
|
+
tile[0] && tile[0].destroy();
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
key: "updateTileVisible",
|
|
73
|
+
value: function updateTileVisible(sourceTile) {
|
|
74
|
+
var tile = this.getTile(sourceTile.key); // if(sourceTile.isVisible) {
|
|
75
|
+
// // 不可见 => 可见 兄弟节点加载完成
|
|
76
|
+
// if(sourceTile.parent) {
|
|
77
|
+
// const flag = this.isChildrenLoaded(sourceTile.parent)
|
|
78
|
+
// tile?.updateVisible(flag);
|
|
79
|
+
// } else {
|
|
80
|
+
// tile?.updateVisible(true);
|
|
81
|
+
// }
|
|
82
|
+
// } else {
|
|
83
|
+
// // 可见 => 不可见 兄弟节点加载完成
|
|
84
|
+
// if(sourceTile.parent) {
|
|
85
|
+
// const flag = this.isChildrenLoaded(sourceTile.parent)
|
|
86
|
+
// tile?.updateVisible(!flag);
|
|
87
|
+
// } else {
|
|
88
|
+
// tile?.updateVisible(false);
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
91
|
+
|
|
92
|
+
tile === null || tile === void 0 ? void 0 : tile.updateVisible(sourceTile.isVisible);
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
key: "isParentLoaded",
|
|
96
|
+
value: function isParentLoaded(sourceTile) {
|
|
97
|
+
var parentTile = sourceTile.parent;
|
|
98
|
+
|
|
99
|
+
if (!parentTile) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
var tile = this.getTile(parentTile === null || parentTile === void 0 ? void 0 : parentTile.key);
|
|
104
|
+
|
|
105
|
+
if (tile !== null && tile !== void 0 && tile.isLoaded) {
|
|
106
|
+
// 递归父级
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}, {
|
|
113
|
+
key: "isChildrenLoaded",
|
|
114
|
+
value: function isChildrenLoaded(sourceTile) {
|
|
115
|
+
var _this = this;
|
|
116
|
+
|
|
117
|
+
var childrenTile = sourceTile === null || sourceTile === void 0 ? void 0 : sourceTile.children;
|
|
118
|
+
|
|
119
|
+
if (childrenTile.length === 0) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return childrenTile.some(function (tile) {
|
|
124
|
+
var tileLayer = _this.getTile(tile === null || tile === void 0 ? void 0 : tile.key);
|
|
125
|
+
|
|
126
|
+
return (tileLayer === null || tileLayer === void 0 ? void 0 : tileLayer.isLoaded) === false;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}, {
|
|
130
|
+
key: "render",
|
|
131
|
+
value: function () {
|
|
132
|
+
var _render = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
133
|
+
var _this2 = this;
|
|
134
|
+
|
|
135
|
+
var layers;
|
|
136
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
137
|
+
while (1) {
|
|
138
|
+
switch (_context2.prev = _context2.next) {
|
|
139
|
+
case 0:
|
|
140
|
+
layers = this.getRenderLayers();
|
|
141
|
+
layers.map( /*#__PURE__*/function () {
|
|
142
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(layer) {
|
|
143
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
144
|
+
while (1) {
|
|
145
|
+
switch (_context.prev = _context.next) {
|
|
146
|
+
case 0:
|
|
147
|
+
_context.next = 2;
|
|
148
|
+
return _this2.layerService.renderLayer(layer);
|
|
149
|
+
|
|
150
|
+
case 2:
|
|
151
|
+
case "end":
|
|
152
|
+
return _context.stop();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}, _callee);
|
|
156
|
+
}));
|
|
157
|
+
|
|
158
|
+
return function (_x) {
|
|
159
|
+
return _ref2.apply(this, arguments);
|
|
160
|
+
};
|
|
161
|
+
}());
|
|
162
|
+
|
|
163
|
+
case 2:
|
|
164
|
+
case "end":
|
|
165
|
+
return _context2.stop();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}, _callee2, this);
|
|
169
|
+
}));
|
|
170
|
+
|
|
171
|
+
function render() {
|
|
172
|
+
return _render.apply(this, arguments);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return render;
|
|
176
|
+
}()
|
|
177
|
+
}, {
|
|
178
|
+
key: "getRenderLayers",
|
|
179
|
+
value: function getRenderLayers() {
|
|
180
|
+
var tileList = this._tiles.filter(function (t) {
|
|
181
|
+
return t.visible && t.isLoaded;
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
var layers = [];
|
|
185
|
+
tileList.map(function (tile) {
|
|
186
|
+
return layers.push.apply(layers, _toConsumableArray(tile.getLayers()));
|
|
187
|
+
});
|
|
188
|
+
return layers;
|
|
189
|
+
}
|
|
190
|
+
}, {
|
|
191
|
+
key: "getLayers",
|
|
192
|
+
value: function getLayers() {
|
|
193
|
+
var tileList = this._tiles.filter(function (t) {
|
|
194
|
+
return t.isLoaded;
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
var layers = [];
|
|
198
|
+
tileList.map(function (tile) {
|
|
199
|
+
return layers.push.apply(layers, _toConsumableArray(tile.getLayers()));
|
|
200
|
+
});
|
|
201
|
+
return layers;
|
|
202
|
+
}
|
|
203
|
+
}, {
|
|
204
|
+
key: "getTiles",
|
|
205
|
+
value: function getTiles() {
|
|
206
|
+
return this._tiles;
|
|
207
|
+
}
|
|
208
|
+
}, {
|
|
209
|
+
key: "destroy",
|
|
210
|
+
value: function destroy() {
|
|
211
|
+
this._tiles.forEach(function (t) {
|
|
212
|
+
return t.destroy();
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
this.tileResource.clear();
|
|
216
|
+
}
|
|
217
|
+
}]);
|
|
218
|
+
|
|
219
|
+
return TileLayerService;
|
|
220
|
+
}();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ILayerService, ITilePickService, IInteractionTarget, ILayer } from '@antv/l7-core';
|
|
2
|
+
import { TileLayerService } from './TileLayerService';
|
|
3
|
+
export interface ITilePickServiceOptions {
|
|
4
|
+
layerService: ILayerService;
|
|
5
|
+
tileLayerService: TileLayerService;
|
|
6
|
+
parent: ILayer;
|
|
7
|
+
}
|
|
8
|
+
export declare class TilePickService implements ITilePickService {
|
|
9
|
+
private layerService;
|
|
10
|
+
private tileLayerService;
|
|
11
|
+
private tileSourceService;
|
|
12
|
+
private parent;
|
|
13
|
+
private tilePickID;
|
|
14
|
+
constructor({ layerService, tileLayerService, parent }: ITilePickServiceOptions);
|
|
15
|
+
pickRender(target: IInteractionTarget): void;
|
|
16
|
+
pick(layer: ILayer, target: IInteractionTarget): boolean;
|
|
17
|
+
selectFeature(pickedColors: Uint8Array | undefined): void;
|
|
18
|
+
highlightPickedFeature(pickedColors: Uint8Array | undefined): void;
|
|
19
|
+
updateHighLight(r: number, g: number, b: number, type: string): void;
|
|
20
|
+
setPickState(): void;
|
|
21
|
+
private color2PickId;
|
|
22
|
+
private pickId2Color;
|
|
23
|
+
/** 从瓦片中根据数据 */
|
|
24
|
+
getFeatureById(pickedFeatureIdx: number): never[] | null;
|
|
25
|
+
pickRasterLayer(layer: ILayer, target: IInteractionTarget, parent?: ILayer): boolean;
|
|
26
|
+
}
|