AnsweredAssumed Answered

GraphicsLayer + SimpleFillSymbol issue in 1.1.1 SDK

Question asked by stephen_quan on Jun 17, 2012
Latest reply on Jun 25, 2012 by stephen_quan
I'm encountering a polygon drawing issue with the automatic black outline you get when using SimpleFillSymbol on the GraphicsLayer.

When using Australian coordinates (Elmore, Victoria, Australia) the automatically black outline does not follow the perimeter of the polygon. Instead, it is incorrectly drawn to infinity.

When using American coordinates (e.g. ESRI campus) the black outline does follow the perimeter of the polygon.

So, this feels like there's an arithmetic issue in the 1.1.1 SDK. The same code works correctly in the 1.0.1 SDK.


The following code example is a modified Hello World Map sample with code for GraphicsLayer with the Polygon and SimpleFillSymbol. Both Elmore and Redlands coordinates are provided with the Redlands commented out.

package;  import; import; import android.os.Bundle;  import; import; import; import com.esri.core.geometry.Envelope; import com.esri.core.geometry.GeometryEngine; import com.esri.core.geometry.Line; import com.esri.core.geometry.MultiPath; import com.esri.core.geometry.Point; import com.esri.core.geometry.Polygon; import com.esri.core.geometry.Segment; import com.esri.core.geometry.SpatialReference; import; import com.esri.core.symbol.SimpleFillSymbol; import com.esri.core.symbol.SimpleMarkerSymbol;  public class GraphicsDemoActivity extends Activity {  MapView map = null;   public void onCreate(Bundle savedInstanceState)  {   super.onCreate(savedInstanceState);   setContentView(R.layout.main);    // Retrieve the map and initial extent from XML layout   map = (MapView)findViewById(;   map.addLayer(new ArcGISTiledMapServiceLayer("" +   ""));    // Prepare Web Mercator projection.   SpatialReference sr = SpatialReference.create(102100);      // Define 3 points in Elmore, Victoria, Australia.    Point pt1 = GeometryEngine.project(144.5933, -36.5067, sr);   Point pt2 = GeometryEngine.project(144.6307, -36.5067, sr);   Point pt3 = GeometryEngine.project(144.6109, -36.4799, sr);      // Define 3 points on ESRI Redlands Campus   //Point pt1 = GeometryEngine.project(-117.200, 34.057, sr);   //Point pt2 = GeometryEngine.project(-117.198, 34.057, sr);   //Point pt3 = GeometryEngine.project(-117.199, 34.059, sr);      // Determine a simple bounding box for the points.   Envelope extent = new Envelope(pt1.getX(), pt1.getY(), pt2.getX(), pt3.getY());   extent.inflate(10000, 10000);    // Create a graphics layer and add it to the map.   GraphicsLayer graphicsLayer = new GraphicsLayer();   map.addLayer(graphicsLayer);   map.setExtent(extent);    // Add a GRAY filled polygon to the graphics layer.    MultiPath poly = new Polygon();   Segment seg = new Line();   seg.setStart(pt1);   seg.setEnd(pt2);   poly.addSegment(seg,  true);   seg = new Line();   seg.setStart(pt2);   seg.setEnd(pt3);   poly.addSegment(seg,  false);   seg = new Line();   seg.setStart(pt3);   seg.setEnd(pt1);   poly.addSegment(seg,  false);   poly.closePathWithLine();   graphicsLayer.addGraphic(new Graphic(poly, new SimpleFillSymbol(Color.GRAY)));    // Add RED markers to the graphics layer.   graphicsLayer.addGraphic(new Graphic(pt1, new SimpleMarkerSymbol(Color.RED, 10, SimpleMarkerSymbol.STYLE.CIRCLE)));   graphicsLayer.addGraphic(new Graphic(pt2, new SimpleMarkerSymbol(Color.RED, 10, SimpleMarkerSymbol.STYLE.CIRCLE)));   graphicsLayer.addGraphic(new Graphic(pt3, new SimpleMarkerSymbol(Color.RED, 10, SimpleMarkerSymbol.STYLE.CIRCLE)));  }   protected void onPause()  {   super.onPause();   map.pause();  }   protected void onResume()  {   super.onResume();   map.unpause();  } }