zoukankan      html  css  js  c++  java
  • arcgis打印服务

    <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 = {
                        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>

  • 相关阅读:
    linux之iptable案例
    nginx常用命令参数
    laravel中的多对多关系详解
    MySql计算时间差函数
    总结下Mysql分表分库的策略及应用
    swoole扩展实现真正的数据库连接池
    linux常用命令整理
    innodb mvcc实现机制
    mysqlslap 压力测试使用总结
    mysql索引总结
  • 原文地址:https://www.cnblogs.com/raorao1994/p/7089549.html
Copyright © 2011-2022 走看看