Home > Enterprise >  Just started to learn arcgis API for JS is wrong
Just started to learn arcgis API for JS is wrong

Time:09-19




<meta HTTP - equiv="content-type" content="text/HTML. Charset=utf-8 "/& gt;
The first map application & lt;/title> <br/><link rel="stylesheet" type="text/CSS" href="http://localhost/css/arcgis_js_api/library/4.4/jsapi/js/dojo/dijit/themes/tundra/tundra.css"/& gt; <br/><link rel="stylesheet" type="text/CSS" href="http://localhost/arcgis_js_api/library/4.4/jsapi/js/esri/css/esri.css"/& gt; <br/><The script type="text/javascript" SRC="http://localhost/arcgis_js_api/library/4.4/jsapi/init.js" & gt; </script> <br/><script SRC="https://bbs.csdn.net/topics/dojo/jsapi_vsdoc10_v44.js" type="text/javascript" & gt; </script> <br/><style type="text/CSS" & gt; <br/>. MapClass <br/>{width: 900 px; <br/>height:600px; <br/>border:1px solid #000; <br/>} <br/></style> <br/><The script type="text/javascript" & gt; <br/>Dojo. The require (" esri map "); <br/>Dojo. AddOnLoad (function () <br/>{<br/>Var MyMap=new esri Map (" MyMapDiv "); <br/>Var MyTiledMapServiceLayer=new esri. The layers. ArcGISTiledMapServiceLayer (" http://www.arcgisonline.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer "); <br/>MyMap. AddLayer (MyTiledMapServiceLayer) <br/>} <br/>) <br/></script> <br/></head> <br/><body & gt; <br/><Div id="=MyMapDiv" & gt; </div> <br/></body> <br/></html> <br/>According to the tutorial on the first piece of code that run out only white box, this is because what ah<p class="article - content rp"> CodePudding user response: </p>I answer your question, I presume that should be your ArcGIS API for JS localization, not doing, localization API needs in the init. JS and dojo/dojo. JS modify IP inside two files,<p class="article - content rp"> CodePudding user response: </p>Var MyTiledMapServiceLayer=new esri. The layers. ArcGISTiledMapServiceLayer (" http://www.arcgisonline.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer "); <br/>You this sentence is sure to map service address? This should be specific to the layer, or with 0, 1... Concrete layer index to load properly, please try MapServer/0<p class="article - content rp"> CodePudding user response: </p>Are you sure you call the right? Is not a Map and MapView applications at the same time<p class="article - content rp"> CodePudding user response: </p>Var MyMap=new esri. The Map (" <span style="color: # FF0000;"> MyMapDiv </span> <br/> ")<Div id="<span style=" color: # FF0000;">=MyMapDiv </span> "& gt; </div> <br/>Red font part should be the same <br/> </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/Enterprise/12483.html" target="_blank" style="color:#999">https//www.codepudding.com/Enterprise/12483.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/Enterprise/12482.html'>WAS 8.5 launch an error, the ball to solve, the nodes are also not line, turntable is load WAS loade</a></div> <div class="detail-arr-right">Next:<a href='/Enterprise/13396.html'>Enterprise routing</a></div> </div> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="hot-tags neitags"> <ul> <li><i class="iconfont icon-x-tags"></i> Tags:  </li> <a href='/e/tags/?tagname=Geographic+information+system' target='_blank'>Geographic information system</a> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="xiangguan"> <ul class="msg msghead"> <li class="tbname">Related</li> </ul> <ul> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="flinks"> <ul> <li><i class="iconfont icon-x-tags"></i> Links:  </li> <li class="liflinks"><a target="_blank" href="/" title="CodePudding">CodePudding</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <p><span style="font-size:16px;color:#666;font-weight: bold">About Us:</span>  <a href="https://www.codepudding.com/contact.html">Contact Us</a>      <a href="https://www.codepudding.com/service.html">Terms of Service</a>      <a href="https://www.codepudding.com/privacy.html"> Privacy Policy</a></p> <p class="foot_info">Copyright © 2010-2023,Powered By <a href="/" target="_blank">CodePudding</a> </p> </div> <script type="text/javascript" src="/skin/code/tianhu.js"></script> </body></html>