<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" type="text/css"
href="http://localhost/arcgis_js_api_v321/library/3.21/3.21/esri/css//esri.css">
<script type="text/javascript" src="http://localhost/arcgis_js_api_v321/library/3.21/3.21/init.js"></script>
</head>
<body>
<div id="mright" >
<!-- 此处填充地图面板内容 -->
</div>
<script>
window.onload = function () {
/*********显示地图************/
//方式一:
// require([
// "esri/map",
// "esri/layers/ArcGISTiledMapServiceLayer",
// ],function (Map,ArcGISTiledMapServiceLayer) {
// var myMap = new Map("mright");
// var myTiledMapServiceLayer = new ArcGISTiledMapServiceLayer("http://localhost/arcgis/rest/services/GXnew/jnsldtfw_0724/MapServer");//瓦片地图服务
// //new esri.layers.ArcGISDynamicMapServiceLayer 动态地图服务
// myTiledMapServiceLayer.id="jnsldtfw_0724";
// myMap.addLayer(myTiledMapServiceLayer);
// })
//方式二:
var myMap = new esri.Map("mright");
var myTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://localhost/arcgis/rest/services/GXnew/jnsldtfw_0724/MapServer");//瓦片地图服务
//new esri.layers.ArcGISDynamicMapServiceLayer 动态地图服务
myTiledMapServiceLayer.id="jnsldtfw_0724";
myMap.addLayer(myTiledMapServiceLayer);
}
</script>
</body>
</html>