Unable to complete operation.
Unable to complete operation.
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:esri="http://www.esri.com/2008/ags" xmlns:flash="flash.text.*" initialize="printTask.getServiceInfo()" pageTitle="High-quality printing"> <fx:Script> <![CDATA[ import com.esri.ags.events.PrintEvent; import com.esri.ags.tasks.supportClasses.DataFile; import com.esri.ags.tasks.supportClasses.JobInfo; import com.esri.ags.tasks.supportClasses.ParameterValue; import com.esri.ags.tasks.supportClasses.PrintServiceInfo; import mx.controls.Alert; private function printBtn_clickHandler(event:MouseEvent):void { if (printTask.getServiceInfoLastResult.isServiceAsynchronous) { printTask.submitJob(printParameters); } else { printTask.execute(printParameters); } } private function printTask_jobCompleteHandler(event:PrintEvent):void { var jobInfo:JobInfo = event.jobInfo; if (jobInfo.jobStatus == JobInfo.STATUS_SUCCEEDED && printTask.getServiceInfoLastResult.hasResultData) { printTask.getResultData(jobInfo.jobId); } else { Alert.show(jobInfo.jobStatus); } } private function printTask_getResultDataCompleteHandler(event:PrintEvent):void { var dataFile:DataFile = event.parameterValue.value as DataFile; if (dataFile) { navigateToURL(new URLRequest(dataFile.url)); } } private function printTask_executeCompleteHandler(event:PrintEvent):void { if (event.executeResult.results && event.executeResult.results.length > 0) { var paramValue:ParameterValue = event.executeResult.results[0]; var dataFile:DataFile = paramValue.value as DataFile; if (dataFile) { navigateToURL(new URLRequest(dataFile.url)); } } } protected function printTask_getServiceInfoCompleteHandler(event:PrintEvent):void { var printServiceInfo:PrintServiceInfo = event.serviceInfo; layoutTemplates.dataProvider = printServiceInfo.layoutTemplates; for (var i:int = 0; i < layoutTemplates.dataProvider.length; i++) { var currentItem:String = layoutTemplates.dataProvider.getItemAt(i) as String; if (currentItem == "A4 Landscape") { layoutTemplates.selectedIndex = i; } } } ]]> </fx:Script> <fx:Declarations> <esri:PrintTask id="printTask" executeComplete="printTask_executeCompleteHandler(event)" fault="Alert.show(event.fault.faultString)" getResultDataComplete="printTask_getResultDataCompleteHandler(event)" getServiceInfoComplete="printTask_getServiceInfoCompleteHandler(event)" jobComplete="printTask_jobCompleteHandler(event)" showBusyCursor="true" url="http://apps.tucson.ars.ag.gov:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"/> <esri:PrintParameters id="printParameters" format="{formats.selectedItem}" layoutTemplate="{layoutTemplates.selectedItem}" map="{map}"> <esri:layoutOptions> <esri:LayoutOptions author="Author: ArcGIS for Flex Team" copyright="Copyright: © ArcGIS for Server" title="My Map"/> </esri:layoutOptions> </esri:PrintParameters> <esri:SimpleLineSymbol id="sls" color="0x999999"/> <esri:SimpleMarkerSymbol id="sms0" color="0xF8FF09" outline="{sls}" size="7" style="circle"/> <esri:SimpleMarkerSymbol id="sms1" color="0xEF8F2D" outline="{sls}" size="8" style="circle"/> <esri:SimpleMarkerSymbol id="sms2" color="0xEA371A" outline="{sls}" size="9" style="circle"/> <esri:SimpleMarkerSymbol id="sms3" color="0xE9000F" outline="{sls}" size="12" style="circle"/> <esri:SimpleMarkerSymbol id="g1SMS" color="0x660033" outline="{sls}" size="30" style="diamond"/> <esri:PictureMarkerSymbol id="g2PMS" width="32" height="32" source="http://static.arcgis.com/images/Symbols/Basic/GreenShinyPin.png" xoffset="2.67" yoffset="10.67"/> <esri:SimpleFillSymbol id="g3SFS" alpha="0.7" color="0xCC0000" outline="{sls}"/> <esri:TextSymbol id="g4TS" background="true" backgroundColor="0x0000FF" border="true" borderColor="0x0066FF" color="0xCCCCCC" placement="above" text="Hawaiian Islands" xoffset="0" yoffset="9"> <flash:TextFormat bold="true" font="Verdana" italic="false" size="10" underline="false"/> </esri:TextSymbol> <esri:CartographicLineSymbol id="g5CLS" width="8" alpha="1" cap="butt" color="0x006633" join="miter" style="solid"/> </fx:Declarations> <s:controlBarLayout> <s:HorizontalLayout gap="10" paddingBottom="7" paddingLeft="10" paddingRight="10" paddingTop="7" verticalAlign="baseline"/> </s:controlBarLayout> <s:controlBarContent> <s:Label text="Layout Templates"/> <s:DropDownList id="layoutTemplates" width="175" requireSelection="true"/> <s:Label text="Formats"/> <s:DropDownList id="formats" width="100" dataProvider="{printTask.getServiceInfoLastResult.formats}" requireSelection="true"/> <s:Button id="printBtn" click="printBtn_clickHandler(event)" enabled="{printTask.getServiceInfoLastResult != null}" label="Export Map"/> </s:controlBarContent> <esri:Map id="map" level="2" wrapAround180="true"> <esri:extent> <esri:Extent xmin="-22453200" ymin="-6080645" xmax="3767758" ymax="14465628"> <esri:SpatialReference wkid="102100"/> </esri:Extent> </esri:extent> <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer"/> </esri:Map> </s:Application>
Make sure the machine at apps.tucson.ars.ag.gov can talk to your dynamic map service.
Also, if you use a tool like HttpFox, you can copy the Web_Map_as_JSON request parameter and paste it here.
{ "mapOptions": { "extent": { "xmin": 491821.60721380572, "ymin": 3436914.170079994, "xmax": 657345.27159446781, "ymax": 3602437.8344606562, "spatialReference": { "wkid": 32612, "latestWkid": 32612 } }, "scale": 1563999.9999999998, "spatialReference": { "wkid": 32612} }, "operationalLayers": [ ], "baseMap": { "title": "My Basemap", "baseMapLayers": [ { "url": "http://apps.tucson.ars.ag.gov/arcgis/rest/services/dap/DAPSites/MapServer" } ] }, "exportOptions": { "dpi": 100, "outputSize": [ 500, 500 ] } }
Can you share the contents of the Web_Map_as_JSON request parameter?