我正在使用 Aptana Studio 3 创建地图,我将函数 init 地址替换为链接到我想要表示的地图所需的适当地址。当我在 Aptana Studio 3 上运行它时,它让我看到了一个未完成的构建,其中没有地图,只有地图区域的轮廓,以及底部的说明性用途。我尝试使用 ArcGIS 资源中心的其他示例,如果我通过 Aptana 或通过根目录实现它,则只能获得相同的结果。
创建地图
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2"></script> <script type="text/javascript"> dojo.require("esri.map"); function init() { var map = new esri.Map("map"); var imageParameters = new esri.layers.ImageParameters(); imageParameters.format = "jpeg"; //set the image type to PNG24, note default is PNG8. //Takes a URL to a non cached map service. var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://maps.nbtexas.org/ArcGIS/rest/services/Maps/NewBraunfelsBaseMap/MapServer",
{"不透明度":0.5, "imageParameters":imageParameters}); map.addLayer(dynamicMapServiceLayer); }
dojo.addOnLoad(init); </script> </head> <body class="claro"> <div id="map" style="width:900px; height:600px; border:1px solid #000;"></div> Creates a map and adds an ArcGISDynamicMapServiceLayer.<br /> Map navigation using mouse: <ul> <li>Drag to pan</li> <li>SHIFT + Click to recenter</li> <li>SHIFT + Drag to zoom in</li> <li>SHIFT + CTRL + Drag to zoom out</li> <li>Mouse Scroll Forward to zoom in</li> <li>Mouse Scroll Backward to zoom out</li> <li>Use Arrow keys to pan</li> <li>+ key to zoom in a level</li> <li>- key to zoom out a level</li> <li>Double Click to Center and Zoom in</li> </ul> </body> </html>