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%20Web%20Map"
}, 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 Alla
Estonian Land Board
Please try webTiledLayer, instead of a custom TiledLayer.
dojo.require("esri.tasks.PrintTask"); printBaseMap = function () { var printTask, params; printTask = new esri.tasks.PrintTask("http://yourserver.com/arcgis/rest/services/LetterPortrait/GPServer/Export%20Web%20Map"); 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); }
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.
Raivo
Estonian Land Board
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%20Web%20Map%20Task/execute?f=json&Web_Map_as_JSON=%7B%22mapOptions%22%3A%7B%22showAttribution%22%3Atrue%2C%22extent%22%3A%7B%22xmin%22%3A541255.859375%2C%22ymin%22%3A6587610.546350479%2C%22xmax%22%3A544869.140625%2C%22ymax%22%3A6589872.265100479%2C%22spatialReference%22%3A%7B%22wkid%22%3A3301%7D%7D%2C%22spatialReference%22%3A%7B%22wkid%22%3A3301%7D%2C%22scale%22%3A14763.75%7D%2C%22operationalLayers%22%3A%5B%7B%22id%22%3A%22kaart%22%2C%22title%22%3A%22kaart%22%2C%22opacity%22%3A1%2C%22minScale%22%3A1889760%2C%22maxScale%22%3A1845.46875%2C%22url%22%3A%22http%3A%2F%2Ftiles.maaamet.ee%2Ftm%2Fs%2F1.0.0%2Fkaart%2F%22%7D%2C%7B%22id%22%3A%22layer0%22%2C%22title%22%3A%22layer0%22%2C%22opacity%22%3A1%2C%22minScale%22%3A0%2C%22maxScale%22%3A0%2C%22url%22%3A%22http%3A%2F%2Fatlas%3A6080%2Farcgis%2Frest%2Fservices%2FRaivotest%2Fraamatukogud%2FMapServer%22%2C%22visibleLayers%22%3Anull%2C%22layers%22%3A%5B%5D%7D%5D%2C%22exportOptions%22%3A%7B%22outputSize%22%3A%5B800%2C1100%5D%2C%22dpi%22%3A96%7D%7D&Format=PNG32&Layout_Template=MAP_ONLY
http://atlas:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task/execute?f=json&Web_Map_as_JSON=%7B%22mapOptions%22%3A%7B%22showAttribution%22%3Atrue%2C%22extent%22%3A%7B%22xmin%22%3A538179.6875%2C%22ymin%22%3A6582123.436927795%2C%22xmax%22%3A552632.8125%2C%22ymax%22%3A6591170.311927795%2C%22spatialReference%22%3A%7B%22wkid%22%3A3301%7D%7D%2C%22spatialReference%22%3A%7B%22wkid%22%3A3301%7D%2C%22scale%22%3A59055%7D%2C%22operationalLayers%22%3A%5B%7B%22id%22%3A%22layer0%22%2C%22title%22%3A%22layer0%22%2C%22opacity%22%3A1%2C%22minScale%22%3A1889760%2C%22maxScale%22%3A1845.46875%2C%22url%22%3Anull%7D%2C%7B%22id%22%3A%22layer1%22%2C%22title%22%3A%22layer1%22%2C%22opacity%22%3A1%2C%22minScale%22%3A0%2C%22maxScale%22%3A0%2C%22url%22%3A%22http%3A%2F%2Fatlas%3A6080%2Farcgis%2Frest%2Fservices%2FRaivotest%2Fmaaamet_katastriyksused%2FMapServer%22%2C%22visibleLayers%22%3Anull%2C%22layers%22%3A%5B%5D%7D%2C%7B%22id%22%3A%22layer2%22%2C%22title%22%3A%22layer2%22%2C%22opacity%22%3A1%2C%22minScale%22%3A0%2C%22maxScale%22%3A0%2C%22url%22%3A%22http%3A%2F%2Fatlas%3A6080%2Farcgis%2Frest%2Fservices%2FRaivotest%2Fraamatukogud%2FMapServer%22%2C%22visibleLayers%22%3Anull%2C%22layers%22%3A%5B%5D%7D%2C%7B%22id%22%3A%22map_graphics%22%2C%22minScale%22%3A0%2C%22maxScale%22%3A0%2C%22featureCollection%22%3A%7B%22layers%22%3A%5B%5D%7D%7D%5D%2C%22exportOptions%22%3A%7B%22outputSize%22%3A%5B800%2C1100%5D%2C%22dpi%22%3A96%7D%7D&Format=PNG32&Layout_Template=MAP_ONLY
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.