1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
| <!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>Recent Earthquakes</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.29/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="https://js.arcgis.com/3.29/esri/css/esri.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } .dijitBorders{ margin:5px 5px 5px 5px; border:solid thin -moz-border-radius: 4px; } .labelText{ color: font-size:12pt; font-family:"Tahoma"; margin:5px; } .headerText{ color: font-size:16pt; font-weight:bold; font-family: "Tahoma"; } </style>
<script src="https://js.arcgis.com/3.29/"></script> <script> var map,timeExtent; require([ "esri/map","esri/layers/ArcGISDynamicMapServiceLayer", "esri/layers/FeatureLayer", "esri/TimeExtent", "esri/layers/TimeInfo", "esri/renderers/ClassBreaksRenderer", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/dijit/editing/TemplatePicker", "esri/dijit/TimeSlider", "esri/renderers/TimeClassBreaksAger", "esri/renderers/TemporalRenderer", "dojo/parser", "dojo/_base/array", "esri/Color", "dojo/dom", "dojo/date", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!" ], function( Map, ArcGISDynamicMapServiceLayer,FeatureLayer, TimeExtent, TimeInfo, ClassBreaksRenderer, SimpleMarkerSymbol, SimpleLineSymbol, TemplatePicker, TimeSlider, TimeClassBreaksAger, TemporalRenderer, parser, arrayUtils, Color, dom, date ) { parser.parse();
map = new Map("map", { basemap: "satellite", center: [114.0143, 34.11075], slider: false, zoom:15 }); //边界 var research_scope = new ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/Henan_S/research_scope1/MapServer",{"id":"100000"}); map.on("load", mapLoaded);
function mapLoaded() { var SOMtlj = new ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/Henan_S/PH1_TLJ/MapServer",{"id":"3"}); SOMtlj.on("load", featureLayerLoaded); map.addLayer(SOMtlj); map.addLayer(research_scope); }
function featureLayerLoaded() { // create time slider var timeSlider = new TimeSlider({ style: "width: 100%;"}, dom.byId("timeSliderDiv")); map.setTimeSlider(timeSlider);
timeExtent = new TimeExtent(); // 设置时区后,开始时间和结束时间 //timeExtent.startTime = new Date("2019/06/06 23:59:00 UTC"); //timeExtent.endTime = new Date("2019/06/07 05:52:00 UTC");
timeSlider.setThumbCount(1); timeSlider.createTimeStopsByTimeInterval(timeExtent, 1, "esriTimeUnitsMinutes"); timeSlider.setThumbIndexes([0]); timeSlider.on("time-extent-change", displayTimeInfo); timeSlider.startup(); // timeSlider.play(); }
function displayTimeInfo(timeExtent) { var info = timeExtent.endTime; dom.byId("timeInfo").innerHTML = info; }
}); </script> </head>
<body class="claro"> <div id="mainWindow" data-dojo-type="dijit/layout/BorderContainer" data-dojo-propx="design:'sidebar', gutters:true" style="width:100%; height:100%;"> <div id="header" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'" class="dijitBorders" style="height:100px;"> <center> <span class="headerText">采样时序</span> <div id="timeInfo" class="labelText"></div> <div id="timeSliderDiv" ></div> </center> </div> <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'" class="dijitBorders" style="background-color:inherit;"> </div> <div id="right" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'left'" style="width:100px;font-size:small;">
<center><span class="labelText">Age</span></center> <div id="ageDiv" class="dijitBorders"></div> <center><span class="labelText">Magnitude</span></center> <div id="magnitudeDiv" class="dijitBorders" ></div> </div> </div> </body> </html>
|