在获取某个点位,然后根据半径画圈,画出来的圈的半径不等于预期输入的半径怎么办?
问题出在一个参数,就是不考虑地形因素的参数!设置为true问题解决。
(center为选取的中心点,radius为半径,radusUnit为单位)

// 画圈圈
addCircleDistance() {
this.radiusCircle = this.ruleForm.inputRadius ? this.ruleForm.inputRadius : this.ruleForm.radius
if (this.circleGraphic) {
this.peripheralLayer.remove(this.circleGraphic)
}
const target = new this.$esri.Point({ type: 'point', longitude: this.anchorPoint[0], latitude: this.anchorPoint[1], spatialReference: this.$mapView.spatialReference })
const that = this
const circleGeometry = new this.$esri.Circle({
center: target,
radius: this.radiusCircle,
radiusUnit: 'meters',
geodesic: true, // 不考虑地形因素
spatialReference: that.$mapView.spatialReference
})
this.circleGraphic = new this.$esri.Graphic({
geometry: circleGeometry,
symbol: {
type: 'simple-fill',
color: [0, 255, 144, 0.1],
outline: {
width: 2,
color: '#08C29D'
}
}
})
this.peripheralLayer.addMany([this.circleGraphic])
this.$mapView.goTo({ target: target, zoom: 15 })
},