gisviewer-vue3-arcgis
Version:
在应用中引入私服的包, 项目根目录下 新建文件 .npmrc 在 .npmrc 中对包源进行配置:
2 lines (1 loc) • 859 B
JavaScript
;Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@turf/bearing"),n=require("../common-utils.js");class d{set stopLine(e){this._stopLine=e,this.stopLineCenter=e.extent.center}get stopLine(){return this._stopLine}get extendedStopLine(){return this._extendedStopLine||(this._extendedStopLine=n.default.extendLineInTowDir(this._stopLine,100)),this._extendedStopLine}async getLaneDirection(){const e=n.default.extendLineInTowDir(this._stopLine,10),i=this._stopLine.paths[0];let t=await n.default.getIntersectPointOfLineAndPolygon(e,this.lanePolygon,5);t.length===0&&(t=await n.default.getIntersectPointOfLineAndPolygon(e,this.lanePolygon,-5)),(!i.length||!t.length)&&console.log("计算方位角失败",i,t);const s=t[0],r=i[0],o=l(r,s);this.laneDirection=o<0?o+360:o}}exports.default=d;