Based on ArcGIS for JavaScript API trajectory playback

Source: Internet
Author: User

<! doctypehtml public "-//w3c//dtd HTML 4.01//en" "Http://www.w3.org/TR/html4/strict.dtd" >
<meta. http-equiv= "Content-type" content= "Text/html;charset=utf-8"/>
<title>simple map</title>
<link rel= "stylesheet" type= text/css "href=" Http://esri-guo/arcgis_js_v32_sdk/arcgis_js_api/library/3.2/jsapi /js/dojo/dijit/themes/tundra/tundra.css "/>
<link rel= "stylesheet" type= text/css "href=" Http://esri-guo/arcgis_js_v32_sdk/arcgis_js_api/library/3.2/jsapi /js/esri/css/esri.css "/>
<script. Type= "Text/javascript" src= "Http://esri-guo/arcgis_js_v32_sdk/arcgis_js_api/library/3.2/jsapi/init.js" ></ Script>
<script. Type= "Text/javascript" >
Dojo.require ("Esri.map");
Dojo.require ("Esri.toolbars.draw");
Dojo.require ("esri.graphic");
Dojo.require ("Esri.layers.graphics");
Dojo.require ("Esri.geometry");
        var ptcount = "13740395.6058,5130594.7971/13740385.6058,5130594.7971/ 13740375.6058,5130594.7971/13740365.6058,5130594.7971/13740355.6058,5130594.7971/13740355.6058,5130583.7971/ 13740355.6058,5130572.7971/13740355.6058,5130561.7971/13740355.6058,5130550.7971/13740355.6058,5130549.7971/ 13740355.6058,5130538.7971/13740355.6058,5130527.7971/13740355.6058,5130516.7971/13740355.6058,5130505.7971/ 13740355.6058,5130494.7971/13740355.6058,5130483.7971/13740355.6058,5130472.7971/13740355.6058,5130461.7971/ 13740355.6058,5130450.7971/13740355.6058,5130449.7971/13740355.6058,5130438.7971/13740355.6058,5130427.7971/ 13740355.6058,5130416.7971/13740355.6058,5130405.7971/13740355.6058,5130394.7971/13740355.6058,5130383.7971/ 13740355.6058,5130372.7971/13740355.6058,5130361.7971/13740355.6058,5130350.7971/13740355.6058,5130349.7971/ 13740355.6058,5130328.7971/13740355.6058,5130317.7971/13740355.6058,5130306.7971/13740355.6058,5130295.7971/ 13740355.6058,5130284.7971/13740355.6058,5130273.7971/13740355.6058,5130262.7971/";
var list;
var Defaultsymbol;
var Mymap;
var icount;
var i = 0;
function Ptcounntsplit () {
List =ptcount.split ("/");
Icount=list.length;
Alert (list[0].substring) (0,list[0].indexof (', '));
Alert (list[0].substring (List[0].indexof (', ') +1, list[0].length));
}
function Ptposition () {


            Varpointsymbol = new Esri.symbol.SimpleMarkerSymbol ();
           pointsymbol.setoutline = Newesri.symbol.SimpleLineSymbol (Esri.symbol.SimpleLineSymbol.STYLE_SOLID, Newdojo. Color ([255, 0, 0]), 1);
           pointsymbol.setsize (5);
           pointsymbol.setcolor (New dojo. Color ([0, 255, 0, 0.25]);
        
             var geometry= new Esri.geometry.Point (13740395.6058, 5130594.7971);
        
             var graphic= new ESRI. Graphic (geometry, pointsymbol);


MyMap.graphics.add (graphic);

var point = new Esri.geometry.Point ({"X": 13740395.6058, "y": 5130594.7971, "spatialreference": {"Wkid": 102100}});
Mymap.centerandzoom (geometry, 20);

}

function Go () {


           
             Varpointsymbol = new Esri.symbol.SimpleMarkerSymbol ();
            pointsymbol.setoutline= New Esri.symbol.SimpleLineSymbol (Esri.symbol.simplelinesymbol.style_solid,new Dojo. Color ([255, 0, 0]), 1);
           pointsymbol.setsize (5);
           pointsymbol.setcolor (New dojo. Color ([0, 255, 0, 0.25]);
           //alert (List[i]);
            var geometry= new Esri.geometry.Point (list[ I].substring (0, List[i].indexof (', ')), list[i].substring (List[i].indexof (', ') + 1, list[i].length));

var graphic = new Esri. Graphic (geometry, pointsymbol);


MyMap.graphics.add (graphic);

var extent =mymap.extent;
if (!extent.contains (graphic.geometry)) {
Mymap.centerat (geometry);
}


i++;


}


        function Gogps () {
       &NBSP;&NBSP;&NBSP;&NBSP
            Go ();
             if (i <icount) {
                             window.settimeout ("Gogps ()", "2000");
           }
            else {
                             window.cleartimeout ("Gogps ()");
           }
          


}

function init () {
var mymap = Newesri. Map ("Mapdiv");
var customextentandsr =new esri.geometry.Extent (13676444.4499247, 5092822.83792968, 13781163.1786753,5160163.85984883, New ESRI. Spatialreference ({"Wkid": 102100}));

Mymap = new ESRI. Map ("Mapdiv", {EXTENT:CUSTOMEXTENTANDSR});


       //note that if you don't havepublic Internet access then you to nee D to point this URL to your own locallyaccessible cached service.
        var mytiledmapservicelayer = Newesri.layers.ArcGISTiledMapServiceLayer ("Http://www.arcgisonline.cn/ArcGIS/rest/services/ChinaCities_ Community_basemap_chn/shenyang_community_basemap_chn/mapserver ");
       mymap.addlayer (mytiledmapservicelayer);

 
     }
      dojo.addonload (init);
     </script>
    <body class= "Tundra"
    <table>
      <tr>
           <TD>
            <div id= "MapDiv" Style= "width:1500px; height:800px;border:1px solid #000; " ></div>
          </td>
           <td>
             <input id= "Button1" type= "button" value= "locate" nclick= ' ptposition () '/>

            <input id= "Button2" type= "button" Value= "Replay" nclick= ' Ptcounntsplit (); Gogps () '/>
          </ Td>
      </tr>
      
   &NBSP;&NBSP;&NBSP
    </table>
  </body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.