<script>
    function print1() {
        require([
               "esri/map",
                "esri/dijit/Print",
                "esri/tasks/PrintTask",
                "esri/tasks/PrintParameters",
                "esri/tasks/PrintTemplate",
                "esri/layers/FeatureLayer",
                "esri/layers/ArcGISDynamicMapServiceLayer",
                "esri/tasks/Geoprocessor",
                "esri/SpatialReference",
                "esri/symbols/TextSymbol",
                "esri/symbols/Font",
                "esri/graphic",
                "esri/geometry/Point",
                "esri/symbols/SimpleMarkerSymbol",
                "esri/symbols/SimpleLineSymbol",
                "esri/Color",
                "dojo/domReady!"
        ],
            function (
                   Map,
                   Print,
                    PrintTask,
                    PrintParameters,
                    PrintTemplate,
                    FeatureLayer,
                    ArcGISDynamicMapServiceLayer,
                    Geoprocessor,
                    TextSymbol,
                    Font,
                    Graphic,
                    Point,
                    SimpleMarkerSymbol,
                    SimpleLineSymbol,
                    Color
            ) {
                var printurl = top.Robin.Setting.GlobalSetting.BaseMapServices.Printing.url;
                var printTask = new PrintTask(printurl);
                var template = new PrintTemplate();
                template.exportOptions = {
                    width: 800,
                    height: 600,
                    dpi: 96
                };
                template.format = "PDF";
                template.layout = "MAP_ONLY";  //MAP_ONLY    print
                template.preserveScale = false;
                var params = new PrintParameters();
                params.map = top.Robin.Map.Map2DControl;
                params.template = template;
                printTask.execute(params, function (evt) {
                    window.open(evt.url, "_blank");
                }, function (erro) { alert(erro); });
            });
    }
</script>

最新文章

  1. 1、MVC和EF中的 Model First 和 Code First
  2. [ACM_水题] ZOJ 3712 [Hard to Play 300 100 50 最大最小]
  3. linux下安装php的imagick扩展模块(附php升级脚本)
  4. PHP+redis实现超迷你全文检索
  5. 夺命雷公狗---Thinkphp----10之后台登录.注销一条龙
  6. ECshop中defined(&#39;IN_ECS&#39;)的实现原理
  7. PHP中使用CURL实现get和post请求(总结)
  8. 内联函数inline
  9. DOS下更改编码方式
  10. 在项目中使用SQLite数据库小结
  11. 使用Python实现Hadoop MapReduce程序
  12. JS 多种变量定义
  13. 【转载】CSS3 filter:drop-shadow滤镜与box-shadow区别应用
  14. java报错排解
  15. win32贪吃蛇实现
  16. I/O-----字符输入流
  17. Assembly.LoadFrom加载程序集无法释放资源的解决方案
  18. php tp3.2生成二维码
  19. docker常用命令记录
  20. 20145203盖泽双 《网络对抗技术》实践1—— MAL_逆向与Bof基础

热门文章

  1. redis学习三 redis持久化
  2. Win10 蓝屏
  3. python爬虫实战(2)--爬取百度贴吧
  4. setAttribute这个方法
  5. 如何选择RDBMS关系型数据库和Nosql非关系型数据库?
  6. python 爬虫 下载图片
  7. cocos2dx中坐标系
  8. matlab rand(3,5)
  9. C++ 成员函数前和函数后加const修饰符区别
  10. jQuery 事件 - trigger() 方法