arcgis javascript api 調用方法測試一例

來源:互聯網
上載者:User
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html>  <head>    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>    <title>Simple Map</title>    <!--    <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.5/js/dojo/dijit/themes/tundra/tundra.css">    <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.5"></script>    -->    <link href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/dijit/themes/claro/claro.css" rel="stylesheet" type="text/css" ><link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/esri/css/esri.css" /><script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/" type="text/javascript"></script>    <script type="text/javascript">      dojo.require("esri.map");      function init() {        var myMap = new esri.Map("mapDiv");        //note that if you do not have public Internet access then you will need to point         //this url to your own locally accesible cached service.        //http://server.arcgisonline.com/ArcGIS/services/ESRI_Imagery_World_2D/MapServer               //var d_ms_url="http://192.168.1.244/ArcGIS/rest/services/CBDMap/MapServer";  //local url        //d_ms_url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer";        //var d_ms_Layer= new esri.layers.ArcGISDynamicMapServiceLayer(d_ms_url);        //myMap.addLayer(d_ms_Layer);                       //tiled mapserver add Layer demo        var t_ms_url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer";        var t_tmsLayer= new esri.layers.ArcGISTiledMapServiceLayer(t_ms_url);        myMap.addLayer(t_tmsLayer);        var p_ms_url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer";        var p_dmsLayer= new esri.layers.ArcGISDynamicMapServiceLayer(p_ms_url);        myMap.addLayer(p_dmsLayer);      }      dojo.addOnLoad(init);    </script>  </head>  <body class="tundra">    <div id="mapDiv" style="width:900px; height:600px; border:1px solid #000;"></div>  </body></html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html>  <head>    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>    <title>Simple Map</title>    <link rel="stylesheet" type="text/css" href="http://192.168.1.244/arcgis_js_api/library/3.3/jsapi/js/dojo/dijit/themes/tundra/tundra.css">    <script type="text/javascript" src="http://192.168.1.244/arcgis_js_api/library/3.3/jsapicompact"></script>    <script type="text/javascript">      dojo.require("esri.map");      function init() {        var myMap = new esri.Map("mapDiv");        //note that if you do not have public Internet access then you will need to point         //this url to your own locally accesible cached service.        //http://server.arcgisonline.com/ArcGIS/services/ESRI_Imagery_World_2D/MapServer               //var d_ms_url="http://192.168.1.244/ArcGIS/services/CBDMap/MapServer";  //local url        //var d_ms_Layer= new esri.layers.ArcGISDynamicMapServiceLayer(d_ms_url);        //myMap.addLayer(d_ms_Layer);                //tiled mapserver add Layer demo        var t_ms_url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer";        var t_tmsLayer= new esri.layers.ArcGISTiledMapServiceLayer(t_ms_url);        myMap.addLayer(t_tmsLayer);      }      dojo.addOnLoad(init);    </script>  </head>  <body class="tundra">    <div id="mapDiv" style="width:900px; height:600px; border:1px solid #000;"></div>  </body></html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html>  <head>    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>    <meta http-equiv="X-UA-Compatible" content="IE=7" />    <title>Create Map</title>    <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.5/js/dojo/dijit/themes/tundra/tundra.css">    <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.5"></script>    <script type="text/javascript">      dojo.require("esri.map");      function init() {        var map = new esri.Map("map");        var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer");        map.addLayer(tiledMapServiceLayer);      }      dojo.addOnLoad(init);    </script>  </head>  <body class="tundra">    <div id="map" style="width:900px; height:600px; border:1px solid #000;"></div>    Creates a map and adds an ArcGISTiledMapServiceLayer.<br />    Map navigation using mouse:    <ul>      <li>Drag to pan</li>      <li>SHIFT + Click to recenter</li>      <li>Mouse Scroll Forward to zoom in</li>      <li>Mouse Scroll Backward to zoom out</li>      <li>Use Arrow keys to pan</li>      <li>+ key to zoom in a level</li>      <li>- key to zoom out a level</li>      <li>Double Click to Center and Zoom in</li>    </ul>  </body></html>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.