Is it possible to show a web appbuilder application as a Image?

2375
23
10-11-2017 10:10 PM
Naveen_KumarKairamkonda
Occasional Contributor

Hi,

I have one web appbuilder application.

URL: http://machinename:3344/webappbuilder/apps/#/?parameter1=ObjID#&parameter2="export"

when parameter2 == "export" in the URL, then the application should load and should show in an image format like .png format.

I have some graphics (polygon features) on the map. Image should show map including the graphics. URL might ends with URL/xxxx.png.

Any suggestion is helpful.

Thanks in advance.

Regards,

Naveen. 

0 Kudos
23 Replies
RobertScheitlin__GISP
MVP Emeritus

Naveen,

   Sorry you are not providing enough info for me to help you. I use this code snippet all the time with out issue so it have to be something in your code (the way you implement it) that is going wrong.

0 Kudos
Naveen_KumarKairamkonda
Occasional Contributor

Hi Robert,

  I created new onScreen widget 'MapExport' and in widget.js file, I'm calling _isEnableExport function from startup function if the isenable parmater is "export" from the URL(https://machinename:port/webappbuilder/apps/xx/?isenable=export). 

_isEnableExport  function has the code which you have shared. 

 

Screenshots of widget.js file of MapExport widget and Error are attached below.

Getting this error after sometime once the widget is created.

Widget.js file of MapExport widget.

widget.js file1 of MapExport Widgetwidget.js file2 of MapExport Widget

Error:

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Naveen,

   Try using this print task url to check if it is an issue with your print service:

http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%2... 

Naveen_KumarKairamkonda
Occasional Contributor

Robert,

Taking the whole URL and throwing below error:

init.js:152 POST https://pcw7vm48:3344/webappbuilder/apps/10/http://sampleserver6.arcgisonline.com/arcgis/rest/servic... 404 (Not Found)

init.js:182 n {message: "Unable to load //pcw7vm48:3344/webappbuilder/apps/…ver/Export%20Web%20Map%20Task/execute status: 404", response: {…}, status: 404, responseText: "Cannot POST /webappbuilder/apps/10/http://samplese…Tools/GPServer/Export%20Web%20Map%20Task/execute↵", xhr: XMLHttpRequest, …}

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Naveen,

  ??? Why are you putting https://pcw7vm48:3344/webappbuilder/apps/10/  in front of the url?

Naveen_KumarKairamkonda
Occasional Contributor

Robert,

   I didn't give that URL anywhere in code, but it's taking like that.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Naveen,

   So you are telling me that you have:

var printTask = new PrintTask('http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%2...');

and it add the other to the front by itself?

0 Kudos
Naveen_KumarKairamkonda
Occasional Contributor

Exactly.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Naveen,

   Zip your widget and attach it to a post for me to inspect.

0 Kudos
Naveen_KumarKairamkonda
Occasional Contributor

Robert,

   attached zip file to a discussion as I am unable to add here.

Please go through this link: https://community.esri.com/message/724456-is-it-possible-to-show-a-web-appbuilder-application-as-a-i... 

0 Kudos