UNPKG

gisviewer-vue3-arcgis

Version:

在应用中引入私服的包, 项目根目录下 新建文件 .npmrc 在 .npmrc 中对包源进行配置:

45 lines (44 loc) 1.2 kB
import a from "@arcgis/core/layers/GraphicsLayer"; import i from "@arcgis/core/Graphic"; import { SimpleFillSymbol as o } from "@arcgis/core/symbols"; import t from "@arcgis/core/widgets/Sketch/SketchViewModel"; class h { constructor(r) { this.view = r, this.indicatorAreaLayer = new a(), this.view.map.add(this.indicatorAreaLayer), this.sketchViewModel = new t({ view: this.view, layer: this.indicatorAreaLayer, defaultUpdateOptions: { tool: "reshape" }, snappingOptions: { enabled: !0 } }); } /** * 显示路口指标计算区 * @param cross */ async showCrossIndicatorArea(r) { this.indicatorAreaLayer.removeAll(); const e = await r.calCrossIndicatorArea(); e ? (this.crossIndicatorAreaGraphic = new i({ geometry: e, symbol: new o({ color: [255, 0, 0, 0.5], outline: { color: [255, 0, 0] } }) }), this.indicatorAreaLayer.add(this.crossIndicatorAreaGraphic)) : this.sketchViewModel.create("polygon"); } /** * 清除所有指标计算区 */ clearIndicatorArea() { this.indicatorAreaLayer.removeAll(); } } export { h as default };