使用产品:iserver 11i, iclient for leaflet 操作系统:win10x64 数据类型: postgre sql 问题详细描述:1、自定义一个动态绘圆的方法,但是画出来的不是正圆,搜索说可以用polygon绘制,但我不是很明确应该怎么改
代码如下:
draw_Circle() {
if (this.circleLayer != null) {
this.map.removeLayer(this.circleLayer)
}
this.r = 0;
this.i = null;
this.circleLayer = new L.circle();
this.map.dragging.disable(); // 将mousemove事件移动地图禁用
this.map.on('mousedown', (e) => {
this.i = e.latlng
this.map.on('mousemove', (ev) => {
this.r = L.latLng(ev.latlng).distanceTo(this.i) // 计算半径
if (this.i) {
// 绘制圆心位置与半径
this.circleLayer.setLatLng(this.i)
this.circleLayer.setRadius(this.r)
this.circleLayer.setStyle({color: '#2260b4', fillOpacity: 0.3})
this.map.addLayer(this.circleLayer)
}
})
this.map.on('mouseup', (ev) => {
var circle = L.circle(this.i, {radius: this.r, color: '#2260b4', fillOpacity: 0.3})
this.map.addLayer(this.circleLayer)
this.map.dragging.enable()
// this.map.setView(this.i, 13)
this.i = null
this.r = 0
this.map.off('mousedown')
this.map.off('mouseup')
this.map.off('mousemove')
})
})
},
2、返回选中圈内的地图上的麻点图层、标注点这些应该用哪个方法查询
问题重现步骤: 1.