@antv/l7-layers 2.16.1 → 2.16.2
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 +9 -31
- package/es/Geometry/models/billboard.js +51 -89
- package/es/Geometry/models/plane.js +81 -143
- package/es/Geometry/models/sprite.js +60 -118
- package/es/canvas/index.js +10 -33
- package/es/canvas/models/canvas.js +41 -97
- package/es/citybuliding/building.js +8 -27
- package/es/citybuliding/models/build.js +57 -82
- package/es/core/BaseLayer.d.ts +3 -0
- package/es/core/BaseLayer.js +360 -528
- package/es/core/BaseModel.d.ts +9 -71
- package/es/core/BaseModel.js +118 -429
- package/es/core/CommonStyleAttribute.d.ts +2 -0
- package/es/core/CommonStyleAttribute.js +66 -0
- package/es/core/LayerPickService.js +21 -32
- package/es/core/TextureService.js +0 -13
- package/es/core/interface.d.ts +13 -3
- package/es/core/interface.js +17 -24
- package/es/core/shape/Path.js +13 -20
- package/es/core/shape/extrude.js +27 -36
- package/es/core/triangulation.d.ts +12 -0
- package/es/core/triangulation.js +124 -114
- package/es/earth/index.js +9 -33
- package/es/earth/models/atmosphere.js +30 -54
- package/es/earth/models/base.js +47 -85
- package/es/earth/models/bloomsphere.js +30 -54
- package/es/earth/utils.js +9 -13
- package/es/heatmap/index.js +10 -40
- package/es/heatmap/models/grid.js +29 -53
- package/es/heatmap/models/grid3d.js +29 -53
- package/es/heatmap/models/heatmap.d.ts +1 -0
- package/es/heatmap/models/heatmap.js +99 -150
- package/es/heatmap/models/hexagon.js +29 -53
- package/es/heatmap/shaders/grid_vert.glsl +2 -2
- package/es/heatmap/shaders/hexagon_3d_vert.glsl +2 -2
- package/es/heatmap/shaders/hexagon_vert.glsl +2 -2
- package/es/heatmap/triangulation.js +0 -4
- package/es/image/index.js +9 -28
- package/es/image/models/image.js +66 -100
- package/es/index.js +9 -17
- package/es/line/index.d.ts +1 -0
- package/es/line/index.js +12 -36
- package/es/line/models/arc.js +72 -160
- package/es/line/models/arc_3d.js +67 -148
- package/es/line/models/earthArc_3d.js +66 -148
- package/es/line/models/{half.d.ts → flow.d.ts} +1 -11
- package/es/line/models/flow.js +167 -0
- package/es/line/models/great_circle.js +57 -135
- package/es/line/models/index.d.ts +1 -1
- package/es/line/models/index.js +3 -3
- package/es/line/models/line.js +98 -186
- package/es/line/models/linearline.js +46 -115
- package/es/line/models/simpleLine.d.ts +0 -1
- package/es/line/models/simpleLine.js +42 -114
- package/es/line/models/wall.js +52 -92
- package/es/line/shaders/dash/arc_dash_frag.glsl +3 -6
- package/es/line/shaders/dash/arc_dash_vert.glsl +6 -46
- package/es/line/shaders/dash/line_dash_frag.glsl +4 -7
- package/es/line/shaders/dash/line_dash_vert.glsl +3 -33
- package/es/line/shaders/flow/flow_line_frag.glsl +13 -0
- package/es/line/shaders/flow/flow_line_vert.glsl +83 -0
- package/es/line/shaders/line_arc_3d_frag.glsl +6 -6
- package/es/line/shaders/line_arc_3d_vert.glsl +4 -34
- package/es/line/shaders/line_arc_frag.glsl +7 -11
- package/es/line/shaders/line_arc_great_circle_frag.glsl +5 -6
- package/es/line/shaders/line_arc_great_circle_vert.glsl +4 -32
- package/es/line/shaders/line_arc_vert.glsl +9 -45
- package/es/line/shaders/line_frag.glsl +15 -17
- package/es/line/shaders/line_vert.glsl +3 -34
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +5 -19
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +9 -48
- package/es/line/shaders/linear/arc_linear_frag.glsl +2 -30
- package/es/line/shaders/linear/arc_linear_vert.glsl +9 -45
- package/es/line/shaders/linear/line_linear_frag.glsl +5 -6
- package/es/line/shaders/linearLine/line_linear_frag.glsl +2 -14
- package/es/line/shaders/linearLine/line_linear_vert.glsl +14 -32
- package/es/line/shaders/simple/simpleline_frag.glsl +1 -5
- package/es/line/shaders/simple/simpleline_linear_frag.glsl +2 -6
- package/es/line/shaders/simple/simpleline_vert.glsl +7 -33
- package/es/mask/index.js +9 -28
- package/es/mask/models/fill.js +29 -54
- package/es/plugins/DataMappingPlugin.js +90 -141
- package/es/plugins/DataSourcePlugin.js +45 -68
- package/es/plugins/FeatureScalePlugin.js +67 -122
- package/es/plugins/LayerAnimateStylePlugin.js +0 -5
- package/es/plugins/LayerMaskPlugin.js +3 -11
- package/es/plugins/LayerModelPlugin.js +79 -104
- package/es/plugins/LayerStylePlugin.js +3 -9
- package/es/plugins/LightingPlugin.js +12 -18
- package/es/plugins/MultiPassRendererPlugin.js +11 -16
- package/es/plugins/PixelPickingPlugin.js +12 -21
- package/es/plugins/RegisterStyleAttributePlugin.js +5 -12
- package/es/plugins/ShaderUniformPlugin.js +15 -29
- package/es/plugins/UpdateModelPlugin.js +0 -5
- package/es/plugins/UpdateStyleAttributePlugin.js +5 -11
- package/es/point/index.d.ts +1 -0
- package/es/point/index.js +27 -77
- package/es/point/models/earthExtrude.d.ts +0 -3
- package/es/point/models/earthExtrude.js +60 -139
- package/es/point/models/earthFill.d.ts +0 -1
- package/es/point/models/earthFill.js +59 -140
- package/es/point/models/extrude.d.ts +0 -3
- package/es/point/models/extrude.js +60 -140
- package/es/point/models/fill.d.ts +0 -1
- package/es/point/models/fill.js +67 -158
- package/es/point/models/fillmage.js +66 -147
- package/es/point/models/image.js +52 -126
- package/es/point/models/index.js +2 -2
- package/es/point/models/normal.js +32 -56
- package/es/point/models/radar.d.ts +0 -1
- package/es/point/models/radar.js +42 -75
- package/es/point/models/simplePoint.d.ts +0 -1
- package/es/point/models/simplePoint.js +46 -115
- package/es/point/models/text.js +211 -344
- package/es/point/shaders/animate/wave_frag.glsl +1 -11
- package/es/point/shaders/earth/extrude_frag.glsl +5 -17
- package/es/point/shaders/earth/extrude_vert.glsl +14 -29
- package/es/point/shaders/earth/fill_frag.glsl +5 -14
- package/es/point/shaders/earth/fill_vert.glsl +1 -75
- package/es/point/shaders/extrude/extrude_frag.glsl +3 -29
- package/es/point/shaders/extrude/extrude_vert.glsl +27 -35
- package/es/point/shaders/fill_frag.glsl +9 -20
- package/es/point/shaders/fill_vert.glsl +16 -101
- package/es/point/shaders/image/fillImage_frag.glsl +2 -5
- package/es/point/shaders/image/fillImage_vert.glsl +4 -47
- package/es/point/shaders/image_frag.glsl +1 -5
- package/es/point/shaders/image_vert.glsl +1 -44
- package/es/point/shaders/normal_frag.glsl +0 -2
- package/es/point/shaders/normal_vert.glsl +2 -1
- package/es/point/shaders/radar/radar_vert.glsl +2 -2
- package/es/point/shaders/simplePoint_frag.glsl +0 -7
- package/es/point/shaders/simplePoint_vert.glsl +3 -45
- package/es/point/shaders/text_frag.glsl +6 -19
- package/es/point/shaders/text_vert.glsl +5 -66
- package/es/point/shape/extrude.js +4 -13
- package/es/polygon/index.d.ts +1 -0
- package/es/polygon/index.js +12 -40
- package/es/polygon/models/extrude.d.ts +0 -3
- package/es/polygon/models/extrude.js +122 -162
- package/es/polygon/models/fill.d.ts +0 -4
- package/es/polygon/models/fill.js +57 -130
- package/es/polygon/models/index.js +3 -2
- package/es/polygon/models/ocean.js +42 -76
- package/es/polygon/models/water.js +37 -71
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +2 -23
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +7 -5
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +7 -32
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +33 -38
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +12 -9
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +16 -44
- package/es/polygon/shaders/polygon_frag.glsl +0 -5
- package/es/polygon/shaders/polygon_linear_frag.glsl +0 -8
- package/es/polygon/shaders/polygon_linear_vert.glsl +0 -32
- package/es/polygon/shaders/polygon_vert.glsl +1 -27
- package/es/raster/buffers/triangulation.js +2 -4
- package/es/raster/index.js +9 -32
- package/es/raster/models/raster.js +80 -116
- package/es/raster/models/rasterRgb.js +84 -127
- package/es/raster/models/rasterTerrainRgb.js +56 -84
- package/es/tile/interaction/getRasterData.js +14 -20
- package/es/tile/interaction/utils.js +7 -9
- package/es/tile/manager/base.js +63 -96
- package/es/tile/service/TileLayerService.js +33 -55
- package/es/tile/service/TilePickService.js +26 -40
- package/es/tile/service/TileSourceService.js +3 -7
- package/es/tile/tileFactory/DebugTile.js +29 -46
- package/es/tile/tileFactory/ImageTile.js +20 -38
- package/es/tile/tileFactory/MaskTile.js +22 -43
- package/es/tile/tileFactory/RasterRGBTile.js +22 -42
- package/es/tile/tileFactory/RasterTerrainRGBTile.js +20 -38
- package/es/tile/tileFactory/RasterTile.js +30 -53
- package/es/tile/tileFactory/Tile.js +63 -97
- package/es/tile/tileFactory/VectorTile.js +41 -68
- package/es/tile/tileFactory/index.js +0 -11
- package/es/tile/tileFactory/layers/TileDebugLayer.js +6 -27
- package/es/tile/tileFactory/util.js +0 -3
- package/es/tile/tileLayer/BaseLayer.js +105 -146
- package/es/tile/utils.js +1 -1
- package/es/utils/blend.js +0 -2
- package/es/utils/collision-index.js +9 -16
- package/es/utils/extrude_polyline.js +101 -149
- package/es/utils/grid-index.js +2 -27
- package/es/utils/identityScale.js +0 -8
- package/es/utils/layerData.js +32 -46
- package/es/utils/multiPassRender.js +11 -13
- package/es/utils/polylineNormal.js +31 -37
- package/es/utils/simpleLine.js +2 -16
- package/es/utils/stencil.js +2 -3
- package/es/utils/symbol-layout.js +27 -53
- package/es/wind/index.js +9 -29
- package/es/wind/models/utils.js +26 -51
- package/es/wind/models/wind.js +101 -147
- package/es/wind/models/windRender.js +53 -66
- package/lib/Geometry/index.js +9 -38
- package/lib/Geometry/models/billboard.js +51 -97
- package/lib/Geometry/models/index.js +0 -5
- package/lib/Geometry/models/plane.js +79 -151
- package/lib/Geometry/models/sprite.js +60 -127
- package/lib/canvas/index.js +10 -40
- package/lib/canvas/models/canvas.js +41 -101
- package/lib/canvas/models/index.js +0 -3
- package/lib/citybuliding/building.js +8 -35
- package/lib/citybuliding/models/build.js +57 -92
- package/lib/core/BaseLayer.js +358 -520
- package/lib/core/BaseModel.js +117 -441
- package/lib/core/CommonStyleAttribute.js +72 -0
- package/lib/core/LayerPickService.js +21 -37
- package/lib/core/TextureService.js +0 -16
- package/lib/core/interface.js +21 -31
- package/lib/core/schema.js +0 -1
- package/lib/core/shape/Path.js +14 -31
- package/lib/core/shape/extrude.js +27 -59
- package/lib/core/triangulation.js +125 -153
- package/lib/earth/index.js +9 -43
- package/lib/earth/models/atmosphere.js +30 -63
- package/lib/earth/models/base.js +47 -90
- package/lib/earth/models/bloomsphere.js +30 -63
- package/lib/earth/utils.js +7 -31
- package/lib/heatmap/index.js +10 -48
- package/lib/heatmap/models/grid.js +29 -61
- package/lib/heatmap/models/grid3d.js +29 -61
- package/lib/heatmap/models/heatmap.js +99 -166
- package/lib/heatmap/models/hexagon.js +29 -61
- package/lib/heatmap/models/index.js +0 -6
- package/lib/heatmap/shaders/grid_vert.glsl +2 -2
- package/lib/heatmap/shaders/hexagon_3d_vert.glsl +2 -2
- package/lib/heatmap/shaders/hexagon_vert.glsl +2 -2
- package/lib/heatmap/triangulation.js +0 -5
- package/lib/image/index.js +9 -36
- package/lib/image/models/image.js +66 -109
- package/lib/image/models/index.js +0 -3
- package/lib/index.js +7 -61
- package/lib/line/index.js +12 -42
- package/lib/line/models/arc.js +70 -170
- package/lib/line/models/arc_3d.js +65 -159
- package/lib/line/models/earthArc_3d.js +64 -159
- package/lib/line/models/flow.js +174 -0
- package/lib/line/models/great_circle.js +57 -146
- package/lib/line/models/index.js +3 -14
- package/lib/line/models/line.js +96 -194
- package/lib/line/models/linearline.js +46 -127
- package/lib/line/models/simpleLine.js +42 -124
- package/lib/line/models/wall.js +52 -103
- package/lib/line/shaders/dash/arc_dash_frag.glsl +3 -6
- package/lib/line/shaders/dash/arc_dash_vert.glsl +6 -46
- package/lib/line/shaders/dash/line_dash_frag.glsl +4 -7
- package/lib/line/shaders/dash/line_dash_vert.glsl +3 -33
- package/lib/line/shaders/flow/flow_line_frag.glsl +13 -0
- package/lib/line/shaders/flow/flow_line_vert.glsl +83 -0
- package/lib/line/shaders/line_arc_3d_frag.glsl +6 -6
- package/lib/line/shaders/line_arc_3d_vert.glsl +4 -34
- package/lib/line/shaders/line_arc_frag.glsl +7 -11
- package/lib/line/shaders/line_arc_great_circle_frag.glsl +5 -6
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +4 -32
- package/lib/line/shaders/line_arc_vert.glsl +9 -45
- package/lib/line/shaders/line_frag.glsl +15 -17
- package/lib/line/shaders/line_vert.glsl +3 -34
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +5 -19
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +9 -48
- package/lib/line/shaders/linear/arc_linear_frag.glsl +2 -30
- package/lib/line/shaders/linear/arc_linear_vert.glsl +9 -45
- package/lib/line/shaders/linear/line_linear_frag.glsl +5 -6
- package/lib/line/shaders/linearLine/line_linear_frag.glsl +2 -14
- package/lib/line/shaders/linearLine/line_linear_vert.glsl +14 -32
- package/lib/line/shaders/simple/simpleline_frag.glsl +1 -5
- package/lib/line/shaders/simple/simpleline_linear_frag.glsl +2 -6
- package/lib/line/shaders/simple/simpleline_vert.glsl +7 -33
- package/lib/mask/index.js +9 -36
- package/lib/mask/models/fill.js +29 -63
- package/lib/mask/models/index.js +0 -3
- package/lib/plugins/DataMappingPlugin.js +90 -152
- package/lib/plugins/DataSourcePlugin.js +45 -76
- package/lib/plugins/FeatureScalePlugin.js +67 -138
- package/lib/plugins/LayerAnimateStylePlugin.js +0 -10
- package/lib/plugins/LayerMaskPlugin.js +4 -17
- package/lib/plugins/LayerModelPlugin.js +80 -113
- package/lib/plugins/LayerStylePlugin.js +4 -14
- package/lib/plugins/LightingPlugin.js +12 -25
- package/lib/plugins/MultiPassRendererPlugin.js +11 -22
- package/lib/plugins/PixelPickingPlugin.js +12 -27
- package/lib/plugins/RegisterStyleAttributePlugin.js +5 -19
- package/lib/plugins/ShaderUniformPlugin.js +15 -36
- package/lib/plugins/UpdateModelPlugin.js +1 -10
- package/lib/plugins/UpdateStyleAttributePlugin.js +5 -16
- package/lib/point/index.js +27 -83
- package/lib/point/models/earthExtrude.js +60 -150
- package/lib/point/models/earthFill.js +59 -170
- package/lib/point/models/extrude.js +60 -150
- package/lib/point/models/fill.js +65 -167
- package/lib/point/models/fillmage.js +64 -155
- package/lib/point/models/image.js +52 -136
- package/lib/point/models/index.js +1 -12
- package/lib/point/models/normal.js +32 -66
- package/lib/point/models/radar.js +42 -85
- package/lib/point/models/simplePoint.js +46 -125
- package/lib/point/models/text.js +209 -350
- package/lib/point/shaders/animate/wave_frag.glsl +1 -11
- package/lib/point/shaders/earth/extrude_frag.glsl +5 -17
- package/lib/point/shaders/earth/extrude_vert.glsl +14 -29
- package/lib/point/shaders/earth/fill_frag.glsl +5 -14
- package/lib/point/shaders/earth/fill_vert.glsl +1 -75
- package/lib/point/shaders/extrude/extrude_frag.glsl +3 -29
- package/lib/point/shaders/extrude/extrude_vert.glsl +27 -35
- package/lib/point/shaders/fill_frag.glsl +9 -20
- package/lib/point/shaders/fill_vert.glsl +16 -101
- package/lib/point/shaders/image/fillImage_frag.glsl +2 -5
- package/lib/point/shaders/image/fillImage_vert.glsl +4 -47
- package/lib/point/shaders/image_frag.glsl +1 -5
- package/lib/point/shaders/image_vert.glsl +1 -44
- package/lib/point/shaders/normal_frag.glsl +0 -2
- package/lib/point/shaders/normal_vert.glsl +2 -1
- package/lib/point/shaders/radar/radar_vert.glsl +2 -2
- package/lib/point/shaders/simplePoint_frag.glsl +0 -7
- package/lib/point/shaders/simplePoint_vert.glsl +3 -45
- package/lib/point/shaders/text_frag.glsl +6 -19
- package/lib/point/shaders/text_vert.glsl +5 -66
- package/lib/point/shape/extrude.js +4 -20
- package/lib/polygon/index.js +12 -48
- package/lib/polygon/models/extrude.js +122 -173
- package/lib/polygon/models/fill.js +57 -140
- package/lib/polygon/models/index.js +2 -14
- package/lib/polygon/models/ocean.js +42 -88
- package/lib/polygon/models/water.js +37 -82
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +2 -23
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +7 -5
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +7 -32
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +33 -38
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +12 -9
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +16 -44
- package/lib/polygon/shaders/polygon_frag.glsl +0 -5
- package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -8
- package/lib/polygon/shaders/polygon_linear_vert.glsl +0 -32
- package/lib/polygon/shaders/polygon_vert.glsl +1 -27
- package/lib/raster/buffers/triangulation.js +3 -7
- package/lib/raster/index.js +9 -40
- package/lib/raster/models/index.js +0 -5
- package/lib/raster/models/raster.js +80 -125
- package/lib/raster/models/rasterRgb.js +84 -139
- package/lib/raster/models/rasterTerrainRgb.js +56 -93
- package/lib/tile/interaction/getRasterData.js +14 -25
- package/lib/tile/interaction/utils.js +7 -19
- package/lib/tile/manager/base.js +63 -104
- package/lib/tile/service/TileLayerService.js +33 -60
- package/lib/tile/service/TilePickService.js +26 -48
- package/lib/tile/service/TileSourceService.js +2 -16
- package/lib/tile/style/utils.js +0 -3
- package/lib/tile/tileFactory/DebugTile.js +29 -54
- package/lib/tile/tileFactory/ImageTile.js +20 -46
- package/lib/tile/tileFactory/MaskTile.js +22 -51
- package/lib/tile/tileFactory/RasterRGBTile.js +22 -50
- package/lib/tile/tileFactory/RasterTerrainRGBTile.js +20 -46
- package/lib/tile/tileFactory/RasterTile.js +30 -63
- package/lib/tile/tileFactory/Tile.js +63 -102
- package/lib/tile/tileFactory/VectorTile.js +41 -76
- package/lib/tile/tileFactory/index.js +0 -25
- package/lib/tile/tileFactory/layers/TileDebugLayer.js +6 -32
- package/lib/tile/tileFactory/util.js +0 -9
- package/lib/tile/tileLayer/BaseLayer.js +105 -153
- package/lib/tile/utils.js +1 -5
- package/lib/utils/blend.js +0 -5
- package/lib/utils/collision-index.js +9 -25
- package/lib/utils/extrude_polyline.js +101 -181
- package/lib/utils/grid-index.js +2 -28
- package/lib/utils/identityScale.js +0 -9
- package/lib/utils/layerData.js +32 -51
- package/lib/utils/multiPassRender.js +11 -16
- package/lib/utils/polylineNormal.js +31 -66
- package/lib/utils/simpleLine.js +2 -21
- package/lib/utils/stencil.js +0 -4
- package/lib/utils/symbol-layout.js +27 -55
- package/lib/wind/index.js +9 -37
- package/lib/wind/models/index.js +0 -3
- package/lib/wind/models/utils.js +26 -62
- package/lib/wind/models/wind.js +101 -157
- package/lib/wind/models/windRender.js +53 -71
- package/lib/wind/models/windShader.js +0 -1
- package/package.json +7 -7
- package/es/line/models/half.js +0 -298
- package/es/line/shaders/half/line_half_frag.glsl +0 -53
- package/es/line/shaders/half/line_half_vert.glsl +0 -169
- package/es/utils/dataMappingStyle.d.ts +0 -31
- package/es/utils/dataMappingStyle.js +0 -147
- package/lib/line/models/half.js +0 -315
- package/lib/line/shaders/half/line_half_frag.glsl +0 -53
- package/lib/line/shaders/half/line_half_vert.glsl +0 -169
- package/lib/utils/dataMappingStyle.js +0 -151
package/es/tile/manager/base.js
CHANGED
|
@@ -9,66 +9,50 @@ import { updateLayersConfig } from "../style/utils";
|
|
|
9
9
|
export var Base = /*#__PURE__*/function () {
|
|
10
10
|
function Base() {
|
|
11
11
|
_classCallCheck(this, Base);
|
|
12
|
-
|
|
13
12
|
_defineProperty(this, "tileCache", new Map());
|
|
14
|
-
|
|
15
13
|
_defineProperty(this, "tileLayerCache", new Map());
|
|
16
14
|
}
|
|
17
|
-
|
|
18
15
|
_createClass(Base, [{
|
|
19
16
|
key: "initTileLayers",
|
|
20
17
|
value: function () {
|
|
21
18
|
var _initTileLayers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(layers, tile) {
|
|
22
19
|
var _this = this;
|
|
23
|
-
|
|
24
20
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
25
|
-
while (1) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
}
|
|
21
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
22
|
+
case 0:
|
|
23
|
+
return _context2.abrupt("return", Promise.all(layers.map( /*#__PURE__*/function () {
|
|
24
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(layer) {
|
|
25
|
+
var container;
|
|
26
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
27
|
+
while (1) switch (_context.prev = _context.next) {
|
|
28
|
+
case 0:
|
|
29
|
+
container = createLayerContainer(_this.parent.sceneContainer);
|
|
30
|
+
layer.setContainer(container, _this.parent.sceneContainer);
|
|
31
|
+
_context.next = 4;
|
|
32
|
+
return layer.init();
|
|
33
|
+
case 4:
|
|
34
|
+
_this.addChild(layer);
|
|
35
|
+
tile.layerLoad();
|
|
36
|
+
_this.render();
|
|
37
|
+
case 7:
|
|
38
|
+
case "end":
|
|
39
|
+
return _context.stop();
|
|
40
|
+
}
|
|
41
|
+
}, _callee);
|
|
42
|
+
}));
|
|
43
|
+
return function (_x3) {
|
|
44
|
+
return _ref.apply(this, arguments);
|
|
45
|
+
};
|
|
46
|
+
}())));
|
|
47
|
+
case 1:
|
|
48
|
+
case "end":
|
|
49
|
+
return _context2.stop();
|
|
64
50
|
}
|
|
65
51
|
}, _callee2);
|
|
66
52
|
}));
|
|
67
|
-
|
|
68
53
|
function initTileLayers(_x, _x2) {
|
|
69
54
|
return _initTileLayers.apply(this, arguments);
|
|
70
55
|
}
|
|
71
|
-
|
|
72
56
|
return initTileLayers;
|
|
73
57
|
}()
|
|
74
58
|
}, {
|
|
@@ -80,55 +64,48 @@ export var Base = /*#__PURE__*/function () {
|
|
|
80
64
|
key: "hasTile",
|
|
81
65
|
value: function hasTile(tile) {
|
|
82
66
|
return this.tileCache.has(tile.key);
|
|
83
|
-
}
|
|
67
|
+
}
|
|
84
68
|
|
|
69
|
+
// 添加图层
|
|
85
70
|
}, {
|
|
86
71
|
key: "addTile",
|
|
87
72
|
value: function () {
|
|
88
73
|
var _addTile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(tile) {
|
|
89
74
|
var layerCollections;
|
|
90
75
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
91
|
-
while (1) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return _context3.abrupt("return", layerCollections);
|
|
119
|
-
|
|
120
|
-
case 8:
|
|
121
|
-
case "end":
|
|
122
|
-
return _context3.stop();
|
|
123
|
-
}
|
|
76
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
77
|
+
case 0:
|
|
78
|
+
if (!this.hasTile(tile)) {
|
|
79
|
+
_context3.next = 2;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
return _context3.abrupt("return", {
|
|
83
|
+
layers: []
|
|
84
|
+
});
|
|
85
|
+
case 2:
|
|
86
|
+
// 存储当前 tile
|
|
87
|
+
this.tileCache.set(tile.key, tile);
|
|
88
|
+
|
|
89
|
+
// 创建 tile 对应的 layers
|
|
90
|
+
layerCollections = this.tileFactory.createTile(tile, this.initOptions); // // 初始化图层
|
|
91
|
+
_context3.next = 6;
|
|
92
|
+
return this.initTileLayers(layerCollections.layers, tile);
|
|
93
|
+
case 6:
|
|
94
|
+
this.tileLayerCache.set(tile.key, layerCollections.layers);
|
|
95
|
+
// const visible = tile.parent ? tile.parent.children.every(t=>this.tileLayerCache.has(t.key)) : true
|
|
96
|
+
// tile.parent?.children.forEach((t)=>{
|
|
97
|
+
// updateLayersConfig(this.getLayers(t),'visible',visible)
|
|
98
|
+
// })
|
|
99
|
+
return _context3.abrupt("return", layerCollections);
|
|
100
|
+
case 8:
|
|
101
|
+
case "end":
|
|
102
|
+
return _context3.stop();
|
|
124
103
|
}
|
|
125
104
|
}, _callee3, this);
|
|
126
105
|
}));
|
|
127
|
-
|
|
128
106
|
function addTile(_x4) {
|
|
129
107
|
return _addTile.apply(this, arguments);
|
|
130
108
|
}
|
|
131
|
-
|
|
132
109
|
return addTile;
|
|
133
110
|
}()
|
|
134
111
|
}, {
|
|
@@ -148,7 +125,6 @@ export var Base = /*#__PURE__*/function () {
|
|
|
148
125
|
key: "addChildren",
|
|
149
126
|
value: function addChildren(layers) {
|
|
150
127
|
var _this$children;
|
|
151
|
-
|
|
152
128
|
(_this$children = this.children).push.apply(_this$children, _toConsumableArray(layers));
|
|
153
129
|
}
|
|
154
130
|
}, {
|
|
@@ -167,11 +143,9 @@ export var Base = /*#__PURE__*/function () {
|
|
|
167
143
|
key: "removeChild",
|
|
168
144
|
value: function removeChild(layer) {
|
|
169
145
|
var layerIndex = this.children.indexOf(layer);
|
|
170
|
-
|
|
171
146
|
if (layerIndex > -1) {
|
|
172
147
|
this.children.splice(layerIndex, 1);
|
|
173
148
|
}
|
|
174
|
-
|
|
175
149
|
layer.destroy();
|
|
176
150
|
}
|
|
177
151
|
}, {
|
|
@@ -180,7 +154,6 @@ export var Base = /*#__PURE__*/function () {
|
|
|
180
154
|
if (!tile) {
|
|
181
155
|
return [];
|
|
182
156
|
}
|
|
183
|
-
|
|
184
157
|
return this.tileLayerCache.get(tile.key) || [];
|
|
185
158
|
}
|
|
186
159
|
}, {
|
|
@@ -205,7 +178,8 @@ export var Base = /*#__PURE__*/function () {
|
|
|
205
178
|
}
|
|
206
179
|
}, {
|
|
207
180
|
key: "initTileFactory",
|
|
208
|
-
value: function initTileFactory() {
|
|
181
|
+
value: function initTileFactory() {
|
|
182
|
+
// this.tileFactory = new TileFactory({
|
|
209
183
|
// parent: this.parent,
|
|
210
184
|
// mapService: this.mapService,
|
|
211
185
|
// rendererService: this.rendererService,
|
|
@@ -226,11 +200,9 @@ export var Base = /*#__PURE__*/function () {
|
|
|
226
200
|
key: "updateTileVisible",
|
|
227
201
|
value: function updateTileVisible(tile, layerService) {
|
|
228
202
|
var layers = this.getLayers(tile);
|
|
229
|
-
|
|
230
203
|
if (layers.length === 0) {
|
|
231
204
|
return;
|
|
232
205
|
}
|
|
233
|
-
|
|
234
206
|
if (tile.isVisible) {
|
|
235
207
|
// 如果可见直接进行渲染,父级发
|
|
236
208
|
updateLayersConfig(layers, 'visible', tile.isVisible);
|
|
@@ -243,16 +215,16 @@ export var Base = /*#__PURE__*/function () {
|
|
|
243
215
|
// console.log(`${t.x}/${t.y}/${t.z}`)
|
|
244
216
|
// })
|
|
245
217
|
updateLayersConfig(layers, 'visible', tile.isVisible);
|
|
246
|
-
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// this.listenLoad(tile, () => {
|
|
247
221
|
// this.isTileAllLoad(tile) && updateLayersConfig(layers, 'visible', tile.isVisible);
|
|
248
222
|
// })
|
|
249
|
-
|
|
250
223
|
}
|
|
251
224
|
}, {
|
|
252
225
|
key: "listenLoad",
|
|
253
226
|
value: function listenLoad(tile, callback) {
|
|
254
227
|
var _tile$parent;
|
|
255
|
-
|
|
256
228
|
tile.once('layerLoaded', function () {
|
|
257
229
|
callback();
|
|
258
230
|
});
|
|
@@ -271,7 +243,6 @@ export var Base = /*#__PURE__*/function () {
|
|
|
271
243
|
if (tile.isLoad) {
|
|
272
244
|
return true;
|
|
273
245
|
}
|
|
274
|
-
|
|
275
246
|
var isLoad = this.getLayers(tile).length === tile.loadedLayers;
|
|
276
247
|
tile.isLoad = isLoad;
|
|
277
248
|
return isLoad;
|
|
@@ -280,11 +251,9 @@ export var Base = /*#__PURE__*/function () {
|
|
|
280
251
|
key: "isTileChildLoaded",
|
|
281
252
|
value: function isTileChildLoaded(tile) {
|
|
282
253
|
var _this2 = this;
|
|
283
|
-
|
|
284
254
|
if (tile.isChildLoad) {
|
|
285
255
|
return true;
|
|
286
256
|
}
|
|
287
|
-
|
|
288
257
|
var children = tile.children;
|
|
289
258
|
var isLoad = children.filter(function (child) {
|
|
290
259
|
return _this2.isTileLoaded(child);
|
|
@@ -296,7 +265,6 @@ export var Base = /*#__PURE__*/function () {
|
|
|
296
265
|
key: "isTileParentLoaded",
|
|
297
266
|
value: function isTileParentLoaded(tile) {
|
|
298
267
|
var parent = tile.parent;
|
|
299
|
-
|
|
300
268
|
if (!parent) {
|
|
301
269
|
return true;
|
|
302
270
|
} else {
|
|
@@ -318,6 +286,5 @@ export var Base = /*#__PURE__*/function () {
|
|
|
318
286
|
this.tileLayerCache.clear();
|
|
319
287
|
}
|
|
320
288
|
}]);
|
|
321
|
-
|
|
322
289
|
return Base;
|
|
323
290
|
}();
|
|
@@ -9,22 +9,18 @@ export var TileLayerService = /*#__PURE__*/function () {
|
|
|
9
9
|
/**
|
|
10
10
|
* tileResource 用于存储瓦片的全局资源
|
|
11
11
|
*/
|
|
12
|
+
|
|
12
13
|
function TileLayerService(_ref) {
|
|
13
14
|
var rendererService = _ref.rendererService,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
layerService = _ref.layerService,
|
|
16
|
+
parent = _ref.parent;
|
|
17
17
|
_classCallCheck(this, TileLayerService);
|
|
18
|
-
|
|
19
18
|
_defineProperty(this, "tileResource", new Map());
|
|
20
|
-
|
|
21
19
|
_defineProperty(this, "layerTiles", []);
|
|
22
|
-
|
|
23
20
|
this.rendererService = rendererService;
|
|
24
21
|
this.layerService = layerService;
|
|
25
22
|
this.parent = parent;
|
|
26
23
|
}
|
|
27
|
-
|
|
28
24
|
_createClass(TileLayerService, [{
|
|
29
25
|
key: "tiles",
|
|
30
26
|
get: function get() {
|
|
@@ -64,7 +60,6 @@ export var TileLayerService = /*#__PURE__*/function () {
|
|
|
64
60
|
return t.key === tileKey;
|
|
65
61
|
});
|
|
66
62
|
var tile = this.layerTiles.splice(index, 1);
|
|
67
|
-
|
|
68
63
|
if (tile[0]) {
|
|
69
64
|
tile[0].destroy();
|
|
70
65
|
}
|
|
@@ -72,7 +67,8 @@ export var TileLayerService = /*#__PURE__*/function () {
|
|
|
72
67
|
}, {
|
|
73
68
|
key: "updateTileVisible",
|
|
74
69
|
value: function updateTileVisible(sourceTile) {
|
|
75
|
-
var tile = this.getTile(sourceTile.key);
|
|
70
|
+
var tile = this.getTile(sourceTile.key);
|
|
71
|
+
// if(sourceTile.isVisible) {
|
|
76
72
|
// // 不可见 => 可见 兄弟节点加载完成
|
|
77
73
|
// if(sourceTile.parent) {
|
|
78
74
|
// const flag = this.isChildrenLoaded(sourceTile.parent)
|
|
@@ -80,6 +76,7 @@ export var TileLayerService = /*#__PURE__*/function () {
|
|
|
80
76
|
// } else {
|
|
81
77
|
// tile?.updateVisible(true);
|
|
82
78
|
// }
|
|
79
|
+
|
|
83
80
|
// } else {
|
|
84
81
|
// // 可见 => 不可见 兄弟节点加载完成
|
|
85
82
|
// if(sourceTile.parent) {
|
|
@@ -89,8 +86,8 @@ export var TileLayerService = /*#__PURE__*/function () {
|
|
|
89
86
|
// tile?.updateVisible(false);
|
|
90
87
|
// }
|
|
91
88
|
// }
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
tile === null || tile === void 0 ? void 0 : tile.updateVisible(sourceTile.isVisible);
|
|
90
|
+
// if (sourceTile.isVisible) {
|
|
94
91
|
// tile?.updateVisible(sourceTile.isVisible);
|
|
95
92
|
// } else {
|
|
96
93
|
// this.removeTile(sourceTile.key);
|
|
@@ -100,34 +97,26 @@ export var TileLayerService = /*#__PURE__*/function () {
|
|
|
100
97
|
key: "isParentLoaded",
|
|
101
98
|
value: function isParentLoaded(sourceTile) {
|
|
102
99
|
var parentTile = sourceTile.parent;
|
|
103
|
-
|
|
104
100
|
if (!parentTile) {
|
|
105
101
|
return true;
|
|
106
102
|
}
|
|
107
|
-
|
|
108
103
|
var tile = this.getTile(parentTile === null || parentTile === void 0 ? void 0 : parentTile.key);
|
|
109
|
-
|
|
110
104
|
if (tile !== null && tile !== void 0 && tile.isLoaded) {
|
|
111
105
|
// 递归父级
|
|
112
106
|
return true;
|
|
113
107
|
}
|
|
114
|
-
|
|
115
108
|
return false;
|
|
116
109
|
}
|
|
117
110
|
}, {
|
|
118
111
|
key: "isChildrenLoaded",
|
|
119
112
|
value: function isChildrenLoaded(sourceTile) {
|
|
120
113
|
var _this = this;
|
|
121
|
-
|
|
122
114
|
var childrenTile = sourceTile === null || sourceTile === void 0 ? void 0 : sourceTile.children;
|
|
123
|
-
|
|
124
115
|
if (childrenTile.length === 0) {
|
|
125
116
|
return true;
|
|
126
117
|
}
|
|
127
|
-
|
|
128
118
|
return childrenTile.some(function (tile) {
|
|
129
119
|
var tileLayer = _this.getTile(tile === null || tile === void 0 ? void 0 : tile.key);
|
|
130
|
-
|
|
131
120
|
return (tileLayer === null || tileLayer === void 0 ? void 0 : tileLayer.isLoaded) === false;
|
|
132
121
|
});
|
|
133
122
|
}
|
|
@@ -136,49 +125,39 @@ export var TileLayerService = /*#__PURE__*/function () {
|
|
|
136
125
|
value: function () {
|
|
137
126
|
var _render = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
138
127
|
var _this2 = this;
|
|
139
|
-
|
|
140
128
|
var layers, renders;
|
|
141
129
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
142
|
-
while (1) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
_context2.next = 4;
|
|
168
|
-
return Promise.all(renders);
|
|
169
|
-
|
|
170
|
-
case 4:
|
|
171
|
-
case "end":
|
|
172
|
-
return _context2.stop();
|
|
173
|
-
}
|
|
130
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
131
|
+
case 0:
|
|
132
|
+
layers = this.getRenderLayers();
|
|
133
|
+
renders = layers.map( /*#__PURE__*/function () {
|
|
134
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(layer) {
|
|
135
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
136
|
+
while (1) switch (_context.prev = _context.next) {
|
|
137
|
+
case 0:
|
|
138
|
+
_context.next = 2;
|
|
139
|
+
return _this2.layerService.renderTileLayer(layer);
|
|
140
|
+
case 2:
|
|
141
|
+
case "end":
|
|
142
|
+
return _context.stop();
|
|
143
|
+
}
|
|
144
|
+
}, _callee);
|
|
145
|
+
}));
|
|
146
|
+
return function (_x) {
|
|
147
|
+
return _ref2.apply(this, arguments);
|
|
148
|
+
};
|
|
149
|
+
}());
|
|
150
|
+
_context2.next = 4;
|
|
151
|
+
return Promise.all(renders);
|
|
152
|
+
case 4:
|
|
153
|
+
case "end":
|
|
154
|
+
return _context2.stop();
|
|
174
155
|
}
|
|
175
156
|
}, _callee2, this);
|
|
176
157
|
}));
|
|
177
|
-
|
|
178
158
|
function render() {
|
|
179
159
|
return _render.apply(this, arguments);
|
|
180
160
|
}
|
|
181
|
-
|
|
182
161
|
return render;
|
|
183
162
|
}()
|
|
184
163
|
}, {
|
|
@@ -219,6 +198,5 @@ export var TileLayerService = /*#__PURE__*/function () {
|
|
|
219
198
|
this.tileResource.clear();
|
|
220
199
|
}
|
|
221
200
|
}]);
|
|
222
|
-
|
|
223
201
|
return TileLayerService;
|
|
224
202
|
}();
|
|
@@ -11,25 +11,20 @@ var ACTIVE = 'active';
|
|
|
11
11
|
export var TilePickService = /*#__PURE__*/function () {
|
|
12
12
|
function TilePickService(_ref) {
|
|
13
13
|
var layerService = _ref.layerService,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
tileLayerService = _ref.tileLayerService,
|
|
15
|
+
parent = _ref.parent;
|
|
17
16
|
_classCallCheck(this, TilePickService);
|
|
18
|
-
|
|
19
17
|
_defineProperty(this, "tilePickID", new Map());
|
|
20
|
-
|
|
21
18
|
this.layerService = layerService;
|
|
22
19
|
this.tileLayerService = tileLayerService;
|
|
23
20
|
this.parent = parent;
|
|
24
21
|
this.tileSourceService = new TileSourceService();
|
|
25
22
|
}
|
|
26
|
-
|
|
27
23
|
_createClass(TilePickService, [{
|
|
28
24
|
key: "pickRender",
|
|
29
25
|
value: function pickRender(target) {
|
|
30
26
|
// 一个 TileLayer 有多个 Tile,但是会同时触发事件的只有一个 Tile
|
|
31
27
|
var tile = this.tileLayerService.getVisibleTileBylngLat(target.lngLat);
|
|
32
|
-
|
|
33
28
|
if (tile) {
|
|
34
29
|
// TODO 多图层拾取
|
|
35
30
|
var pickLayer = tile.getMainLayer();
|
|
@@ -41,18 +36,14 @@ export var TilePickService = /*#__PURE__*/function () {
|
|
|
41
36
|
value: function pick(layer, target) {
|
|
42
37
|
var container = this.parent.getContainer();
|
|
43
38
|
var pickingService = container.get(TYPES.IPickingService);
|
|
44
|
-
|
|
45
39
|
if (layer.type === 'RasterLayer') {
|
|
46
40
|
var tile = this.tileLayerService.getVisibleTileBylngLat(target.lngLat);
|
|
47
|
-
|
|
48
41
|
if (tile && tile.getMainLayer() !== undefined) {
|
|
49
42
|
var pickLayer = tile.getMainLayer();
|
|
50
43
|
return pickLayer.layerPickService.pickRasterLayer(pickLayer, target, this.parent);
|
|
51
44
|
}
|
|
52
|
-
|
|
53
45
|
return false;
|
|
54
46
|
}
|
|
55
|
-
|
|
56
47
|
this.pickRender(target);
|
|
57
48
|
return pickingService.pickFromPickingFBO(layer, target);
|
|
58
49
|
}
|
|
@@ -61,10 +52,9 @@ export var TilePickService = /*#__PURE__*/function () {
|
|
|
61
52
|
value: function selectFeature(pickedColors) {
|
|
62
53
|
// @ts-ignore
|
|
63
54
|
var _pickedColors = _slicedToArray(pickedColors, 3),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
r = _pickedColors[0],
|
|
56
|
+
g = _pickedColors[1],
|
|
57
|
+
b = _pickedColors[2];
|
|
68
58
|
var id = this.color2PickId(r, g, b);
|
|
69
59
|
this.tilePickID.set(SELECT, id);
|
|
70
60
|
this.updateHighLight(r, g, b, SELECT);
|
|
@@ -74,10 +64,9 @@ export var TilePickService = /*#__PURE__*/function () {
|
|
|
74
64
|
value: function highlightPickedFeature(pickedColors) {
|
|
75
65
|
// @ts-ignore
|
|
76
66
|
var _pickedColors2 = _slicedToArray(pickedColors, 3),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
67
|
+
r = _pickedColors2[0],
|
|
68
|
+
g = _pickedColors2[1],
|
|
69
|
+
b = _pickedColors2[2];
|
|
81
70
|
var id = this.color2PickId(r, g, b);
|
|
82
71
|
this.tilePickID.set(ACTIVE, id);
|
|
83
72
|
this.updateHighLight(r, g, b, ACTIVE);
|
|
@@ -87,12 +76,10 @@ export var TilePickService = /*#__PURE__*/function () {
|
|
|
87
76
|
value: function updateHighLight(r, g, b, type) {
|
|
88
77
|
this.tileLayerService.tiles.map(function (tile) {
|
|
89
78
|
var layer = tile.getMainLayer();
|
|
90
|
-
|
|
91
79
|
switch (type) {
|
|
92
80
|
case SELECT:
|
|
93
81
|
layer === null || layer === void 0 ? void 0 : layer.hooks.beforeSelect.call([r, g, b]);
|
|
94
82
|
break;
|
|
95
|
-
|
|
96
83
|
case ACTIVE:
|
|
97
84
|
layer === null || layer === void 0 ? void 0 : layer.hooks.beforeHighlight.call([r, g, b]);
|
|
98
85
|
break;
|
|
@@ -104,25 +91,21 @@ export var TilePickService = /*#__PURE__*/function () {
|
|
|
104
91
|
value: function setPickState() {
|
|
105
92
|
var selectColor = this.tilePickID.get(SELECT);
|
|
106
93
|
var activeColor = this.tilePickID.get(ACTIVE);
|
|
107
|
-
|
|
108
94
|
if (selectColor) {
|
|
109
95
|
var _this$pickId2Color = this.pickId2Color(selectColor),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
96
|
+
_this$pickId2Color2 = _slicedToArray(_this$pickId2Color, 3),
|
|
97
|
+
r = _this$pickId2Color2[0],
|
|
98
|
+
g = _this$pickId2Color2[1],
|
|
99
|
+
b = _this$pickId2Color2[2];
|
|
115
100
|
this.updateHighLight(r, g, b, SELECT);
|
|
116
101
|
return;
|
|
117
102
|
}
|
|
118
|
-
|
|
119
103
|
if (activeColor) {
|
|
120
104
|
var _this$pickId2Color3 = this.pickId2Color(activeColor),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
105
|
+
_this$pickId2Color4 = _slicedToArray(_this$pickId2Color3, 3),
|
|
106
|
+
_r = _this$pickId2Color4[0],
|
|
107
|
+
_g = _this$pickId2Color4[1],
|
|
108
|
+
_b = _this$pickId2Color4[2];
|
|
126
109
|
this.updateHighLight(_r, _g, _b, ACTIVE);
|
|
127
110
|
return;
|
|
128
111
|
}
|
|
@@ -137,33 +120,36 @@ export var TilePickService = /*#__PURE__*/function () {
|
|
|
137
120
|
value: function pickId2Color(str) {
|
|
138
121
|
return encodePickingColor(str);
|
|
139
122
|
}
|
|
140
|
-
/** 从瓦片中根据数据 */
|
|
141
123
|
|
|
124
|
+
/** 从瓦片中根据数据 */
|
|
142
125
|
}, {
|
|
143
126
|
key: "getFeatureById",
|
|
144
127
|
value: function getFeatureById(pickedFeatureIdx) {
|
|
145
128
|
// 提取当前可见瓦片
|
|
146
129
|
var tiles = this.tileLayerService.getTiles().filter(function (tile) {
|
|
147
130
|
return tile.visible;
|
|
148
|
-
});
|
|
149
|
-
|
|
131
|
+
});
|
|
132
|
+
// 提取当前可见瓦片中匹配 ID 的 feature 列表
|
|
150
133
|
var features = [];
|
|
151
134
|
tiles.forEach(function (tile) {
|
|
152
135
|
features.push.apply(features, _toConsumableArray(tile.getFeatureById(pickedFeatureIdx)));
|
|
153
|
-
});
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// 将 feature 列表合并后返回
|
|
154
139
|
// 统一返回成 polygon 的格式 点、线、面可以通用
|
|
140
|
+
|
|
155
141
|
// const data = this.tileSourceService.getCombineFeature(features);
|
|
156
142
|
|
|
157
143
|
return features;
|
|
158
|
-
}
|
|
159
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
144
|
+
}
|
|
160
145
|
|
|
146
|
+
// Tip: for interface define
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
161
148
|
}, {
|
|
162
149
|
key: "pickRasterLayer",
|
|
163
150
|
value: function pickRasterLayer(layer, target, parent) {
|
|
164
151
|
return false;
|
|
165
152
|
}
|
|
166
153
|
}]);
|
|
167
|
-
|
|
168
154
|
return TilePickService;
|
|
169
155
|
}();
|
|
@@ -3,37 +3,33 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
4
|
import * as turf from '@turf/helpers';
|
|
5
5
|
import union from '@turf/union';
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
8
|
* 专门处理 Tile 数据相关
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
10
|
export var TileSourceService = /*#__PURE__*/function () {
|
|
11
11
|
function TileSourceService() {
|
|
12
12
|
_classCallCheck(this, TileSourceService);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
14
|
_createClass(TileSourceService, [{
|
|
16
15
|
key: "getCombineFeature",
|
|
17
16
|
value: function getCombineFeature(features) {
|
|
18
17
|
var p = null;
|
|
19
18
|
var properties = features[0];
|
|
20
19
|
features.map(function (feature) {
|
|
21
|
-
var polygon = turf.polygon(feature.coordinates);
|
|
22
|
-
|
|
20
|
+
var polygon = turf.polygon(feature.coordinates);
|
|
21
|
+
// tslint:disable-next-line: prefer-conditional-expression
|
|
23
22
|
if (p === null) {
|
|
24
23
|
p = polygon;
|
|
25
24
|
} else {
|
|
26
25
|
p = union(p, polygon);
|
|
27
26
|
}
|
|
28
27
|
});
|
|
29
|
-
|
|
30
28
|
if (properties) {
|
|
31
29
|
p.properties = _objectSpread({}, properties);
|
|
32
30
|
}
|
|
33
|
-
|
|
34
31
|
return p;
|
|
35
32
|
}
|
|
36
33
|
}]);
|
|
37
|
-
|
|
38
34
|
return TileSourceService;
|
|
39
35
|
}();
|