根源:是里面的init.js脚本文件换成http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.0就成功了,但具体为什么还要继续想。
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="http://DNISO-201410151/arcgis_js_api/jsapi/js/dojo/dijit/themes/tundra/tundra.css"/> <link rel="stylesheet" type="text/css href="http://DNISO-201410151/arcgis_js_api/jsapi/js/esri/css/esri.css" /> <script type="text/javascript" src="http://DNISO-201410151/arcgis_js_api/jsapi/init.js"></script> <style type="text/css"> .MapClass { width: 900px; height: 600px; border: 1px solid #000; } </style> <script type="text/javascript"> dojo.require("esri.map"); dojo.addOnLoad(function () { var MyMap = new esri.Map("MyMapDiv"); var MyTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer ("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"); MyMap.addLayer(MyTiledMapServiceLayer) } ) </script> </head> <body class="tundra"> <div id="MyMapDiv" class="MapClass"</div> </body> </html>
时间: 2024-10-07 16:40:48