Select to view content in your preferred language

Print Widget has limits

1644
9
06-18-2012 10:56 AM
spencermartin
Emerging Contributor
I've gotten the print widget to do most of what we need. The only issues I have found are that it will not print a textsymbol nor a Bing aerial base map. Does anyone have any experience
with these two items?
0 Kudos
9 Replies
derekswingley1
Deactivated User
I'll do a little research but before I get into that, which versions of the JS API and ArcGIS Server are you using?
0 Kudos
spencermartin
Emerging Contributor
10.1 Server and 3.0 js api
0 Kudos
derekswingley1
Deactivated User
Thanks. Looks like the text symbol issue is a bug. I'll post a bug ID to track it once I've confirmed.

I see bing maps in the print output here:  http://jsfiddle.net/zKaVn/
0 Kudos
spencermartin
Emerging Contributor
On Bing maps I just confirmed that MAP_STYLE_AERIAL_WITH_LABELS is what doesn't print vs your version of MAP_STYLE_AERIAL.  Strangely similar to the textsymbol bug. Thanks.
0 Kudos
spencermartin
Emerging Contributor
On Bing maps I just confirmed that MAP_STYLE_AERIAL_WITH_LABELS is what doesn't print vs your version of MAP_STYLE_AERIAL.  Strangely similar to the textsymbol bug. Thanks.
0 Kudos
derekswingley1
Deactivated User
On Bing maps I just confirmed that MAP_STYLE_AERIAL_WITH_LABELS is what doesn't print vs your version of MAP_STYLE_AERIAL.  Strangely similar to the textsymbol bug. Thanks.


Also a bug...the print dijit is sending the wrong layer.type property to the print service. It is sending "BingMapsaerialWithLabels" instead of "BingMapsHybrid". Here's a workaround:  http://jsfiddle.net/axPwz/

The key is using esri.setRequestPreCallback to update the JSON that's sent to the print service. Here's the relevant code:
function fixBingHybrid(ioArgs) {
  // look for requests to the print service
  if ( ioArgs.url == app.printUrl + "/execute" ) {
    var webmapJson = dojo.fromJson(ioArgs.content.Web_Map_as_JSON);
    // check that the webmap JSON has operational layers
    // bing is always considered an operational layer
    if ( webmapJson.operationalLayers.length ) {
      dojo.forEach(webmapJson.operationalLayers, function(lyr) {
        // correct the type property for the bing hybrid layer
        if ( lyr.type && lyr.type == "BingMapsaerialWithLabels" ) {
          lyr.type = "BingMapsHybrid";
        }
      });
      ioArgs.content.Web_Map_as_JSON = dojo.toJson(webmapJson);
    }
  }
  return ioArgs;
}


And this line in the init function:
esri.setRequestPreCallback(fixBingHybrid);
0 Kudos
spencermartin
Emerging Contributor
Using MAP_STYLE_AERIAL_WITH_LABELS the workaround you suggest works so long as no additional graphic is added. Once I add a graphic it doesn't print but does work with MAP_STYLE_AERIAL instead.
0 Kudos
WillCorum
Deactivated User
Thanks. Looks like the text symbol issue is a bug. I'll post a bug ID to track it once I've confirmed.



Was the text symbol posted as a bug? If so, do you know the status or have the bug ID?
0 Kudos
derekswingley1
Deactivated User
The ID for the text symbol bug is NIM080545. We're planning to fix in the next release (3.2) which should be out in a week or two. Watch the ArcGIS Blog's Developer feed for notification of when the release officially happens.
0 Kudos