SuperMap绘制扇形
function getPoints(center, radius, startAngle, endAngle, pointNum) { var sin; var cos; var x; var y; var angle; var points = new Array(); points.push(center); for (var i = 0; i <= pointNum; i++) { angle = startAngle + (endAngle - startAngle) * i / pointNum; sin = Math.sin(angle * Math.PI / 180); cos = Math.cos(angle * Math.PI / 180); y = center[0] + radius * cos; x = center[1] + radius * sin; points[i] = [y, x]; debugger } var point = points; point.push(center); return point; } //2.调用leaflet中饿多边形生成扇形 var var clon = 115.5; var clat = 38.5; var points = getPoints([clat, clon], 2, 45, 0, 50); points[points.length] = points[0]; var arcS = L.polygon(points).addTo(map).bindPopup("一个扇形");
本文来自博客园,作者:ALin_Da,转载请注明原文链接:https://www.cnblogs.com/alinda/p/15735247.html
。 一个programmer小菜鸟的成长记