日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

android arcgis 绘制圆_arcgis for android 定位 圆

發布時間:2023/12/9 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android arcgis 绘制圆_arcgis for android 定位 圆 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

不多說直接代碼 ,群里人共享的

方法一:?/**

* 繪制圓,配合 cleargraphicLayer()清除

*

* @param center 圓心

* @param radius 半徑

* @param alpha 填充的透明度 0-100

* @param fillColor 填充的顏色

*/

public void DrawCircle(Point center, double radius, int alpha, int fillColor) {

if (graphicLayer == null) { //是否已添加繪制圖層

graphicLayer = new GraphicsLayer();

mapView.addLayer(graphicLayer);

}

Polygon polygon = new Polygon();

getCircle(center, radius, polygon);

FillSymbol symbol = new SimpleFillSymbol(fillColor);

SimpleLineSymbol simplelinesymbol = new SimpleLineSymbol(Color.BLUE, (float) 0.5);

symbol.setOutline(simplelinesymbol);

symbol.setAlpha(alpha);

Graphic g = new Graphic(polygon,symbol);

graphicLayer.addGraphic(g);

}

/**

* 獲取圓的圖形對象

*

* @param center

* @param radius

* @return

*/

public static Polygon getCircle(Point center, double radius) {

Polygon polygon = new Polygon();

getCircle(center, radius, polygon);

return polygon;

}

private static void getCircle(Point center, double radius, Polygon circle) {

circle.setEmpty();

Point[] points = getPoints(center, radius);

circle.startPath(points[0]);

for (int i = 1; i < points.length; i++)

circle.lineTo(points[i]);

}

private static Point[] getPoints(Point center, double radius) {

Point[] points = new Point[50];

double sin;

double cos;

double x;

double y;

for (double i = 0; i < 50; i++) {

sin = Math.sin(Math.PI * 2 * i / 50);

cos = Math.cos(Math.PI * 2 * i / 50);

x = center.getX() + radius * sin;

y = center.getY() + radius * cos;

points[(int) i] = new Point(x, y);

}

return points;

}

方法二:

Polygon polygon = GeometryEngine.buffer(mapPoint,mapView.getSpatialReference(), 100, null); FillSymbol symbol = new SimpleFillSymbol(Color.BLUE); SimpleLineSymbol simplelinesymbol = new SimpleLineSymbol(Color.BLUE,(float) 0.5); symbol.setOutline(simplelinesymbol); symbol.setAlpha(30); Graphic g = new Graphic(polygon, symbol); graphicLayer.addGraphic(g);

總結

以上是生活随笔為你收集整理的android arcgis 绘制圆_arcgis for android 定位 圆的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。