Save map with graphics as image file

6445
4
04-28-2013 03:57 AM
Udaya_BhaskerCheerala
New Contributor
Hello All,
We are using the 3.1 Javascript API for displaying map, and have created few grahphics on map. We want the user to be able to save the resultant display as a jpeg, ping, bmp or some such format.
If user right-click on the base map and 'Save Picture As', user gets the map without the graphics layer. But we need to show graphics on image.
Anyone know how we can make this work?

Thanks,
Uday
Tags(2)
0Kudos
4 Replies
ShreyasVakil
Occasional Contributor II
I think you can use Print utility from ArcGIS Server 10.1 which has the capability to return the following Formats:
[ PDF, PNG32, PNG8, JPG, GIF, EPS, SVG, SVGZ ]

We have a Print Widget in JS API to use the capability of Print Utility from ArcGIS Server 10.1.

Code snippet:
app.printer = new esri.dijit.Print({ map: app.map, url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task" }, dojo.byId("printButton")); app.printer.startup();


Here is the link to the sample which adds graphics and gets the resultant image in PNG32 format(You can change it to JPG).

Print class documentation.
0Kudos
Udaya_BhaskerCheerala
New Contributor
Hi,
Thankyou very much for the reply. But we are using ArcGIS Server 10.0, how could I achieve this in ArcGIS Server 10.0

Thanks,
Uday





I think you can use Print utility from ArcGIS Server 10.1 which has the capability to return the following Formats:
[ PDF, PNG32, PNG8, JPG, GIF, EPS, SVG, SVGZ ]

We have a Print Widget in JS API to use the capability of Print Utility from ArcGIS Server 10.1.

Code snippet:
app.printer = new esri.dijit.Print({ map: app.map, url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task" }, dojo.byId("printButton")); app.printer.startup();


Hereis the link to the sample which adds graphics and gets the resultant image in PNG32 format(You can change it to JPG).

Printclass documentation.
0Kudos
AdrianMarsden
Occasional Contributor III
Hi

I have just asked a similar question (sorry, failed to find this thread)

My users are used to being able to right click to simply copy the image. True we can (as we are on 10.1) use a print task, but that is quite intensive and time consuming, simply copying the image the browser has already is almost instantaneous.

Cheers

ACM
0Kudos
fdsffdsf
New Contributor
thank you for the tutorials and sample codes up here, but can you tell me whether this is a good way to save image as jpeg file . i am new on this, any suggestions? thank you.
0Kudos