@antv/l7-layers 2.10.3 → 2.10.4
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 +3 -2
- package/es/Geometry/index.js +17 -27
- package/es/Geometry/models/billboard.d.ts +2 -2
- package/es/Geometry/models/billboard.js +37 -77
- package/es/Geometry/models/plane.d.ts +2 -2
- package/es/Geometry/models/plane.js +40 -80
- package/es/Geometry/models/sprite.d.ts +2 -2
- package/es/Geometry/models/sprite.js +45 -83
- package/es/canvas/index.d.ts +3 -2
- package/es/canvas/index.js +19 -29
- package/es/canvas/models/canvas.d.ts +2 -2
- package/es/canvas/models/canvas.js +15 -54
- package/es/citybuliding/building.d.ts +3 -2
- package/es/citybuliding/building.js +17 -26
- package/es/citybuliding/models/build.d.ts +2 -2
- package/es/citybuliding/models/build.js +25 -70
- package/es/core/BaseLayer.d.ts +18 -21
- package/es/core/BaseLayer.js +274 -385
- package/es/core/BaseModel.d.ts +2 -2
- package/es/core/BaseModel.js +6 -47
- package/es/core/triangulation.js +1 -8
- package/es/earth/index.d.ts +2 -2
- package/es/earth/index.js +9 -28
- package/es/earth/models/atmosphere.d.ts +2 -2
- package/es/earth/models/atmosphere.js +22 -67
- package/es/earth/models/base.d.ts +2 -2
- package/es/earth/models/base.js +43 -89
- package/es/earth/models/bloomsphere.d.ts +2 -2
- package/es/earth/models/bloomsphere.js +22 -67
- package/es/heatmap/index.d.ts +3 -2
- package/es/heatmap/index.js +22 -33
- package/es/heatmap/models/grid.d.ts +2 -2
- package/es/heatmap/models/grid.js +27 -68
- package/es/heatmap/models/grid3d.d.ts +2 -2
- package/es/heatmap/models/grid3d.js +28 -69
- package/es/heatmap/models/heatmap.d.ts +2 -2
- package/es/heatmap/models/heatmap.js +14 -40
- package/es/heatmap/models/hexagon.d.ts +2 -2
- package/es/heatmap/models/hexagon.js +28 -69
- package/es/image/index.d.ts +3 -2
- package/es/image/index.js +17 -27
- package/es/image/models/dataImage.d.ts +2 -2
- package/es/image/models/dataImage.js +54 -93
- package/es/image/models/image.d.ts +2 -2
- package/es/image/models/image.js +67 -108
- package/es/image/models/tileDataImage.d.ts +2 -2
- package/es/image/models/tileDataImage.js +43 -84
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/line/index.d.ts +4 -5
- package/es/line/index.js +25 -51
- package/es/line/models/arc.d.ts +2 -2
- package/es/line/models/arc.js +38 -73
- package/es/line/models/arc_3d.d.ts +2 -2
- package/es/line/models/arc_3d.js +34 -69
- package/es/line/models/earthArc_3d.d.ts +2 -2
- package/es/line/models/earthArc_3d.js +37 -72
- package/es/line/models/great_circle.d.ts +2 -2
- package/es/line/models/great_circle.js +29 -70
- package/es/line/models/half.d.ts +2 -2
- package/es/line/models/half.js +17 -40
- package/es/line/models/index.d.ts +1 -1
- package/es/line/models/index.js +2 -0
- package/es/line/models/line.d.ts +2 -2
- package/es/line/models/line.js +47 -79
- package/es/line/models/linearline.d.ts +2 -2
- package/es/line/models/linearline.js +31 -70
- package/es/line/models/simpleLine.d.ts +2 -2
- package/es/line/models/simpleLine.js +34 -71
- package/es/line/models/simpleTileLine.d.ts +2 -2
- package/es/line/models/simpleTileLine.js +30 -70
- package/es/line/models/tile.d.ts +2 -2
- package/es/line/models/tile.js +17 -40
- package/es/line/models/wall.d.ts +2 -2
- package/es/line/models/wall.js +22 -67
- package/es/mask/index.d.ts +4 -2
- package/es/mask/index.js +97 -27
- package/es/mask/models/fill.d.ts +2 -2
- package/es/mask/models/fill.js +16 -40
- package/es/mask/models/index.d.ts +1 -1
- package/es/mask/models/index.js +3 -1
- package/es/plugins/DataMappingPlugin.d.ts +2 -0
- package/es/plugins/DataMappingPlugin.js +152 -90
- package/es/plugins/DataSourcePlugin.js +30 -74
- package/es/plugins/FeatureScalePlugin.d.ts +1 -0
- package/es/plugins/FeatureScalePlugin.js +61 -85
- package/es/plugins/LayerModelPlugin.d.ts +2 -2
- package/es/plugins/LayerModelPlugin.js +37 -121
- package/es/plugins/LayerStylePlugin.js +6 -1
- package/es/plugins/MultiPassRendererPlugin.js +1 -1
- package/es/plugins/PixelPickingPlugin.js +1 -1
- package/es/plugins/RegisterStyleAttributePlugin.js +16 -1
- package/es/plugins/UpdateModelPlugin.js +0 -3
- package/es/plugins/UpdateStyleAttributePlugin.js +6 -3
- package/es/point/index.d.ts +4 -4
- package/es/point/index.js +23 -55
- package/es/point/models/earthExtrude.d.ts +2 -2
- package/es/point/models/earthExtrude.js +30 -73
- package/es/point/models/earthFill.d.ts +2 -2
- package/es/point/models/earthFill.js +21 -66
- package/es/point/models/extrude.d.ts +2 -2
- package/es/point/models/extrude.js +17 -40
- package/es/point/models/fill.d.ts +2 -2
- package/es/point/models/fill.js +20 -43
- package/es/point/models/fillmage.d.ts +2 -2
- package/es/point/models/fillmage.js +43 -82
- package/es/point/models/image.d.ts +2 -2
- package/es/point/models/image.js +31 -72
- package/es/point/models/index.d.ts +1 -1
- package/es/point/models/index.js +2 -0
- package/es/point/models/normal.d.ts +2 -2
- package/es/point/models/normal.js +30 -71
- package/es/point/models/radar.d.ts +2 -2
- package/es/point/models/radar.js +35 -75
- package/es/point/models/simplePoint.d.ts +2 -2
- package/es/point/models/simplePoint.js +29 -70
- package/es/point/models/text.d.ts +2 -3
- package/es/point/models/text.js +110 -183
- package/es/point/models/tile.d.ts +2 -2
- package/es/point/models/tile.js +35 -77
- package/es/point/models/tileText.d.ts +2 -2
- package/es/point/models/tileText.js +116 -151
- package/es/polygon/index.d.ts +3 -2
- package/es/polygon/index.js +24 -27
- package/es/polygon/models/extrude.d.ts +2 -2
- package/es/polygon/models/extrude.js +32 -69
- package/es/polygon/models/fill.d.ts +2 -2
- package/es/polygon/models/fill.js +43 -76
- package/es/polygon/models/index.d.ts +1 -1
- package/es/polygon/models/index.js +2 -0
- package/es/polygon/models/ocean.d.ts +2 -2
- package/es/polygon/models/ocean.js +28 -69
- package/es/polygon/models/tile.d.ts +2 -2
- package/es/polygon/models/tile.js +30 -70
- package/es/polygon/models/water.d.ts +2 -2
- package/es/polygon/models/water.js +28 -69
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +2 -1
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +2 -1
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +2 -1
- package/es/raster/index.d.ts +4 -3
- package/es/raster/index.js +22 -28
- package/es/raster/models/index.d.ts +1 -1
- package/es/raster/models/index.js +3 -1
- package/es/raster/models/raster.d.ts +2 -2
- package/es/raster/models/raster.js +13 -36
- package/es/raster/models/rasterRgb.d.ts +2 -2
- package/es/raster/models/rasterRgb.js +13 -36
- package/es/raster/models/rasterTile.d.ts +2 -2
- package/es/raster/models/rasterTile.js +36 -77
- package/es/raster/raster.d.ts +1 -1
- package/es/raster/raster.js +22 -42
- package/es/tile/interaction/TilePickService.d.ts +16 -0
- package/es/tile/interaction/TilePickService.js +129 -0
- package/es/tile/interaction/getRasterData.d.ts +2 -2
- package/es/tile/interaction/utils.js +11 -3
- package/es/tile/interface.d.ts +4 -5
- package/es/tile/manager/base.d.ts +12 -17
- package/es/tile/manager/base.js +47 -212
- package/es/tile/manager/layerManager.d.ts +19 -0
- package/es/tile/manager/layerManager.js +254 -0
- package/es/tile/manager/mapLayerManager.d.ts +7 -0
- package/es/tile/manager/mapLayerManager.js +119 -0
- package/es/tile/models/tileModel.d.ts +10 -0
- package/es/tile/models/tileModel.js +81 -0
- package/es/tile/render/TileRenderService.d.ts +10 -0
- package/es/tile/render/TileRenderService.js +68 -0
- package/es/tile/style/TileStyleService.d.ts +17 -0
- package/es/tile/style/TileStyleService.js +118 -0
- package/es/tile/style/constants.d.ts +13 -1
- package/es/tile/style/constants.js +15 -6
- package/es/tile/style/utils.d.ts +8 -1
- package/es/tile/style/utils.js +126 -0
- package/es/tile/tileFactory/base.d.ts +45 -0
- package/es/tile/tileFactory/base.js +403 -0
- package/es/tile/tileFactory/index.d.ts +4 -10
- package/es/tile/tileFactory/index.js +23 -30
- package/es/tile/tileFactory/layers/{RasterDataLayer.d.ts → rasterDataLayer.d.ts} +3 -3
- package/es/tile/tileFactory/layers/{RasterDataLayer.js → rasterDataLayer.js} +21 -33
- package/es/tile/tileFactory/layers/{TileDebugLayer.d.ts → tileTest.d.ts} +2 -2
- package/es/tile/tileFactory/layers/{TileDebugLayer.js → tileTest.js} +10 -23
- package/es/tile/tileFactory/layers/vectorLayer.d.ts +30 -0
- package/es/tile/tileFactory/layers/vectorLayer.js +253 -0
- package/es/tile/tileFactory/line.d.ts +12 -0
- package/es/tile/tileFactory/line.js +59 -0
- package/es/tile/tileFactory/mask.d.ts +12 -0
- package/es/tile/tileFactory/mask.js +60 -0
- package/es/tile/tileFactory/point.d.ts +12 -0
- package/es/tile/tileFactory/point.js +60 -0
- package/es/tile/tileFactory/polygon.d.ts +12 -0
- package/es/tile/tileFactory/polygon.js +59 -0
- package/es/tile/tileFactory/raster.d.ts +12 -0
- package/es/tile/tileFactory/raster.js +55 -0
- package/es/tile/tileFactory/rasterData.d.ts +12 -0
- package/es/tile/tileFactory/rasterData.js +81 -0
- package/es/tile/tileFactory/test.d.ts +12 -0
- package/es/tile/tileFactory/test.js +94 -0
- package/es/tile/tileLayer/MapTileLayer.d.ts +6 -0
- package/es/tile/tileLayer/MapTileLayer.js +48 -0
- package/es/tile/tileLayer/TileLayer.d.ts +22 -0
- package/es/tile/tileLayer/TileLayer.js +198 -0
- package/es/tile/tileLayer/base.d.ts +33 -0
- package/es/tile/tileLayer/base.js +212 -0
- package/es/tile/utils.d.ts +11 -1
- package/es/tile/utils.js +129 -0
- package/es/utils/dataMappingStyle.d.ts +4 -4
- package/es/utils/dataMappingStyle.js +18 -16
- package/es/utils/layerData.js +11 -5
- package/es/wind/index.d.ts +3 -2
- package/es/wind/index.js +17 -27
- package/es/wind/models/wind.d.ts +2 -2
- package/es/wind/models/wind.js +104 -123
- package/lib/Geometry/index.js +17 -29
- package/lib/Geometry/models/billboard.js +37 -79
- package/lib/Geometry/models/plane.js +40 -82
- package/lib/Geometry/models/sprite.js +45 -85
- package/lib/canvas/index.js +19 -31
- package/lib/canvas/models/canvas.js +15 -56
- package/lib/citybuliding/building.js +17 -28
- package/lib/citybuliding/models/build.js +25 -72
- package/lib/core/BaseLayer.js +269 -385
- package/lib/core/BaseModel.js +6 -48
- package/lib/core/triangulation.js +1 -8
- package/lib/earth/index.js +9 -30
- package/lib/earth/models/atmosphere.js +22 -69
- package/lib/earth/models/base.js +42 -90
- package/lib/earth/models/bloomsphere.js +22 -69
- package/lib/heatmap/index.js +22 -35
- package/lib/heatmap/models/grid.js +27 -70
- package/lib/heatmap/models/grid3d.js +28 -71
- package/lib/heatmap/models/heatmap.js +14 -40
- package/lib/heatmap/models/hexagon.js +28 -71
- package/lib/image/index.js +17 -29
- package/lib/image/models/dataImage.js +54 -95
- package/lib/image/models/image.js +67 -110
- package/lib/image/models/tileDataImage.js +43 -86
- package/lib/index.js +5 -5
- package/lib/line/index.js +26 -53
- package/lib/line/models/arc.js +38 -75
- package/lib/line/models/arc_3d.js +34 -71
- package/lib/line/models/earthArc_3d.js +37 -74
- package/lib/line/models/great_circle.js +29 -72
- package/lib/line/models/half.js +17 -40
- package/lib/line/models/index.js +3 -0
- package/lib/line/models/line.js +47 -81
- package/lib/line/models/linearline.js +31 -72
- package/lib/line/models/simpleLine.js +34 -73
- package/lib/line/models/simpleTileLine.js +30 -72
- package/lib/line/models/tile.js +17 -40
- package/lib/line/models/wall.js +22 -69
- package/lib/mask/index.js +99 -28
- package/lib/mask/models/fill.js +16 -40
- package/lib/mask/models/index.js +4 -1
- package/lib/plugins/DataMappingPlugin.js +149 -91
- package/lib/plugins/DataSourcePlugin.js +30 -76
- package/lib/plugins/FeatureScalePlugin.js +61 -87
- package/lib/plugins/LayerModelPlugin.js +41 -128
- package/lib/plugins/LayerStylePlugin.js +6 -1
- package/lib/plugins/MultiPassRendererPlugin.js +1 -1
- package/lib/plugins/PixelPickingPlugin.js +1 -1
- package/lib/plugins/RegisterStyleAttributePlugin.js +16 -1
- package/lib/plugins/UpdateModelPlugin.js +0 -3
- package/lib/plugins/UpdateStyleAttributePlugin.js +6 -3
- package/lib/point/index.js +24 -56
- package/lib/point/models/earthExtrude.js +30 -75
- package/lib/point/models/earthFill.js +21 -68
- package/lib/point/models/extrude.js +17 -40
- package/lib/point/models/fill.js +21 -44
- package/lib/point/models/fillmage.js +43 -84
- package/lib/point/models/image.js +31 -74
- package/lib/point/models/index.js +3 -0
- package/lib/point/models/normal.js +30 -73
- package/lib/point/models/radar.js +35 -77
- package/lib/point/models/simplePoint.js +29 -72
- package/lib/point/models/text.js +109 -183
- package/lib/point/models/tile.js +35 -79
- package/lib/point/models/tileText.js +115 -151
- package/lib/polygon/index.js +25 -29
- package/lib/polygon/models/extrude.js +32 -71
- package/lib/polygon/models/fill.js +43 -78
- package/lib/polygon/models/index.js +3 -0
- package/lib/polygon/models/ocean.js +28 -71
- package/lib/polygon/models/tile.js +30 -72
- package/lib/polygon/models/water.js +28 -71
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +2 -1
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +2 -1
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +2 -1
- package/lib/raster/index.js +22 -30
- package/lib/raster/models/index.js +4 -1
- package/lib/raster/models/raster.js +13 -36
- package/lib/raster/models/rasterRgb.js +13 -36
- package/lib/raster/models/rasterTile.js +36 -79
- package/lib/raster/raster.js +22 -44
- package/lib/tile/interaction/TilePickService.js +143 -0
- package/lib/tile/interaction/utils.js +11 -3
- package/lib/tile/manager/base.js +47 -213
- package/lib/tile/manager/layerManager.js +275 -0
- package/lib/tile/manager/mapLayerManager.js +134 -0
- package/lib/tile/models/tileModel.js +94 -0
- package/lib/tile/render/TileRenderService.js +78 -0
- package/lib/tile/style/TileStyleService.js +133 -0
- package/lib/tile/style/constants.js +19 -8
- package/lib/tile/style/utils.js +140 -0
- package/lib/tile/tileFactory/base.js +427 -0
- package/lib/tile/tileFactory/index.js +24 -42
- package/lib/tile/tileFactory/layers/{RasterDataLayer.js → rasterDataLayer.js} +21 -35
- package/lib/tile/tileFactory/layers/{TileDebugLayer.js → tileTest.js} +11 -24
- package/lib/tile/tileFactory/layers/vectorLayer.js +268 -0
- package/lib/tile/tileFactory/line.js +70 -0
- package/lib/tile/tileFactory/mask.js +71 -0
- package/lib/tile/tileFactory/point.js +71 -0
- package/lib/tile/tileFactory/polygon.js +70 -0
- package/lib/tile/tileFactory/raster.js +68 -0
- package/lib/tile/tileFactory/rasterData.js +93 -0
- package/lib/tile/tileFactory/test.js +106 -0
- package/lib/tile/tileLayer/MapTileLayer.js +63 -0
- package/lib/tile/tileLayer/TileLayer.js +215 -0
- package/lib/tile/tileLayer/base.js +225 -0
- package/lib/tile/utils.js +148 -0
- package/lib/utils/dataMappingStyle.js +20 -18
- package/lib/utils/layerData.js +10 -4
- package/lib/wind/index.js +17 -29
- package/lib/wind/models/wind.js +104 -125
- package/package.json +7 -7
- package/es/core/LayerPickService.d.ts +0 -9
- package/es/core/LayerPickService.js +0 -85
- package/es/tile/service/TileLayerService.d.ts +0 -33
- package/es/tile/service/TileLayerService.js +0 -172
- package/es/tile/service/TilePickService.d.ts +0 -22
- package/es/tile/service/TilePickService.js +0 -148
- package/es/tile/service/TileSourceService.d.ts +0 -7
- package/es/tile/service/TileSourceService.js +0 -39
- package/es/tile/tileFactory/DebugTile.d.ts +0 -16
- package/es/tile/tileFactory/DebugTile.js +0 -100
- package/es/tile/tileFactory/ImageTile.d.ts +0 -14
- package/es/tile/tileFactory/ImageTile.js +0 -89
- package/es/tile/tileFactory/MaskTile.d.ts +0 -17
- package/es/tile/tileFactory/MaskTile.js +0 -98
- package/es/tile/tileFactory/RasterRGBTile.d.ts +0 -16
- package/es/tile/tileFactory/RasterRGBTile.js +0 -91
- package/es/tile/tileFactory/RasterTile.d.ts +0 -27
- package/es/tile/tileFactory/RasterTile.js +0 -186
- package/es/tile/tileFactory/Tile.d.ts +0 -34
- package/es/tile/tileFactory/Tile.js +0 -199
- package/es/tile/tileFactory/VectorTile.d.ts +0 -20
- package/es/tile/tileFactory/VectorTile.js +0 -152
- package/es/tile/tileFactory/util.d.ts +0 -6
- package/es/tile/tileFactory/util.js +0 -33
- package/es/tile/tileLayer/BaseLayer.d.ts +0 -46
- package/es/tile/tileLayer/BaseLayer.js +0 -358
- package/lib/core/LayerPickService.js +0 -96
- package/lib/tile/service/TileLayerService.js +0 -185
- package/lib/tile/service/TilePickService.js +0 -162
- package/lib/tile/service/TileSourceService.js +0 -59
- package/lib/tile/tileFactory/DebugTile.js +0 -115
- package/lib/tile/tileFactory/ImageTile.js +0 -104
- package/lib/tile/tileFactory/MaskTile.js +0 -113
- package/lib/tile/tileFactory/RasterRGBTile.js +0 -106
- package/lib/tile/tileFactory/RasterTile.js +0 -205
- package/lib/tile/tileFactory/Tile.js +0 -210
- package/lib/tile/tileFactory/VectorTile.js +0 -167
- package/lib/tile/tileFactory/util.js +0 -48
- package/lib/tile/tileLayer/BaseLayer.js +0 -373
package/lib/point/models/text.js
CHANGED
|
@@ -107,49 +107,79 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
107
107
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "textureHeight", 0);
|
|
108
108
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "textCount", 0);
|
|
109
109
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "preTextStyle", {});
|
|
110
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
switch (_context.prev = _context.next) {
|
|
114
|
-
case 0:
|
|
115
|
-
_this.initGlyph(); //
|
|
110
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "buildModels", /*#__PURE__*/function () {
|
|
111
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(callbackModel) {
|
|
112
|
+
var _ref2, _ref2$mask, mask, _ref2$maskInside, maskInside;
|
|
116
113
|
|
|
114
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
115
|
+
while (1) {
|
|
116
|
+
switch (_context.prev = _context.next) {
|
|
117
|
+
case 0:
|
|
118
|
+
_ref2 = _this.layer.getLayerConfig(), _ref2$mask = _ref2.mask, mask = _ref2$mask === void 0 ? false : _ref2$mask, _ref2$maskInside = _ref2.maskInside, maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside;
|
|
117
119
|
|
|
118
|
-
|
|
120
|
+
_this.mapping();
|
|
119
121
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
_this.layer.buildLayerModel({
|
|
123
|
+
moduleName: 'pointText',
|
|
124
|
+
vertexShader: textVert,
|
|
125
|
+
fragmentShader: textFrag,
|
|
126
|
+
triangulation: TextTriangulation.bind((0, _assertThisInitialized2.default)(_this)),
|
|
127
|
+
depth: {
|
|
128
|
+
enable: false
|
|
129
|
+
},
|
|
130
|
+
blend: _this.getBlend(),
|
|
131
|
+
stencil: (0, _l7Utils.getMask)(mask, maskInside)
|
|
132
|
+
}).then(function (model) {
|
|
133
|
+
callbackModel([model]);
|
|
134
|
+
}).catch(function (err) {
|
|
135
|
+
console.warn(err);
|
|
136
|
+
callbackModel([]);
|
|
137
|
+
});
|
|
122
138
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
139
|
+
case 3:
|
|
140
|
+
case "end":
|
|
141
|
+
return _context.stop();
|
|
142
|
+
}
|
|
126
143
|
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
144
|
+
}, _callee);
|
|
145
|
+
}));
|
|
146
|
+
|
|
147
|
+
return function (_x) {
|
|
148
|
+
return _ref.apply(this, arguments);
|
|
149
|
+
};
|
|
150
|
+
}());
|
|
151
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mapping", function () {
|
|
152
|
+
_this.initGlyph();
|
|
153
|
+
|
|
154
|
+
_this.updateTexture();
|
|
155
|
+
|
|
156
|
+
_this.filterGlyphs();
|
|
157
|
+
|
|
158
|
+
_this.reBuildModel();
|
|
159
|
+
});
|
|
130
160
|
return _this;
|
|
131
161
|
}
|
|
132
162
|
|
|
133
163
|
(0, _createClass2.default)(TextModel, [{
|
|
134
164
|
key: "getUninforms",
|
|
135
165
|
value: function getUninforms() {
|
|
136
|
-
var
|
|
137
|
-
|
|
138
|
-
opacity =
|
|
139
|
-
|
|
140
|
-
stroke =
|
|
141
|
-
|
|
142
|
-
strokeWidth =
|
|
143
|
-
|
|
144
|
-
textAnchor =
|
|
145
|
-
|
|
146
|
-
textAllowOverlap =
|
|
147
|
-
|
|
148
|
-
halo =
|
|
149
|
-
|
|
150
|
-
gamma =
|
|
151
|
-
|
|
152
|
-
raisingHeight =
|
|
166
|
+
var _ref3 = this.layer.getLayerConfig(),
|
|
167
|
+
_ref3$opacity = _ref3.opacity,
|
|
168
|
+
opacity = _ref3$opacity === void 0 ? 1.0 : _ref3$opacity,
|
|
169
|
+
_ref3$stroke = _ref3.stroke,
|
|
170
|
+
stroke = _ref3$stroke === void 0 ? '#fff' : _ref3$stroke,
|
|
171
|
+
_ref3$strokeWidth = _ref3.strokeWidth,
|
|
172
|
+
strokeWidth = _ref3$strokeWidth === void 0 ? 0 : _ref3$strokeWidth,
|
|
173
|
+
_ref3$textAnchor = _ref3.textAnchor,
|
|
174
|
+
textAnchor = _ref3$textAnchor === void 0 ? 'center' : _ref3$textAnchor,
|
|
175
|
+
_ref3$textAllowOverla = _ref3.textAllowOverlap,
|
|
176
|
+
textAllowOverlap = _ref3$textAllowOverla === void 0 ? false : _ref3$textAllowOverla,
|
|
177
|
+
_ref3$halo = _ref3.halo,
|
|
178
|
+
halo = _ref3$halo === void 0 ? 0.5 : _ref3$halo,
|
|
179
|
+
_ref3$gamma = _ref3.gamma,
|
|
180
|
+
gamma = _ref3$gamma === void 0 ? 2.0 : _ref3$gamma,
|
|
181
|
+
_ref3$raisingHeight = _ref3.raisingHeight,
|
|
182
|
+
raisingHeight = _ref3$raisingHeight === void 0 ? 0 : _ref3$raisingHeight;
|
|
153
183
|
|
|
154
184
|
var _this$fontService = this.fontService,
|
|
155
185
|
canvas = _this$fontService.canvas,
|
|
@@ -217,117 +247,35 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
217
247
|
}
|
|
218
248
|
}, {
|
|
219
249
|
key: "initModels",
|
|
220
|
-
value: function () {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
225
|
-
while (1) {
|
|
226
|
-
switch (_context2.prev = _context2.next) {
|
|
227
|
-
case 0:
|
|
228
|
-
// 绑定事件
|
|
229
|
-
if (!this.layer.inited) {
|
|
230
|
-
this.bindEvent();
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
this.extent = this.textExtent();
|
|
234
|
-
_ref3 = this.layer.getLayerConfig(), _ref3$textAnchor = _ref3.textAnchor, textAnchor = _ref3$textAnchor === void 0 ? 'center' : _ref3$textAnchor, _ref3$textAllowOverla = _ref3.textAllowOverlap, textAllowOverlap = _ref3$textAllowOverla === void 0 ? true : _ref3$textAllowOverla;
|
|
235
|
-
this.preTextStyle = {
|
|
236
|
-
textAnchor: textAnchor,
|
|
237
|
-
textAllowOverlap: textAllowOverlap
|
|
238
|
-
};
|
|
239
|
-
_context2.next = 6;
|
|
240
|
-
return this.buildModels();
|
|
241
|
-
|
|
242
|
-
case 6:
|
|
243
|
-
return _context2.abrupt("return", _context2.sent);
|
|
244
|
-
|
|
245
|
-
case 7:
|
|
246
|
-
case "end":
|
|
247
|
-
return _context2.stop();
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}, _callee2, this);
|
|
251
|
-
}));
|
|
252
|
-
|
|
253
|
-
function initModels() {
|
|
254
|
-
return _initModels.apply(this, arguments);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
return initModels;
|
|
258
|
-
}()
|
|
259
|
-
}, {
|
|
260
|
-
key: "buildModels",
|
|
261
|
-
value: function () {
|
|
262
|
-
var _buildModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
263
|
-
var _ref4, _ref4$mask, mask, _ref4$maskInside, maskInside, _ref4$textAllowOverla, textAllowOverlap, model;
|
|
264
|
-
|
|
265
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
266
|
-
while (1) {
|
|
267
|
-
switch (_context3.prev = _context3.next) {
|
|
268
|
-
case 0:
|
|
269
|
-
_ref4 = this.layer.getLayerConfig(), _ref4$mask = _ref4.mask, mask = _ref4$mask === void 0 ? false : _ref4$mask, _ref4$maskInside = _ref4.maskInside, maskInside = _ref4$maskInside === void 0 ? true : _ref4$maskInside, _ref4$textAllowOverla = _ref4.textAllowOverlap, textAllowOverlap = _ref4$textAllowOverla === void 0 ? false : _ref4$textAllowOverla; // this.mapping(); 重复调用
|
|
270
|
-
|
|
271
|
-
this.initGlyph(); //
|
|
272
|
-
|
|
273
|
-
this.updateTexture();
|
|
274
|
-
|
|
275
|
-
if (!textAllowOverlap) {
|
|
276
|
-
this.filterGlyphs();
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
_context3.next = 6;
|
|
280
|
-
return this.layer.buildLayerModel({
|
|
281
|
-
moduleName: 'pointText',
|
|
282
|
-
vertexShader: textVert,
|
|
283
|
-
fragmentShader: textFrag,
|
|
284
|
-
triangulation: TextTriangulation.bind(this),
|
|
285
|
-
depth: {
|
|
286
|
-
enable: false
|
|
287
|
-
},
|
|
288
|
-
blend: this.getBlend(),
|
|
289
|
-
stencil: (0, _l7Utils.getMask)(mask, maskInside)
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
case 6:
|
|
293
|
-
model = _context3.sent;
|
|
294
|
-
return _context3.abrupt("return", [model]);
|
|
295
|
-
|
|
296
|
-
case 8:
|
|
297
|
-
case "end":
|
|
298
|
-
return _context3.stop();
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}, _callee3, this);
|
|
302
|
-
}));
|
|
250
|
+
value: function initModels(callbackModel) {
|
|
251
|
+
this.layer.on('remapping', this.mapping);
|
|
252
|
+
this.extent = this.textExtent();
|
|
303
253
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
254
|
+
var _ref4 = this.layer.getLayerConfig(),
|
|
255
|
+
_ref4$textAnchor = _ref4.textAnchor,
|
|
256
|
+
textAnchor = _ref4$textAnchor === void 0 ? 'center' : _ref4$textAnchor,
|
|
257
|
+
_ref4$textAllowOverla = _ref4.textAllowOverlap,
|
|
258
|
+
textAllowOverlap = _ref4$textAllowOverla === void 0 ? true : _ref4$textAllowOverla;
|
|
307
259
|
|
|
308
|
-
|
|
309
|
-
|
|
260
|
+
this.preTextStyle = {
|
|
261
|
+
textAnchor: textAnchor,
|
|
262
|
+
textAllowOverlap: textAllowOverlap
|
|
263
|
+
};
|
|
264
|
+
this.buildModels(callbackModel);
|
|
265
|
+
}
|
|
310
266
|
}, {
|
|
311
267
|
key: "needUpdate",
|
|
312
268
|
value: function needUpdate() {
|
|
313
269
|
var _ref5 = this.layer.getLayerConfig(),
|
|
314
270
|
_ref5$textAllowOverla = _ref5.textAllowOverlap,
|
|
315
|
-
textAllowOverlap = _ref5$textAllowOverla === void 0 ? false : _ref5$textAllowOverla;
|
|
316
|
-
|
|
317
|
-
var data = this.layer.getEncodedData();
|
|
318
|
-
|
|
319
|
-
if (data.length < 5 || textAllowOverlap) {
|
|
320
|
-
// 小于不做避让
|
|
321
|
-
return false;
|
|
322
|
-
} // textAllowOverlap 发生改变
|
|
271
|
+
textAllowOverlap = _ref5$textAllowOverla === void 0 ? false : _ref5$textAllowOverla; // textAllowOverlap 发生改变
|
|
323
272
|
|
|
324
273
|
|
|
325
274
|
var zoom = this.mapService.getZoom();
|
|
326
275
|
var extent = this.mapService.getBounds();
|
|
327
276
|
var flag = (0, _l7Utils.boundsContains)(this.extent, extent); // 文本不能压盖则进行过滤
|
|
328
277
|
|
|
329
|
-
if (Math.abs(this.currentZoom - zoom) > 1 || !flag || textAllowOverlap !== this.preTextStyle.textAllowOverlap) {
|
|
330
|
-
// TODO this.mapping 数据未变化,避让
|
|
278
|
+
if (!textAllowOverlap && (Math.abs(this.currentZoom - zoom) > 1 || !flag) || textAllowOverlap !== this.preTextStyle.textAllowOverlap) {
|
|
331
279
|
this.reBuildModel();
|
|
332
280
|
return true;
|
|
333
281
|
}
|
|
@@ -340,8 +288,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
340
288
|
var _this$texture, _this$dataTexture;
|
|
341
289
|
|
|
342
290
|
(_this$texture = this.texture) === null || _this$texture === void 0 ? void 0 : _this$texture.destroy();
|
|
343
|
-
(_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
|
|
344
|
-
|
|
291
|
+
(_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
|
|
345
292
|
this.layer.off('remapping', this.mapping);
|
|
346
293
|
}
|
|
347
294
|
}, {
|
|
@@ -419,14 +366,6 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
419
366
|
}
|
|
420
367
|
});
|
|
421
368
|
}
|
|
422
|
-
}, {
|
|
423
|
-
key: "bindEvent",
|
|
424
|
-
value: function bindEvent() {
|
|
425
|
-
if (!this.layer.isTileLayer) {
|
|
426
|
-
// 重新绑定
|
|
427
|
-
this.layer.on('remapping', this.mapping);
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
369
|
}, {
|
|
431
370
|
key: "textExtent",
|
|
432
371
|
value: function textExtent() {
|
|
@@ -591,7 +530,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
591
530
|
|
|
592
531
|
var centroid = feature.version === 'GAODE2.x' ? feature.originCentroid : feature.centroid;
|
|
593
532
|
var size = feature.size;
|
|
594
|
-
var fontScale = size /
|
|
533
|
+
var fontScale = size / 24;
|
|
595
534
|
|
|
596
535
|
var pixels = _this3.mapService.lngLatToContainer(centroid);
|
|
597
536
|
|
|
@@ -659,48 +598,35 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
659
598
|
}
|
|
660
599
|
}, {
|
|
661
600
|
key: "reBuildModel",
|
|
662
|
-
value: function () {
|
|
663
|
-
var
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
case "end":
|
|
692
|
-
return _context4.stop();
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
}, _callee4, this);
|
|
696
|
-
}));
|
|
697
|
-
|
|
698
|
-
function reBuildModel() {
|
|
699
|
-
return _reBuildModel.apply(this, arguments);
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
return reBuildModel;
|
|
703
|
-
}()
|
|
601
|
+
value: function reBuildModel() {
|
|
602
|
+
var _this4 = this;
|
|
603
|
+
|
|
604
|
+
var _ref10 = this.layer.getLayerConfig(),
|
|
605
|
+
_ref10$mask = _ref10.mask,
|
|
606
|
+
mask = _ref10$mask === void 0 ? false : _ref10$mask,
|
|
607
|
+
_ref10$maskInside = _ref10.maskInside,
|
|
608
|
+
maskInside = _ref10$maskInside === void 0 ? true : _ref10$maskInside;
|
|
609
|
+
|
|
610
|
+
this.filterGlyphs();
|
|
611
|
+
this.layer.buildLayerModel({
|
|
612
|
+
moduleName: 'pointText',
|
|
613
|
+
vertexShader: textVert,
|
|
614
|
+
fragmentShader: textFrag,
|
|
615
|
+
triangulation: TextTriangulation.bind(this),
|
|
616
|
+
depth: {
|
|
617
|
+
enable: false
|
|
618
|
+
},
|
|
619
|
+
blend: this.getBlend(),
|
|
620
|
+
stencil: (0, _l7Utils.getMask)(mask, maskInside)
|
|
621
|
+
}).then(function (model) {
|
|
622
|
+
_this4.layer.models = [model];
|
|
623
|
+
|
|
624
|
+
_this4.layerService.throttleRenderLayers();
|
|
625
|
+
}).catch(function (err) {
|
|
626
|
+
console.warn(err);
|
|
627
|
+
_this4.layer.models = [];
|
|
628
|
+
});
|
|
629
|
+
}
|
|
704
630
|
}]);
|
|
705
631
|
return TextModel;
|
|
706
632
|
}(_BaseModel2.default);
|
package/lib/point/models/tile.js
CHANGED
|
@@ -7,10 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
11
|
|
|
16
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -80,83 +76,43 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
80
76
|
}
|
|
81
77
|
}, {
|
|
82
78
|
key: "initModels",
|
|
83
|
-
value: function () {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
while (1) {
|
|
87
|
-
switch (_context.prev = _context.next) {
|
|
88
|
-
case 0:
|
|
89
|
-
_context.next = 2;
|
|
90
|
-
return this.buildModels();
|
|
91
|
-
|
|
92
|
-
case 2:
|
|
93
|
-
return _context.abrupt("return", _context.sent);
|
|
94
|
-
|
|
95
|
-
case 3:
|
|
96
|
-
case "end":
|
|
97
|
-
return _context.stop();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}, _callee, this);
|
|
101
|
-
}));
|
|
102
|
-
|
|
103
|
-
function initModels() {
|
|
104
|
-
return _initModels.apply(this, arguments);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return initModels;
|
|
108
|
-
}()
|
|
79
|
+
value: function initModels(callbackModel) {
|
|
80
|
+
this.buildModels(callbackModel);
|
|
81
|
+
}
|
|
109
82
|
}, {
|
|
110
83
|
key: "buildModels",
|
|
111
|
-
value: function () {
|
|
112
|
-
var
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
model = _context2.sent;
|
|
144
|
-
return _context2.abrupt("return", [model]);
|
|
145
|
-
|
|
146
|
-
case 6:
|
|
147
|
-
case "end":
|
|
148
|
-
return _context2.stop();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}, _callee2, this);
|
|
152
|
-
}));
|
|
153
|
-
|
|
154
|
-
function buildModels() {
|
|
155
|
-
return _buildModels.apply(this, arguments);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return buildModels;
|
|
159
|
-
}()
|
|
84
|
+
value: function buildModels(callbackModel) {
|
|
85
|
+
var _ref2 = this.layer.getLayerConfig(),
|
|
86
|
+
_ref2$workerEnabled = _ref2.workerEnabled,
|
|
87
|
+
workerEnabled = _ref2$workerEnabled === void 0 ? false : _ref2$workerEnabled,
|
|
88
|
+
usage = _ref2.usage;
|
|
89
|
+
|
|
90
|
+
this.layer.triangulation = _triangulation.PointFillTriangulation;
|
|
91
|
+
this.layer.buildLayerModel({
|
|
92
|
+
moduleName: 'pointTile_' + usage,
|
|
93
|
+
vertexShader: point_tile_vert,
|
|
94
|
+
fragmentShader: point_tile_frag,
|
|
95
|
+
triangulation: _triangulation.PointFillTriangulation,
|
|
96
|
+
depth: {
|
|
97
|
+
enable: false
|
|
98
|
+
},
|
|
99
|
+
cull: {
|
|
100
|
+
enable: true,
|
|
101
|
+
face: (0, _l7Utils.getCullFace)(this.mapService.version)
|
|
102
|
+
},
|
|
103
|
+
blend: this.getBlend(),
|
|
104
|
+
workerEnabled: workerEnabled,
|
|
105
|
+
workerOptions: {
|
|
106
|
+
modelType: 'pointTile'
|
|
107
|
+
},
|
|
108
|
+
pick: usage !== 'basemap'
|
|
109
|
+
}).then(function (model) {
|
|
110
|
+
callbackModel([model]);
|
|
111
|
+
}).catch(function (err) {
|
|
112
|
+
console.warn(err);
|
|
113
|
+
callbackModel([]);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
160
116
|
}, {
|
|
161
117
|
key: "clearModels",
|
|
162
118
|
value: function clearModels() {}
|