• 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>

  • 相关阅读:
    乐观锁和悲观锁
    c++ inline使函数实现可以在头文件中,避免多重定义错误
    无锁队列的实现
    同步异步阻塞非阻塞
    log(m+n)找第k大
    ios开发常见的 工具 - 值得收藏
    iOS 性能优化得 方法
    搭建 安卓开发环境 !
    项目支持 64 - bit
    AFN学习笔记
  • 原文地址:https://www.cnblogs.com/raorao1994/p/7089549.html
Copyright © 2020-2023  润新知