@vtx/cs-map 1.0.92 → 1.0.94
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/lib/_util/EventEmitter.js +3 -3
- package/lib/_util/Provider.js +1 -1
- package/lib/_util/Provider.js.map +1 -1
- package/lib/_util/StyleCache.js +3 -3
- package/lib/_util/encryptParams.js +1 -1
- package/lib/_util/encryptParams.js.map +1 -1
- package/lib/_util/filterSpecialCharacters.js +6 -6
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getBBoxFromGeojson.js +5 -5
- package/lib/_util/getDefaultMapInfo.js +1 -1
- package/lib/_util/getSystemInfo.js +1 -1
- package/lib/_util/getToken.js +3 -3
- package/lib/_util/getToken.js.map +1 -1
- package/lib/_util/getUrlParam.js +1 -1
- package/lib/_util/getUrlParam.js.map +1 -1
- package/lib/_util/http.js +5 -5
- package/lib/_util/http.js.map +1 -1
- package/lib/_util/layer.js +8 -8
- package/lib/_util/layer.js.map +1 -1
- package/lib/_util/parabola.js +64 -0
- package/lib/_util/parabola.js.map +1 -0
- package/lib/_util/useColSize.js +1 -1
- package/lib/_util/useColSize.js.map +1 -1
- package/lib/_util/useSet.js +5 -5
- package/lib/_util/useSet.js.map +1 -1
- package/lib/assets/img_1.png +0 -0
- package/lib/building-tiles-layer/BuildingTilesLayer.js +11 -11
- package/lib/building-tiles-layer/BuildingTilesLayer.js.map +1 -1
- package/lib/building-tiles-layer/index.js +2 -2
- package/lib/building-tiles-layer/index.js.map +1 -1
- package/lib/cesium-tiles-layer/CesiumTilesLayer.js +11 -11
- package/lib/cesium-tiles-layer/CesiumTilesLayer.js.map +1 -1
- package/lib/cesium-tiles-layer/index.js +2 -2
- package/lib/cesium-tiles-layer/index.js.map +1 -1
- package/lib/circle/Circle.js +11 -11
- package/lib/circle/Circle.js.map +1 -1
- package/lib/circle/index.js +13 -4
- package/lib/circle/index.js.map +1 -1
- package/lib/circle-fly/index.js +5 -5
- package/lib/circle-fly/index.js.map +1 -1
- package/lib/demand-layer/DemandLayer.js +14 -14
- package/lib/demand-layer/DemandLayer.js.map +1 -1
- package/lib/demand-layer/index.js +5 -5
- package/lib/demand-layer/index.js.map +1 -1
- package/lib/dom/Dom.js +7 -7
- package/lib/dom/Dom.js.map +1 -1
- package/lib/dom/index.js +4 -4
- package/lib/dom/index.js.map +1 -1
- package/lib/excavation-analysis/Cut.js +203 -0
- package/lib/excavation-analysis/Cut.js.map +1 -0
- package/lib/excavation-analysis/TilesetCut.js +96 -165
- package/lib/excavation-analysis/TilesetCut.js.map +1 -1
- package/lib/excavation-analysis/hooks/useDrawHandler.js +1 -1
- package/lib/excavation-analysis/hooks/useDrawHandler.js.map +1 -1
- package/lib/excavation-analysis/hooks/useTerrainClipPlan.js +13 -3
- package/lib/excavation-analysis/hooks/useTerrainClipPlan.js.map +1 -1
- package/lib/excavation-analysis/hooks/useTileSetCut.js +5 -3
- package/lib/excavation-analysis/hooks/useTileSetCut.js.map +1 -1
- package/lib/excavation-analysis/index.js +26 -8
- package/lib/excavation-analysis/index.js.map +1 -1
- package/lib/feature-layer/FeatureLayer.js +31 -25
- package/lib/feature-layer/FeatureLayer.js.map +1 -1
- package/lib/feature-layer/createFeatureCollection.js +9 -9
- package/lib/feature-layer/createFeatureCollection.js.map +1 -1
- package/lib/feature-layer/index.js +14 -8
- package/lib/feature-layer/index.js.map +1 -1
- package/lib/fence-layer/FenceLayer.js +19 -19
- package/lib/fence-layer/FenceLayer.js.map +1 -1
- package/lib/fence-layer/index.js +2 -2
- package/lib/fence-layer/index.js.map +1 -1
- package/lib/flight-line-layer/FlightLineLayer.js +199 -0
- package/lib/flight-line-layer/FlightLineLayer.js.map +1 -0
- package/lib/flight-line-layer/index.js +85 -0
- package/lib/flight-line-layer/index.js.map +1 -0
- package/lib/flight-line-layer/style/css.js +4 -0
- package/lib/flight-line-layer/style/css.js.map +1 -0
- package/lib/flight-line-layer/style/index.css +0 -0
- package/lib/flight-line-layer/style/index.js +4 -0
- package/lib/flight-line-layer/style/index.js.map +1 -0
- package/lib/flight-line-layer/style/index.less +0 -0
- package/lib/fly-line-layer/FlyLineLayer.js +20 -82
- package/lib/fly-line-layer/FlyLineLayer.js.map +1 -1
- package/lib/fly-line-layer/LineFlowMaterialProperty.js +3 -3
- package/lib/fly-line-layer/LineFlowMaterialProperty.js.map +1 -1
- package/lib/fly-line-layer/index.js +1 -1
- package/lib/fly-line-layer/index.js.map +1 -1
- package/lib/gif-dom-layer/GifDomLayer.js +8 -8
- package/lib/gif-dom-layer/GifDomLayer.js.map +1 -1
- package/lib/gif-dom-layer/index.js +1 -1
- package/lib/gif-dom-layer/index.js.map +1 -1
- package/lib/gradation-line-layer/GradationLineLayer.js +9 -9
- package/lib/gradation-line-layer/GradationLineLayer.js.map +1 -1
- package/lib/gradation-line-layer/index.js +1 -1
- package/lib/gradation-line-layer/index.js.map +1 -1
- package/lib/group-layer/GroupLayer.js +5 -5
- package/lib/group-layer/GroupLayer.js.map +1 -1
- package/lib/group-layer/index.js +5 -5
- package/lib/group-layer/index.js.map +1 -1
- package/lib/heatmap-layer/CesiumHeatmap.js +15 -15
- package/lib/heatmap-layer/CesiumHeatmap.js.map +1 -1
- package/lib/heatmap-layer/HeatmapLayer.js +17 -17
- package/lib/heatmap-layer/HeatmapLayer.js.map +1 -1
- package/lib/heatmap-layer/index.js +9 -9
- package/lib/heatmap-layer/index.js.map +1 -1
- package/lib/highlight-layer/HighlightLayer.js +7 -7
- package/lib/highlight-layer/HighlightLayer.js.map +1 -1
- package/lib/highlight-layer/index.js +1 -1
- package/lib/highlight-layer/index.js.map +1 -1
- package/lib/image-layer/ImageLayer.js +14 -14
- package/lib/image-layer/ImageLayer.js.map +1 -1
- package/lib/image-layer/index.js +2 -2
- package/lib/image-layer/index.js.map +1 -1
- package/lib/image-wms-layer/ImageWmsLayer.js +6 -6
- package/lib/image-wms-layer/ImageWmsLayer.js.map +1 -1
- package/lib/image-wms-layer/index.js +4 -4
- package/lib/image-wms-layer/index.js.map +1 -1
- package/lib/index.js +22 -1
- package/lib/index.js.map +1 -1
- package/lib/inundate-analysis/index.js +6 -6
- package/lib/inundate-analysis/index.js.map +1 -1
- package/lib/label/Label.js +16 -16
- package/lib/label/Label.js.map +1 -1
- package/lib/label/index.js +1 -1
- package/lib/label/index.js.map +1 -1
- package/lib/legend/index.js +11 -11
- package/lib/legend/index.js.map +1 -1
- package/lib/line-flow-layer/LineFlowLayer.js +8 -8
- package/lib/line-flow-layer/LineFlowLayer.js.map +1 -1
- package/lib/line-flow-layer/index.js +1 -1
- package/lib/line-flow-layer/index.js.map +1 -1
- package/lib/map/InfoTool/index.js +7 -7
- package/lib/map/InfoTool/index.js.map +1 -1
- package/lib/map/InfoWindow.js +5 -5
- package/lib/map/InfoWindow.js.map +1 -1
- package/lib/map/Layers.js +14 -14
- package/lib/map/Layers.js.map +1 -1
- package/lib/map/Popup.js +10 -10
- package/lib/map/Popup.js.map +1 -1
- package/lib/map/base/imagery/amap/AmapImageryProvider.js +9 -9
- package/lib/map/base/imagery/amap/AmapImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/amap/AmapMercatorTilingScheme.js +9 -9
- package/lib/map/base/imagery/amap/AmapMercatorTilingScheme.js.map +1 -1
- package/lib/map/base/imagery/baidu/BaiduImageryProvider.js +4 -4
- package/lib/map/base/imagery/baidu/BaiduImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/baidu/BaiduMercatorProjection.js +3 -3
- package/lib/map/base/imagery/baidu/BaiduMercatorTilingScheme.js +9 -9
- package/lib/map/base/imagery/baidu/BaiduMercatorTilingScheme.js.map +1 -1
- package/lib/map/base/imagery/geoq/GeoQImageryProvider.js +9 -9
- package/lib/map/base/imagery/geoq/GeoQImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/google/GoogleImageryProvider.js +8 -8
- package/lib/map/base/imagery/google/GoogleImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/irs/IRSImageryProvider.js +10 -10
- package/lib/map/base/imagery/irs/IRSImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/tdt/JiangSuTdtImageryProvider.js +8 -8
- package/lib/map/base/imagery/tdt/JiangSuTdtImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/tdt/TdtImageryProvider.js +8 -8
- package/lib/map/base/imagery/tdt/TdtImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/tencent/TencentImageryProvider.js +8 -8
- package/lib/map/base/imagery/tencent/TencentImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/transform/AmapMercatorTilingScheme.js +9 -9
- package/lib/map/base/imagery/transform/AmapMercatorTilingScheme.js.map +1 -1
- package/lib/map/base/imagery/transform/CoordTransform.js +3 -3
- package/lib/map/base/index.js +12 -12
- package/lib/map/base/index.js.map +1 -1
- package/lib/map/hooks/useGetMapFeatureInfoByText.js +3 -3
- package/lib/map/hooks/useGetMapFeatureInfoByText.js.map +1 -1
- package/lib/map/index.js +25 -17
- package/lib/map/index.js.map +1 -1
- package/lib/map/material/AroundPoint.js +3 -3
- package/lib/map/material/AroundPoint.js.map +1 -1
- package/lib/map/material/CircleRippleMaterialProperty.js +1 -1
- package/lib/map/material/CircleRippleMaterialProperty.js.map +1 -1
- package/lib/map/material/ODLineLayer.js +3 -3
- package/lib/map/material/ODLineLayer.js.map +1 -1
- package/lib/map/material/PolylineTrailLinkMaterialProperty.js +4 -4
- package/lib/map/material/PolylineTrailLinkMaterialProperty.js.map +1 -1
- package/lib/map/material/PolylineTrailMaterialProperty.js +4 -4
- package/lib/map/material/PolylineTrailMaterialProperty.js.map +1 -1
- package/lib/map/material/TilesBuilding.js +3 -3
- package/lib/map/material/TilesBuilding.js.map +1 -1
- package/lib/map/material/index.js +1 -1
- package/lib/map/material/index.js.map +1 -1
- package/lib/marker/Marker.js +17 -17
- package/lib/marker/Marker.js.map +1 -1
- package/lib/marker/index.js +1 -1
- package/lib/marker/index.js.map +1 -1
- package/lib/model/Model.js +30 -19
- package/lib/model/Model.js.map +1 -1
- package/lib/model/index.js +14 -6
- package/lib/model/index.js.map +1 -1
- package/lib/navigation/index.js +5 -5
- package/lib/navigation/index.js.map +1 -1
- package/lib/pipe-tiles-layer/PipeTilesLayer.js +12 -12
- package/lib/pipe-tiles-layer/PipeTilesLayer.js.map +1 -1
- package/lib/pipe-tiles-layer/index.js +2 -2
- package/lib/pipe-tiles-layer/index.js.map +1 -1
- package/lib/point/Point.js +16 -16
- package/lib/point/Point.js.map +1 -1
- package/lib/point/index.js +1 -1
- package/lib/point/index.js.map +1 -1
- package/lib/polygon/Polygon.js +16 -16
- package/lib/polygon/Polygon.js.map +1 -1
- package/lib/polygon/index.js +1 -1
- package/lib/polygon/index.js.map +1 -1
- package/lib/polyline/Polyline.js +16 -16
- package/lib/polyline/Polyline.js.map +1 -1
- package/lib/polyline/index.js +1 -1
- package/lib/polyline/index.js.map +1 -1
- package/lib/renderer/index.js +4 -4
- package/lib/renderer/index.js.map +1 -1
- package/lib/scene-roam/index.js +2 -2
- package/lib/scene-roam/index.js.map +1 -1
- package/lib/slider-scene/index.js +86 -0
- package/lib/slider-scene/index.js.map +1 -0
- package/lib/slider-scene/style/css.js +4 -0
- package/lib/slider-scene/style/css.js.map +1 -0
- package/lib/slider-scene/style/index.css +12 -0
- package/lib/slider-scene/style/index.js +4 -0
- package/lib/slider-scene/style/index.js.map +1 -0
- package/lib/slider-scene/style/index.less +13 -0
- package/lib/split-screen/index.js +5 -5
- package/lib/split-screen/index.js.map +1 -1
- package/lib/three-line-layer/ThreeLineLayer.js +127 -0
- package/lib/three-line-layer/ThreeLineLayer.js.map +1 -0
- package/lib/three-line-layer/index.js +85 -0
- package/lib/three-line-layer/index.js.map +1 -0
- package/lib/three-line-layer/style/css.js +4 -0
- package/lib/three-line-layer/style/css.js.map +1 -0
- package/lib/three-line-layer/style/index.css +0 -0
- package/lib/three-line-layer/style/index.js +4 -0
- package/lib/three-line-layer/style/index.js.map +1 -0
- package/lib/three-line-layer/style/index.less +0 -0
- package/lib/tools/base-map-switch/index.js +6 -6
- package/lib/tools/base-map-switch/index.js.map +1 -1
- package/lib/tools/components/Icon/index.js +1 -1
- package/lib/tools/components/Icon/index.js.map +1 -1
- package/lib/tools/components/Icon/svg.js +1 -1
- package/lib/tools/components/Icon/svg.js.map +1 -1
- package/lib/tools/components/Modal/index.js +1 -1
- package/lib/tools/components/Modal/index.js.map +1 -1
- package/lib/tools/components/item-wrap/index.js +5 -5
- package/lib/tools/components/item-wrap/index.js.map +1 -1
- package/lib/tools/components/tool-Item/index.js +1 -1
- package/lib/tools/components/tool-Item/index.js.map +1 -1
- package/lib/tools/dimension-switch/index.js +5 -5
- package/lib/tools/dimension-switch/index.js.map +1 -1
- package/lib/tools/index.js +2 -2
- package/lib/tools/index.js.map +1 -1
- package/lib/tools/layer-control/index.js +9 -9
- package/lib/tools/layer-control/index.js.map +1 -1
- package/lib/tools/layer-control-popover/LayersCheckService.js +5 -5
- package/lib/tools/layer-control-popover/LayersCheckService.js.map +1 -1
- package/lib/tools/layer-control-popover/index.js +9 -9
- package/lib/tools/layer-control-popover/index.js.map +1 -1
- package/lib/tools/loading/index.js +5 -5
- package/lib/tools/loading/index.js.map +1 -1
- package/lib/tools/map-search/Select/index.js +5 -5
- package/lib/tools/map-search/Select/index.js.map +1 -1
- package/lib/tools/map-search/index.js +8 -8
- package/lib/tools/map-search/index.js.map +1 -1
- package/lib/tools/tip/index.js +1 -1
- package/lib/tools/tip/index.js.map +1 -1
- package/lib/tools/tool-box/Measure/Area/index.js +2 -2
- package/lib/tools/tool-box/Measure/Area/index.js.map +1 -1
- package/lib/tools/tool-box/Measure/Distance/index.js +2 -2
- package/lib/tools/tool-box/Measure/Distance/index.js.map +1 -1
- package/lib/tools/tool-box/Measure/Height/index.js +2 -2
- package/lib/tools/tool-box/Measure/Height/index.js.map +1 -1
- package/lib/tools/tool-box/Measure/Measure.js +3 -3
- package/lib/tools/tool-box/Measure/Measure.js.map +1 -1
- package/lib/tools/tool-box/Measure/index.js +4 -4
- package/lib/tools/tool-box/Measure/index.js.map +1 -1
- package/lib/tools/tool-box/index.js +6 -6
- package/lib/tools/tool-box/index.js.map +1 -1
- package/lib/trail-polyline-layer/TrailPolylineLayer.js +9 -9
- package/lib/trail-polyline-layer/TrailPolylineLayer.js.map +1 -1
- package/lib/trail-polyline-layer/index.js +1 -1
- package/lib/trail-polyline-layer/index.js.map +1 -1
- package/lib/wall/WallGeometry.js +13 -13
- package/lib/wall/WallGeometry.js.map +1 -1
- package/lib/wall/index.js +1 -1
- package/lib/wall/index.js.map +1 -1
- package/lib/water-surface-layer/WaterSurfaceLayer.js +16 -16
- package/lib/water-surface-layer/WaterSurfaceLayer.js.map +1 -1
- package/lib/water-surface-layer/index.js +2 -2
- package/lib/water-surface-layer/index.js.map +1 -1
- package/lib/weather/Weather.js +4 -4
- package/lib/weather/Weather.js.map +1 -1
- package/lib/weather/index.js +1 -1
- package/lib/weather/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _cesium = require("cesium");
|
|
8
|
+
var _parabola = _interopRequireDefault(require("../_util/parabola"));
|
|
9
|
+
var _transformRgb = _interopRequireDefault(require("../_util/transformRgb"));
|
|
10
|
+
var _CircleRippleMaterialProperty = _interopRequireDefault(require("../map/material/CircleRippleMaterialProperty"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
14
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
17
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
18
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
20
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
21
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
|
+
var FlowingLineMaterialGLSL = "float SPEED_STEP = 0.01; \n" + "vec4 drawLight(float xPos, vec2 st, float headOffset, float tailOffset, float widthOffset){ \n" + "float lineLength = smoothstep(xPos + headOffset, xPos, st.x) - smoothstep(xPos, xPos - tailOffset, st.x); \n" + "float lineWidth = smoothstep(widthOffset, 0.5, st.y) - smoothstep(0.5, 1.0 - widthOffset, st.y); \n" + "return vec4(lineLength * lineWidth); \n" + "}\n" + "czm_material czm_getMaterial(czm_materialInput materialInput) \n" + "{ \n" + "czm_material m = czm_getDefaultMaterial(materialInput);\n" + "float sinTime = sin(czm_frameNumber * SPEED_STEP * speed); \n" + "vec4 v4_core;\n" + "vec4 v4_color;\n" + "float xPos = 0.0; \n" + "if (sinTime < 0.0){ \n" + "xPos = cos(czm_frameNumber * SPEED_STEP * speed)+ 1.0 - tailSize; \n" + "}else{ \n" + "xPos = -cos(czm_frameNumber * SPEED_STEP * speed)+ 1.0 - tailSize; \n" + "} \n" + "v4_color = drawLight(xPos, materialInput.st, headSize, tailSize, widthOffset);\n" + "v4_core = drawLight(xPos, materialInput.st, coreSize, coreSize*2.0, widthOffset*2.0);\n" + "m.diffuse = color.xyz + v4_core.xyz*v4_core.w*0.8; \n" + "m.alpha = pow(v4_color.w, 3.0); \n" + "return m; \n" + "} \n";
|
|
25
|
+
var FlightLineLayer = /*#__PURE__*/function () {
|
|
26
|
+
function FlightLineLayer(options) {
|
|
27
|
+
var _this$data;
|
|
28
|
+
_classCallCheck(this, FlightLineLayer);
|
|
29
|
+
var _options$show = options.show,
|
|
30
|
+
show = _options$show === void 0 ? true : _options$show;
|
|
31
|
+
this.map = options.map;
|
|
32
|
+
this.data = options.data;
|
|
33
|
+
this.color = options.color;
|
|
34
|
+
this.ellipses = options.ellipses;
|
|
35
|
+
this.show = show;
|
|
36
|
+
if ((_this$data = this.data) !== null && _this$data !== void 0 && _this$data.length) {
|
|
37
|
+
this.loadData(this.data);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return _createClass(FlightLineLayer, [{
|
|
41
|
+
key: "show",
|
|
42
|
+
set: function set(value) {
|
|
43
|
+
var _this$points, _this$ellipses;
|
|
44
|
+
this.line && (this.line.show = value);
|
|
45
|
+
this.point && (this.point.show = value);
|
|
46
|
+
if ((_this$points = this.points) !== null && _this$points !== void 0 && _this$points.length) {
|
|
47
|
+
this.points.map(function (item) {
|
|
48
|
+
item.show = value;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if ((_this$ellipses = this.ellipses) !== null && _this$ellipses !== void 0 && _this$ellipses.length) {
|
|
52
|
+
this.ellipses.map(function (item) {
|
|
53
|
+
item.show = value;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
key: "loadData",
|
|
59
|
+
value: function loadData(data) {
|
|
60
|
+
var _this = this;
|
|
61
|
+
this.data = data;
|
|
62
|
+
var map = this.map;
|
|
63
|
+
var show = this.show;
|
|
64
|
+
this.destroy();
|
|
65
|
+
var colors = {};
|
|
66
|
+
var line_instances = [];
|
|
67
|
+
this.ellipses = [];
|
|
68
|
+
data.map(function (item) {
|
|
69
|
+
var _item$hasOwnProperty, _this$ellipses2;
|
|
70
|
+
// 飞行线颜色
|
|
71
|
+
var flyColor = item.color || _this.color || '#05FFD5';
|
|
72
|
+
|
|
73
|
+
// 轨迹颜色
|
|
74
|
+
var lineColor = item.lineColor || _this.lineColor || flyColor;
|
|
75
|
+
|
|
76
|
+
// 轨迹颜色转换
|
|
77
|
+
var line_color = _cesium.Color.fromCssColorString((0, _transformRgb["default"])(lineColor, item.lineCpacity || _this.lineCpacity || 0.4));
|
|
78
|
+
|
|
79
|
+
// 飞行线颜色转换
|
|
80
|
+
var color = _cesium.Color.fromCssColorString((0, _transformRgb["default"])(flyColor, item.opacity || _this.opacity || 1));
|
|
81
|
+
|
|
82
|
+
// 缓存颜色
|
|
83
|
+
var color_str = color.toString();
|
|
84
|
+
colors[color_str] = colors[color.toString()] || {
|
|
85
|
+
color: color,
|
|
86
|
+
point_instances: []
|
|
87
|
+
};
|
|
88
|
+
var distance = _cesium.Cartesian3.distance(_cesium.Cartesian3.fromDegrees.apply(_cesium.Cartesian3, _toConsumableArray(item.start)), _cesium.Cartesian3.fromDegrees.apply(_cesium.Cartesian3, _toConsumableArray(item.end)));
|
|
89
|
+
var heightProportion = 0.23; // 自定义最高点和总距离的比值(即图中H比上AB的值),值越大则抛物线越弯曲
|
|
90
|
+
var height = item !== null && item !== void 0 && (_item$hasOwnProperty = item.hasOwnProperty) !== null && _item$hasOwnProperty !== void 0 && _item$hasOwnProperty.call(item, 'height') ? item.height : distance * heightProportion;
|
|
91
|
+
var positions = (0, _parabola["default"])({
|
|
92
|
+
startPosition: item.start,
|
|
93
|
+
endPosition: item.end,
|
|
94
|
+
height: height
|
|
95
|
+
});
|
|
96
|
+
line_instances.push(new _cesium.GeometryInstance({
|
|
97
|
+
geometry: new _cesium.PolylineGeometry({
|
|
98
|
+
positions: positions,
|
|
99
|
+
width: item.lineWidth || 2.0,
|
|
100
|
+
vertexFormat: _cesium.PolylineColorAppearance.VERTEX_FORMAT
|
|
101
|
+
}),
|
|
102
|
+
attributes: {
|
|
103
|
+
color: new _cesium.ColorGeometryInstanceAttribute.fromColor(line_color)
|
|
104
|
+
}
|
|
105
|
+
}));
|
|
106
|
+
colors[color_str].point_instances.push(new _cesium.GeometryInstance({
|
|
107
|
+
geometry: new _cesium.PolylineGeometry({
|
|
108
|
+
positions: positions,
|
|
109
|
+
width: 20.0,
|
|
110
|
+
vertexFormat: _cesium.VertexFormat.ALL
|
|
111
|
+
})
|
|
112
|
+
}));
|
|
113
|
+
if ((_this$ellipses2 = _this.ellipses) !== null && _this$ellipses2 !== void 0 && _this$ellipses2.show) {
|
|
114
|
+
_this.ellipses.push(map.entities.add({
|
|
115
|
+
position: _cesium.Cartesian3.fromDegrees.apply(_cesium.Cartesian3, _toConsumableArray(item.end)),
|
|
116
|
+
ellipse: {
|
|
117
|
+
semiMinorAxis: _this.ellipses.radius || 500.0,
|
|
118
|
+
semiMajorAxis: _this.ellipses.radius || 500.0,
|
|
119
|
+
material: new _CircleRippleMaterialProperty["default"]({
|
|
120
|
+
color: _cesium.Color.fromCssColorString((0, _transformRgb["default"])(flyColor || '#f7ff01', 0.7)),
|
|
121
|
+
speed: 12.0,
|
|
122
|
+
count: 3,
|
|
123
|
+
gradient: 0.2
|
|
124
|
+
})
|
|
125
|
+
},
|
|
126
|
+
show: show
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
this.points = [];
|
|
131
|
+
for (var color_str in colors) {
|
|
132
|
+
var _colors$color_str = colors[color_str],
|
|
133
|
+
color = _colors$color_str.color,
|
|
134
|
+
point_instances = _colors$color_str.point_instances;
|
|
135
|
+
var point = new _cesium.Primitive({
|
|
136
|
+
geometryInstances: point_instances,
|
|
137
|
+
show: show,
|
|
138
|
+
appearance: new _cesium.PolylineMaterialAppearance({
|
|
139
|
+
material: new _cesium.Material({
|
|
140
|
+
fabric: {
|
|
141
|
+
type: "FlowingLineMaterial",
|
|
142
|
+
uniforms: {
|
|
143
|
+
color: color,
|
|
144
|
+
// light color
|
|
145
|
+
speed: 1.5,
|
|
146
|
+
// flowing speed, speed > 0.0
|
|
147
|
+
headSize: 0.05,
|
|
148
|
+
// 0.0 < headSize < 1.0
|
|
149
|
+
tailSize: 0.5,
|
|
150
|
+
// 0.0 < tailSize < 1.0
|
|
151
|
+
widthOffset: 0.1,
|
|
152
|
+
// 0.0 < widthOffset < 1.0
|
|
153
|
+
coreSize: 0.05 // 0.0 < coreSize < 1.0
|
|
154
|
+
},
|
|
155
|
+
source: FlowingLineMaterialGLSL
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
});
|
|
160
|
+
map.scene.primitives.add(point);
|
|
161
|
+
this.points.push(point);
|
|
162
|
+
}
|
|
163
|
+
this.line = new _cesium.Primitive({
|
|
164
|
+
geometryInstances: line_instances,
|
|
165
|
+
show: show,
|
|
166
|
+
appearance: new _cesium.PolylineColorAppearance()
|
|
167
|
+
});
|
|
168
|
+
map.scene.primitives.add(this.line);
|
|
169
|
+
}
|
|
170
|
+
}, {
|
|
171
|
+
key: "destroy",
|
|
172
|
+
value: function destroy() {
|
|
173
|
+
var _this$points2, _this$ellipses3;
|
|
174
|
+
var map = this.map;
|
|
175
|
+
if (this.line) {
|
|
176
|
+
map.scene.primitives.remove(this.line);
|
|
177
|
+
this.line = null;
|
|
178
|
+
}
|
|
179
|
+
if (this.point) {
|
|
180
|
+
map.scene.primitives.remove(this.point);
|
|
181
|
+
this.point = null;
|
|
182
|
+
}
|
|
183
|
+
if ((_this$points2 = this.points) !== null && _this$points2 !== void 0 && _this$points2.length) {
|
|
184
|
+
this.points.map(function (item) {
|
|
185
|
+
map.scene.primitives.remove(item);
|
|
186
|
+
});
|
|
187
|
+
this.points = null;
|
|
188
|
+
}
|
|
189
|
+
if ((_this$ellipses3 = this.ellipses) !== null && _this$ellipses3 !== void 0 && _this$ellipses3.length) {
|
|
190
|
+
this.ellipses.map(function (item) {
|
|
191
|
+
map.entities.remove(item);
|
|
192
|
+
});
|
|
193
|
+
this.ellipses = null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}]);
|
|
197
|
+
}();
|
|
198
|
+
var _default = exports["default"] = FlightLineLayer;
|
|
199
|
+
//# sourceMappingURL=FlightLineLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlightLineLayer.js","names":["_cesium","require","_parabola","_interopRequireDefault","_transformRgb","_CircleRippleMaterialProperty","e","__esModule","_typeof","o","Symbol","iterator","constructor","prototype","_toConsumableArray","r","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","TypeError","a","_arrayLikeToArray","t","toString","call","slice","name","Array","from","test","isArray","length","n","_classCallCheck","_defineProperties","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","_createClass","i","_toPrimitive","toPrimitive","String","Number","FlowingLineMaterialGLSL","FlightLineLayer","options","_this$data","_options$show","show","map","data","color","ellipses","loadData","set","value","_this$points","_this$ellipses","line","point","points","item","_this","destroy","colors","line_instances","_item$hasOwnProperty","_this$ellipses2","flyColor","lineColor","line_color","Color","fromCssColorString","transformRgb","lineCpacity","opacity","color_str","point_instances","distance","Cartesian3","fromDegrees","apply","start","end","heightProportion","height","hasOwnProperty","positions","parabola","startPosition","endPosition","push","GeometryInstance","geometry","PolylineGeometry","width","lineWidth","vertexFormat","PolylineColorAppearance","VERTEX_FORMAT","attributes","ColorGeometryInstanceAttribute","fromColor","VertexFormat","ALL","entities","add","position","ellipse","semiMinorAxis","radius","semiMajorAxis","material","CircleRippleMaterialProperty","speed","count","gradient","_colors$color_str","Primitive","geometryInstances","appearance","PolylineMaterialAppearance","Material","fabric","type","uniforms","headSize","tailSize","widthOffset","coreSize","source","scene","primitives","_this$points2","_this$ellipses3","remove","_default","exports"],"sources":["flight-line-layer/FlightLineLayer.js"],"sourcesContent":["import {\n Material,\n Color,\n Primitive,\n GeometryInstance,\n PolylineGeometry,\n VertexFormat,\n PolylineMaterialAppearance,\n PolylineColorAppearance,\n Cartesian3,\n ColorGeometryInstanceAttribute\n} from 'cesium';\nimport parabola from '../_util/parabola';\nimport transformRgb from \"../_util/transformRgb\";\nimport CircleRippleMaterialProperty from \"../map/material/CircleRippleMaterialProperty\";\n\nconst FlowingLineMaterialGLSL =\n \"float SPEED_STEP = 0.01; \\n\" +\n \"vec4 drawLight(float xPos, vec2 st, float headOffset, float tailOffset, float widthOffset){ \\n\" +\n \"float lineLength = smoothstep(xPos + headOffset, xPos, st.x) - smoothstep(xPos, xPos - tailOffset, st.x); \\n\" +\n \"float lineWidth = smoothstep(widthOffset, 0.5, st.y) - smoothstep(0.5, 1.0 - widthOffset, st.y); \\n\" +\n \"return vec4(lineLength * lineWidth); \\n\" +\n \"}\\n\" +\n \"czm_material czm_getMaterial(czm_materialInput materialInput) \\n\" +\n \"{ \\n\" +\n \"czm_material m = czm_getDefaultMaterial(materialInput);\\n\" +\n \"float sinTime = sin(czm_frameNumber * SPEED_STEP * speed); \\n\" +\n \"vec4 v4_core;\\n\" +\n \"vec4 v4_color;\\n\" +\n \"float xPos = 0.0; \\n\" +\n \"if (sinTime < 0.0){ \\n\" +\n \"xPos = cos(czm_frameNumber * SPEED_STEP * speed)+ 1.0 - tailSize; \\n\" +\n \"}else{ \\n\" +\n \"xPos = -cos(czm_frameNumber * SPEED_STEP * speed)+ 1.0 - tailSize; \\n\" +\n \"} \\n\" +\n \"v4_color = drawLight(xPos, materialInput.st, headSize, tailSize, widthOffset);\\n\" +\n \"v4_core = drawLight(xPos, materialInput.st, coreSize, coreSize*2.0, widthOffset*2.0);\\n\" +\n \"m.diffuse = color.xyz + v4_core.xyz*v4_core.w*0.8; \\n\" +\n \"m.alpha = pow(v4_color.w, 3.0); \\n\" +\n \"return m; \\n\" +\n \"} \\n\";\n\nclass FlightLineLayer {\n constructor(options) {\n const {show = true} = options;\n this.map = options.map;\n\n this.data = options.data;\n\n this.color = options.color;\n\n this.ellipses = options.ellipses;\n\n this.show = show;\n\n if (this.data?.length) {\n this.loadData(this.data)\n }\n }\n\n set show(value) {\n this.line && (this.line.show = value);\n this.point && (this.point.show = value);\n\n if (this.points?.length) {\n this.points.map(item => {\n item.show = value\n })\n }\n\n if (this.ellipses?.length) {\n this.ellipses.map(item => {\n item.show = value\n })\n }\n }\n\n loadData(data) {\n this.data = data;\n const map = this.map;\n const show = this.show;\n\n this.destroy();\n\n const colors = {};\n const line_instances = [];\n this.ellipses = [];\n\n data.map((item) => {\n // 飞行线颜色\n const flyColor = item.color || this.color || '#05FFD5';\n\n // 轨迹颜色\n const lineColor = item.lineColor || this.lineColor || flyColor;\n\n // 轨迹颜色转换\n const line_color = Color.fromCssColorString(transformRgb(lineColor, item.lineCpacity || this.lineCpacity || 0.4));\n\n // 飞行线颜色转换\n const color = Color.fromCssColorString(transformRgb(flyColor, item.opacity || this.opacity || 1));\n\n // 缓存颜色\n const color_str = color.toString();\n colors[color_str] = colors[color.toString()] || {\n color,\n point_instances: []\n };\n const distance = Cartesian3.distance(Cartesian3.fromDegrees(...item.start), Cartesian3.fromDegrees(...item.end));\n\n const heightProportion = 0.23; // 自定义最高点和总距离的比值(即图中H比上AB的值),值越大则抛物线越弯曲\n const height = item?.hasOwnProperty?.('height') ? item.height : distance * heightProportion;\n let positions = parabola({startPosition: item.start, endPosition: item.end, height});\n\n line_instances.push(new GeometryInstance({\n geometry: new PolylineGeometry({\n positions: positions,\n width: item.lineWidth || 2.0,\n vertexFormat: PolylineColorAppearance.VERTEX_FORMAT,\n }),\n attributes: {\n color: new ColorGeometryInstanceAttribute.fromColor(line_color)\n }\n }))\n\n colors[color_str].point_instances.push(new GeometryInstance({\n geometry: new PolylineGeometry({\n positions: positions,\n width: 20.0,\n vertexFormat: VertexFormat.ALL,\n }),\n }))\n\n if (this.ellipses?.show) {\n this.ellipses.push(map.entities.add({\n position: Cartesian3.fromDegrees(...item.end),\n ellipse: {\n semiMinorAxis: this.ellipses.radius || 500.0,\n semiMajorAxis: this.ellipses.radius || 500.0,\n material: new CircleRippleMaterialProperty({\n color: Color.fromCssColorString(transformRgb(flyColor || '#f7ff01', 0.7)),\n speed: 12.0,\n count: 3,\n gradient: 0.2,\n }),\n },\n show\n }))\n }\n });\n\n this.points = [];\n for (let color_str in colors) {\n const {color, point_instances} = colors[color_str];\n\n const point = new Primitive({\n geometryInstances: point_instances,\n show,\n appearance: new PolylineMaterialAppearance({\n material: new Material({\n fabric: {\n type: \"FlowingLineMaterial\",\n uniforms: {\n color: color, // light color\n speed: 1.5, // flowing speed, speed > 0.0\n headSize: 0.05, // 0.0 < headSize < 1.0\n tailSize: 0.5, // 0.0 < tailSize < 1.0\n widthOffset: 0.1, // 0.0 < widthOffset < 1.0\n coreSize: 0.05, // 0.0 < coreSize < 1.0\n },\n source: FlowingLineMaterialGLSL,\n },\n }),\n }),\n })\n map.scene.primitives.add(point);\n this.points.push(point);\n }\n\n this.line = new Primitive({\n geometryInstances: line_instances,\n show,\n appearance: new PolylineColorAppearance(),\n })\n map.scene.primitives.add(this.line);\n }\n\n destroy() {\n const map = this.map;\n\n if (this.line) {\n map.scene.primitives.remove(this.line);\n this.line = null;\n }\n\n if (this.point) {\n map.scene.primitives.remove(this.point);\n this.point = null;\n }\n\n if (this.points?.length) {\n this.points.map(item => {\n map.scene.primitives.remove(item);\n })\n this.points = null;\n }\n\n if (this.ellipses?.length) {\n this.ellipses.map(item => {\n map.entities.remove(item);\n })\n this.ellipses = null;\n }\n }\n}\n\nexport default FlightLineLayer;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAYA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,6BAAA,GAAAF,sBAAA,CAAAF,OAAA;AAAwF,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AAAA,SAAAK,mBAAAC,CAAA,WAAAC,kBAAA,CAAAD,CAAA,KAAAE,gBAAA,CAAAF,CAAA,KAAAG,2BAAA,CAAAH,CAAA,KAAAI,kBAAA;AAAA,SAAAA,mBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAH,CAAA,EAAAM,CAAA,QAAAN,CAAA,2BAAAA,CAAA,SAAAO,iBAAA,CAAAP,CAAA,EAAAM,CAAA,OAAAE,CAAA,MAAAC,QAA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XA,aAAA,CAAa3G,MAAM,EAAE;QACrB,IAAI,CAACkC,MAAM,CAACX,GAAG,CAAC,UAAAY,IAAI,EAAI;UACpBZ,GAAG,CAACkF,KAAK,CAACC,UAAU,CAACG,MAAM,CAAC1E,IAAI,CAAC;QACrC,CAAC,CAAC;QACF,IAAI,CAACD,MAAM,GAAG,IAAI;MACtB;MAEA,KAAA0E,eAAA,GAAI,IAAI,CAAClF,QAAQ,cAAAkF,eAAA,eAAbA,eAAA,CAAe5G,MAAM,EAAE;QACvB,IAAI,CAAC0B,QAAQ,CAACH,GAAG,CAAC,UAAAY,IAAI,EAAI;UACtBZ,GAAG,CAACwD,QAAQ,CAAC8B,MAAM,CAAC1E,IAAI,CAAC;QAC7B,CAAC,CAAC;QACF,IAAI,CAACT,QAAQ,GAAG,IAAI;MACxB;IACJ;EAAC;AAAA;AAAA,IAAAoF,QAAA,GAAAC,OAAA,cAGU7F,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = _default;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _FlightLineLayer = _interopRequireDefault(require("./FlightLineLayer"));
|
|
10
|
+
var _ahooks = require("ahooks");
|
|
11
|
+
var _events = require("../events");
|
|
12
|
+
var _useProps2 = _interopRequireDefault(require("../_util/useProps"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
16
|
+
function _default(props) {
|
|
17
|
+
var data = props.data,
|
|
18
|
+
features = props.features,
|
|
19
|
+
url = props.url,
|
|
20
|
+
params = props.params,
|
|
21
|
+
zIndex = props.zIndex,
|
|
22
|
+
key = props.id,
|
|
23
|
+
_key = props._key,
|
|
24
|
+
name = props.name,
|
|
25
|
+
style = props.style,
|
|
26
|
+
labelField = props.labelField,
|
|
27
|
+
template = props.template,
|
|
28
|
+
_props$show = props.show,
|
|
29
|
+
show = _props$show === void 0 ? true : _props$show,
|
|
30
|
+
groupLayer = props.groupLayer,
|
|
31
|
+
legend = props.legend,
|
|
32
|
+
height = props.height,
|
|
33
|
+
color = props.color,
|
|
34
|
+
speed = props.speed,
|
|
35
|
+
width = props.width,
|
|
36
|
+
flyWidth = props.flyWidth,
|
|
37
|
+
_props$layerControl = props.layerControl,
|
|
38
|
+
layerControl = _props$layerControl === void 0 ? true : _props$layerControl,
|
|
39
|
+
number = props.number,
|
|
40
|
+
glowPower = props.glowPower;
|
|
41
|
+
var layerRef = (0, _react.useRef)();
|
|
42
|
+
var _useProps = (0, _useProps2["default"])(),
|
|
43
|
+
map = _useProps.map;
|
|
44
|
+
(0, _react.useEffect)(function () {
|
|
45
|
+
var layer = new _FlightLineLayer["default"]({
|
|
46
|
+
data: data,
|
|
47
|
+
features: features,
|
|
48
|
+
url: url,
|
|
49
|
+
params: params,
|
|
50
|
+
style: style,
|
|
51
|
+
zIndex: zIndex,
|
|
52
|
+
key: key || _key,
|
|
53
|
+
name: name,
|
|
54
|
+
labelField: labelField,
|
|
55
|
+
template: template,
|
|
56
|
+
show: show,
|
|
57
|
+
legend: legend,
|
|
58
|
+
height: height,
|
|
59
|
+
color: color,
|
|
60
|
+
speed: speed,
|
|
61
|
+
map: map,
|
|
62
|
+
groupLayer: groupLayer,
|
|
63
|
+
width: width,
|
|
64
|
+
flyWidth: flyWidth,
|
|
65
|
+
layerControl: layerControl,
|
|
66
|
+
number: number,
|
|
67
|
+
glowPower: glowPower
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// 注册事件
|
|
71
|
+
(0, _events.registerEventLayer)(layer, props);
|
|
72
|
+
layerRef.current = layer;
|
|
73
|
+
return function () {
|
|
74
|
+
layerRef.current.destroy();
|
|
75
|
+
};
|
|
76
|
+
}, []);
|
|
77
|
+
(0, _ahooks.useUpdateEffect)(function () {
|
|
78
|
+
layerRef.current.loadData(data);
|
|
79
|
+
}, [JSON.stringify(data)]);
|
|
80
|
+
(0, _ahooks.useUpdateEffect)(function () {
|
|
81
|
+
layerRef.current.show = show;
|
|
82
|
+
}, [show]);
|
|
83
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null);
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_FlightLineLayer","_interopRequireDefault","_ahooks","_events","_useProps2","e","__esModule","_getRequireWildcardCache","WeakMap","r","t","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_default","props","data","features","url","params","zIndex","key","id","_key","name","style","labelField","template","_props$show","show","groupLayer","legend","height","color","speed","width","flyWidth","_props$layerControl","layerControl","number","glowPower","layerRef","useRef","_useProps","useProps","map","useEffect","layer","FlightLineLayer","registerEventLayer","current","destroy","useUpdateEffect","loadData","JSON","stringify","createElement","Fragment"],"sources":["flight-line-layer/index.js"],"sourcesContent":["import React, { useRef, useEffect } from 'react';\nimport FlightLineLayer from './FlightLineLayer';\nimport { useUpdateEffect } from 'ahooks';\nimport { registerEventLayer } from '../events';\nimport useProps from '../_util/useProps';\n\nexport default function(props) {\n const {\n data,\n features,\n url,\n params,\n zIndex,\n id: key,\n _key,\n name,\n style,\n labelField,\n template,\n show = true,\n groupLayer,\n legend,\n height,\n color,\n speed,\n width,\n flyWidth,\n layerControl = true,\n number,\n glowPower,\n } = props;\n const layerRef = useRef();\n const { map } = useProps();\n\n useEffect(() => {\n let layer = new FlightLineLayer({\n data,\n features,\n url,\n params,\n style,\n zIndex,\n key: key || _key,\n name,\n labelField,\n template,\n show,\n legend,\n height,\n color,\n speed,\n map,\n groupLayer,\n width,\n flyWidth,\n layerControl,\n number,\n glowPower,\n });\n\n // 注册事件\n registerEventLayer(layer, props);\n\n\n layerRef.current = layer;\n return () => {\n layerRef.current.destroy()\n };\n }, []);\n\n useUpdateEffect(() => {\n layerRef.current.loadData(data);\n }, [JSON.stringify(data)]);\n\n useUpdateEffect(() => {\n layerRef.current.show = show;\n }, [show]);\n\n return <></>;\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAyC,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,yBAAAF,CAAA,6BAAAG,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,yBAAAF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;MACRE,IAAI,EAAJA,IAAI;MACJE,MAAM,EAANA,MAAM;MACNC,MAAM,EAANA,MAAM;MACNC,KAAK,EAALA,KAAK;MACLC,KAAK,EAALA,KAAK;MACLW,GAAG,EAAHA,GAAG;MACHf,UAAU,EAAVA,UAAU;MACVK,KAAK,EAALA,KAAK;MACLC,QAAQ,EAARA,QAAQ;MACRE,YAAY,EAAZA,YAAY;MACZC,MAAM,EAANA,MAAM;MACNC,SAAS,EAATA;IACJ,CAAC,CAAC;;IAEF;IACA,IAAAS,0BAAkB,EAACF,KAAK,EAAEhC,KAAK,CAAC;IAGhC0B,QAAQ,CAACS,OAAO,GAAGH,KAAK;IACxB,OAAO,YAAM;MACTN,QAAQ,CAACS,OAAO,CAACC,OAAO,CAAC,CAAC;IAC9B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,IAAAC,uBAAe,EAAC,YAAM;IAClBX,QAAQ,CAACS,OAAO,CAACG,QAAQ,CAACrC,IAAI,CAAC;EACnC,CAAC,EAAE,CAACsC,IAAI,CAACC,SAAS,CAACvC,IAAI,CAAC,CAAC,CAAC;EAE1B,IAAAoC,uBAAe,EAAC,YAAM;IAClBX,QAAQ,CAACS,OAAO,CAACrB,IAAI,GAAGA,IAAI;EAChC,CAAC,EAAE,CAACA,IAAI,CAAC,CAAC;EAEV,oBAAO3C,MAAA,YAAAsE,aAAA,CAAAtE,MAAA,YAAAuE,QAAA,MAAI,CAAC;AAChB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.js","names":["require"],"sources":["flight-line-layer/style/index.js"],"sourcesContent":["import './index.less';\n"],"mappings":";;AAAAA,OAAA","ignoreList":[]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["require"],"sources":["flight-line-layer/style/index.js"],"sourcesContent":["import './index.less';\n"],"mappings":";;AAAAA,OAAA","ignoreList":[]}
|
|
File without changes
|
|
@@ -10,93 +10,31 @@ var _LineFlowMaterialProperty = _interopRequireDefault(require("./LineFlowMateri
|
|
|
10
10
|
var _createFeatureCollection = require("../feature-layer/createFeatureCollection");
|
|
11
11
|
var _lodash = require("lodash");
|
|
12
12
|
var _transformRgb = _interopRequireDefault(require("../_util/transformRgb"));
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
function
|
|
13
|
+
var _parabola = _interopRequireDefault(require("../_util/parabola"));
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
17
18
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
18
|
-
function _possibleConstructorReturn(
|
|
19
|
-
function _assertThisInitialized(
|
|
19
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
20
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
20
21
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
|
-
function _get() {
|
|
22
|
-
function _inherits(
|
|
23
|
-
function _setPrototypeOf(
|
|
24
|
-
function set(
|
|
25
|
-
function _set(
|
|
26
|
-
function _defineProperty(
|
|
22
|
+
function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
|
|
23
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
24
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
25
|
+
function set(e, r, t, o) { return set = "undefined" != typeof Reflect && Reflect.set ? Reflect.set : function (e, r, t, o) { var f, i = _superPropBase(e, r); if (i) { if ((f = Object.getOwnPropertyDescriptor(i, r)).set) return f.set.call(o, t), !0; if (!f.writable) return !1; } if (f = Object.getOwnPropertyDescriptor(o, r)) { if (!f.writable) return !1; f.value = t, Object.defineProperty(o, r, f); } else _defineProperty(o, r, t); return !0; }, set(e, r, t, o); }
|
|
26
|
+
function _set(e, r, t, o, f) { if (!set(e, r, t, o || e) && f) throw new TypeError("failed to set property"); return t; }
|
|
27
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
27
28
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
28
29
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
29
|
-
function _superPropBase(
|
|
30
|
-
function _getPrototypeOf(
|
|
31
|
-
function _slicedToArray(
|
|
30
|
+
function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }
|
|
31
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
32
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
32
33
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
-
function _unsupportedIterableToArray(
|
|
34
|
-
function _arrayLikeToArray(
|
|
34
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
35
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
35
36
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
36
|
-
function _arrayWithHoles(
|
|
37
|
-
// import {point, greatCircle} from '@turf/turf';
|
|
38
|
-
|
|
39
|
-
// const lineToBezierSpline = (startPosition, endPosition) => {
|
|
40
|
-
// const start = point(startPosition);
|
|
41
|
-
// const end = point(endPosition);
|
|
42
|
-
// const pos = greatCircle(start, end, {npoints: 500}).geometry.coordinates;
|
|
43
|
-
// return Cartesian3.fromDegreesArray(pos.flat());
|
|
44
|
-
// }
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @description: 抛物线构造函数(方程 y=-(4h/L^2)*x^2+h h:顶点高度 L:横纵间距较大者)
|
|
48
|
-
* @param {*} startPosition: 起点
|
|
49
|
-
* @param {*} endPosition: 终点
|
|
50
|
-
* @param {*} height: 高度
|
|
51
|
-
* @param {*} count: 数量
|
|
52
|
-
* @return {*}
|
|
53
|
-
*/
|
|
54
|
-
function parabola(_ref) {
|
|
55
|
-
var startPosition = _ref.startPosition,
|
|
56
|
-
endPosition = _ref.endPosition,
|
|
57
|
-
_ref$height = _ref.height,
|
|
58
|
-
height = _ref$height === void 0 ? 0 : _ref$height,
|
|
59
|
-
_ref$count = _ref.count,
|
|
60
|
-
count = _ref$count === void 0 ? 50 : _ref$count;
|
|
61
|
-
if (!height) {
|
|
62
|
-
return [new _cesium.Cartesian3.fromDegrees(startPosition[0], startPosition[1], startPosition[2] || 0), new _cesium.Cartesian3.fromDegrees(endPosition[0], endPosition[1], endPosition[2] || 0)];
|
|
63
|
-
}
|
|
64
|
-
var result = [];
|
|
65
|
-
height = Math.max(+height, 100);
|
|
66
|
-
count = Math.max(+count, 50);
|
|
67
|
-
var diffLon = Math.abs(startPosition[0] - endPosition[0]);
|
|
68
|
-
var diffLat = Math.abs(startPosition[1] - endPosition[1]);
|
|
69
|
-
var L = Math.max(diffLon, diffLat);
|
|
70
|
-
var dlt = L / count;
|
|
71
|
-
if (diffLon > diffLat) {
|
|
72
|
-
//base on lon
|
|
73
|
-
var delLat = (endPosition[1] - startPosition[1]) / count;
|
|
74
|
-
if (startPosition[0] - endPosition[0] > 0) {
|
|
75
|
-
dlt = -dlt;
|
|
76
|
-
}
|
|
77
|
-
for (var i = 0; i < count; i++) {
|
|
78
|
-
var h = height - Math.pow(-0.5 * L + Math.abs(dlt) * i, 2) * 4 * height / Math.pow(L, 2);
|
|
79
|
-
var lon = startPosition[0] + dlt * i;
|
|
80
|
-
var lat = startPosition[1] + delLat * i;
|
|
81
|
-
var point = new _cesium.Cartesian3.fromDegrees(lon, lat, h);
|
|
82
|
-
result.push(point);
|
|
83
|
-
}
|
|
84
|
-
} else {
|
|
85
|
-
//base on lat
|
|
86
|
-
var delLon = (endPosition[0] - startPosition[0]) / count;
|
|
87
|
-
if (startPosition[1] - endPosition[1] > 0) {
|
|
88
|
-
dlt = -dlt;
|
|
89
|
-
}
|
|
90
|
-
for (var _i = 0; _i < count; _i++) {
|
|
91
|
-
var _h = height - Math.pow(-0.5 * L + Math.abs(dlt) * _i, 2) * 4 * height / Math.pow(L, 2);
|
|
92
|
-
var _lon = startPosition[0] + delLon * _i;
|
|
93
|
-
var _lat = startPosition[1] + dlt * _i;
|
|
94
|
-
var _point = new _cesium.Cartesian3.fromDegrees(_lon, _lat, _h);
|
|
95
|
-
result.push(_point);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return result;
|
|
99
|
-
}
|
|
37
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
100
38
|
var getCoordinates = function getCoordinates(geometryInfo) {
|
|
101
39
|
if (geometryInfo) {
|
|
102
40
|
if ((0, _lodash.isString)(geometryInfo)) {
|
|
@@ -248,7 +186,7 @@ var FlyLineLayer = exports["default"] = /*#__PURE__*/function (_CustomDataSource
|
|
|
248
186
|
startPosition = getCoordinates(start);
|
|
249
187
|
endPosition = getCoordinates(end);
|
|
250
188
|
}
|
|
251
|
-
var positions =
|
|
189
|
+
var positions = (0, _parabola["default"])({
|
|
252
190
|
startPosition: startPosition,
|
|
253
191
|
endPosition: endPosition,
|
|
254
192
|
height: height,
|