为了账号安全,请及时绑定邮箱和手机立即绑定

SharpMap画圆 怎么画?

SharpMap画圆 怎么画?

慕姐8265434 2018-08-10 12:09:25
SharpMap画圆   是.net  winform   希望会的教教...弄了两天,也没弄出来..
查看完整描述

2 回答

?
慕容森

TA贡献1853条经验 获得超18个赞

function drawCircle(lat, lng, radius, strokeColor, strokeWidth, strokeOpacity, fillColor, fillOpacity) {
     var d2r = Math.PI / 180;
     var r2d = 180 / Math.PI;
     var Clat = radius * 0.014483;  // Convert statute miles into degrees latitude
     var Clng = Clat / Math.cos(lat * d2r);
     var Cpoints = [];
 
     // 计算圆周上33个点的经纬度,若需要圆滑些,可以增加圆周的点数
     for (var i = 0; i < 33; i++) {
        var theta = Math.PI * (i / 16);
        Cy = lat + (Clat * Math.sin(theta));
        Cx = lng + (Clng * Math.cos(theta));
        var P = new GPoint(Cx, Cy);
        Cpoints.push(P);
    }

    strokeColor = strokeColor || "#0055ff";   // 边框颜色,默认"#0055ff"
    strokeWidth = strokeWidth || 1;           // 边框宽度,默认1px
    strokeOpacity = strokeOpacity || 1;       // 边框透明度,默认不透明
    fillColor = fillColor || strokeColor;     // 填充颜色,默认同边框颜色
    fillOpacity = fillOpacity || 0.1;         // 填充透明度,默认0.1

    var polygon = new GPolygon(Cpoints, strokeColor, strokeWidth, strokeOpacity, fillColor, fillOpacity);
   map.addOverlay(polygon);
}

查看完整回答
反对 回复 2018-08-13
?
慕标琳琳

TA贡献1830条经验 获得超9个赞

你问提解决没  怎么解决的?

查看完整回答
反对 回复 2018-08-13
  • 2 回答
  • 0 关注
  • 604 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信