Select to view content in your preferred language

geometryService.Project with polygons

769
0
08-25-2011 10:21 AM
MikeAdams
Emerging Contributor
In the ArcGIS API for Flex, version 1.3, 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.  Even when I try using it to reproject points, it always returns 0, 0.

{
// 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.
Tags (2)
0 Kudos
0 Replies