首先我们需要先创建一个地图,代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Resizable Map</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.0/js/dojo/dijit/themes/tundra/tundra.css"/>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis?v=2.0"></script>
<script>
dojo.require("esri.map");
var map;
function init(){
map = new esri.Map("map",{//加载地图
logo:false//不显示logo
});
var myTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://192.168.0.181/ArcGIS/rest/services/GISBaseMap/MapServer");
map.addLayer(myTiledMapServi