Does the geometryService.Project() method work with polygons? According to the documentation, it should work for any geometries, but I can only get it to work with points. When I try using it to reproject a polygon, it returns nothing.
var geom = esri.geometry.geographicToWebMercator(geometryToProject);
Here is a portion of the code:
{
// Create the spatial reference objects:
m_spref_In = new SpatialReference(4326); // GCS_WGS_1984
m_spref_Out = new SpatialReference(102113); // WGS_1984_Web_Mercator
shpPolygon = ac_Polygons[i_ShapeNum]
// Create the graphic object:
myGraphic = new Graphic();
myGraphic.geometry = shpPolygon.toPolygon();
geometryService.project([ myGraphic ], m_spref_Out);
}
private function projectCompleteHandler(event:GeometryServiceEvent):void
{
/* DEBUG */
Alert.show("#1001: event.graphics.length = " + event.graphics.length.toString());
}
The event.graphics.length is ALWAYS zero.