Solved! Go to Solution.
<!DOCTYPE html> <html> <head> <title>Create a Web Map</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.9/js/esri/css/esri.css"> <style> html,body,#mapDiv,.map.container{ padding:0; margin:0; height:100%; } #linkDiv{ position: absolute; top:4px; right:20px; background-color: #fff; border: solid 1px #333; border-radius:4px; padding:10px; } </style> <script>var dojoConfig = { parseOnLoad:true };</script> <script src="http://js.arcgis.com/3.9/"></script> <script> require([ "esri/map", "esri/arcgis/utils", "esri/IdentityManager", "esri/request", "dojo/dom-construct", "dojo/domReady!" ], function (Map, arcgisUtils, IdentityManager, esriRequest, domConstruct) { arcgisUtils.createMap("c1f07f8344284500b770bc36ee6f5d1d", "mapDiv"); //create links var pdfUrl = "http://www.arcgis.com/sharing/rest/content/items/de2f584ecb77473985e6d0ae37a58713/data"; esri.id.getCredential(pdfUrl).then(function(credential){ if(credential.token){ pdfUrl += "?token=" + credential.token; } //create and add the download link to the page domConstruct.create("a", { href: pdfUrl, target: "_blank", innerHTML: "Capitol Forest PDF" },"linkDiv"); }); }); </script> </head> <body class="claro"> <div id="mapDiv"></div> <div id="linkDiv"></div> </body> </html>
<!DOCTYPE html> <html> <head> <title>Create a Web Map</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.9/js/esri/css/esri.css"> <style> html,body,#mapDiv,.map.container{ padding:0; margin:0; height:100%; } #linkDiv{ position: absolute; top:4px; right:20px; background-color: #fff; border: solid 1px #333; border-radius:4px; padding:10px; } </style> <script>var dojoConfig = { parseOnLoad:true };</script> <script src="http://js.arcgis.com/3.9/"></script> <script> require([ "esri/map", "esri/arcgis/utils", "esri/IdentityManager", "esri/request", "dojo/dom-construct", "dojo/domReady!" ], function (Map, arcgisUtils, IdentityManager, esriRequest, domConstruct) { arcgisUtils.createMap("c1f07f8344284500b770bc36ee6f5d1d", "mapDiv"); //create links var pdfUrl = "http://www.arcgis.com/sharing/rest/content/items/de2f584ecb77473985e6d0ae37a58713/data"; esri.id.getCredential(pdfUrl).then(function(credential){ if(credential.token){ pdfUrl += "?token=" + credential.token; } //create and add the download link to the page domConstruct.create("a", { href: pdfUrl, target: "_blank", innerHTML: "Capitol Forest PDF" },"linkDiv"); }); }); </script> </head> <body class="claro"> <div id="mapDiv"></div> <div id="linkDiv"></div> </body> </html>