码迷,mamicode.com
首页 > 移动开发 > 详细

third application :Directions widget

时间:2015-04-13 00:02:46      阅读:409      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!