arcgis javascript api 调用方法测试一例

<!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>




   

你可能感兴趣的:(arcgis javascript api 调用方法测试一例)