Can't Print Bing Basemaps

1018
4
11-19-2012 06:46 AM
MarkHoover
Occasional Contributor II
Every time I run a PrintTask with a Bing Basemap, I get a timeout exceeded error.  This same Print Task works for any non-Bing basemap I use.

I tried the workaround suggested in this thread: http://forums.arcgis.com/threads/60240-Print-Widget-has-limits?highlight=Print+Bing
but in doing so determined that workaround isn't even needed anymore, as the correct lyr.type is already used.  Is something new causing this timeout error?  Are the Esri support folks seeing the same behavior as me?

Thanks,
Mark
0 Kudos
4 Replies
derekswingley1
Frequent Contributor
Can you post a simple test page that uses 3.2 to reproduce this?
0 Kudos
MarkHoover
Occasional Contributor II
Seems like it works with the code below.  Is there any reason you can think of why it wouldn't work?  Is there maybe some proxy issues or...?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>    
<head>     
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">    
 <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />    
 <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices-->    
 <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
     <title>     
 </title>     

 <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dijit/themes/claro/claro.css">
        <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/esri/css/esri.css" />    
 <style type="text/css">       
  html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
        #map{
   padding:0;      
  }    
 </style>         

 <script type="text/javascript">
  var djConfig = {
          parseOnLoad: true      
  };    
 </script>
 
 <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2"></script>
        
 <script type="text/javascript">
 dojo.require("dijit.dijit"); // optimize: load dijit layer      
 dojo.require("dijit.layout.BorderContainer");      
 dojo.require("dijit.layout.ContentPane");      
 dojo.require("esri.map");      
 dojo.require("esri.virtualearth.VETiledLayer");      
 dojo.require("dijit.TitlePane");      
 dojo.require("esri.dijit.BasemapGallery");      
 dojo.require("esri.arcgis.utils");
 dojo.require("esri.dijit.Print");
            
 var map = null;
 var printer = null;      

 function init() {        
  var initExtent = new esri.geometry.Extent({"xmin":-11727455,"ymin":4861652,"xmax":-11706340,"ymax":4871512,"spatialReference":{"wkid":102100}});        
  map = new esri.Map("map",{extent:initExtent});        
  var initBasemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");        
  map.addLayer(initBasemap);                
  createBasemapGallery();

  printer = new esri.dijit.Print({          
   map: map,          
   url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"        
  }, dojo.byId("printButton"));        
  printer.startup();
                
  //resize the map when the browser resizes        
  dojo.connect(dijit.byId('map'), 'resize', map,map.resize);      
 }      

 function createBasemapGallery() {        
 //add the basemap gallery, in this case we'll display maps from ArcGIS.com including bing maps        
 var basemapGallery = new esri.dijit.BasemapGallery({          
  showArcGISBasemaps: true,          
  bingMapsKey: 'Aif97ms9mB7rx0XekBectyS7N3_RMC-t9PVPCXmyrbYemoD4GjhUpenNXpEJCI7w',          
  map: map        
 }, "basemapGallery");        

 basemapGallery.startup();                

 dojo.connect(basemapGallery, "onError", function(msg) {console.log(msg)});      
 }      

 //show map on load       
 dojo.addOnLoad(init);    
 </script>   
</head>   
<body class="claro">     
 <div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width:100%;height:100%;margin:0;">    
 <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="border:1px solid #000;padding:0;">
 <div id="printButton"></div>     
 <div style="position:absolute; right:20px; top:10px; z-Index:999;">        
 <div dojoType="dijit.TitlePane" title="Switch Basemap" closable="false"  open="false">          
 <div dojoType="dijit.layout.ContentPane" style="width:380px; height:280px; overflow:auto;">          
 <div id="basemapGallery">
 </div>
 </div>        
 </div>            
 </div>    
 </div>
 </div>  
</body>
</html>
0 Kudos
MarkHoover
Occasional Contributor II
More details: I was seeing the Timeout Exceeded error when the service was synchronous.  If I make it asynchronous, however, it tries to export the Bing Map ad nauseum and neither of my callbacks (success or error) ever fires.
0 Kudos
AntonioSergio
Esri Contributor
The user that is executing the AGS Service in the Windows Service have permissions to access the Web?

Try to login with that user and access the web with the Internet Explorer!

AS
0 Kudos