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

  • 相关阅读:
    vue3配置rem适配
    webPack转vite2
    vite ant Design vue按需加载
    Vue3 +Vite+ts
    vite 2.0 动态引入加载图片
    Vue3使用vmdeditor自定义锚点
    ThinkPHP6 路由
    DIV+CSS 文本属性
    DIV+CSS 入门篇 CSS选择器
    如何不使用react,也能解析jsx?
  • 原文地址:https://www.cnblogs.com/raorao1994/p/7089549.html
Copyright © 2020-2023  润新知