Is there a way to delete 'MAP_ONLY' from a Print Service

2297
9
Jump to solution
11-10-2016 09:20 AM
WilliamMiller4
Occasional Contributor II

Hello,

Is there a way to delete/remove 'MAP_ONLY' from the Printing Utility Service in Portal? I click the red X and save, but the 'MAP_ONLY' option is still available in the Web AppBuilder Print widget.

Thank you for your help in this matter.

William

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Willaim,'

 Sure in the Print widgets print.js file fin the _handlePrintInfo and make this change:

    _handlePrintInfo: function(rData) {
      if (!rData.isGPPrint) {
        domStyle.set(this.layoutDijit.domNode.parentNode.parentNode, 'display', 'none');
        domStyle.set(this.formatDijit.domNode.parentNode.parentNode, 'display', 'none');
        domStyle.set(this.advancedButtonDijit.domNode, 'display', 'none');
      } else {
        var data = rData.data;
        domStyle.set(this.layoutDijit.domNode.parentNode.parentNode, 'display', '');
        domStyle.set(this.formatDijit.domNode.parentNode.parentNode, 'display', '');
        domStyle.set(this.advancedButtonDijit.domNode, 'display', '');
        var Layout_Template = array.filter(data.parameters, function(param) {
          return param.name === "Layout_Template";
        });
        if (Layout_Template.length === 0) {
          console.log("print service parameters name for templates must be \"Layout_Template\"");
          return;
        }
        var layoutItems = array.map(Layout_Template[0].choiceList, function(item) {
//Remove the MAP_ONLY layout
        if(item !== "MAP_ONLY"){
          return {
            label: item,
            value: item
          };
        }
//end my change
        });

View solution in original post

9 Replies
RobertScheitlin__GISP
MVP Emeritus

Willaim,'

 Sure in the Print widgets print.js file fin the _handlePrintInfo and make this change:

    _handlePrintInfo: function(rData) {
      if (!rData.isGPPrint) {
        domStyle.set(this.layoutDijit.domNode.parentNode.parentNode, 'display', 'none');
        domStyle.set(this.formatDijit.domNode.parentNode.parentNode, 'display', 'none');
        domStyle.set(this.advancedButtonDijit.domNode, 'display', 'none');
      } else {
        var data = rData.data;
        domStyle.set(this.layoutDijit.domNode.parentNode.parentNode, 'display', '');
        domStyle.set(this.formatDijit.domNode.parentNode.parentNode, 'display', '');
        domStyle.set(this.advancedButtonDijit.domNode, 'display', '');
        var Layout_Template = array.filter(data.parameters, function(param) {
          return param.name === "Layout_Template";
        });
        if (Layout_Template.length === 0) {
          console.log("print service parameters name for templates must be \"Layout_Template\"");
          return;
        }
        var layoutItems = array.map(Layout_Template[0].choiceList, function(item) {
//Remove the MAP_ONLY layout
        if(item !== "MAP_ONLY"){
          return {
            label: item,
            value: item
          };
        }
//end my change
        });
WebGISGdibx
New Contributor III

... and without programming?

Is there any way to delete "MAP_ONLY" Layout when someone is just using configurable apps/web app builder in arc gis online?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

There is not a way to do this without editing code unless you stand up your own print service and remove the map only option and then have your site point to that print service.

0 Kudos
WebGISGdibx
New Contributor III

I even did that... publishing my own print service and disable "map_only" within service configuration. Unfortunately this had no effect. The map_only option seems to be very persistant. 😞

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

That should not be the case if your app is using your print service instead of the standard esri one.

0 Kudos
WebGISGdibx
New Contributor III

This picture shows the service editor (german version) and I think the Layout-template parameter is the only where I could disable "map_only". As you can see I dischecked it.

Or is there any other point where I have to do it?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

That is good but how are you telling your app to use this particular print service?

0 Kudos
WebGISGdibx
New Contributor III

Publishing this Geoprocessing-Service on our Server, getting the REST-URL, adding the Service as an Element with stored credentials in ArcGIS Online and then adding the elements URL in the organizations utility print service. And the map_only is available in the utility services properties in AGOL despite I disabled it in the services properties. So I deleted it there too. And it still appears when using the print widget.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Hmm. All your steps sound correct. I would open a case with tech support.

0 Kudos