<!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>
时间: 2024-10-10 08:48:34