Hi All,
This should be an easy fix that I'm overlooking. My app use to display the state plane coordinates after converting from the Mercator projection. I made some changes and now can't get it to work properly.
The geometry service is working properly and converting the map point. However, i can't "keep" that converted value to a variable to be used else where in my app. After the "projectcomplete" of the geometryservice is finished, it looses the value.
If the map is clicked again, it get's the previous value from the previous map click event.
I've tried everything, except the correct thing........ I've set global [bindable] variables, passed the variable as a 'return' after the projectcomplete event....... nothing.
Help, I'm loosing my hair!
Eddie
public function reProject(coord:MapPoint):void
{
try
{
//myGeoService is set in the declarations..................
// All variables are set and working..............................
myGeoService.project([coord as Geometry], outSR);
//Alert.show(processedpt.toString());
}
catch (error:Error)
{
Alert.show("DecimaltoDMS.as error " + error.toString()); // gives null value on first map click
}
//Alert.show(processedpt.toString()); // gives null value on first map click
}
private function ConvertCoord (event:GeometryServiceEvent):void
{
pt = (event.result as Array)[0]as MapPoint;
//processedpt = pt // or same results next line
processedpt = new MapPoint(pt.x, pt.y, pt.spatialReference);
Alert.show(processedpt.toString()); // This displays the correct converted map points!!!!!
}