deeptwins-engine-3d 0.1.76 → 0.2.1
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/dist/assets/Build/DeepTwins/Image/noise.png +0 -0
- package/dist/assets/Build/DeepTwins/Workers/CustomRasterClip.worker.js +1 -2
- package/dist/assets/Build/DeepTwins/Workers/MvtVector.worker.js +1 -1
- package/dist/assets/Build/Map3d/ThirdParty/Workers/zip-web-worker.js +640 -0
- package/dist/assets/Build/Map3d/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/dist/assets/Build/Map3d/ThirdParty/zip-module.wasm +0 -0
- package/dist/assets/Build/Map3d/Workers/chunk-27NG6PQR.js +456 -0
- package/dist/assets/Build/Map3d/Workers/chunk-2JVMMMWT.js +353 -0
- package/dist/assets/Build/Map3d/Workers/chunk-2Y2XYQCS.js +1481 -0
- package/dist/assets/Build/Map3d/Workers/chunk-34RF3V5G.js +220 -0
- package/dist/assets/Build/Map3d/Workers/chunk-35H7BYLJ.js +1800 -0
- package/dist/assets/Build/Map3d/Workers/chunk-57OGEF5V.js +435 -0
- package/dist/assets/Build/Map3d/Workers/chunk-5PX3DYJA.js +196 -0
- package/dist/assets/Build/Map3d/Workers/chunk-7B5XGQRN.js +171 -0
- package/dist/assets/Build/Map3d/Workers/chunk-ATLWOZFF.js +39 -0
- package/dist/assets/Build/Map3d/Workers/chunk-BMSUECTA.js +1055 -0
- package/dist/assets/Build/Map3d/Workers/chunk-C6IA4TKW.js +476 -0
- package/dist/assets/Build/Map3d/Workers/chunk-CZ44I32U.js +157 -0
- package/dist/assets/Build/Map3d/Workers/chunk-DE6UV44R.js +122 -0
- package/dist/assets/Build/Map3d/Workers/chunk-DUCCKVOG.js +834 -0
- package/dist/assets/Build/Map3d/Workers/chunk-EBJBPIYX.js +239 -0
- package/dist/assets/Build/Map3d/Workers/chunk-EYSYQ2R6.js +138 -0
- package/dist/assets/Build/Map3d/Workers/chunk-FMCAAUQI.js +368 -0
- package/dist/assets/Build/Map3d/Workers/chunk-GMYZNRRQ.js +2717 -0
- package/dist/assets/Build/Map3d/Workers/chunk-GWPNZZV4.js +781 -0
- package/dist/assets/Build/Map3d/Workers/chunk-HLP2U4KW.js +758 -0
- package/dist/assets/Build/Map3d/Workers/chunk-HSJSUPQV.js +500 -0
- package/dist/assets/Build/Map3d/Workers/chunk-I73Q3AG7.js +58 -0
- package/dist/assets/Build/Map3d/Workers/chunk-IMZ4YIMV.js +511 -0
- package/dist/assets/Build/Map3d/Workers/chunk-IZSK4DVF.js +421 -0
- package/dist/assets/Build/Map3d/Workers/chunk-JKLMRPKK.js +75 -0
- package/dist/assets/Build/Map3d/Workers/chunk-KGM345JM.js +691 -0
- package/dist/assets/Build/Map3d/Workers/chunk-L4IR5U4G.js +102 -0
- package/dist/assets/Build/Map3d/Workers/chunk-MG4EVQH2.js +44 -0
- package/dist/assets/Build/Map3d/Workers/chunk-NXWEFAZJ.js +300 -0
- package/dist/assets/Build/Map3d/Workers/chunk-PDFAJISJ.js +59 -0
- package/dist/assets/Build/Map3d/Workers/chunk-PHWZFJR5.js +100 -0
- package/dist/assets/Build/Map3d/Workers/chunk-PLE7CHBE.js +101 -0
- package/dist/assets/Build/Map3d/Workers/chunk-PN3GIZ5Q.js +163 -0
- package/dist/assets/Build/Map3d/Workers/chunk-PXL5XLHV.js +1073 -0
- package/dist/assets/Build/Map3d/Workers/chunk-QYXOF5JC.js +959 -0
- package/dist/assets/Build/Map3d/Workers/chunk-R2LIFXV3.js +115 -0
- package/dist/assets/Build/Map3d/Workers/chunk-R4W6IRJZ.js +10357 -0
- package/dist/assets/Build/Map3d/Workers/chunk-R5PZXG56.js +1258 -0
- package/dist/assets/Build/Map3d/Workers/chunk-RZQLZIUI.js +629 -0
- package/dist/assets/Build/Map3d/Workers/chunk-SIBDD6Y4.js +390 -0
- package/dist/assets/Build/Map3d/Workers/chunk-U5NN6JTQ.js +398 -0
- package/dist/assets/Build/Map3d/Workers/chunk-UA5RPPP3.js +73 -0
- package/dist/assets/Build/Map3d/Workers/chunk-UXLKFS3C.js +305 -0
- package/dist/assets/Build/Map3d/Workers/chunk-VUX4BQIM.js +37 -0
- package/dist/assets/Build/Map3d/Workers/chunk-WJDUUUJS.js +684 -0
- package/dist/assets/Build/Map3d/Workers/chunk-XBJOJHWX.js +139 -0
- package/dist/assets/Build/Map3d/Workers/chunk-XJDMTNKD.js +634 -0
- package/dist/assets/Build/Map3d/Workers/chunk-XUCXZZE5.js +963 -0
- package/dist/assets/Build/Map3d/Workers/chunk-YIKGVMJ5.js +287 -0
- package/dist/assets/Build/Map3d/Workers/chunk-YTNCIBPQ.js +262 -0
- package/dist/assets/Build/Map3d/Workers/chunk-ZMDUYETO.js +55 -0
- package/dist/assets/Build/Map3d/Workers/chunk-ZW52HXFN.js +2857 -0
- package/dist/esm/analyze/LineOfSightAnalysis.js +1 -326
- package/dist/esm/analyze/SubmergenceAnalysis.js +1 -137
- package/dist/esm/analyze/SunLightAnalysis.js +1 -91
- package/dist/esm/analyze/TerrainExcavationAnalysis.js +1 -612
- package/dist/esm/analyze/ViewshedAnalysis.js +1 -292
- package/dist/esm/cameraControl/ModelRoamHistory.js +1 -639
- package/dist/esm/cameraControl/ModelRoamRealTime.js +1 -874
- package/dist/esm/cameraControl/Roam.js +1 -418
- package/dist/esm/cameraControl/Rotate.js +1 -134
- package/dist/esm/cameraControl/RotateInPlace.js +1 -99
- package/dist/esm/constant.d.ts +90 -0
- package/dist/esm/constant.js +1 -1287
- package/dist/esm/deepTwins/index.js +1 -121
- package/dist/esm/drawCommand/index.js +1 -3
- package/dist/esm/drawCommand/viewShed/Event.js +1 -142
- package/dist/esm/drawCommand/viewShed/RectangularSensorPrimitive.js +1 -1306
- package/dist/esm/drawCommand/viewShed/ViewShadowPrimitive.js +1 -66
- package/dist/esm/drawCommand/viewShed/ViewShedAnalyserLayer.js +1 -466
- package/dist/esm/drawCommand/viewShed/ViewShedMap.js +1 -1238
- package/dist/esm/drawCommand/viewShed/config.js +1 -21
- package/dist/esm/drawCommand/volumeCloud/GeometryPrimitive.js +1 -89
- package/dist/esm/drawCommand/volumeCloud/ImprovedNoise.js +1 -112
- package/dist/esm/drawCommand/volumeCloud/VolumeClouds.js +1 -91
- package/dist/esm/drawer/algorithm.js +1 -314
- package/dist/esm/drawer/common.js +1 -965
- package/dist/esm/drawer/coordinate.js +1 -184
- package/dist/esm/drawer/index.js +1 -688
- package/dist/esm/drawer/plotUtil.js +1 -266
- package/dist/esm/drawer/shape/Assemble.js +1 -415
- package/dist/esm/drawer/shape/AttackArrow.js +1 -442
- package/dist/esm/drawer/shape/BaseShape.js +1 -383
- package/dist/esm/drawer/shape/Bow.js +1 -375
- package/dist/esm/drawer/shape/Circle.js +1 -461
- package/dist/esm/drawer/shape/Curve.js +1 -386
- package/dist/esm/drawer/shape/DragPoint.js +1 -211
- package/dist/esm/drawer/shape/Elliptic.js +1 -491
- package/dist/esm/drawer/shape/Formation.js +1 -395
- package/dist/esm/drawer/shape/PincerArrow.js +1 -445
- package/dist/esm/drawer/shape/Point.js +1 -131
- package/dist/esm/drawer/shape/Polygon.js +1 -368
- package/dist/esm/drawer/shape/Polyline.js +1 -325
- package/dist/esm/drawer/shape/RegularPolygon.js +1 -468
- package/dist/esm/drawer/shape/RightAngleArrow.js +1 -423
- package/dist/esm/drawer/shape/Sector.js +1 -568
- package/dist/esm/drawer/shape/StraightArrow.js +1 -422
- package/dist/esm/drawer/shape/SwallowtailArrow.js +1 -438
- package/dist/esm/drawer/types.js +1 -11
- package/dist/esm/drawer/utils.js +1 -381
- package/dist/esm/global.css +22 -1
- package/dist/esm/graphicLayer/BaseEntity.js +1 -51
- package/dist/esm/graphicLayer/BaseLayer.js +1 -730
- package/dist/esm/graphicLayer/BasePointPrimitive.js +1 -45
- package/dist/esm/graphicLayer/BasePrimitive.js +1 -36
- package/dist/esm/graphicLayer/BasePrimitiveInstance.js +1 -37
- package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
- package/dist/esm/graphicLayer/BaseSource.js +1 -630
- package/dist/esm/graphicLayer/BillboardEntity.js +1 -106
- package/dist/esm/graphicLayer/BillboardPrimitive.js +1 -119
- package/dist/esm/graphicLayer/BoxEntity.js +1 -99
- package/dist/esm/graphicLayer/BoxPrimitive.js +1 -48
- package/dist/esm/graphicLayer/BoxPrimitiveInstance.js +1 -91
- package/dist/esm/graphicLayer/EllipseEntity.js +1 -110
- package/dist/esm/graphicLayer/EllipsePrimitive.js +1 -47
- package/dist/esm/graphicLayer/EllipsePrimitiveInstance.js +1 -98
- package/dist/esm/graphicLayer/EllipsoidEntity.js +1 -118
- package/dist/esm/graphicLayer/EllipsoidPrimitive.js +1 -48
- package/dist/esm/graphicLayer/EllipsoidPrimitiveInstance.js +1 -113
- package/dist/esm/graphicLayer/GraphicLayerCollection.js +1 -491
- package/dist/esm/graphicLayer/HtmlEntity.d.ts +4 -0
- package/dist/esm/graphicLayer/HtmlEntity.js +1 -189
- package/dist/esm/graphicLayer/LabelEntity.js +1 -110
- package/dist/esm/graphicLayer/LabelPrimitive.js +1 -127
- package/dist/esm/graphicLayer/ModelEntity.js +1 -122
- package/dist/esm/graphicLayer/ModelPrimitive.js +1 -59
- package/dist/esm/graphicLayer/ModelPrimitiveInstance.js +1 -86
- package/dist/esm/graphicLayer/PointEntity.js +1 -94
- package/dist/esm/graphicLayer/PointPrimitive.js +1 -107
- package/dist/esm/graphicLayer/PolygonEntity.js +1 -103
- package/dist/esm/graphicLayer/PolygonGroundPrimitive.js +1 -49
- package/dist/esm/graphicLayer/PolygonGroundPrimitiveImageMaterialInstance.js +1 -87
- package/dist/esm/graphicLayer/PolygonPrimitive.js +1 -60
- package/dist/esm/graphicLayer/PolygonPrimitiveImageMaterialInstance.js +1 -84
- package/dist/esm/graphicLayer/PolygonPrimitiveInstance.js +1 -101
- package/dist/esm/graphicLayer/PolylineEntity.js +1 -96
- package/dist/esm/graphicLayer/PolylineGroundPrimitive.js +1 -55
- package/dist/esm/graphicLayer/PolylineGroundPrimitiveInstance.js +1 -85
- package/dist/esm/graphicLayer/PolylinePrimitive.js +1 -53
- package/dist/esm/graphicLayer/PolylinePrimitiveInstance.js +1 -85
- package/dist/esm/graphicLayer/PolylineVolumeEntity.js +1 -105
- package/dist/esm/graphicLayer/PolylineVolumePrimitive.js +1 -47
- package/dist/esm/graphicLayer/PolylineVolumePrimitiveInstance.js +1 -94
- package/dist/esm/graphicLayer/WallEntity.js +1 -96
- package/dist/esm/graphicLayer/WallPrimitive.js +1 -47
- package/dist/esm/graphicLayer/WallPrimitiveInstance.js +1 -88
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +1 -175
- package/dist/esm/lowAltitude/BarrierLayer.js +1 -172
- package/dist/esm/lowAltitude/BaseGridMvtLayer.js +1 -122
- package/dist/esm/lowAltitude/FactorLayer.js +1 -199
- package/dist/esm/lowAltitude/FlightPlanning.js +1 -411
- package/dist/esm/lowAltitude/FlightRiskEvaluation.js +1 -543
- package/dist/esm/lowAltitude/GridDraw.js +1 -137
- package/dist/esm/lowAltitude/PoiLayer.js +1 -74
- package/dist/esm/lowAltitude/RoutePlanning.js +1 -318
- package/dist/esm/lowAltitude/VisitLayer.js +1 -180
- package/dist/esm/map/Event.js +1 -377
- package/dist/esm/map/GroundSkyBox.js +1 -166
- package/dist/esm/map/Map.js +1 -881
- package/dist/esm/map/Property.js +1 -35
- package/dist/esm/material/AtmosphericDispersion.js +1 -569
- package/dist/esm/material/GlobalVolumetricCloud.js +1 -377
- package/dist/esm/material/VolumeCloud.js +1 -115
- package/dist/esm/material/WeatherEffects.js +1 -351
- package/dist/esm/material/entity/BaseMaterialProperty.js +1 -51
- package/dist/esm/material/entity/CircleWaveMaterialProperty.js +1 -101
- package/dist/esm/material/entity/DynamicWallMaterialProperty.js +1 -101
- package/dist/esm/material/entity/ImageGlowingMaterialProperty.js +1 -89
- package/dist/esm/material/entity/ImageMaterialProperty.js +1 -34
- package/dist/esm/material/entity/PolylineTrailLinkMaterialProperty.js +1 -132
- package/dist/esm/material/primitive/BaseMaterialAppearance.js +1 -28
- package/dist/esm/material/primitive/ImageGlowingMaterialAppearance.js +1 -77
- package/dist/esm/material/primitive/ImageMaterialAppearance.js +1 -77
- package/dist/esm/measure/Area.js +1 -220
- package/dist/esm/measure/BaseDraw.js +1 -105
- package/dist/esm/measure/Distance.js +1 -223
- package/dist/esm/measure/index.js +1 -266
- package/dist/esm/measure/types.js +1 -17
- package/dist/esm/measure/utils.js +1 -319
- package/dist/esm/particle/BaseParticle.js +1 -196
- package/dist/esm/particle/FireParticle.js +1 -65
- package/dist/esm/particle/FountainParticle.js +1 -80
- package/dist/esm/particle/SmokeParticle.js +1 -65
- package/dist/esm/particle/common.js +1 -23
- package/dist/esm/particle/index.js +1 -5
- package/dist/esm/property/PositionProperty.js +1 -56
- package/dist/esm/tileLayer/ArcGisLayer.js +1 -41
- package/dist/esm/tileLayer/CustomRasterClipWorkerClient.js +1 -147
- package/dist/esm/tileLayer/CustomRasterLayer.js +1 -1136
- package/dist/esm/tileLayer/ImageryLayer.js +1 -44
- package/dist/esm/tileLayer/MvtVectorLoad.js +1 -1549
- package/dist/esm/tileLayer/MvtVectorWorkerClient.js +1 -126
- package/dist/esm/tileLayer/RasterLayer.js +1 -23
- package/dist/esm/tileLayer/WmsLayer.js +1 -26
- package/dist/esm/tileLayer/WmtsLayer.js +1 -23
- package/dist/esm/tool/BuildClampedPolygonGrid.js +1 -278
- package/dist/esm/tool/Compass.js +1 -282
- package/dist/esm/tool/PrimitiveCluster.js +1 -706
- package/dist/esm/tool/TimerInterval.js +1 -58
- package/dist/esm/tool/common.js +1 -405
- package/dist/esm/tool/fetch.js +1 -222
- package/dist/esm/tool/heatmap.js +1 -631
- package/dist/esm/tool/utils.d.ts +1 -0
- package/dist/esm/tool/utils.js +1 -501
- package/dist/esm/toolTip/index.js +1 -79
- package/dist/esm/videoFusion/BaseVideo.d.ts +7 -0
- package/dist/esm/videoFusion/BaseVideo.js +1 -330
- package/dist/esm/videoFusion/VideoProject.js +1 -230
- package/dist/esm/videoFusion/VideoTexture.js +1 -163
- package/dist/esm/visualization/BaseHeatmap.js +1 -271
- package/dist/esm/visualization/BoundaryHighlight.d.ts +135 -0
- package/dist/esm/visualization/BoundaryHighlight.js +1 -0
- package/dist/esm/visualization/DynamicWater.js +1 -289
- package/dist/esm/visualization/Frustum.js +1 -248
- package/dist/esm/visualization/Heatmap2d.js +1 -97
- package/dist/esm/visualization/Heatmap3d.js +1 -281
- package/dist/esm/visualization/MigrationEffect.js +1 -397
- package/dist/esm/visualization/PointCluster.js +1 -220
- package/dist/esm/visualization/RadarScan.js +1 -333
- package/dist/esm/visualization/SampledTerrainRiver.d.ts +180 -0
- package/dist/esm/visualization/SampledTerrainRiver.js +1 -0
- package/dist/esm/visualization/SampledTerrainWater.d.ts +170 -0
- package/dist/esm/visualization/SampledTerrainWater.js +1 -0
- package/dist/esm/visualization/WindField.d.ts +72 -0
- package/dist/esm/visualization/WindField.js +1 -0
- package/dist/esm/visualization/windCore.d.ts +161 -0
- package/dist/esm/visualization/windCore.js +8 -0
- package/dist/umd/deeptwins-engine-3d.min.css +1 -1
- package/dist/umd/deeptwins-engine-3d.min.js +1 -1
- package/package.json +6 -4
|
@@ -1,131 +1 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
6
|
-
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
7
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
16
|
-
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); }
|
|
17
|
-
import * as Cesium from 'deeptwins-cesium';
|
|
18
|
-
import { isNil } from 'lodash';
|
|
19
|
-
import BaseShape from "./BaseShape";
|
|
20
|
-
import DragPoint from "./DragPoint";
|
|
21
|
-
export { default as DragPoint } from "./DragPoint";
|
|
22
|
-
var Point = /*#__PURE__*/function (_BaseShape) {
|
|
23
|
-
_inherits(Point, _BaseShape);
|
|
24
|
-
var _super = _createSuper(Point);
|
|
25
|
-
function Point(drawContext, config) {
|
|
26
|
-
var _this;
|
|
27
|
-
_classCallCheck(this, Point);
|
|
28
|
-
_this = _super.call(this, drawContext);
|
|
29
|
-
_defineProperty(_assertThisInitialized(_this), "type", 'point');
|
|
30
|
-
_defineProperty(_assertThisInitialized(_this), "shapePointLayer", void 0);
|
|
31
|
-
_this.clampToGround = isNil(config === null || config === void 0 ? void 0 : config.clampToGround) ? _this.clampToGround : config.clampToGround;
|
|
32
|
-
_this.pointStyle.heightReference = _this.clampToGround ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE;
|
|
33
|
-
return _this;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// 数据转换
|
|
37
|
-
_createClass(Point, [{
|
|
38
|
-
key: "transformData",
|
|
39
|
-
value: function transformData(positions) {
|
|
40
|
-
this.positions = positions;
|
|
41
|
-
this.shapePointLayer = new DragPoint(this.getMap(), {
|
|
42
|
-
positions: this.positions,
|
|
43
|
-
style: this.pointStyle
|
|
44
|
-
});
|
|
45
|
-
this.shapePointLayer.endEdit();
|
|
46
|
-
this.dragPoints = [this.shapePointLayer];
|
|
47
|
-
// 存入
|
|
48
|
-
this._drawContext.setDrawerLayer(this.id, this);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// 添加点位
|
|
52
|
-
}, {
|
|
53
|
-
key: "addPoint",
|
|
54
|
-
value: function addPoint(position) {
|
|
55
|
-
var lng = position.lng,
|
|
56
|
-
lat = position.lat,
|
|
57
|
-
alt = position.alt;
|
|
58
|
-
this.positions = [lng, lat, alt];
|
|
59
|
-
this.shapePointLayer = new DragPoint(this.getMap(), {
|
|
60
|
-
positions: this.positions,
|
|
61
|
-
style: this.pointStyle
|
|
62
|
-
});
|
|
63
|
-
this.dragPoints = [this.shapePointLayer];
|
|
64
|
-
// 存入
|
|
65
|
-
this._drawContext.setDrawerLayer(this.id, this);
|
|
66
|
-
this.drawing(this);
|
|
67
|
-
this.drawEnd(this);
|
|
68
|
-
this.startEdit();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// 开始编辑
|
|
72
|
-
}, {
|
|
73
|
-
key: "startEdit",
|
|
74
|
-
value: function startEdit() {
|
|
75
|
-
_get(_getPrototypeOf(Point.prototype), "startEdit", this).call(this);
|
|
76
|
-
this.dragPoints[0] && this.dragPoints[0].startEdit();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// 开始鼠标拖拽
|
|
80
|
-
}, {
|
|
81
|
-
key: "mouseDragStart",
|
|
82
|
-
value: function mouseDragStart(position, dragLayer) {
|
|
83
|
-
this.dragging = true;
|
|
84
|
-
this.dragLayer = dragLayer;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// 鼠标拖拽
|
|
88
|
-
}, {
|
|
89
|
-
key: "mouseDragChange",
|
|
90
|
-
value: function mouseDragChange(position) {
|
|
91
|
-
if (this.dragging) {
|
|
92
|
-
var _this$_drawContext$op, _this$_drawContext$op2;
|
|
93
|
-
// 根据edges重新生成新的点位
|
|
94
|
-
this.positions = [position.lng, position.lat, position.alt];
|
|
95
|
-
// 调用点位改变事件
|
|
96
|
-
((_this$_drawContext$op = this._drawContext.options) === null || _this$_drawContext$op === void 0 ? void 0 : _this$_drawContext$op.onPointsChange) && ((_this$_drawContext$op2 = this._drawContext.options) === null || _this$_drawContext$op2 === void 0 ? void 0 : _this$_drawContext$op2.onPointsChange({
|
|
97
|
-
layer: this,
|
|
98
|
-
positions: this.positions
|
|
99
|
-
}));
|
|
100
|
-
this.dragLayer.mouseDragChange(position);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// 结束鼠标拖拽
|
|
105
|
-
}, {
|
|
106
|
-
key: "mouseDragEnd",
|
|
107
|
-
value: function mouseDragEnd() {
|
|
108
|
-
this.dragging = false;
|
|
109
|
-
this.dragLayer = null;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// 结束编辑
|
|
113
|
-
}, {
|
|
114
|
-
key: "endEdit",
|
|
115
|
-
value: function endEdit(layer) {
|
|
116
|
-
var emitComplete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
117
|
-
_get(_getPrototypeOf(Point.prototype), "endEdit", this).call(this, layer, emitComplete);
|
|
118
|
-
this.dragPoints[0] && this.dragPoints[0].endEdit();
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// 销毁
|
|
122
|
-
}, {
|
|
123
|
-
key: "destroy",
|
|
124
|
-
value: function destroy() {
|
|
125
|
-
_get(_getPrototypeOf(Point.prototype), "destroy", this).call(this);
|
|
126
|
-
this.shapePointLayer = null;
|
|
127
|
-
}
|
|
128
|
-
}]);
|
|
129
|
-
return Point;
|
|
130
|
-
}(BaseShape);
|
|
131
|
-
export default Point;
|
|
1
|
+
(function(_0x52afd4,_0x16e9b0){var _0x4013ef=_0x4c41,_0x9027c6=_0x52afd4();while(!![]){try{var _0x127489=-parseInt(_0x4013ef(0xe3))/0x1*(-parseInt(_0x4013ef(0xa5))/0x2)+-parseInt(_0x4013ef(0xcc))/0x3*(-parseInt(_0x4013ef(0xa7))/0x4)+parseInt(_0x4013ef(0xce))/0x5*(-parseInt(_0x4013ef(0xa8))/0x6)+parseInt(_0x4013ef(0xd8))/0x7*(-parseInt(_0x4013ef(0xc7))/0x8)+-parseInt(_0x4013ef(0xd7))/0x9+parseInt(_0x4013ef(0xbc))/0xa*(-parseInt(_0x4013ef(0xbd))/0xb)+parseInt(_0x4013ef(0xd2))/0xc;if(_0x127489===_0x16e9b0)break;else _0x9027c6['push'](_0x9027c6['shift']());}catch(_0x422429){_0x9027c6['push'](_0x9027c6['shift']());}}}(_0x19cc,0x66b01));function _typeof(_0x4c5ff0){'@babel/helpers - typeof';var _0xe23028=_0x4c41;return _typeof=_0xe23028(0xb0)==typeof Symbol&&_0xe23028(0xb7)==typeof Symbol['iterator']?function(_0x510f37){return typeof _0x510f37;}:function(_0xd270b){var _0x2251af=_0xe23028;return _0xd270b&&_0x2251af(0xb0)==typeof Symbol&&_0xd270b[_0x2251af(0xb9)]===Symbol&&_0xd270b!==Symbol['prototype']?_0x2251af(0xb7):typeof _0xd270b;},_typeof(_0x4c5ff0);}function _classCallCheck(_0x5152e8,_0x316e2d){var _0x26d792=_0x4c41;if(!(_0x5152e8 instanceof _0x316e2d))throw new TypeError(_0x26d792(0xc8));}function _defineProperties(_0x33abeb,_0x28f940){var _0x206adc=_0x4c41;for(var _0x51a637=0x0;_0x51a637<_0x28f940[_0x206adc(0xc4)];_0x51a637++){var _0x20a4c4=_0x28f940[_0x51a637];_0x20a4c4[_0x206adc(0xb1)]=_0x20a4c4['enumerable']||![],_0x20a4c4[_0x206adc(0xe6)]=!![];if('value'in _0x20a4c4)_0x20a4c4[_0x206adc(0xdd)]=!![];Object['defineProperty'](_0x33abeb,_toPropertyKey(_0x20a4c4['key']),_0x20a4c4);}}function _createClass(_0x1bd6e8,_0x4eb473,_0x15dba1){var _0xf059f7=_0x4c41;if(_0x4eb473)_defineProperties(_0x1bd6e8['prototype'],_0x4eb473);if(_0x15dba1)_defineProperties(_0x1bd6e8,_0x15dba1);return Object[_0xf059f7(0xb6)](_0x1bd6e8,_0xf059f7(0xdc),{'writable':![]}),_0x1bd6e8;}function _get(){var _0x32e5b1=_0x4c41;return typeof Reflect!=='undefined'&&Reflect[_0x32e5b1(0xa6)]?_get=Reflect['get'][_0x32e5b1(0xcf)]():_get=function _0x25571b(_0x1d4a6a,_0x3a6975,_0x59288f){var _0x223771=_0x32e5b1,_0x142eb0=_superPropBase(_0x1d4a6a,_0x3a6975);if(!_0x142eb0)return;var _0x4417fc=Object[_0x223771(0xcd)](_0x142eb0,_0x3a6975);if(_0x4417fc['get'])return _0x4417fc[_0x223771(0xa6)][_0x223771(0xc9)](arguments['length']<0x3?_0x1d4a6a:_0x59288f);return _0x4417fc[_0x223771(0xac)];},_get[_0x32e5b1(0xd0)](this,arguments);}function _superPropBase(_0x195324,_0x50eeb1){var _0x400a0f=_0x4c41;while(!Object[_0x400a0f(0xdc)][_0x400a0f(0xd5)]['call'](_0x195324,_0x50eeb1)){_0x195324=_getPrototypeOf(_0x195324);if(_0x195324===null)break;}return _0x195324;}function _inherits(_0x38e109,_0x548754){var _0x2cc8e6=_0x4c41;if(typeof _0x548754!==_0x2cc8e6(0xb0)&&_0x548754!==null)throw new TypeError(_0x2cc8e6(0xc2));_0x38e109['prototype']=Object[_0x2cc8e6(0xc1)](_0x548754&&_0x548754['prototype'],{'constructor':{'value':_0x38e109,'writable':!![],'configurable':!![]}}),Object['defineProperty'](_0x38e109,'prototype',{'writable':![]});if(_0x548754)_setPrototypeOf(_0x38e109,_0x548754);}function _setPrototypeOf(_0x1d8233,_0x56aee1){var _0x1d882a=_0x4c41;return _setPrototypeOf=Object['setPrototypeOf']?Object[_0x1d882a(0xbf)]['bind']():function _0x249fd6(_0x26fd17,_0x54cd52){var _0x31b2e2=_0x1d882a;return _0x26fd17[_0x31b2e2(0xb3)]=_0x54cd52,_0x26fd17;},_setPrototypeOf(_0x1d8233,_0x56aee1);}function _createSuper(_0x4fa57c){var _0x37c6ee=_isNativeReflectConstruct();return function _0x10c974(){var _0x2e4ad1=_0x4c41,_0x3a153f=_getPrototypeOf(_0x4fa57c),_0x52a776;if(_0x37c6ee){var _0x1a4fef=_getPrototypeOf(this)['constructor'];_0x52a776=Reflect[_0x2e4ad1(0xe4)](_0x3a153f,arguments,_0x1a4fef);}else _0x52a776=_0x3a153f['apply'](this,arguments);return _possibleConstructorReturn(this,_0x52a776);};}function _0x4c41(_0x2740ab,_0x4b646f){_0x2740ab=_0x2740ab-0xa5;var _0x19cc13=_0x19cc();var _0x4c41a4=_0x19cc13[_0x2740ab];if(_0x4c41['ZWFvtY']===undefined){var _0x21794e=function(_0x10a123){var _0x4c26d3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1b9371='',_0x198acb='';for(var _0x305688=0x0,_0x4c5ff0,_0x510f37,_0xd270b=0x0;_0x510f37=_0x10a123['charAt'](_0xd270b++);~_0x510f37&&(_0x4c5ff0=_0x305688%0x4?_0x4c5ff0*0x40+_0x510f37:_0x510f37,_0x305688++%0x4)?_0x1b9371+=String['fromCharCode'](0xff&_0x4c5ff0>>(-0x2*_0x305688&0x6)):0x0){_0x510f37=_0x4c26d3['indexOf'](_0x510f37);}for(var _0x5152e8=0x0,_0x316e2d=_0x1b9371['length'];_0x5152e8<_0x316e2d;_0x5152e8++){_0x198acb+='%'+('00'+_0x1b9371['charCodeAt'](_0x5152e8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x198acb);};_0x4c41['xoTERm']=_0x21794e,_0x4c41['TJYqTp']={},_0x4c41['ZWFvtY']=!![];}var _0x41dda1=_0x19cc13[0x0],_0x4858f5=_0x2740ab+_0x41dda1,_0x4bbbad=_0x4c41['TJYqTp'][_0x4858f5];return!_0x4bbbad?(_0x4c41a4=_0x4c41['xoTERm'](_0x4c41a4),_0x4c41['TJYqTp'][_0x4858f5]=_0x4c41a4):_0x4c41a4=_0x4bbbad,_0x4c41a4;}function _possibleConstructorReturn(_0x3e293c,_0x589d38){var _0x2faacc=_0x4c41;if(_0x589d38&&(_typeof(_0x589d38)==='object'||typeof _0x589d38===_0x2faacc(0xb0)))return _0x589d38;else{if(_0x589d38!==void 0x0)throw new TypeError('Derived\x20constructors\x20may\x20only\x20return\x20object\x20or\x20undefined');}return _assertThisInitialized(_0x3e293c);}function _assertThisInitialized(_0x15ee46){var _0x42668d=_0x4c41;if(_0x15ee46===void 0x0)throw new ReferenceError(_0x42668d(0xc3));return _0x15ee46;}function _isNativeReflectConstruct(){var _0x804aaa=_0x4c41;if(typeof Reflect===_0x804aaa(0xcb)||!Reflect['construct'])return![];if(Reflect[_0x804aaa(0xe4)]['sham'])return![];if(typeof Proxy==='function')return!![];try{return Boolean[_0x804aaa(0xdc)][_0x804aaa(0xaf)][_0x804aaa(0xc9)](Reflect['construct'](Boolean,[],function(){})),!![];}catch(_0x259ae8){return![];}}function _getPrototypeOf(_0x4e9040){var _0x3e635e=_0x4c41;return _getPrototypeOf=Object[_0x3e635e(0xbf)]?Object['getPrototypeOf'][_0x3e635e(0xcf)]():function _0x3bde3e(_0x4b9212){var _0x299e17=_0x3e635e;return _0x4b9212['__proto__']||Object[_0x299e17(0xc6)](_0x4b9212);},_getPrototypeOf(_0x4e9040);}function _defineProperty(_0x4a273f,_0x2acc03,_0x5619b0){var _0x42bf61=_0x4c41;return _0x2acc03=_toPropertyKey(_0x2acc03),_0x2acc03 in _0x4a273f?Object[_0x42bf61(0xb6)](_0x4a273f,_0x2acc03,{'value':_0x5619b0,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x4a273f[_0x2acc03]=_0x5619b0,_0x4a273f;}function _0x19cc(){var _0x1488fb=['y2fSBa','ywrKug9PBNq','Dw5KzwzPBMvK','nNfmsNPwua','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9Y','mZeZodK5nwf5AgLKrG','yMLUza','yxbWBhK','zhjHz0XHEwvY','mtK4ndq0mtjIBhL1B0u','Bg5N','z2v0twfW','AgfZt3DUuhjVCgvYDhK','DhLWzq','nZuZnZa4nMHbwNvevG','mtqYodGWnuTftuzjyG','Cg9ZAxrPB25Z','Bw91C2veCMfNrw5K','B3b0Aw9UCW','ChjVDg90ExbL','D3jPDgfIBgu','zhjHD2LUzW','C2HHCgvqB2LUDeXHEwvY','C2v0rhjHD2vYtgf5zxi','zhjHD0vUza','zhjHz1bVAw50CW','muvJyuzeuq','y29UC3rYDwn0','zgvMyxvSDa','y29UzMLNDxjHyMXL','nZm5mtC0tK1HD3vK','z2v0','mtm0ndKWoeLNvMDotW','nM1Ps2vnCq','Cg9PBNrtDhLSzq','sgvPz2H0uMvMzxjLBMnL','Cg9PBNq','DMfSDwu','zgvZDhjVEq','Dg9qCMLTAxrPDMu','DMfSDwvpzG','zNvUy3rPB24','zw51BwvYywjSzq','x2rYyxDdB250zxH0','x19WCM90B19F','Bgf0','Bw91C2veCMfNq2HHBMDL','zgvMAw5LuhjVCgvYDhK','C3LTyM9S','C3rHCNrfzgL0','y29UC3rYDwn0B3i','zhjHz2DPBMC','ywX0','ntbUrvDYvKW','mtmZmJy4m1f3zvPlBa','y2XHBxbuB0DYB3vUza','C2v0uhjVDg90ExbLt2y','zw5KrwrPDa','y3jLyxrL','u3vWzxiGzxHWCMvZC2LVBIbTDxn0igvPDgHLCIbIzsbUDwXSig9YigeGzNvUy3rPB24','DgHPCYbOyxnUj3qGyMvLBIbPBML0AwfSAxnLzcaTihn1CgvYkcKGAgfZBID0igjLzw4Gy2fSBgvK','BgvUz3rO','qeb0B1bYAw1PDgL2zsbTDxn0ihjLDhvYBIbHihbYAw1PDgL2zsb2ywX1zs4','z2v0uhjVDg90ExbLt2y','ohb1C05puG','q2fUBM90ignHBgWGysbJBgfZCYbHCYbHigz1BMn0Aw9U'];_0x19cc=function(){return _0x1488fb;};return _0x19cc();}function _toPropertyKey(_0x327267){var _0x3388d0=_0x4c41,_0x4f15ae=_toPrimitive(_0x327267,'string');return _0x3388d0(0xb7)==_typeof(_0x4f15ae)?_0x4f15ae:String(_0x4f15ae);}function _toPrimitive(_0xd41530,_0x4ae046){var _0x5bf182=_0x4c41;if('object'!=_typeof(_0xd41530)||!_0xd41530)return _0xd41530;var _0x191204=_0xd41530[Symbol[_0x5bf182(0xae)]];if(void 0x0!==_0x191204){var _0x294bbd=_0x191204['call'](_0xd41530,_0x4ae046||_0x5bf182(0xe5));if('object'!=_typeof(_0x294bbd))return _0x294bbd;throw new TypeError(_0x5bf182(0xc5));}return('string'===_0x4ae046?String:Number)(_0xd41530);}import*as _0x1b9371 from'deeptwins-cesium';import{isNil}from'lodash';import _0x198acb from'./BaseShape';import _0x305688 from'./DragPoint';export{default as DragPoint}from'./DragPoint';var Point=function(_0x4420a1){var _0x77b4bc=_0x4c41;_inherits(_0xd9a960,_0x4420a1);var _0x4b2a8d=_createSuper(_0xd9a960);function _0xd9a960(_0x189c5a,_0x28abb9){var _0x2f5154=_0x4c41,_0x452cd1;return _classCallCheck(this,_0xd9a960),_0x452cd1=_0x4b2a8d['call'](this,_0x189c5a),_defineProperty(_assertThisInitialized(_0x452cd1),_0x2f5154(0xd6),_0x2f5154(0xab)),_defineProperty(_assertThisInitialized(_0x452cd1),'shapePointLayer',void 0x0),_0x452cd1[_0x2f5154(0xbe)]=isNil(_0x28abb9===null||_0x28abb9===void 0x0?void 0x0:_0x28abb9[_0x2f5154(0xbe)])?_0x452cd1[_0x2f5154(0xbe)]:_0x28abb9['clampToGround'],_0x452cd1['pointStyle']['heightReference']=_0x452cd1[_0x2f5154(0xbe)]?_0x1b9371[_0x2f5154(0xaa)]['CLAMP_TO_GROUND']:_0x1b9371['HeightReference']['NONE'],_0x452cd1;}return _createClass(_0xd9a960,[{'key':'transformData','value':function _0x51baf3(_0x284548){var _0x1fee6a=_0x4c41;this['positions']=_0x284548,this[_0x1fee6a(0xdf)]=new _0x305688(this[_0x1fee6a(0xd4)](),{'positions':this['positions'],'style':this[_0x1fee6a(0xa9)]}),this['shapePointLayer']['endEdit'](),this['dragPoints']=[this[_0x1fee6a(0xdf)]],this['_drawContext']['setDrawerLayer'](this['id'],this);}},{'key':_0x77b4bc(0xca),'value':function _0x45c7bd(_0x354181){var _0x410ed1=_0x77b4bc,_0x212b55=_0x354181[_0x410ed1(0xd3)],_0x1afc30=_0x354181[_0x410ed1(0xb4)],_0xcda89b=_0x354181[_0x410ed1(0xbb)];this[_0x410ed1(0xd9)]=[_0x212b55,_0x1afc30,_0xcda89b],this[_0x410ed1(0xdf)]=new _0x305688(this[_0x410ed1(0xd4)](),{'positions':this['positions'],'style':this[_0x410ed1(0xa9)]}),this[_0x410ed1(0xe2)]=[this['shapePointLayer']],this[_0x410ed1(0xb2)][_0x410ed1(0xe0)](this['id'],this),this[_0x410ed1(0xde)](this),this[_0x410ed1(0xe1)](this),this[_0x410ed1(0xb8)]();}},{'key':_0x77b4bc(0xb8),'value':function _0x34be7d(){var _0x47929c=_0x77b4bc;_get(_getPrototypeOf(_0xd9a960['prototype']),'startEdit',this)['call'](this),this[_0x47929c(0xe2)][0x0]&&this[_0x47929c(0xe2)][0x0]['startEdit']();}},{'key':'mouseDragStart','value':function _0x4ebae0(_0x45dc80,_0x563937){var _0x180e40=_0x77b4bc;this[_0x180e40(0xba)]=!![],this['dragLayer']=_0x563937;}},{'key':'mouseDragChange','value':function _0x4fc503(_0x26814f){var _0x2169e2=_0x77b4bc;if(this['dragging']){var _0x37743d,_0x4b20aa;this['positions']=[_0x26814f[_0x2169e2(0xd3)],_0x26814f['lat'],_0x26814f['alt']],((_0x37743d=this['_drawContext'][_0x2169e2(0xdb)])===null||_0x37743d===void 0x0?void 0x0:_0x37743d['onPointsChange'])&&((_0x4b20aa=this[_0x2169e2(0xb2)][_0x2169e2(0xdb)])===null||_0x4b20aa===void 0x0?void 0x0:_0x4b20aa['onPointsChange']({'layer':this,'positions':this['positions']})),this['dragLayer'][_0x2169e2(0xb5)](_0x26814f);}}},{'key':_0x77b4bc(0xda),'value':function _0x399e32(){var _0x18446b=_0x77b4bc;this['dragging']=![],this[_0x18446b(0xd1)]=null;}},{'key':_0x77b4bc(0xc0),'value':function _0x445366(_0x24e2bc){var _0x121286=_0x77b4bc,_0x1f3266=arguments[_0x121286(0xc4)]>0x1&&arguments[0x1]!==undefined?arguments[0x1]:!![];_get(_getPrototypeOf(_0xd9a960[_0x121286(0xdc)]),_0x121286(0xc0),this)[_0x121286(0xc9)](this,_0x24e2bc,_0x1f3266),this['dragPoints'][0x0]&&this[_0x121286(0xe2)][0x0]['endEdit']();}},{'key':'destroy','value':function _0x389a92(){var _0x33f335=_0x77b4bc;_get(_getPrototypeOf(_0xd9a960[_0x33f335(0xdc)]),_0x33f335(0xad),this)['call'](this),this[_0x33f335(0xdf)]=null;}}]),_0xd9a960;}(_0x198acb);export default Point;
|
|
@@ -1,368 +1 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
-
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."); }
|
|
4
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
-
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
9
|
-
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
10
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
11
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
14
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
15
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
16
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
17
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
19
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
20
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
|
-
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); }
|
|
23
|
-
import * as Cesium from 'deeptwins-cesium';
|
|
24
|
-
import { isNil } from 'lodash';
|
|
25
|
-
import { v4 as uuidV4 } from 'uuid';
|
|
26
|
-
import PositionProperty from "../../property/PositionProperty";
|
|
27
|
-
import * as utils from "../../tool/utils";
|
|
28
|
-
import { STATUS } from "../types";
|
|
29
|
-
import BaseShape from "./BaseShape";
|
|
30
|
-
import DragPoint from "./DragPoint";
|
|
31
|
-
import { ShapePolyline } from "./Polyline";
|
|
32
|
-
|
|
33
|
-
// 创建形状面
|
|
34
|
-
export var ShapePolygon = /*#__PURE__*/function () {
|
|
35
|
-
/**
|
|
36
|
-
* 构造函数,用于创建一个地图多边形对象
|
|
37
|
-
* @param map 地图实例对象,用于获取地图上下文
|
|
38
|
-
* @param options 配置选项对象
|
|
39
|
-
* @param options.positions 多边形的坐标点数组
|
|
40
|
-
* @param options.style 多边形的样式配置
|
|
41
|
-
*/
|
|
42
|
-
function ShapePolygon(map, _ref) {
|
|
43
|
-
var positions = _ref.positions,
|
|
44
|
-
style = _ref.style;
|
|
45
|
-
_classCallCheck(this, ShapePolygon);
|
|
46
|
-
_defineProperty(this, "_mapContext", void 0);
|
|
47
|
-
_defineProperty(this, "id", '');
|
|
48
|
-
_defineProperty(this, "layer", void 0);
|
|
49
|
-
_defineProperty(this, "isDestroyed", false);
|
|
50
|
-
_defineProperty(this, "_geoJson", void 0);
|
|
51
|
-
_defineProperty(this, "_style", void 0);
|
|
52
|
-
this._mapContext = map._mapContext;
|
|
53
|
-
this.id = uuidV4();
|
|
54
|
-
this._geoJson = {
|
|
55
|
-
type: 'Feature',
|
|
56
|
-
geometry: {
|
|
57
|
-
type: 'Polygon',
|
|
58
|
-
coordinates: [positions]
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
this._style = style;
|
|
62
|
-
this._create();
|
|
63
|
-
}
|
|
64
|
-
_createClass(ShapePolygon, [{
|
|
65
|
-
key: "getMap",
|
|
66
|
-
value: function getMap() {
|
|
67
|
-
return this._mapContext && this._mapContext.getMap();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// 是否能进行操作
|
|
71
|
-
}, {
|
|
72
|
-
key: "_canOperate",
|
|
73
|
-
value: function _canOperate() {
|
|
74
|
-
if (this.isDestroyed) {
|
|
75
|
-
utils.error('ShapePolygon实例已销毁');
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
}, {
|
|
81
|
-
key: "_create",
|
|
82
|
-
value: function _create() {
|
|
83
|
-
if (!this._canOperate()) return;
|
|
84
|
-
this.layer = this.getMap().addGraphicLayer(this._geoJson, {
|
|
85
|
-
type: 'polygon',
|
|
86
|
-
id: this.id,
|
|
87
|
-
style: this._style,
|
|
88
|
-
positionProperty: new PositionProperty()
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// 更新
|
|
93
|
-
}, {
|
|
94
|
-
key: "update",
|
|
95
|
-
value: function update(positions) {
|
|
96
|
-
if (!this._canOperate()) return;
|
|
97
|
-
if (this.layer) {
|
|
98
|
-
this._geoJson.geometry.coordinates = [positions];
|
|
99
|
-
this.layer.setData(this._geoJson);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// 销毁
|
|
104
|
-
}, {
|
|
105
|
-
key: "destroy",
|
|
106
|
-
value: function destroy() {
|
|
107
|
-
if (!this._canOperate()) return;
|
|
108
|
-
this.isDestroyed = true;
|
|
109
|
-
this.layer && this.layer.remove();
|
|
110
|
-
this.layer = null;
|
|
111
|
-
}
|
|
112
|
-
}]);
|
|
113
|
-
return ShapePolygon;
|
|
114
|
-
}();
|
|
115
|
-
var Polygon = /*#__PURE__*/function (_BaseShape) {
|
|
116
|
-
_inherits(Polygon, _BaseShape);
|
|
117
|
-
var _super = _createSuper(Polygon);
|
|
118
|
-
function Polygon(drawContext, config) {
|
|
119
|
-
var _this;
|
|
120
|
-
_classCallCheck(this, Polygon);
|
|
121
|
-
_this = _super.call(this, drawContext);
|
|
122
|
-
_defineProperty(_assertThisInitialized(_this), "type", 'polygon');
|
|
123
|
-
_defineProperty(_assertThisInitialized(_this), "shapePolylineLayer", void 0);
|
|
124
|
-
_defineProperty(_assertThisInitialized(_this), "shapePolygonLayer", void 0);
|
|
125
|
-
// 鼠标移动时的临时点
|
|
126
|
-
_defineProperty(_assertThisInitialized(_this), "_tempPosition", void 0);
|
|
127
|
-
_this.clampToGround = isNil(config === null || config === void 0 ? void 0 : config.clampToGround) ? _this.clampToGround : config.clampToGround;
|
|
128
|
-
_this.polylineStyle.clampToGround = _this.clampToGround;
|
|
129
|
-
if (_this.clampToGround) {
|
|
130
|
-
_this.polygonStyle.heightReference = Cesium.HeightReference.CLAMP_TO_GROUND;
|
|
131
|
-
_this.polygonStyle.perPositionHeight = false;
|
|
132
|
-
} else {
|
|
133
|
-
_this.polygonStyle.heightReference = Cesium.HeightReference.NONE;
|
|
134
|
-
_this.polygonStyle.perPositionHeight = true;
|
|
135
|
-
}
|
|
136
|
-
return _this;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// 数据转换
|
|
140
|
-
_createClass(Polygon, [{
|
|
141
|
-
key: "transformData",
|
|
142
|
-
value: function transformData(positions) {
|
|
143
|
-
var _this2 = this;
|
|
144
|
-
this.positions = positions;
|
|
145
|
-
this.shapePolylineLayer = new ShapePolyline(this.getMap(), {
|
|
146
|
-
map: this.getMap(),
|
|
147
|
-
positions: this._getDrawPolylinePositions(),
|
|
148
|
-
style: this.polylineStyle
|
|
149
|
-
});
|
|
150
|
-
this.shapePolygonLayer = new ShapePolygon(this.getMap(), {
|
|
151
|
-
map: this.getMap(),
|
|
152
|
-
positions: this._getDrawPolygonPositions(),
|
|
153
|
-
style: this.polygonStyle
|
|
154
|
-
});
|
|
155
|
-
positions.forEach(function (position, index) {
|
|
156
|
-
var layer = new DragPoint(_this2.getMap(), {
|
|
157
|
-
positions: position,
|
|
158
|
-
style: _this2.pointStyle
|
|
159
|
-
});
|
|
160
|
-
layer.isStart = index === 0;
|
|
161
|
-
layer.endEdit();
|
|
162
|
-
layer.show(false);
|
|
163
|
-
_this2.dragPoints.push(layer);
|
|
164
|
-
});
|
|
165
|
-
// 存入
|
|
166
|
-
this._drawContext.setDrawerLayer(this.id, this);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// 获取绘制中的线的点位
|
|
170
|
-
}, {
|
|
171
|
-
key: "_getDrawPolylinePositions",
|
|
172
|
-
value: function _getDrawPolylinePositions() {
|
|
173
|
-
var _this$positions;
|
|
174
|
-
if (!((_this$positions = this.positions) !== null && _this$positions !== void 0 && _this$positions.length)) return [];
|
|
175
|
-
var positions = this._tempPosition ? [].concat(_toConsumableArray(this.positions), [this._tempPosition]) : _toConsumableArray(this.positions);
|
|
176
|
-
var isNeedClose = positions.length > 2;
|
|
177
|
-
isNeedClose && positions.push(positions[0]);
|
|
178
|
-
return positions;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// 获取绘制中的面的点位
|
|
182
|
-
}, {
|
|
183
|
-
key: "_getDrawPolygonPositions",
|
|
184
|
-
value: function _getDrawPolygonPositions() {
|
|
185
|
-
var _this$positions2;
|
|
186
|
-
if (!((_this$positions2 = this.positions) !== null && _this$positions2 !== void 0 && _this$positions2.length)) return [];
|
|
187
|
-
return this._tempPosition ? [].concat(_toConsumableArray(this.positions), [this._tempPosition, this.positions[0]]) : [].concat(_toConsumableArray(this.positions), [this.positions[0]]);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// 添加点位
|
|
191
|
-
}, {
|
|
192
|
-
key: "addPoint",
|
|
193
|
-
value: function addPoint(position) {
|
|
194
|
-
var _this$positions3;
|
|
195
|
-
var lng = position.lng,
|
|
196
|
-
lat = position.lat,
|
|
197
|
-
alt = position.alt;
|
|
198
|
-
if (!((_this$positions3 = this.positions) !== null && _this$positions3 !== void 0 && _this$positions3.length)) {
|
|
199
|
-
// 创建
|
|
200
|
-
this.positions = [[lng, lat, alt]];
|
|
201
|
-
this.shapePolylineLayer = new ShapePolyline(this.getMap(), {
|
|
202
|
-
map: this.getMap(),
|
|
203
|
-
positions: this._getDrawPolylinePositions(),
|
|
204
|
-
style: this.polylineStyle
|
|
205
|
-
});
|
|
206
|
-
this.shapePolygonLayer = new ShapePolygon(this.getMap(), {
|
|
207
|
-
map: this.getMap(),
|
|
208
|
-
positions: this._getDrawPolygonPositions(),
|
|
209
|
-
style: this.polygonStyle
|
|
210
|
-
});
|
|
211
|
-
} else {
|
|
212
|
-
var _this$shapePolylineLa, _this$shapePolygonLay;
|
|
213
|
-
// 添加
|
|
214
|
-
this.positions.push([lng, lat, alt]);
|
|
215
|
-
(_this$shapePolylineLa = this.shapePolylineLayer) === null || _this$shapePolylineLa === void 0 || _this$shapePolylineLa.update(this._getDrawPolylinePositions());
|
|
216
|
-
(_this$shapePolygonLay = this.shapePolygonLayer) === null || _this$shapePolygonLay === void 0 || _this$shapePolygonLay.update(this._getDrawPolygonPositions());
|
|
217
|
-
}
|
|
218
|
-
// 创建拖动点位
|
|
219
|
-
this._createDragPoint(position);
|
|
220
|
-
// 绘制中
|
|
221
|
-
this.drawing(this);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// 创建拖动点位
|
|
225
|
-
}, {
|
|
226
|
-
key: "_createDragPoint",
|
|
227
|
-
value: function _createDragPoint(position) {
|
|
228
|
-
var _this$positions4;
|
|
229
|
-
var lng = position.lng,
|
|
230
|
-
lat = position.lat,
|
|
231
|
-
alt = position.alt;
|
|
232
|
-
var layer = new DragPoint(this.getMap(), {
|
|
233
|
-
positions: [lng, lat, alt],
|
|
234
|
-
style: this.pointStyle
|
|
235
|
-
});
|
|
236
|
-
layer.isStart = ((_this$positions4 = this.positions) === null || _this$positions4 === void 0 ? void 0 : _this$positions4.length) === 1;
|
|
237
|
-
this.dragPoints.push(layer);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// 删除上一个
|
|
241
|
-
}, {
|
|
242
|
-
key: "removePrev",
|
|
243
|
-
value: function removePrev() {
|
|
244
|
-
var _this$positions5, _this$positions6, _this$positions7, _this$positions8;
|
|
245
|
-
if (!((_this$positions5 = this.positions) !== null && _this$positions5 !== void 0 && _this$positions5.length)) return;
|
|
246
|
-
var i = ((_this$positions6 = this.positions) === null || _this$positions6 === void 0 ? void 0 : _this$positions6.length) - 1;
|
|
247
|
-
this.positions.splice(i, 1);
|
|
248
|
-
if (!((_this$positions7 = this.positions) !== null && _this$positions7 !== void 0 && _this$positions7.length)) {
|
|
249
|
-
this.positions = [];
|
|
250
|
-
this.shapePolylineLayer && this.shapePolylineLayer.destroy();
|
|
251
|
-
this.shapePolylineLayer = null;
|
|
252
|
-
this.shapePolygonLayer && this.shapePolygonLayer.destroy();
|
|
253
|
-
this.shapePolygonLayer = null;
|
|
254
|
-
} else {
|
|
255
|
-
var _this$shapePolylineLa2, _this$shapePolygonLay2;
|
|
256
|
-
(_this$shapePolylineLa2 = this.shapePolylineLayer) === null || _this$shapePolylineLa2 === void 0 || _this$shapePolylineLa2.update(this._getDrawPolylinePositions());
|
|
257
|
-
(_this$shapePolygonLay2 = this.shapePolygonLayer) === null || _this$shapePolygonLay2 === void 0 || _this$shapePolygonLay2.update(this._getDrawPolygonPositions());
|
|
258
|
-
}
|
|
259
|
-
if (this.dragPoints[i]) {
|
|
260
|
-
this.dragPoints[i].destroy();
|
|
261
|
-
this.dragPoints.splice(i, 1);
|
|
262
|
-
}
|
|
263
|
-
// 绘制中
|
|
264
|
-
this.drawing(this);
|
|
265
|
-
this._drawContext.options.onMouseMoveChange && this._drawContext.options.onMouseMoveChange({
|
|
266
|
-
layer: this,
|
|
267
|
-
positions: this._tempPosition ? [].concat(_toConsumableArray(this.positions), [this._tempPosition]) : this.positions
|
|
268
|
-
});
|
|
269
|
-
if (!((_this$positions8 = this.positions) !== null && _this$positions8 !== void 0 && _this$positions8.length)) {
|
|
270
|
-
this._drawContext._changeStatus(STATUS.START_DRAW);
|
|
271
|
-
this._drawContext._updateTooltip();
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// 更新临时点位
|
|
276
|
-
}, {
|
|
277
|
-
key: "updateTempPosition",
|
|
278
|
-
value: function updateTempPosition(position) {
|
|
279
|
-
var _this$shapePolylineLa3, _this$shapePolygonLay3;
|
|
280
|
-
if (!this.shapePolylineLayer || !this.shapePolygonLayer) return;
|
|
281
|
-
var lng = position.lng,
|
|
282
|
-
lat = position.lat,
|
|
283
|
-
alt = position.alt;
|
|
284
|
-
this._tempPosition = [lng, lat, alt];
|
|
285
|
-
(_this$shapePolylineLa3 = this.shapePolylineLayer) === null || _this$shapePolylineLa3 === void 0 || _this$shapePolylineLa3.update(this._getDrawPolylinePositions());
|
|
286
|
-
(_this$shapePolygonLay3 = this.shapePolygonLayer) === null || _this$shapePolygonLay3 === void 0 || _this$shapePolygonLay3.update(this._getDrawPolygonPositions());
|
|
287
|
-
this._drawContext.options.onMouseMoveChange && this._drawContext.options.onMouseMoveChange({
|
|
288
|
-
layer: this,
|
|
289
|
-
positions: this._tempPosition ? [].concat(_toConsumableArray(this.positions), [this._tempPosition]) : this.positions
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
// 结束绘制
|
|
294
|
-
}, {
|
|
295
|
-
key: "endDraw",
|
|
296
|
-
value: function endDraw() {
|
|
297
|
-
var _this$shapePolylineLa4, _this$shapePolygonLay4;
|
|
298
|
-
if (this.positions.length < 3) return;
|
|
299
|
-
this._tempPosition = null;
|
|
300
|
-
(_this$shapePolylineLa4 = this.shapePolylineLayer) === null || _this$shapePolylineLa4 === void 0 || _this$shapePolylineLa4.update(this._getDrawPolylinePositions());
|
|
301
|
-
(_this$shapePolygonLay4 = this.shapePolygonLayer) === null || _this$shapePolygonLay4 === void 0 || _this$shapePolygonLay4.update(this._getDrawPolygonPositions());
|
|
302
|
-
this.drawEnd(this);
|
|
303
|
-
// 存入
|
|
304
|
-
this._drawContext.setDrawerLayer(this.id, this);
|
|
305
|
-
this.startEdit();
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
// 开始编辑
|
|
309
|
-
}, {
|
|
310
|
-
key: "startEdit",
|
|
311
|
-
value: function startEdit() {
|
|
312
|
-
_get(_getPrototypeOf(Polygon.prototype), "startEdit", this).call(this);
|
|
313
|
-
this._startEdgeEditing(true);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
// 开始鼠标拖拽
|
|
317
|
-
}, {
|
|
318
|
-
key: "mouseDragStart",
|
|
319
|
-
value: function mouseDragStart(position, dragLayer) {
|
|
320
|
-
this._handleDragStart(dragLayer);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
// 鼠标拖拽
|
|
324
|
-
}, {
|
|
325
|
-
key: "mouseDragChange",
|
|
326
|
-
value: function mouseDragChange(position) {
|
|
327
|
-
var _this$shapePolylineLa5, _this$shapePolygonLay5, _this$_drawContext$op, _this$_drawContext$op2;
|
|
328
|
-
if (!this.dragging) return;
|
|
329
|
-
this.positions = this._handleDragChange(position);
|
|
330
|
-
(_this$shapePolylineLa5 = this.shapePolylineLayer) === null || _this$shapePolylineLa5 === void 0 || _this$shapePolylineLa5.update(this._getDrawPolylinePositions());
|
|
331
|
-
(_this$shapePolygonLay5 = this.shapePolygonLayer) === null || _this$shapePolygonLay5 === void 0 || _this$shapePolygonLay5.update(this._getDrawPolygonPositions());
|
|
332
|
-
// 调用点位改变事件
|
|
333
|
-
((_this$_drawContext$op = this._drawContext.options) === null || _this$_drawContext$op === void 0 ? void 0 : _this$_drawContext$op.onPointsChange) && ((_this$_drawContext$op2 = this._drawContext.options) === null || _this$_drawContext$op2 === void 0 ? void 0 : _this$_drawContext$op2.onPointsChange({
|
|
334
|
-
layer: this,
|
|
335
|
-
positions: this.positions
|
|
336
|
-
}));
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// 拖拽结束
|
|
340
|
-
}, {
|
|
341
|
-
key: "mouseDragEnd",
|
|
342
|
-
value: function mouseDragEnd() {
|
|
343
|
-
this._handleDragEnd();
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
// 结束编辑
|
|
347
|
-
}, {
|
|
348
|
-
key: "endEdit",
|
|
349
|
-
value: function endEdit(layer) {
|
|
350
|
-
var emitComplete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
351
|
-
_get(_getPrototypeOf(Polygon.prototype), "endEdit", this).call(this, layer, emitComplete);
|
|
352
|
-
this._stopEdgeEditing();
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// 销毁
|
|
356
|
-
}, {
|
|
357
|
-
key: "destroy",
|
|
358
|
-
value: function destroy() {
|
|
359
|
-
_get(_getPrototypeOf(Polygon.prototype), "destroy", this).call(this);
|
|
360
|
-
this.shapePolylineLayer && this.shapePolylineLayer.destroy();
|
|
361
|
-
this.shapePolylineLayer = null;
|
|
362
|
-
this.shapePolygonLayer && this.shapePolygonLayer.destroy();
|
|
363
|
-
this.shapePolygonLayer = null;
|
|
364
|
-
}
|
|
365
|
-
}]);
|
|
366
|
-
return Polygon;
|
|
367
|
-
}(BaseShape);
|
|
368
|
-
export default Polygon;
|
|
1
|
+
(function(_0x22be4d,_0x1c79ed){var _0x594f53=_0x574c,_0xfb059b=_0x22be4d();while(!![]){try{var _0x399cc8=-parseInt(_0x594f53(0xdd))/0x1*(-parseInt(_0x594f53(0xee))/0x2)+parseInt(_0x594f53(0xb8))/0x3+parseInt(_0x594f53(0xde))/0x4+-parseInt(_0x594f53(0xa4))/0x5*(-parseInt(_0x594f53(0xec))/0x6)+-parseInt(_0x594f53(0xe7))/0x7*(-parseInt(_0x594f53(0xeb))/0x8)+parseInt(_0x594f53(0xaf))/0x9*(-parseInt(_0x594f53(0xaa))/0xa)+-parseInt(_0x594f53(0xd9))/0xb*(parseInt(_0x594f53(0xc8))/0xc);if(_0x399cc8===_0x1c79ed)break;else _0xfb059b['push'](_0xfb059b['shift']());}catch(_0x15222f){_0xfb059b['push'](_0xfb059b['shift']());}}}(_0x124a,0x53e87));function _typeof(_0x54acf9){'@babel/helpers - typeof';var _0x30dd3a=_0x574c;return _typeof=_0x30dd3a(0xc1)==typeof Symbol&&'symbol'==typeof Symbol['iterator']?function(_0x1eb752){return typeof _0x1eb752;}:function(_0x33a0a2){var _0x8e3a5e=_0x30dd3a;return _0x33a0a2&&'function'==typeof Symbol&&_0x33a0a2[_0x8e3a5e(0xf0)]===Symbol&&_0x33a0a2!==Symbol['prototype']?_0x8e3a5e(0xdc):typeof _0x33a0a2;},_typeof(_0x54acf9);}function _toConsumableArray(_0xba58d8){return _arrayWithoutHoles(_0xba58d8)||_iterableToArray(_0xba58d8)||_unsupportedIterableToArray(_0xba58d8)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError('Invalid\x20attempt\x20to\x20spread\x20non-iterable\x20instance.\x0aIn\x20order\x20to\x20be\x20iterable,\x20non-array\x20objects\x20must\x20have\x20a\x20[Symbol.iterator]()\x20method.');}function _unsupportedIterableToArray(_0x1eea5c,_0x2ef05f){var _0x1366f1=_0x574c;if(!_0x1eea5c)return;if(typeof _0x1eea5c==='string')return _arrayLikeToArray(_0x1eea5c,_0x2ef05f);var _0x21fb90=Object['prototype'][_0x1366f1(0xa8)]['call'](_0x1eea5c)['slice'](0x8,-0x1);if(_0x21fb90==='Object'&&_0x1eea5c['constructor'])_0x21fb90=_0x1eea5c[_0x1366f1(0xf0)]['name'];if(_0x21fb90==='Map'||_0x21fb90==='Set')return Array['from'](_0x1eea5c);if(_0x21fb90==='Arguments'||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/[_0x1366f1(0x9b)](_0x21fb90))return _arrayLikeToArray(_0x1eea5c,_0x2ef05f);}function _iterableToArray(_0x22cd52){var _0x2e3a1e=_0x574c;if(typeof Symbol!==_0x2e3a1e(0xb6)&&_0x22cd52[Symbol['iterator']]!=null||_0x22cd52['@@iterator']!=null)return Array['from'](_0x22cd52);}function _arrayWithoutHoles(_0x446b56){var _0x1e8b85=_0x574c;if(Array[_0x1e8b85(0xcf)](_0x446b56))return _arrayLikeToArray(_0x446b56);}function _arrayLikeToArray(_0x513312,_0xe6ee9b){if(_0xe6ee9b==null||_0xe6ee9b>_0x513312['length'])_0xe6ee9b=_0x513312['length'];for(var _0x425e0e=0x0,_0x44b491=new Array(_0xe6ee9b);_0x425e0e<_0xe6ee9b;_0x425e0e++)_0x44b491[_0x425e0e]=_0x513312[_0x425e0e];return _0x44b491;}function _get(){var _0x3f1e88=_0x574c;return typeof Reflect!=='undefined'&&Reflect[_0x3f1e88(0xa6)]?_get=Reflect[_0x3f1e88(0xa6)][_0x3f1e88(0xbf)]():_get=function _0x2da19c(_0x4ffe86,_0x24e6b1,_0x5321b5){var _0x5c1a09=_0x3f1e88,_0x362c5b=_superPropBase(_0x4ffe86,_0x24e6b1);if(!_0x362c5b)return;var _0x1feec4=Object[_0x5c1a09(0xc2)](_0x362c5b,_0x24e6b1);if(_0x1feec4[_0x5c1a09(0xa6)])return _0x1feec4[_0x5c1a09(0xa6)][_0x5c1a09(0xda)](arguments['length']<0x3?_0x4ffe86:_0x5321b5);return _0x1feec4['value'];},_get['apply'](this,arguments);}function _superPropBase(_0xc28ed4,_0x4295c1){var _0x31e125=_0x574c;while(!Object['prototype'][_0x31e125(0xc9)][_0x31e125(0xda)](_0xc28ed4,_0x4295c1)){_0xc28ed4=_getPrototypeOf(_0xc28ed4);if(_0xc28ed4===null)break;}return _0xc28ed4;}function _inherits(_0x492cdf,_0x1389e9){var _0x374e01=_0x574c;if(typeof _0x1389e9!==_0x374e01(0xc1)&&_0x1389e9!==null)throw new TypeError(_0x374e01(0xc0));_0x492cdf['prototype']=Object[_0x374e01(0x9a)](_0x1389e9&&_0x1389e9['prototype'],{'constructor':{'value':_0x492cdf,'writable':!![],'configurable':!![]}}),Object[_0x374e01(0xc7)](_0x492cdf,'prototype',{'writable':![]});if(_0x1389e9)_setPrototypeOf(_0x492cdf,_0x1389e9);}function _setPrototypeOf(_0x4088b9,_0x5ef613){var _0x45db13=_0x574c;return _setPrototypeOf=Object['setPrototypeOf']?Object['setPrototypeOf'][_0x45db13(0xbf)]():function _0x390c6b(_0x3876bd,_0x384863){return _0x3876bd['__proto__']=_0x384863,_0x3876bd;},_setPrototypeOf(_0x4088b9,_0x5ef613);}function _0x124a(){var _0x1445e9=['y29UC3rYDwn0','Cg9SEwXPBMvtDhLSzq','CgvYug9ZAxrPB25izwLNAhq','D3jPDgfIBgu','ndq1BhzsALHb','x21HCenVBNrLEhq','z2v0','C2HHCgvqB2X5z29Utgf5zxi','Dg9tDhjPBMC','x2nYzwf0zq','mtbpAMP1r1u','Cg9SEwDVBLn0EwXL','Cg9ZAxrPB25Z','BgvUz3rO','Bgf0','mZa1mZm4nvbPvxPkta','A2v5','zgvMyxvSDa','C3rHCNrfzgL0','x2DLDerYyxDqB2X5BgLUzvbVC2L0Aw9UCW','x19WCM90B19F','x2HHBMrSzurYywDtDgfYDa','Dw5KzwzPBMvK','Cg9SEwDVBG','mtq3otiZmvzothnewa','x2rYyxDdB250zxH0','DgHPCYbOyxnUj3qGyMvLBIbPBML0AwfSAxnLzcaTihn1CgvYkcKGAgfZBID0igjLzw4Gy2fSBgvK','x2HHBMrSzurYywDfBMq','u1rbuLrFrfjbvW','B2jQzwn0','yxbWBhK','yMLUza','u3vWzxiGzxHWCMvZC2LVBIbTDxn0igvPDgHLCIbIzsbUDwXSig9YigeGzNvUy3rPB24','zNvUy3rPB24','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9Y','Axnezxn0CM95zwq','tK9orq','rMvHDhvYzq','zw5KrwrPDa','zgvMAw5LuhjVCgvYDhK','mtjWAKrMu1i','AgfZt3DUuhjVCgvYDhK','x2DLB0PZB24','x2nHBK9WzxjHDgu','Bw91C2veCMfNu3rHCNq','y29VCMrPBMf0zxm','Dg9qCMLTAxrPDMu','AxnbCNjHEq','DMfSDwu','Bg5N','x2DLDerYyxDqB2X5z29Uug9ZAxrPB25Z','x3rLBxbqB3nPDgLVBG','C2v0rhjHD2vYtgf5zxi','B25nB3vZzu1VDMvdAgfUz2u','C2v0rgf0yq','x2HHBMrSzurYywDdAgfUz2u','y2XHBxbuB0DYB3vUza','mtuZodq3ndnYq3jqwLK','y2fSBa','C3r5Bgu','C3LTyM9S','nJmYnZHzEM1lC0u','mJu2ndC2mhf6BLPUAq','ug9SEwDVBG','x2nYzwf0zurYywDqB2LUDa','zhjHD0vUza','Cg9PBNrtDhLSzq','ChvZAa','qeb0B1bYAw1PDgL2zsbTDxn0ihjLDhvYBIbHihbYAw1PDgL2zsb2ywX1zs4','DMfSDwvpzG','DxbKyxrLvgvTCfbVC2L0Aw9U','ntKZodfxqu5My0G','B3b0Aw9UCW','z2v0uhjVDg90ExbLt2y','C2HHCgvqB2X5BgLUzuXHEwvY','nta0qxzywfjr','mtKZmdjTBevwBvu','zgvZDhjVEq','ne9ezLrzuG','DxbKyxrL','y29UC3rYDwn0B3i','x3n0EwXL','CMvTB3zLuhjLDG','ywX0','zw5KrhjHDW','ChjVDg90ExbL','y3jLyxrL','DgvZDa','zhjHz1bVAw50CW','y29Uy2f0','z2v0twfW','Bgf5zxi'];_0x124a=function(){return _0x1445e9;};return _0x124a();}function _createSuper(_0x4354f3){var _0x3084ba=_isNativeReflectConstruct();return function _0xf7f398(){var _0x412422=_0x574c,_0x5ba0fc=_getPrototypeOf(_0x4354f3),_0x28de25;if(_0x3084ba){var _0x100478=_getPrototypeOf(this)[_0x412422(0xf0)];_0x28de25=Reflect[_0x412422(0xa0)](_0x5ba0fc,arguments,_0x100478);}else _0x28de25=_0x5ba0fc[_0x412422(0xbe)](this,arguments);return _possibleConstructorReturn(this,_0x28de25);};}function _possibleConstructorReturn(_0x12e19c,_0x1eae12){if(_0x1eae12&&(_typeof(_0x1eae12)==='object'||typeof _0x1eae12==='function'))return _0x1eae12;else{if(_0x1eae12!==void 0x0)throw new TypeError('Derived\x20constructors\x20may\x20only\x20return\x20object\x20or\x20undefined');}return _assertThisInitialized(_0x12e19c);}function _assertThisInitialized(_0x325a96){var _0x42fb0d=_0x574c;if(_0x325a96===void 0x0)throw new ReferenceError(_0x42fb0d(0xba));return _0x325a96;}function _isNativeReflectConstruct(){var _0x37b025=_0x574c;if(typeof Reflect===_0x37b025(0xb6)||!Reflect['construct'])return![];if(Reflect['construct']['sham'])return![];if(typeof Proxy==='function')return!![];try{return Boolean[_0x37b025(0x99)][_0x37b025(0xe5)]['call'](Reflect['construct'](Boolean,[],function(){})),!![];}catch(_0x64a230){return![];}}function _getPrototypeOf(_0x3d80e3){var _0x598e45=_0x574c;return _getPrototypeOf=Object['setPrototypeOf']?Object[_0x598e45(0xe9)]['bind']():function _0x57d645(_0x5e8f8b){var _0x3cc5c6=_0x598e45;return _0x5e8f8b[_0x3cc5c6(0xb4)]||Object[_0x3cc5c6(0xe9)](_0x5e8f8b);},_getPrototypeOf(_0x3d80e3);}function _classCallCheck(_0x4a8421,_0x68f9b5){if(!(_0x4a8421 instanceof _0x68f9b5))throw new TypeError('Cannot\x20call\x20a\x20class\x20as\x20a\x20function');}function _defineProperties(_0xdff9e6,_0x50d40a){var _0x163d52=_0x574c;for(var _0x3d7ca9=0x0;_0x3d7ca9<_0x50d40a[_0x163d52(0xad)];_0x3d7ca9++){var _0x194eb1=_0x50d40a[_0x3d7ca9];_0x194eb1['enumerable']=_0x194eb1['enumerable']||![],_0x194eb1['configurable']=!![];if(_0x163d52(0xd0)in _0x194eb1)_0x194eb1[_0x163d52(0xa3)]=!![];Object[_0x163d52(0xc7)](_0xdff9e6,_toPropertyKey(_0x194eb1[_0x163d52(0xb0)]),_0x194eb1);}}function _createClass(_0x5cb42c,_0x44f2dd,_0x1ecd0c){var _0x124ca8=_0x574c;if(_0x44f2dd)_defineProperties(_0x5cb42c['prototype'],_0x44f2dd);if(_0x1ecd0c)_defineProperties(_0x5cb42c,_0x1ecd0c);return Object[_0x124ca8(0xc7)](_0x5cb42c,_0x124ca8(0x99),{'writable':![]}),_0x5cb42c;}function _defineProperty(_0x51e267,_0x380508,_0x4a2ef1){return _0x380508=_toPropertyKey(_0x380508),_0x380508 in _0x51e267?Object['defineProperty'](_0x51e267,_0x380508,{'value':_0x4a2ef1,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x51e267[_0x380508]=_0x4a2ef1,_0x51e267;}function _toPropertyKey(_0x3e4d5e){var _0x4a58ed=_0x574c,_0x36302a=_toPrimitive(_0x3e4d5e,'string');return _0x4a58ed(0xdc)==_typeof(_0x36302a)?_0x36302a:String(_0x36302a);}function _toPrimitive(_0x1774e8,_0xc9b649){var _0x2e7a6d=_0x574c;if('object'!=_typeof(_0x1774e8)||!_0x1774e8)return _0x1774e8;var _0x5f78e5=_0x1774e8[Symbol[_0x2e7a6d(0xce)]];if(void 0x0!==_0x5f78e5){var _0x4f8bae=_0x5f78e5['call'](_0x1774e8,_0xc9b649||_0x2e7a6d(0xb1));if(_0x2e7a6d(0xbd)!=_typeof(_0x4f8bae))return _0x4f8bae;throw new TypeError(_0x2e7a6d(0xe4));}return('string'===_0xc9b649?String:Number)(_0x1774e8);}import*as _0x129f47 from'deeptwins-cesium';import{isNil}from'lodash';import{v4 as _0x9a8bda}from'uuid';function _0x574c(_0x8c7ac6,_0x3f993f){_0x8c7ac6=_0x8c7ac6-0x97;var _0x124a7b=_0x124a();var _0x574c09=_0x124a7b[_0x8c7ac6];if(_0x574c['eNxxLC']===undefined){var _0x306139=function(_0x30ce4d){var _0x359ef4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x129f47='',_0x9a8bda='';for(var _0x2d29db=0x0,_0xbeacc0,_0x1d6859,_0x14c215=0x0;_0x1d6859=_0x30ce4d['charAt'](_0x14c215++);~_0x1d6859&&(_0xbeacc0=_0x2d29db%0x4?_0xbeacc0*0x40+_0x1d6859:_0x1d6859,_0x2d29db++%0x4)?_0x129f47+=String['fromCharCode'](0xff&_0xbeacc0>>(-0x2*_0x2d29db&0x6)):0x0){_0x1d6859=_0x359ef4['indexOf'](_0x1d6859);}for(var _0x54acf9=0x0,_0x1eb752=_0x129f47['length'];_0x54acf9<_0x1eb752;_0x54acf9++){_0x9a8bda+='%'+('00'+_0x129f47['charCodeAt'](_0x54acf9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x9a8bda);};_0x574c['XoLBhi']=_0x306139,_0x574c['RNIoiv']={},_0x574c['eNxxLC']=!![];}var _0x1a8813=_0x124a7b[0x0],_0x7deef5=_0x8c7ac6+_0x1a8813,_0x4fec45=_0x574c['RNIoiv'][_0x7deef5];return!_0x4fec45?(_0x574c09=_0x574c['XoLBhi'](_0x574c09),_0x574c['RNIoiv'][_0x7deef5]=_0x574c09):_0x574c09=_0x4fec45,_0x574c09;}import _0x2d29db from'../../property/PositionProperty';import*as _0xbeacc0 from'../../tool/utils';import{STATUS}from'../types';import _0x1d6859 from'./BaseShape';import _0x14c215 from'./DragPoint';import{ShapePolyline}from'./Polyline';export var ShapePolygon=(function(){var _0x2f4328=_0x574c;function _0x1c8259(_0x3c9e36,_0x280d4d){var _0x1a7cb0=_0x574c,_0x361028=_0x280d4d['positions'],_0x2bce4b=_0x280d4d[_0x1a7cb0(0xdb)];_classCallCheck(this,_0x1c8259),_defineProperty(this,_0x1a7cb0(0xa5),void 0x0),_defineProperty(this,'id',''),_defineProperty(this,'layer',void 0x0),_defineProperty(this,'isDestroyed',![]),_defineProperty(this,'_geoJson',void 0x0),_defineProperty(this,_0x1a7cb0(0xf1),void 0x0),this[_0x1a7cb0(0xa5)]=_0x3c9e36['_mapContext'],this['id']=_0x9a8bda(),this['_geoJson']={'type':_0x1a7cb0(0xc5),'geometry':{'type':_0x1a7cb0(0xdf),'coordinates':[_0x361028]}},this['_style']=_0x2bce4b,this[_0x1a7cb0(0xa9)]();}return _createClass(_0x1c8259,[{'key':_0x2f4328(0x9e),'value':function _0x271bad(){var _0x1d8eab=_0x2f4328;return this['_mapContext']&&this[_0x1d8eab(0xa5)]['getMap']();}},{'key':'_canOperate','value':function _0x3d76f5(){var _0x365827=_0x2f4328;if(this[_0x365827(0xc3)])return _0xbeacc0['error']('ShapePolygon实例已销毁'),![];return!![];}},{'key':'_create','value':function _0xa3a1d0(){var _0x5c9c65=_0x2f4328;if(!this['_canOperate']())return;this[_0x5c9c65(0x9f)]=this['getMap']()['addGraphicLayer'](this[_0x5c9c65(0xca)],{'type':_0x5c9c65(0xb7),'id':this['id'],'style':this[_0x5c9c65(0xf1)],'positionProperty':new _0x2d29db()});}},{'key':_0x2f4328(0xef),'value':function _0x28faeb(_0x1593b1){var _0x11b197=_0x2f4328;if(!this[_0x11b197(0xcb)]())return;this[_0x11b197(0x9f)]&&(this[_0x11b197(0xca)]['geometry'][_0x11b197(0xcd)]=[_0x1593b1],this['layer'][_0x11b197(0xd6)](this['_geoJson']));}},{'key':_0x2f4328(0xed),'value':function _0x5108c1(){var _0x4af6bc=_0x2f4328;if(!this['_canOperate']())return;this[_0x4af6bc(0xc3)]=!![],this['layer']&&this[_0x4af6bc(0x9f)]['remove'](),this['layer']=null;}}]),_0x1c8259;}());var Polygon=function(_0x4ee7d8){var _0x109814=_0x574c;_inherits(_0x4a80bd,_0x4ee7d8);var _0x3da639=_createSuper(_0x4a80bd);function _0x4a80bd(_0x18f0d5,_0x4877a2){var _0x1d1be3=_0x574c,_0x506ee5;return _classCallCheck(this,_0x4a80bd),_0x506ee5=_0x3da639['call'](this,_0x18f0d5),_defineProperty(_assertThisInitialized(_0x506ee5),'type',_0x1d1be3(0xb7)),_defineProperty(_assertThisInitialized(_0x506ee5),'shapePolylineLayer',void 0x0),_defineProperty(_assertThisInitialized(_0x506ee5),_0x1d1be3(0xa7),void 0x0),_defineProperty(_assertThisInitialized(_0x506ee5),_0x1d1be3(0xd3),void 0x0),_0x506ee5['clampToGround']=isNil(_0x4877a2===null||_0x4877a2===void 0x0?void 0x0:_0x4877a2[_0x1d1be3(0xd8)])?_0x506ee5[_0x1d1be3(0xd8)]:_0x4877a2['clampToGround'],_0x506ee5['polylineStyle'][_0x1d1be3(0xd8)]=_0x506ee5[_0x1d1be3(0xd8)],_0x506ee5['clampToGround']?(_0x506ee5['polygonStyle']['heightReference']=_0x129f47['HeightReference']['CLAMP_TO_GROUND'],_0x506ee5['polygonStyle'][_0x1d1be3(0xa2)]=![]):(_0x506ee5[_0x1d1be3(0xab)]['heightReference']=_0x129f47['HeightReference'][_0x1d1be3(0xc4)],_0x506ee5['polygonStyle']['perPositionHeight']=!![]),_0x506ee5;}return _createClass(_0x4a80bd,[{'key':'transformData','value':function _0xee47e8(_0x28232b){var _0x152d6d=_0x574c,_0x145b8c=this;this[_0x152d6d(0xac)]=_0x28232b,this['shapePolylineLayer']=new ShapePolyline(this['getMap'](),{'map':this[_0x152d6d(0x9e)](),'positions':this['_getDrawPolylinePositions'](),'style':this[_0x152d6d(0xa1)]}),this['shapePolygonLayer']=new ShapePolygon(this['getMap'](),{'map':this['getMap'](),'positions':this[_0x152d6d(0xd2)](),'style':this['polygonStyle']}),_0x28232b['forEach'](function(_0x31451f,_0x254165){var _0x3f809c=_0x152d6d,_0x567e9d=new _0x14c215(_0x145b8c[_0x3f809c(0x9e)](),{'positions':_0x31451f,'style':_0x145b8c['pointStyle']});_0x567e9d['isStart']=_0x254165===0x0,_0x567e9d[_0x3f809c(0xc6)](),_0x567e9d['show'](![]),_0x145b8c['dragPoints'][_0x3f809c(0xe3)](_0x567e9d);}),this[_0x152d6d(0xb9)]['setDrawerLayer'](this['id'],this);}},{'key':'_getDrawPolylinePositions','value':function _0x5a76dd(){var _0x58cd24=_0x574c,_0x5ee854;if(!((_0x5ee854=this[_0x58cd24(0xac)])!==null&&_0x5ee854!==void 0x0&&_0x5ee854[_0x58cd24(0xad)]))return[];var _0x49013b=this[_0x58cd24(0xd3)]?[][_0x58cd24(0x9d)](_toConsumableArray(this[_0x58cd24(0xac)]),[this[_0x58cd24(0xd3)]]):_toConsumableArray(this[_0x58cd24(0xac)]),_0xe9fc9f=_0x49013b['length']>0x2;return _0xe9fc9f&&_0x49013b[_0x58cd24(0xe3)](_0x49013b[0x0]),_0x49013b;}},{'key':_0x109814(0xd2),'value':function _0x5a6413(){var _0x2c5dd7=_0x109814,_0x22dbaa;if(!((_0x22dbaa=this[_0x2c5dd7(0xac)])!==null&&_0x22dbaa!==void 0x0&&_0x22dbaa['length']))return[];return this['_tempPosition']?[]['concat'](_toConsumableArray(this['positions']),[this['_tempPosition'],this['positions'][0x0]]):[]['concat'](_toConsumableArray(this[_0x2c5dd7(0xac)]),[this[_0x2c5dd7(0xac)][0x0]]);}},{'key':'addPoint','value':function _0x4b94ef(_0x148953){var _0x491635=_0x109814,_0x40641e,_0x439598=_0x148953[_0x491635(0xd1)],_0x55e67f=_0x148953[_0x491635(0xae)],_0xf5dda4=_0x148953['alt'];if(!((_0x40641e=this['positions'])!==null&&_0x40641e!==void 0x0&&_0x40641e[_0x491635(0xad)]))this[_0x491635(0xac)]=[[_0x439598,_0x55e67f,_0xf5dda4]],this[_0x491635(0xea)]=new ShapePolyline(this['getMap'](),{'map':this[_0x491635(0x9e)](),'positions':this['_getDrawPolylinePositions'](),'style':this['polylineStyle']}),this['shapePolygonLayer']=new ShapePolygon(this[_0x491635(0x9e)](),{'map':this['getMap'](),'positions':this['_getDrawPolygonPositions'](),'style':this[_0x491635(0xab)]});else{var _0x22905d,_0x117abe;this[_0x491635(0xac)]['push']([_0x439598,_0x55e67f,_0xf5dda4]),(_0x22905d=this[_0x491635(0xea)])===null||_0x22905d===void 0x0||_0x22905d['update'](this[_0x491635(0xb3)]()),(_0x117abe=this['shapePolygonLayer'])===null||_0x117abe===void 0x0||_0x117abe[_0x491635(0xef)](this[_0x491635(0xd2)]());}this['_createDragPoint'](_0x148953),this['drawing'](this);}},{'key':_0x109814(0xe0),'value':function _0x191e96(_0x3c915e){var _0x57f43f=_0x109814,_0x4cf3c0,_0xdce39d=_0x3c915e['lng'],_0x35e1b6=_0x3c915e[_0x57f43f(0xae)],_0x258143=_0x3c915e[_0x57f43f(0x97)],_0x319e72=new _0x14c215(this[_0x57f43f(0x9e)](),{'positions':[_0xdce39d,_0x35e1b6,_0x258143],'style':this[_0x57f43f(0xe2)]});_0x319e72['isStart']=((_0x4cf3c0=this['positions'])===null||_0x4cf3c0===void 0x0?void 0x0:_0x4cf3c0['length'])===0x1,this['dragPoints'][_0x57f43f(0xe3)](_0x319e72);}},{'key':_0x109814(0xf2),'value':function _0x5e2d62(){var _0x30dd3f=_0x109814,_0x3bd6d3,_0x107695,_0x472453,_0x12244d;if(!((_0x3bd6d3=this['positions'])!==null&&_0x3bd6d3!==void 0x0&&_0x3bd6d3['length']))return;var _0x2c4d31=((_0x107695=this['positions'])===null||_0x107695===void 0x0?void 0x0:_0x107695[_0x30dd3f(0xad)])-0x1;this[_0x30dd3f(0xac)]['splice'](_0x2c4d31,0x1);if(!((_0x472453=this['positions'])!==null&&_0x472453!==void 0x0&&_0x472453[_0x30dd3f(0xad)]))this[_0x30dd3f(0xac)]=[],this[_0x30dd3f(0xea)]&&this[_0x30dd3f(0xea)][_0x30dd3f(0xed)](),this[_0x30dd3f(0xea)]=null,this['shapePolygonLayer']&&this['shapePolygonLayer']['destroy'](),this[_0x30dd3f(0xa7)]=null;else{var _0x58804c,_0x442c43;(_0x58804c=this['shapePolylineLayer'])===null||_0x58804c===void 0x0||_0x58804c[_0x30dd3f(0xef)](this[_0x30dd3f(0xb3)]()),(_0x442c43=this['shapePolygonLayer'])===null||_0x442c43===void 0x0||_0x442c43['update'](this[_0x30dd3f(0xd2)]());}this['dragPoints'][_0x2c4d31]&&(this[_0x30dd3f(0x9c)][_0x2c4d31][_0x30dd3f(0xed)](),this['dragPoints']['splice'](_0x2c4d31,0x1)),this['drawing'](this),this['_drawContext'][_0x30dd3f(0xe8)][_0x30dd3f(0xd5)]&&this[_0x30dd3f(0xb9)]['options'][_0x30dd3f(0xd5)]({'layer':this,'positions':this['_tempPosition']?[][_0x30dd3f(0x9d)](_toConsumableArray(this[_0x30dd3f(0xac)]),[this['_tempPosition']]):this[_0x30dd3f(0xac)]}),!((_0x12244d=this[_0x30dd3f(0xac)])!==null&&_0x12244d!==void 0x0&&_0x12244d['length'])&&(this['_drawContext']['_changeStatus'](STATUS[_0x30dd3f(0xbc)]),this['_drawContext']['_updateTooltip']());}},{'key':_0x109814(0xe6),'value':function _0x25cf0e(_0x2044c9){var _0x31ee9a=_0x109814,_0x5764fb,_0x3752fa;if(!this[_0x31ee9a(0xea)]||!this['shapePolygonLayer'])return;var _0x3e2af5=_0x2044c9['lng'],_0x1f8c75=_0x2044c9[_0x31ee9a(0xae)],_0x118387=_0x2044c9[_0x31ee9a(0x97)];this[_0x31ee9a(0xd3)]=[_0x3e2af5,_0x1f8c75,_0x118387],(_0x5764fb=this[_0x31ee9a(0xea)])===null||_0x5764fb===void 0x0||_0x5764fb[_0x31ee9a(0xef)](this[_0x31ee9a(0xb3)]()),(_0x3752fa=this[_0x31ee9a(0xa7)])===null||_0x3752fa===void 0x0||_0x3752fa[_0x31ee9a(0xef)](this[_0x31ee9a(0xd2)]()),this[_0x31ee9a(0xb9)][_0x31ee9a(0xe8)][_0x31ee9a(0xd5)]&&this['_drawContext'][_0x31ee9a(0xe8)]['onMouseMoveChange']({'layer':this,'positions':this['_tempPosition']?[][_0x31ee9a(0x9d)](_toConsumableArray(this[_0x31ee9a(0xac)]),[this[_0x31ee9a(0xd3)]]):this['positions']});}},{'key':_0x109814(0x98),'value':function _0x1d4b52(){var _0x10a83d=_0x109814,_0x31a336,_0x222889;if(this[_0x10a83d(0xac)]['length']<0x3)return;this['_tempPosition']=null,(_0x31a336=this[_0x10a83d(0xea)])===null||_0x31a336===void 0x0||_0x31a336['update'](this['_getDrawPolylinePositions']()),(_0x222889=this[_0x10a83d(0xa7)])===null||_0x222889===void 0x0||_0x222889[_0x10a83d(0xef)](this['_getDrawPolygonPositions']()),this[_0x10a83d(0xe1)](this),this['_drawContext'][_0x10a83d(0xd4)](this['id'],this),this['startEdit']();}},{'key':'startEdit','value':function _0x29dd65(){var _0x12fe50=_0x109814;_get(_getPrototypeOf(_0x4a80bd['prototype']),_0x12fe50(0xb2),this)[_0x12fe50(0xda)](this),this['_startEdgeEditing'](!![]);}},{'key':_0x109814(0xcc),'value':function _0x4af48d(_0x401826,_0xe10319){var _0x4c1f05=_0x109814;this[_0x4c1f05(0xb5)](_0xe10319);}},{'key':'mouseDragChange','value':function _0x3c1ed3(_0x3641e9){var _0x36ae24=_0x109814,_0x48e326,_0xbfe039,_0x46e12d,_0x36eea4;if(!this['dragging'])return;this[_0x36ae24(0xac)]=this[_0x36ae24(0xd7)](_0x3641e9),(_0x48e326=this['shapePolylineLayer'])===null||_0x48e326===void 0x0||_0x48e326['update'](this['_getDrawPolylinePositions']()),(_0xbfe039=this[_0x36ae24(0xa7)])===null||_0xbfe039===void 0x0||_0xbfe039[_0x36ae24(0xef)](this['_getDrawPolygonPositions']()),((_0x46e12d=this['_drawContext']['options'])===null||_0x46e12d===void 0x0?void 0x0:_0x46e12d['onPointsChange'])&&((_0x36eea4=this['_drawContext'][_0x36ae24(0xe8)])===null||_0x36eea4===void 0x0?void 0x0:_0x36eea4['onPointsChange']({'layer':this,'positions':this['positions']}));}},{'key':'mouseDragEnd','value':function _0x4d7d1f(){var _0xa31530=_0x109814;this[_0xa31530(0xbb)]();}},{'key':_0x109814(0xc6),'value':function _0x1d4577(_0x2d692c){var _0x79a3db=_0x109814,_0x1ed362=arguments[_0x79a3db(0xad)]>0x1&&arguments[0x1]!==undefined?arguments[0x1]:!![];_get(_getPrototypeOf(_0x4a80bd[_0x79a3db(0x99)]),_0x79a3db(0xc6),this)['call'](this,_0x2d692c,_0x1ed362),this['_stopEdgeEditing']();}},{'key':'destroy','value':function _0x5d5ef9(){var _0x1494e8=_0x109814;_get(_getPrototypeOf(_0x4a80bd['prototype']),_0x1494e8(0xed),this)['call'](this),this[_0x1494e8(0xea)]&&this[_0x1494e8(0xea)]['destroy'](),this[_0x1494e8(0xea)]=null,this[_0x1494e8(0xa7)]&&this[_0x1494e8(0xa7)][_0x1494e8(0xed)](),this['shapePolygonLayer']=null;}}]),_0x4a80bd;}(_0x1d6859);export default Polygon;
|