0

I keep getting the following errors when attempting to provide my code with a webmap id in conjunction with the ESRI tutorial for ArcGIS Online Web Map :

http://imgur.com/a/WEGM9

Below is the Javascript code which I am currently using.

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Create a Web Map</title>

        <link rel="stylesheet" type="text/css"
            href="http://js.arcgis.com/3.9/js/esri/css/esri.css" />
        <style>
            html, body, #mapDiv,.map.container{
                padding:0;
                margin:0;
                height:100%;
            }
            #legendDiv{
                background-color: #fff;
                postion: absolute !important;
                z-index: 99;
                top:10px;
                right:20px;
            }
        </style>

        <script>var dojoConfig = { parseOnLoad:true };</script>
        <script src="http://js.arcgis.com/3.9compact/"></script>
        <script>
            var map;
            require([
                    "esri/map",
                    "esri/arcgis/utils",
                    "esri/dijit/Legend",
                    "dojo/domReady!"
                    ], function(Map, arcgisUtils, Legend){
                arcgisUtils.createMap("08fdfee37898470385ad4b3752db969f", "mapDiv").then(function
             (response) {
                    map = response.map;

                var legend = new Legend({
                    map: map,
                    layerInfos:(arcgisUtils.getLegendLayers(response))
                }, "legendDiv");

                legend.startup();
                });
            });
        </script>
    </head>
    <body>
        <div id="mapDiv"></div>
        <div id="legendDiv"></div>
    </body>
</html>

The Map id is a publicly available map of Richmond, VA's Historic Sites

4

2 回答 2

0

相同的代码在我的浏览器中运行良好,没有任何错误。您身边的网速可能很慢。由于互联网速度慢,您会遇到第二个错误。不确定第一个错误。

于 2014-07-17T04:52:36.477 回答
0

我尝试了相同的代码,它工作正常。

根据您的屏幕截图,您正在尝试从本地系统打开文件。

为了能够成功加载此页面,您需要将其部署在您的 Web 服务器(IIS、tomcat 等)中。

于 2014-10-24T09:50:38.413 回答