create a ploygon by SketchEditor , but the label doesn't display

194
1
10-25-2021 08:49 PM
donkeyliao
New Contributor

SDK: arcgis sdk for android 100.12.0

I used sketcheditor to create a polygon, and get the polygon points, then send the points to server. 

There are tow problems I got:

1.In APP, I set the layer display label, but the created polygon doesn't display the label. The polygon create from js client dispaly well.

2.In PC, I use the coordinate which get from App but it doesn't display as a polygon, it only rendered the outline. 

the polygon display in PC: 

donkeyliao_1-1635219409959.png

the polygon display in Android:

donkeyliao_2-1635219842864.png

My android code to get the polygon points:

Polygon polygon = (Polygon) GeometryEngine.project(sketchEditor.getGeometry(), SpatialReferences.getWgs84());
PointCollection points = new PointCollection(polygon.getParts().getPartsAsPoints());

I'm so confused, anyone can help me?

 

0 Kudos
1 Reply
donkeyliao
New Contributor

I solved the problem, the geometry get from sketcheditor is not topologically consistent. so I guess in PC it can't render as a polygon and in Android, it can't find the center point to show label. I use  GeometryEngine.simplify to make it topologically consistent and now it render well in PC and Android.

Hope to be useful to you. ^_^

0 Kudos