思路:
图层会跟随地图缩放,所以创建一个圆放进自定义渲染图层
代码实现:
引入了四个包,这个引包方式可以看看之前的文章(和proxy初次结合)
GraphicsLayer、SimpleFillSymbol、Graphic、Circle
原作者👉👉👉
https://segmentfault.com/u/yo...

const GraphicsLayer = await arcgisPackage.GraphicsLayer;
const SimpleFillSymbol = await arcgisPackage.SimpleFillSymbol;
const Graphic = await arcgisPackage.Graphic;
const Circle = await arcgisPackage.Circle;
let graphicCirCle = new GraphicsLayer();

var symbol = {
    color: [255, 85, 0, 0.9],
    style: "solid",
    outline: {
      color: [255, 85, 0, 0.9],
      width: 1,
    },
};
var circle = new Circle({
  center: [i.lon, i.lat], //中心点坐标就是 [经度,纬度]
  numberOfPoints: 80, //沿圆弧曲线的点数
  geodesic: true, //不考虑地形因素
  radius: 100, //半径单位M
});
var sfs = new SimpleFillSymbol(symbol);
graphicCirCle.add(new Graphic(circle, sfs));


map.add(graphicCirCle)

友人A
81 声望11 粉丝