Sorry for late feedback Due to several problems I lost patience to do something useful for us with ArcGIS Javascript API. Mainly because too much struggle with custom projections... Switched to do some more basic stuff with application templates and we even updated our tiling technology (now it's MapCache) to produce WMTS tile layer (TMS ja not acceptable for Arcgis.com). Well, now the thing is that yes I can add our WMTS tile service to map easily, but still I don't get any sensible printout when pressing "Print" button. Tried even some other,non-Estonian, WMTS services, but still the same bug: WMTS basemap does not appear in printout!
Actually, this frustration does not end here, but I don't fall into that deep hole of problems we face dealing with ArcGIS Server or frontend development, at the moment. For us the most important things are our custom basemaps - yes, we don't use ArcGIS to produce them (thank God!) - that are projected in EPSG:3301. Because of diffent problems we can't serve our tiled basemaps in JSAPI-s Basemap Gallery and now, with that new printout bug - can't serve them at all.
I hope my criticism will be constrctive, I've send this bug to our local support. Atm, I don't have alternatives to use other solutions besides ArcGIS, so have mercy, Jackals.
I've been able to get the WebTiledLayer to work with the Print Task. The problem is that the TileInfo is not included in the webMapJson. So, you have to add a prerequest callback, and insert the TileInfo. See my code in this post:
WebTiledLayer and PrintTask working at 10.2?
I've got this problem, too. Any updates?
I can see my WebTiledLayer layer in the json. But, it doesn't include the LOD's, which could be a problem for the Print Server, because it wouldn't know how to get the tiles. So, it seems there would be a problem with the JavaScript and the Service.
Please check the print request in your browser's debug tool. I believe the request includes the custom TiledMapServiceLayer or WebTiledLayer. Then, it's the print service that doesn't work with your tiled map service.Please post the print request here. I will try to diagnose it.Thanks.
http://atlas:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task/execute?f=json&Web_Map_as_JSON={"mapOptions":{"showAttribution":true,"extent":{"xmin":541255.859375,"ymin":6587610.546350479,"xmax":544869.140625,"ymax":6589872.265100479,"spatialReference":{"wkid":3301}},"spatialReference":{"wkid":3301},"scale":14763.75},"operationalLayers":[{"id":"kaart","title":"kaart","opacity":1,"minScale":1889760,"maxScale":1845.46875,"url":"http://tiles.maaamet.ee/tm/s/1.0.0/kaart/"},{"id":"layer0","title":"layer0","opacity":1,"minScale":0,"maxScale":0,"url":"http://atlas:6080/arcgis/rest/services/Raivotest/raamatukogud/MapServer","visibleLayers":null,"layers":[]}],"exportOptions":{"outputSize":[800,1100],"dpi":96}}&Format=PNG32&Layout_Template=MAP_ONLY
http://atlas:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task/execute?f=json&Web_Map_as_JSON={"mapOptions":{"showAttribution":true,"extent":{"xmin":538179.6875,"ymin":6582123.436927795,"xmax":552632.8125,"ymax":6591170.311927795,"spatialReference":{"wkid":3301}},"spatialReference":{"wkid":3301},"scale":59055},"operationalLayers":[{"id":"layer0","title":"layer0","opacity":1,"minScale":1889760,"maxScale":1845.46875,"url":null},{"id":"layer1","title":"layer1","opacity":1,"minScale":0,"maxScale":0,"url":"http://atlas:6080/arcgis/rest/services/Raivotest/maaamet_katastriyksused/MapServer","visibleLayers":null,"layers":[]},{"id":"layer2","title":"layer2","opacity":1,"minScale":0,"maxScale":0,"url":"http://atlas:6080/arcgis/rest/services/Raivotest/raamatukogud/MapServer","visibleLayers":null,"layers":[]},{"id":"map_graphics","minScale":0,"maxScale":0,"featureCollection":{"layers":[]}}],"exportOptions":{"outputSize":[800,1100],"dpi":96}}&Format=PNG32&Layout_Template=MAP_ONLY
I was successful with redefining TiledMapServiceLayer to WebTileLayer, but outcome is the same.This layer wont show up on the outprint.It is a pain... like being shot by dum-dum bullet. RaivoEstonian Land Board
dojo.require("esri.tasks.PrintTask"); printBaseMap = function () { var printTask, params; printTask = new esri.tasks.PrintTask("http://yourserver.com/arcgis/rest/services/LetterPortrait/GPServer/Export Web Map"); var ptemplate = new esri.tasks.PrintTemplate(); ptemplate.layout = "Letter ANSI A Landscape"; ptemplate.format = "PNG32"; ptemplate.layoutOptions = { "authorText": "your author text", "copyrightText": "© " + (new Date).getFullYear(), "legendLayers": [], "titleText": "your title text", "scalebarUnit": "Miles" }; // use the extent of the webmap in the output image ptemplate.preserveScale = false; ptemplate.showAttribution = false; params = new esri.tasks.PrintParameters(); params.map = yourMap; params.template = ptemplate; printTask.execute(params, printComplete, printError); } printComplete = function (result) { window.open(result.url + "?k=" + new Date().getTime()); } printError = function (error) { alert(error); }
Please try webTiledLayer, instead of a custom TiledLayer.
Hello!We have implemented esri.layers.TiledMapServiceLayer basemaps in our Javascript code (external TMS tiles) and now we are having a problem including such basemap into outprint. Basemaps are added via map.addLayer interface and default printing service is declared this way:[INDENT][INDENT] var printer = new esri.dijit.Print({ map: map, url: "http://atlas:6080/arcgis/rest/services/Raivotest/ExportWebMap/GPServer/Export Web Map" }, dojo.byId("b_print")); printer.startup();[/INDENT][/INDENT]But, this output file contains only ArcGISDynamicMapServiceLayer layers . How I can include TiledMapServiceLayer?It is a major problem here as those basemaps are for us very important. Is ArcGIS a system or closed system? Thank you,Raivo AllaEstonian Land Board
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.