首页 > 移动平台 > 详细

third application :Directions widget

时间:2015-04-12 23:59:38      阅读:355      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
    <title>Directions Widget</title>
    <link rel="stylesheet" href="http://js.arcgis.com/3.13/dijit/themes/claro/claro.css">
    <link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css">
    <style>
      html, body, #map {
        height:100%;
        width:100%;
        margin:0;
        padding:0;
      }
      body {
        background-color:#FFF;
        overflow:hidden;
        font-family:"Trebuchet MS";
      }
    </style>

    <script src="http://js.arcgis.com/3.13/"></script>
    <script>
      require([
        "esri/map", "esri/dijit/Directions", 
        "dojo/parser", 
        "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!"
      ], function(
        Map, Directions,parser
      ) {
        parser.parse();
        

        var map = new Map("map", {
          basemap: "streets",
          center:[-98.56,39.82],
          zoom: 4
        });

        var directions = new Directions({
          map: map,
          routeTaskUrl: "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Route",
        },"dir");
        directions.startup();
      });
    </script>
  </head>
  <body class="claro">
    <div data-dojo-type="dijit/layout/BorderContainer" 
         data-dojo-props="design:‘headline‘, gutters:false" 
         style="width:100%;height:100%;">
      <div data-dojo-type="dijit/layout/ContentPane" 
           data-dojo-props="region:‘right‘" 
           style="width:300px;height:600px;">
        
        <div id="dir"></div>
      </div>
      <div id="map" 
           data-dojo-type="dijit/layout/ContentPane" 
           data-dojo-props="region:‘center‘">
      </div>
    </div>
  </body>
</html>

 

third application :Directions widget

原文:http://www.cnblogs.com/tiandi/p/4420886.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!