<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");
});
});
网友评论