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
| <!DOCTYPE HTML> <html>
<head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>Layer Swipe</title> <link rel="stylesheet" type="text/css" href="esri.css" /> <link rel="stylesheet" type="text/css" href="tundra.css" /> <style> html, body, #map { padding: 0; margin: 0; height: 100%; position: relative; } </style> <script src="https://js.arcgis.com/3.29/"></script> </head>
<body class="calcite"> <div id="map" class="map"> <div id="swipeDiv"></div> </div> </body>
<script> require([ "esri/map", "esri/layers/FeatureLayer", "esri/dijit/LayerSwipe", "dojo/domReady!" ], function ( Map, FeatureLayer, LayerSwipe ) { var map = new Map("map"); thingslayer0 = new FeatureLayer("http://localhost:6080/arcgis/rest/services/gaofen/bazhou/MapServer" + "/0", { mode: FeatureLayer.MODE_ONDEMAND, outFields: ["*"] }); thingslayer1 = new FeatureLayer("http://localhost:6080/arcgis/rest/services/gaofen/bazhou/MapServer" + "/1", { mode: FeatureLayer.MODE_ONDEMAND, outFields: ["*"] }); map.addLayer(thingslayer0); map.addLayer(thingslayer1); var swipeWidget = new LayerSwipe({ type: "vertical", map: map, layers: [thingslayer0, thingslayer1], }, "swipeDiv"); swipeWidget.startup(); }); </script>
</html>
|