-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrols234.js
More file actions
176 lines (157 loc) · 6.09 KB
/
controls234.js
File metadata and controls
176 lines (157 loc) · 6.09 KB
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
//this function puts checks in boxes of selected layers for controls2,3,4
//is called from set_state() in map.php
function load_selections(){
var layers = parent.map.document.getElementById('layers_ajax').value;
//alert(layers);
if (layers.indexOf('muni') != -1){document.forms[0].muni.checked = true;}
if (layers.indexOf('zones') != -1){document.forms[0].zones.checked = true;}
if (layers.indexOf('island') != -1){document.forms[0].islands.checked = true;}
if (layers.indexOf('roads') != -1){document.forms[0].roads.checked = true;}
if (layers.indexOf('hexs') != -1){document.forms[0].hexs.checked = true;}
if (layers.indexOf('wtshds') != -1){document.forms[0].wtshds.checked = true;}
if (layers.indexOf('subwaters') != -1){document.forms[0].subwtshds.checked = true;}
if (layers.indexOf('ownership') != -1){
document.forms[0].steward[0].checked = true;
}else if (layers.indexOf('management') != -1){
document.forms[0].steward[1].checked = true;
}else if (layers.indexOf('status') != -1){
document.forms[0].steward[2].checked = true;
}else{
document.forms[0].steward[3].checked = true;
}
if (layers.indexOf('landcover') != -1){
document.forms[0].background[0].checked = true;
}else if (layers.indexOf('lcov2') != -1){
document.forms[0].background[1].checked = true;
}else if (layers.indexOf('elevation') != -1){
document.forms[0].background[2].checked = true;
}else{
document.forms[0].background[3].checked = true;
}
}
//this function puts checks in boxes of selected layers for controls
//is called from set_state() in map.php
function load_selections_1(){
var layers = parent.map.document.getElementById('layers').value;
if (layers.indexOf('muni') != -1){
document.forms[0].muni.checked = true;
document.forms[0].muni_tab2.checked = true;
}else{
document.forms[0].muni.checked = false;
document.forms[0].muni_tab2.checked = false;
}
if (layers.indexOf('zones') != -1){
document.forms[0].zones.checked = true;
document.forms[0].life_zone_tab2.checked = true;
}else{
document.forms[0].zones.checked = false;
document.forms[0].life_zone_tab2.checked = false;
}
if (layers.indexOf('island') != -1){
document.forms[0].islands.checked = true;
document.forms[0].island_tab2.checked = true;
}else{
document.forms[0].islands.checked = false;
document.forms[0].island_tab2.checked = false;
}
if (layers.indexOf('wtshds') != -1){
document.forms[0].wtshds.checked = true;
document.forms[0].wtshd_tab2.checked = true;
}else{
document.forms[0].wtshds.checked = false;
document.forms[0].wtshd_tab2.checked = false;
}
if (layers.indexOf('subwaters') != -1){
document.forms[0].subwtshds.checked = true;
document.forms[0].subwtshd_tab2.checked = true;
}else{
document.forms[0].subwtshds.checked = false;
document.forms[0].subwtshd_tab2.checked = false;
}
if (layers.indexOf('roads') != -1){document.forms[0].roads.checked = true;}
if (layers.indexOf('hexs') != -1){document.forms[0].hexs.checked = true;}
if (layers.indexOf('ownership') != -1){
document.forms[0].steward[0].checked = true;
document.forms[0].owner_tab2.checked = true;
document.forms[0].manage_tab2.checked = false;
}else if (layers.indexOf('management') != -1){
document.forms[0].steward[1].checked = true;
document.forms[0].manage_tab2.checked = true;
document.forms[0].owner_tab2.checked = false;
}else if (layers.indexOf('status') != -1){
document.forms[0].steward[2].checked = true;
}else{
document.forms[0].steward[3].checked = true;
document.forms[0].owner_tab2.checked = false;
document.forms[0].manage_tab2.checked = false;
}
if (layers.indexOf('landcover') != -1){
document.forms[0].background[0].checked = true;
}else if (layers.indexOf('lcov2') != -1){
document.forms[0].background[1].checked = true;
}else if (layers.indexOf('elevation') != -1){
document.forms[0].background[2].checked = true;
}else{
document.forms[0].background[3].checked = true;
}
}
function categories(){
//alert('hello');
if(document.forms.fm2.fed.checked || document.forms.fm2.state.checked || document.forms.fm2.nsglobal.checked ){
//alert('hello');
document.forms.fm2.species[1].checked = true;
}else{
document.forms.fm2.species[0].checked = true;
}
}
//function polls checked layer selections, puts result on parent.map and submits
function change_categories(){
parent.data.location = 'dummy.html';
parent.functions.location = 'dummy.html';
document.forms[1].action = 'controls3.php';
document.forms[1].target = 'controls';
document.forms[1].submit();
parent.map.document.forms.fm1.species_layer.value = '';
parent.map.document.forms.fm1.zoom.value = '1';
parent.map.document.forms.fm1.submit();
}
function functions_action(){
var pathname = window.location.pathname;
if(document.forms[1].mode[0].checked){
parent.functions.location = pathname.replace("controls4.php", "single.php");
}
if(document.forms[1].mode[1].checked){
parent.functions.location = pathname.replace("controls4.php", "multiple.php");
}
}
function lc_report(){
// window.open("","report","toolbar=no, menubar=no, scrollbars");
window.open("","report","toolbar=no, menubar=no, scrollbars");
parent.map.document.forms.fm2.target = 'report';
parent.map.document.forms.fm2.report.value = 'landcover';
parent.map.document.forms.fm2.submit();
}
function manage_report(){
window.open("","report","toolbar=no, menubar=no, scrollbars");
parent.map.document.forms.fm2.target = 'report';
parent.map.document.forms.fm2.report.value = 'management';
parent.map.document.forms.fm2.submit();
}
function owner_report(){
window.open("","report","toolbar=no, menubar=no, scrollbars");
parent.map.document.forms.fm2.target = 'report';
parent.map.document.forms.fm2.report.value = 'owner';
parent.map.document.forms.fm2.submit();
}
function status_report(){
window.open("","report","toolbar=no, menubar=no, scrollbars");
parent.map.document.forms.fm2.target = 'report';
parent.map.document.forms.fm2.report.value = 'status';
parent.map.document.forms.fm2.submit();
}
function close_gears(){
var but_on = parent.gears.document.getElementById("cont3").style.display;
if (but_on == 'none'){
parent.gears.close();
}
}