Hello, how to create a bookmark thumbnail image based on the current layers, extent, and graphics? Thanks
Alex,
Here is a code snippet that I use for the purpose of getting a map image:
var printTask = new PrintTask('your server ExportWebMap url'); var template = new PrintTemplate(); this.imgHeight = (740/oWid) * oHgt; template.exportOptions = { width: 1542, height: (1542/oWid) * oHgt, dpi: 200 }; template.format = "jpg"; template.layout = "MAP_ONLY"; template.preserveScale = false; template.showAttribution = false; var params = new PrintParameters(); params.map = this.map; params.template = template; printTask.execute(params, lang.hitch(this, function(rsltURL){ var mapImg = domConstruct.toDom('<img src="'+rsltURL.url+'" border="0" style="width:740px;height:'+this.imgHeight+'px;"/>'); domConstruct.place(mapImg, dom.byId('mapImgDiv'), 'replace'); }));
Thanks for the link, Baba.
Hi Alex,
Export Web Map Task depends on what you want it to achieve and the resource below shows examples, steps and various ways to achieve them.
A quick tour of publishing a geoprocessing service—Sharing geoprocessing workflows | ArcGIS for Desktop
Baba
Thanks Robert. Can you please direct me any online resources of how to create my own Export Web Map Task GP services? is it possible or i have to use ESRI's?
Absolutely you can use the PrintTask in the JS API to get "MAP_ONLY" output. I use the PrintTask to get a map image in several of my custom apps.
Thanks Robert. I saw the Print widget can generate a map in graphics format. Can I use it for my purpose? sorry I haven't tried it yet.
As there is no cross browser ability in the JS API to scrape the map image, your option is to click printscreen on your computer and edit the saved screen image to your liking and use that image.
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.