美文网首页gis
arcgis for javascript 4.4 print

arcgis for javascript 4.4 print

作者: arcgis | 来源:发表于2017-09-27 16:50 被阅读15次

    <script>
    var myMap, view;

    require([

    "esri/Basemap",

    "esri/layers/TileLayer",

    "esri/Map",

    "esri/views/MapView",

    "esri/widgets/Print",

    "dojo/domReady!"

    ],

    function(

    Basemap,TileLayer, Map, MapView, Print

    ) {

    /* 全网图  */

    var tLayer = new TileLayer({

    url: "http://发布的服务地址/arcgis/rest/services/DlbjServerx/MapServer"

    });

    var customBasemap = new Basemap({

    baseLayers: [tLayer],

    title: "Custom Basemap",

    id: "myBasemap"

    });

    myMap = new Map({

    basemap: customBasemap

    });

    // Create a new instance of a MapView

    view = new MapView({

    container: "viewDiv",

    map: myMap

    });

    view.then(function() {

    var print = new Print({

    view: view,

    // specify your own print service

    printServiceUrl: "http://gp服务地址/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"

    });

    // Add widget to the top right corner of the view

    view.ui.add(print, "top-right");

    });

    });

    相关文章

      网友评论

        本文标题:arcgis for javascript 4.4 print

        本文链接:https://www.haomeiwen.com/subject/ceiuextx.html