forked from USGS-WiM/BLTPublic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapper.html
478 lines (438 loc) · 21.8 KB
/
mapper.html
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Bulletins Live - EPA</title>
<meta http-equiv="X-UA-Compatible" content="IE=9">
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!--<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9">-->
<!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<!-- ArcGIS Javascript API and dojo theme references -->
<link rel="stylesheet" href="https://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dijit/themes/claro/claro.css"/>
<link rel="stylesheet" href="https://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/esri/css/esri.css" />
<!-- Style sheets -->
<link rel="stylesheet" media="screen" type="text/css" href="styles/main.css"/>
<link rel="stylesheet" media="only screen and (max-device-width: 480px)" type="text/css" href="styles/handheld.css"/>
<link rel="stylesheet" type="text/css" href="wim/css/wim.css"/>
<link rel="stylesheet" type="text/css" href="modules/css/modules.css"/>
<link rel="stylesheet" type="text/css" href="styles/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="styles/introjs.css" />
<script type="text/javascript">
var basePath = location.pathname.replace(/\/[^/]+$/, "");
if (basePath.substr( basePath.length - 1, 1) != "/") { basePath += "\/";}
var dojoConfig = {
parseOnLoad: true,
packages: [
{ name: "modules", location: basePath + "modules" },
{ name: "wim", location: basePath + "wim"}
]
};
</script>
<!-- ArcGIS Javascript API reference -->
<script defer src="https://serverapi.arcgisonline.com/jsapi/arcgis/3.5/" type="text/javascript"></script>
<!-- references to js for DatePicker -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script defer src="js/basemap.js" type="text/javascript"></script>
<script defer src="js/geocoder.js" type="text/javascript"></script>
<script defer src="js/geolocator.js" type="text/javascript"></script>
<!-- Mapper js file -->
<script src="js/jsPDF.js" type="text/javascript"></script>
<script src="js/jspdf.debug.js" type="text/javascript"></script>
<script src="js/jspdf.min.js" type="text/javascript"></script>
<script src="js/intro.js" type="text/javascript"></script>
<script src="js/adler32cs.js" type="text/javascript"></script>
<script src="js/FileSaver.js" type="text/javascript"></script>
<script src="js/jspdf.plugin.table.js" type="text/javascript"></script>
<script src="js/jspdf.plugin.cell.js" type="text/javascript"></script>
<script src="js/html2canvas.min.js" type="text/javascript"></script>
<script src="js/jspdf.plugin.addhtml.js" type="text/javascript"></script>
<script src="js/jspdf.plugin.addimage.js" type="text/javascript"></script>
<script src="js/downloadify.min.js" type="text/javascript"></script>
<script src="js/date.js" type="text/javascript"></script>
<script defer src="js/BLT.js" type="text/javascript"></script>
</head>
<body class="claro">
<div id="appWindow" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline',gutters:false" style="width:100%;height:100%;margin:0;">
<!--<div id="topBar" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'" style="overflow:hidden">
</div>-->
<div id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'" style="padding:0; width:60%">
<!--<div id="refreshScreen" data-dojo-type="wim.RefreshScreen" data-dojo-props="attachedMapID: 'map'"></div>-->
<!--Dialog for no Limiations within map extent -->
<script type="text/javascript">
$(function() {
$( "#dialog-confirm" ).dialog({
dialogClass: 'dialog_Style',
resizable: false,
height:180,
modal: true,
autoOpen: false,
buttons: [
{
text: "Printable Bulletin",
"class": 'printButton',
click: function() {
$(this).dialog("close");
//redirect to new tab with formatted pdf to print
LimitationsPDF("None");
}
},
{
text: "Cancel",
"class": 'cancelPrintButton',
click: function() {
$( this ).dialog( "close" );
}
}
]
});
});
</script>
<style type="text/css">
.dialog_Style {
font-family: 'BryantRegular';
}
.dialog_Style .ui-widget-header {
background: #369;
color: white;
}
.cancelPrintButton {
height: 35px !important;
margin: 0;
}
.printButton {
height: 35px !important;
margin: 0;
}
.printButton .ui-button-text, .cancelPrintButton .ui-button-text {
font-family: 'BryantRegular';
font-size: smaller;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{
text-align: center !important;
}
</style>
<div id="dialog-confirm" title="No Limitations">
<div>No limitation within map view.</div>
</div>
<!-- basemap selection tool -->
<div id="basemapSelector">
<div data-dojo-type="dijit.TitlePane" data-dojo-props="title:'<img src=\'images/basemap_new_small.png\'> Basemaps', closable:false, open:false">
<div data-dojo-type="dijit.layout.ContentPane" style="width:380px; height:360px; overflow:auto;">
<div id="basemapGallery" ></div>
</div>
</div>
</div>
<div id="currentDate" style="padding:5px"><label style="color:#E7E4CE">Current View: <span id="currentView" style="color:#F37A49"><b></b></span></label></div>
<div id="extentSelector" data-dojo-type="wim.ExtentNav" data-dojo-props="attachedMapID: 'map'"></div>
<div id="latLngScaleBar"></div>
<!-- geocoder -->
<div id="geocodeBar" title="Example search criteria:
-City: New York, NY,
-County: New York County, NY,
-Landmark: Statue of Liberty, NY,
-Zip code: zip code 10001,
-Full address: Statue of Liberty National Monument, Liberty Island, New York, NY 10004">
<input id="geocode" type="text" name="search" onKeyPress="enterKeyLocate(event)" placeholder="Find address or place" />
<input id="searchIcon" type="image" src="images/searchIcon.png" alt="Submit" onClick="locate()" />
</div>
<div id="sliderWrapper"> <!-- slider divs -->
<div id="sliderOpacity"
data-dojo-type="dijit/form/HorizontalSlider"
data-dojo-props="showButtons:'true', value:50, minimum:0, maximum:100, discreteValues:101, intermediateChanges:true">
<ol id="sliderLabels"
data-dojo-type="dijit/form/HorizontalRuleLabels"
data-dojo-props="container:'topDecoration'">
<li>0%</li>
<li><span style="text-decoration:underline">Opacity</span></li>
<li>100%</li>
</ol>
</div>
</div> <!-- end slider divs -->
<div id="userTools">
<div id="availableLayers" data-dojo-type="wim.CollapsingContainer" data-dojo-props="title:'Map Layers'">
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'Click to toggle'">
<div id="toggle"></div>
</div>
<div id="legendHeader">Explanation</div>
<div id="legend" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'Explanation',selected:true">
<div id="legendDiv"></div>
</div>
</div>
</div>
</div>
<div id="sideBar" data-dojo-type="dijit.layout.ContentPane" style="width:40%;overflow:hidden !important" data-dojo-props="region:'right'">
<div id="searchContainer" style="height:inherit">
<div id="loading"><div id="loadingcontent"><p id="loadingspinner" style=""><img src='images/LoadingOrange110.gif' /></p></div></div>
<div id="tabs" dojoType="dijit.layout.TabContainer" style="width:100%;height:100%;">
<div id="tabOne" data-dojo-type="dijit.layout.ContentPane" title="INSTRUCTIONS">
<img style="display:none" id="mapExtentImg" src=""></img>
<label class='searchInstructions'>Protecting Endangered Species</label>
</br>
<!--Directions-->
<div>
<p><b>Directions:</b> This search tool provides Pesticide Use Limitation Areas (PULAs) for pesticide active ingredients and products with active Bulletins. To access Endangered Species Protection Bulletins from this search tool:
</p>
</div>
<!--Filter-->
<div>
<ol type="1">
<li>Zoom to your intended pesticide application area:</li>
<ol type="a">
<li>Manually zoom to a location by dragging the map to your location and using the "+" and "-" buttons to zoom in and out, or</li>
<li>Enter your intended pesticide application area into the Location Search Tool to automatically zoom to that location.</li>
</ol>
<li>Select your Application Month.</li>
<li>Optional: Refine your search by entering a specific active ingredient or product and click the "Search" button. (Default is all active ingredients and products).</li>
<li>Click on the PULA within your intended pesticide application area to activate the Results Tab with the associated limitations and print your Bulletin. If no PULA is present, click the "Search" button to activate the "No Limitations" dialog box and print your Bulletin.</li>
<li>To complete an additional search, use the "Clear All" button to clear your current results.</li>
</ol>
</div>
<!--Dates-->
<!-- start of script and style for Product -->
<script type="text/javascript">
$(function () {
Date.prototype.today = function () {
return (this.getMonth() + 1) + "/" + this.getDate() + "/" + this.getFullYear()
};
var newDate = new Date();
var datetime = newDate.today();
var cache = {};
$('#prods').autocomplete({
minLength: 3,
source: function (request, response) {
var product = request.term;
if (product in cache) {
response(cache[product]);
return;
}
$.get("../BLTServices/Products.json?publishedDate=" + datetime, request, function (data, status, xhr) {
var dataTest = $.map( data, function(item) {//}) $('PRODUCT', data).map(function () {
return {
value: item.product_registration_number,// $("product_registration_number", this).text(),
label: item.product_name + " [" + item.product_registration_number + "]",// $("product_name", this).text() + " [" + $("product_registration_number", this).text() + "]",
id: item.product_id// $("product_id", this).text()
};
});
cache[product] = dataTest;
response(dataTest);
}, "json");
},
position:
{ my : "left top", at: "left bottom" },
select: function (event, ui) {
var name = ui.item.label;
$('#prods').val(name);
$("#hiddenProdID").val(ui.item.id);
//clear product registration number
$('#prodReg').val("");
$("#hiddenProdRegID").val("");
//and AI
$("#AISelectInput").val("");
return false;
},
change: function (event, ui) {
if (ui.item == null) {
$("#hiddenProdID").val("");
}
else {
$("#hiddenProdID").val(ui.item.id);
}
}
});
//product registration number needs more characters before searching
$('#prodReg').autocomplete({
minLength: 7,
source: function (request, response) {
var product = request.term;
if (product in cache) {
response(cache[product]);
return;
}
$.get("../BLTServices/Products.json?publishedDate=" + datetime, request, function (data, status, xhr) {
if (data.length <= 0){//.childNodes[0].textContent == "") {
alert("no match");
$("#prodReg").val("");
$("#prodReg").removeClass("ui-autocomplete-loading");
}
else {
var dataTest = $.map( data, function(item) {//$('product', data).map(function () {
return {
value: item.product_registration_number, //$("product_registration_number", this).text(),
label: item.product_name + " [" + item.product_registration_number + "]",
id: item.product_id
};
});
cache[product] = dataTest;
response(dataTest);
$("#prodReg").removeClass("ui-autocomplete-loading");
}
}, "json");
},
position:
{ my : "left top", at: "left bottom" },
select: function (event, ui) {
var name = ui.item.label;
$('#prodReg').val(name);
$("#hiddenProdRegID").val(ui.item.id);
//clear Product Name result
$('#prods').val("");
$("#hiddenProdID").val("");
//and AI
$("#AISelectInput").val("");
return false;
},
change: function (event, ui) {
if (ui.item == null) {
$("#hiddenProdRegID").val("");
}
else {
$("#hiddenProdRegID").val(ui.item.id);
}
}
});
});
</script>
<style type="text/css">
.ui-autocomplete-loading
{
background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat;
}
.ui-autocomplete
{
max-height: 100px;
overflow-y: auto;
overflow-x: hidden;
}
.ui-autocomplete-input
{
font-size: 11pt !important;
width: 100%;
}
ul.ui-autocomplete.ui-menu
{
width: 397px !important;
font-size: 10pt;
}
html .ui-autocomplete
{
height: 100px;
}
#prods::-webkit-input-placeholder
{ /* WebKit browsers */
font-size: x-small;
padding-top: 1px;
}
#prods:-moz-placeholder
{ /* Mozilla Firefox 4 to 18 */
font-size: x-small;
padding-top: 1px;
}
#prods::-moz-placeholder
{ /* Mozilla Firefox 19+ */
font-size: x-small;
padding-top: 1px;
}
#prods:-ms-input-placeholder
{ /* Internet Explorer 10+ */
font-size: x-small;
padding-top: 1px;
}
#prodReg::-webkit-input-placeholder
{ /* WebKit browsers */
font-size: x-small;
padding-top: 1px;
}
#prodReg:-moz-placeholder
{ /* Mozilla Firefox 4 to 18 */
font-size: x-small;
padding-top: 1px;
}
#prodReg::-moz-placeholder
{ /* Mozilla Firefox 19+ */
font-size: x-small;
padding-top: 1px;
}
#prodReg:-ms-input-placeholder
{ /* Internet Explorer 10+ */
font-size: x-small;
padding-top: 1px;
}
</style>
<!-- End of script and style for Product -->
<div style="margin-bottom:7px">
<label>Application Month:</label>
<select class="InstrSelects" id="AppMonthYr"></select>
</div>
<div style="margin-bottom:7px">
<label>Active Ingredient:</label>
<select class="InstrSelects" id="AISelectInput" onchange="AIChanged();"></select>
</div>
<div id="ProductSection">
<div style="font-family:BryantRegular;font-size:1em" class="ui-widget">
<label>Product Name:</label>
<input style="width:98%" placeholder="Start typing Product name" id="prods" />
<input type="hidden" id="hiddenProdID" />
</div>
<div style="text-align:center;margin-top:7px;">-- OR --</div>
<div style="font-family:BryantRegular;font-size:1em" class="ui-widget">
<label>Product Registration Number:</label>
<input style="width:98%" placeholder="Type Product Registration #" id="prodReg" />
<input type="hidden" id="hiddenProdRegID" />
</div>
<br/>
</div>
<div class="searchButtonDiv">
<button class='searchButtons' onclick="SubmitClick();" id="siteSubmitButton">SEARCH</button>
<button class='clearButtons' onclick="ClearClick();" id="siteclearButton">CLEAR ALL</button>
</div>
</div> <!--END TAB ONE CONTENT PANE-->
<!--TAB TWO CONTENT PANE-->
<div id="tabTwo" data-dojo-type="dijit.layout.ContentPane" title="RESULTS">
<!--Effective Date-->
<h2><span>Effective Date: </span><span id="EffectiveDate"></span>
<!--Limitation Table-->
<!--List<PULALimitation> pubPULAModel = ViewData["PULAlimitationList"] as List<PULALimitation>; }-->
<h3 style="font-weight:bold"></h3>
<div id="theTables">
<h3>Pesticide Use Limitation Summary Table</h3>
<table id="ResultsTable" style="width:100%; display:block; overflow:auto">
<thead>
<tr>
<th style="width:30%;text-align:left;border:#E7E4CE solid 1px;padding:4px">AI/Product</th>
<th style="width:21%;text-align:left;border:#E7E4CE solid 1px;padding:4px">Use</th>
<th style="width:21%;text-align:left;border:#E7E4CE solid 1px;padding:4px">App Method</th>
<th style="width:20%;text-align:left;border:#E7E4CE solid 1px;padding:4px">Formulation</th>
<th style="border:#E7E4CE solid 1px;padding:4px">Code</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<br clear='all' />
<div id="ThisCodeTable">
<h3>Codes and Limitations Table</h3>
<table id="CodeTable" border-collapse:"collapse" style="display:block; overflow:auto">
<thead>
<tr>
<th style="border:#E7E4CE solid 1px;width:10%;text-align:left;padding:4px">Code</th>
<th style="border:#E7E4CE solid 1px;text-align:left;padding:4px">Limitation</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div style="text-align:center">
<button class="PrintLimitationButton" type="button" onclick='LimitationsPDF("Limits");' id="printPDFLimitButton">Printable Bulletin</button>
</div><!--PrintLimitationPDF();-->
</div> <!--END TAB TWO CONTENT PANE-->
</div> <!--END TAB CONTAINER-->
</div> <!--END SEARCH CONTAINER-->
</div> <!-- end of sidebar -->
</div>
</body>
</html>