Changeset 12314 in main
- Timestamp:
- 11/17/16 08:47:56 (6 years ago)
- Location:
- adopters/nm-epht/trunk/src/main/webapps/WildFireSmoke
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
adopters/nm-epht/trunk/src/main/webapps/WildFireSmoke/index.html
r11556 r12314 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> 6 <!--The viewport meta tag is used to improve the presentation and behavior of the samples 7 on iOS devices--> 8 <meta name="apple-mobile-web-app-capable" content="yes"> 9 <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> 10 <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> 11 <title>Mapping Application</title> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 2 <html style="height: 100%;"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 5 <meta http-equiv="X-UA-Compatible" content="IE=7" /> 6 <title>5-3-1 mile buffers</title> 7 <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.6/js/dojo/dijit/themes/tundra/tundra.css"> 8 <style> 9 #status { 10 background-color: #C0C0C0; 11 color: black; 12 padding: 3px; 13 border: solid 3px black; 14 border-radius: 5px; 15 } 16 body { 17 background-color:LemonChiffon 18 } 19 </style> 12 20 13 <!--TOC stylesheet --> 14 <link rel="stylesheet" type="text/css" href="vendor/agsjs/css/agsjs.css" /> 21 <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.6" type="text/javascript"></script> 15 22 16 <!-- Stylesheets --> 17 <link rel="stylesheet" href="https://js.arcgis.com/3.8/js/dojo/dijit/themes/claro/claro.css" /> 18 <link rel="stylesheet" href="https://js.arcgis.com/3.8/js/esri/css/esri.css" /> 19 <link rel="stylesheet" href="css/newpage.css" /> 20 21 </head> 23 <script type="text/javascript"> 24 dojo.require("esri.map"); 25 dojo.require("esri.tasks.geometry"); 22 26 23 <body class="claro"> 24 <div id="cpCenter" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'"> 25 <!-- Data layers --> 26 <div id="dataLayers" class="fnbutton"> 27 <div data-dojo-type="dijit/TitlePane" data-dojo-props="title:'Data Layers', closable:false, open:false"> 28 <div id="drop_toc" data-dojo-type="dijit/layout/ContentPane"> 29 <div id="divLegend"></div> 30 </div> 31 </div> 32 </div> 27 var map = null; 28 var gsvc = null; 33 29 34 <!-- Ken Clear Btn --> 35 <button id="clearBtn"class="fnbutton">Clear Buffers</button> 30 function initialize() { 31 map = new esri.Map("map"); 32 map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer")); 33 map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer")); 34 map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer")); 35 map.addLayer(new esri.layers.ArcGISDynamicMapServiceLayer("http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/geomac_dyn/MapServer")); 36 map.setExtent(new esri.geometry.Extent(-11932064.234, 4168330.335, -11636153.642, 4338299.008, new esri.SpatialReference({wkid: 102100}))); 37 gsvc = new esri.tasks.GeometryService("http://sampleserver1.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer"); 38 dojo.connect(map, "onClick", doBuffer); 39 } 36 40 37 <!-- Geolocator --> 38 <div id="geolocator" class="fnbutton"> 39 <!--<div data-dojo-type="dijit/TitlePane" data-dojo-props="title:'Locate Address', closable:false, open:false">--> 40 <div id="gc_drop" data-dojo-type="dijit/layout/ContentPane"> 41 <div id="search"></div> 42 <!-- </div> --> 43 </div> 44 </div> 41 function doBuffer(evt) { 42 map.graphics.clear(); 43 var symbol = new esri.symbol.SimpleMarkerSymbol(); 44 var graphic = new esri.Graphic(evt.mapPoint, symbol); 45 var params = new esri.tasks.BufferParameters(); 46 params.features = [ graphic ]; 47 // 8.05km = 5mi, etc. 48 params.distances = [ 8.05, 4.83, 1.61 ]; 49 params.unit = esri.tasks.BufferParameters.UNIT_KILOMETER; 50 params.bufferSpatialReference = new esri.SpatialReference({wkid: 102100}); 51 params.outSpatialReference = map.spatialReference; 52 gsvc.buffer(params, showBuffer); 53 } 45 54 46 <!-- Print --> 47 <div id="printer" class="fnbutton"> 48 <div data-dojo-type="dijit/TitlePane" data-dojo-props="title:'Print', closable:false, open:false"> 49 <div id="printWidget" data-dojo-type="dijit/layout/ContentPane"> 50 Select Orientation 51 <div id="printButton"></div> 52 </div> 53 </div> 54 </div> 55 function showBuffer(features) { 56 var symbol0 = new esri.symbol.SimpleFillSymbol( 57 esri.symbol.SimpleFillSymbol.STYLE_SOLID, 58 new esri.symbol.SimpleLineSymbol( 59 esri.symbol.SimpleLineSymbol.STYLE_SOLID, 60 new dojo.Color([230,230,0,0.90]), 2 61 ), 62 new dojo.Color([230,230,0,0.20]) 63 ); 64 var symbol1 = new esri.symbol.SimpleFillSymbol( 65 esri.symbol.SimpleFillSymbol.STYLE_SOLID, 66 new esri.symbol.SimpleLineSymbol( 67 esri.symbol.SimpleLineSymbol.STYLE_SOLID, 68 new dojo.Color([204,128,0,1]), 2 69 ), 70 new dojo.Color([204,128,0,0.33]) 71 ); 72 var symbol2 = new esri.symbol.SimpleFillSymbol( 73 esri.symbol.SimpleFillSymbol.STYLE_SOLID, 74 new esri.symbol.SimpleLineSymbol( 75 esri.symbol.SimpleLineSymbol.STYLE_SOLID, 76 new dojo.Color([204,0,0,0.90]), 2 77 ), 78 new dojo.Color([204,0,0,0.33]) 79 ); 80 features[0].setSymbol(symbol0); 81 map.graphics.add(features[0]); 82 features[1].setSymbol(symbol1); 83 map.graphics.add(features[1]); 84 features[2].setSymbol(symbol2); 85 map.graphics.add(features[2]); 86 disableBtn(false); 87 } 88 function clearMap() { 89 map.graphics.clear(); 90 disableBtn(true); 91 } 92 function disableBtn(x) { 93 document.getElementById("clearBtn").disabled=x; 94 } 95 dojo.addOnLoad(initialize); 96 </script> 97 </head> 55 98 56 <!-- Bookmarks widget inside ContentPane dropdown menu --> 57 <div id="bmark" class="fnbutton"> 58 <div data-dojo-type="dijit/TitlePane" data-dojo-props="title:'Bookmarks', closable:false, open:false"> 59 <div id="bookmarks-wrapper" data-dojo-type="dijit/layout/ContentPane"> 60 <div id="bookmarks"></div> 61 </div> 62 </div> 63 </div> 99 <body class="tundra" style="height: 100%;" onload="disableBtn(true)"> 100 <div id="map" style="width:100%; height:98%; border:1px solid #000;"> 101 <span id="status" style="position: absolute; z-index: 100; right: 10px; top: 15px;">Click a location on the map to draw <span style="color:rgb(230,230,0); font-weight:bolder; font-size:125%">5</span>, <span style="color:rgb(204,128,0); font-weight:bolder; font-size:125%">3</span>, and <span style="color:rgb(204,0,0); font-weight:bolder; font-size:125%">1</span> mile buffers. Click again on another location to buffer again. 102 <button id="clearBtn" onClick="clearMap()">Clear Buffers</button> 103 </span> 104 </div> 105 </body> 64 106 65 <!-- Basemap Gallery inside ContentPane Dropdown menu-->66 <div id="bmGallery" class="fnbutton">67 <div data-dojo-type="dijit/TitlePane" data-dojo-props="title:'Switch Basemap', closable:false, open:false">68 <div id="bmSwitch" data-dojo-type="dijit/layout/ContentPane">69 <div id="basemapGallery"></div>70 </div>71 </div>72 </div>73 74 <!-- default position for now -->75 <div id="LocateButton"></div>76 77 78 <div id="bufferIns" class="fnbutton">79 Click on the map to draw <span style="color:rgb(230,230,0); font-weight:bolder; font-size:125%">5</span>, <span style="color:rgb(204,128,0); font-weight:bolder; font-size:125%">3</span>, and <span style="color:rgb(204,0,0); font-weight:bolder; font-size:125%">1</span> mile buffers. Click another location to buffer again.</div>80 81 82 <!-- Configure dojo for asynchronous module loading -->83 <script type="text/javascript">84 var package_path = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/'));85 var dojoConfig = {86 async : true,87 parseOnLoad : false,88 89 packages : [{90 name : "agsjs",91 // Locally sourced, remember to update periodically 4/22/201492 location: package_path + "/vendor/agsjs"93 //if you want to host on your own server, download from94 //https://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/95 //location : "https://gmaps-utility-gis.googlecode.com/svn/trunk/agsjs/build/agsjs"96 }, {97 name: "modules",98 location: package_path + "/js"99 }, {100 name: "zesri",101 location: package_path +"/js"102 }]103 };104 </script>105 106 107 <script src="https://js.arcgis.com/3.8/"></script>108 109 <!--Calls the main javascript file for the page -->110 <script src="js/javascript.js"></script>111 112 </body>113 107 </html> -
adopters/nm-epht/trunk/src/main/webapps/WildFireSmoke/js/javascript.js
r11556 r12314 37 37 //esri.config.defaults.io.proxyUrl = "https://edacweb.unm.edu/proxy/proxy.php"; 38 38 esri.config.defaults.io.alwaysUseProxy = false; 39 39 //pleo-test of turning off corsDetction 40 //esriConfig.defaults.io.corsDetection = false; 41 42 require(["esri/config"], function(esriConfig) { 43 esriConfig.defaults.io.corsEnabledServers.push("tasks.arcgisonline.com"); 44 esriConfig.defaults.io.corsEnabledServers.push("js.arcgis.com"); 45 }); 46 40 47 /* 41 48 * Step: Specify the initial extent … … 395 402 396 403 function showBuffer(geometries) { 397 //console.log(JSON.stringify(geometries[1]));404 console.log(JSON.stringify(geometries[1])); 398 405 var i = 0; 399 406 dojo.forEach(geometries, function (geometry) {
Note: See TracChangeset
for help on using the changeset viewer.