-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathurlquery.js
More file actions
83 lines (79 loc) · 2.64 KB
/
Copy pathurlquery.js
File metadata and controls
83 lines (79 loc) · 2.64 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
var QueryString = function () {
// This function is anonymous, is executed immediately and
// the return value is assigned to QueryString!
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = pair[1];
// If second entry with this name
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]], pair[1] ];
query_string[pair[0]] = arr;
// If third or later entry with this name
} else {
query_string[pair[0]].push(pair[1]);
}
}
return query_string;
} ();
function checksinglecollection()
{
if(typeof(QueryString.productid) != "undefined")
{
hsdataset.vnir.productid = QueryString.productid.toLowerCase().replace("l_","s_");
hsdataset.vnir.collection = hsdataset.vnir.productid + "_" + pcversion + "_" + ptversion;
hsdataset.ir.productid = QueryString.productid.toLowerCase().replace("s_","l_");
hsdataset.ir.collection = hsdataset.ir.productid + "_" + pcversion + "_" + ptversion;
consolestring = "";
if(typeof(QueryString.console) != "undefined")
{
consolestring = decodeURIComponent(QueryString.console);
}
hyperspectral_load(consolestring);
}
}
function checkregion()
{
if(typeof(QueryString.region) != "undefined")
{
var options = $('#chooseregion option');
$.map(options ,function(option) {
if(option.value == QueryString.region)
{
$("#chooseregion").val(QueryString.region);
$('#chooseregion').change();
}
});
}
}
function checkmrdr()
{
if(typeof(QueryString.mrdr) != "undefined")
{
for(productid in mrdr)
{
if(QueryString.mrdr.toUpperCase() == productid)
{
loadmrdr(productid); //loadregion.js
}
}
}
}
function checklonlat()
{
if (typeof(QueryString.lat) != "undefined" && typeof(QueryString.lon) != "undefined")
{
if (typeof(QueryString.zoomlevel) != "undefined")
{
map.panTo(new OpenLayers.LonLat(QueryString.lon, QueryString.lat));
map.zoomTo(QueryString.zoomlevel);
} else
{
map.panTo(new OpenLayers.LonLat(QueryString.lon, QueryString.lat));
}
}
}