public function projectPoint(mapPoint:MapPoint, toWKID:Number, callbackFunction:Function, errorFunction:Function = null):void { this.geometryService = new GeometryService(this.geometryServiceURL); this.geometryService.addEventListener(GeometryServiceEvent.PROJECT_COMPLETE, callbackFunction); if (errorFunction != null) { this.geometryService.addEventListener(FaultEvent.FAULT, errorFunction); } else { this.geometryService.addEventListener(FaultEvent.FAULT, function():void { Alert.show("Error projecting coordinates.","Error"); }); } var projParams:ProjectParameters = new ProjectParameters(); projParams.geometries = [MapPoint as Geometry]; projParams.outSpatialReference = new SpatialReference(toWKID); // Note: GeometryService takes in geometries instead of graphics as input geometryService.project(projParams);
Solved! Go to Solution.
var projParams:ProjectParameters = new ProjectParameters; projParams.geometries = [mapPoint as Geometry]; projParams.outSpatialReference = new SpatialReference(toWKID); // Note: GeometryService takes in geometries instead of graphics as input geometryService.project(projParams);
var projParams:ProjectParameters = new ProjectParameters; projParams.geometries = [mapPoint as Geometry]; projParams.outSpatialReference = new SpatialReference(toWKID); // Note: GeometryService takes in geometries instead of graphics as input geometryService.project(projParams);