本文整理汇总了Java中com.esri.core.geometry.GeometryEngine.geodesicEllipse方法的典型用法代码示例。如果您正苦于以下问题:Java GeometryEngine.geodesicEllipse方法的具体用法?Java GeometryEngine.geodesicEllipse怎么用?Java GeometryEngine.geodesicEllipse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esri.core.geometry.GeometryEngine
的用法示例。
在下文中一共展示了GeometryEngine.geodesicEllipse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addEllipses
import com.esri.core.geometry.GeometryEngine; //导入方法依赖的package包/类
private void addEllipses(int numberOfEllipses) {
SimpleMarkerSymbol[] symbols = {symbol4, symbol3, symbol2, symbol1};
// some values that works well
int majorAxisLength = 4612483;
int minorAxisLength = 1843676;
centerPoint = new Point(500000-5000000, 500000 + 3000000);
centerGraphicsLayer.addGraphic(new Graphic(centerPoint, null));
for (int i = 0; i < numberOfEllipses; i++) {
Point center = new Point(random.nextInt(500000)-5000000, random.nextInt(500000) + 3000000);
int majorAxisDirection = random.nextInt(60);
LinearUnit unit = new LinearUnit(LinearUnit.Code.METER);
Geometry ellipse = GeometryEngine.geodesicEllipse(center, map.getSpatialReference(), majorAxisLength, minorAxisLength,
majorAxisDirection, pointCount, unit, Geometry.Type.MULTIPOINT);
if (ellipse instanceof MultiPoint) {
SimpleMarkerSymbol symbol = symbols[i%4];
MultiPoint mp = (MultiPoint) ellipse;
Ellipse currentEllipse = new Ellipse(mp);
ellipses.add(currentEllipse);
int j = 0;
while (j < mp.getPointCount()) {
if (j%8==0) {
Point point = mp.getPoint(j);
int id = ellipseGraphicsLayer.addGraphic(new Graphic(point, symbol));
currentEllipse.addPoint(id, j);
}
j++;
}
}
}
}