-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.js
572 lines (524 loc) · 22 KB
/
map.js
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
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
map = new OpenLayers.Map("demoMap");
map.addLayer(new OpenLayers.Layer.OSM());
var markers = new OpenLayers.Layer.Markers("Station Locations");
map.addLayer(markers);
var filedata = "";
var allTextLines;
var request = new XMLHttpRequest();
var centerMarkerLayer = new OpenLayers.Layer.Markers("Center Marker");
map.addLayer(centerMarkerLayer);
request.open('GET', 'https://koppencalc.oijon.net/extracted-data.csv')
request.send(null)
request.onreadystatechange = function () {
if (request.readyState === 4 && request.status === 200) {
var type = request.getResponseHeader('Content-Type');
if (type.indexOf("text") !== 1) {
var filedata = request.responseText;
allTextLines = filedata.split(/\r?\n|\r|\n/g);
}
}
}
map.zoomToMaxExtent();
map.events.register("move", map, function() {
updateLonLat();
calcKoppen();
});
function moveCenterMarker(lng, lat) {
map.removeLayer(map.getLayersByName("Center Marker")[0]);
var centerMarkerLayer = new OpenLayers.Layer.Markers("Center Marker");
map.addLayer(centerMarkerLayer);
var lonLat = new OpenLayers.LonLat(lng, lat).transform(
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
map.getProjectionObject());
var marker = new OpenLayers.Marker(lonLat);
var size = new OpenLayers.Size(10,10);
var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
var icon = new OpenLayers.Icon('img/crosshair.png', size, offset);
centerMarkerLayer.addMarker(new OpenLayers.Marker(lonLat, icon));
}
function calcKoppen() {
// find closest station
let x1 = document.getElementById('long').value;
let y1 = document.getElementById('lat').value;
var distance = 9999999999;
var closestStation = -1;
for (let i = 0; i < allTextLines.length; i++) {
var entries = allTextLines[i].split(',');
let x2 = entries[2];
let y2 = entries[1];
let newdistance = Math.sqrt(Math.pow((x2 - x1), 2) + Math.pow((y2 - y1), 2));
if (newdistance < distance) {
distance = newdistance;
closestStation = i;
}
}
// calculate köppen from climate of nearest station
// TODO: average out the 3 closest stations to get a more accurate climate
var climatedata = allTextLines[closestStation];
var splitData = climatedata.split(",");
var koppenCode = "";
var temps = [];
var mmOfPrecipitation = [];
var avgtemp = splitData[3];
var totalPrecip = splitData[16];
temps.push(splitData[4], splitData[5], splitData[6], splitData[7], splitData[8], splitData[9], splitData[10], splitData[11], splitData[12],
splitData[13], splitData[14], splitData[15]);
mmOfPrecipitation.push(splitData[17], splitData[18], splitData[19], splitData[20], splitData[21], splitData[22], splitData[23], splitData[24], splitData[25],
splitData[26], splitData[27], splitData[28]);
var distKM = distance * 111.1;
if (parseFloat(distKM) < 500) {
console.log("-----");
// Group A: Tropical Climates
var hot = true;
var canBeTropical = true;
for (let i = 0; i < temps.length; i++) {
if (parseFloat(temps[i]) < 18) {
hot = false;
canBeTropical = false;
}
}
var canBeAf = true;
var tropicalPrecipitationMin = parseFloat(100 - (totalPrecip / 25));
if (hot) {
console.log("Hot enough to be tropical.");
for (let i = 0; i < mmOfPrecipitation.length; i++) {
if (parseFloat(mmOfPrecipitation[i]) < 60) {
canBeAf = false;
console.log("Too dry for Af, not neccessarially for A.");
break;
}
if (parseFloat(mmOfPrecipitation[i]) < tropicalPrecipitationMin) {
canBeTropical = false;
console.log("Cannot be tropical, too dry.");
break;
}
}
} else {
console.log("Cannot be tropical, too cold.");
}
// Definetely tropical at this point, check if Af, Am, As, or Aw
if (canBeTropical) {
console.log("Wet enough to be tropical. Köppen climate is in group A...");
var driestMonth = -1;
var driestPrecipAmount = 999999;
for (let i = 0; i < mmOfPrecipitation.length; i++) {
if (parseFloat(mmOfPrecipitation[i]) < driestPrecipAmount) {
driestMonth = i;
driestPrecipAmount = parseFloat(mmOfPrecipitation[i]);
}
}
if (canBeAf) {
koppenCode = "Af";
console.log("If it can be Af, it must be Af.");
} else if (parseFloat(document.getElementById('lat').value) < 0) { // determines if north or south of the equator
// south of equator
console.log("South of equator.");
if (driestMonth == 5) {
// not the best way to determine monsoon climates, but the dries month is right after the winter solstice...
console.log("Driest month is one with winter solstice. (" + driestMonth + ") Is Am.");
koppenCode = "Am";
}
else if (4 < driestMonth & driestMonth <= 9) {
// including a bit of spring and fall here just in case
console.log("Driest month is one in winter. (" + (driestMonth + 1) + ") Is Aw.");
koppenCode = "Aw";
} else {
console.log("Driest month is one in summer. (" + (driestMonth + 1) + ") Is As.");
koppenCode = "As";
}
} else {
// north of equator
console.log("North of equator.");
if (driestMonth == 11) {
// not the best way to determine monsoon climates, but the dries month is right after the winter solstice...
console.log("Driest month is one with winter solstice. (" + (driestMonth + 1) + ") Is Am.");
koppenCode = "Am";
}
else if (4 < driestMonth & driestMonth <= 9) {
// including a bit of spring and fall here just in case
console.log("Driest month is one in summer. (" + (driestMonth + 1) + ") Is As.");
koppenCode = "As";
} else {
console.log("Driest month is one in winter. (" + (driestMonth + 1) + ") Is Aw.");
koppenCode = "Aw";
}
}
}
// Group B: arid climates
littlePrecipThreshold = parseFloat(avgtemp) * 20; // defined here, also used for group E
// equator specific threshold
if (parseFloat(document.getElementById('lat').value) < 0) {
springSummerPrecip = parseFloat(mmOfPrecipitation[9] + mmOfPrecipitation[10] + mmOfPrecipitation[11] + mmOfPrecipitation[0] + mmOfPrecipitation[1] + mmOfPrecipitation[2]);
var percentSpringSummerPrecip = parseFloat(parseFloat(springSummerPrecip) / parseFloat(totalPrecip)) * 100;
if (percentSpringSummerPrecip >= 70) {
littlePrecipThreshold += 280;
} else if (percentSpringSummerPrecip >= 30) {
littlePrecipThreshold += 140;
}
} else {
springSummerPrecip = parseFloat(mmOfPrecipitation[3] + mmOfPrecipitation[4] + mmOfPrecipitation[5] + mmOfPrecipitation[6] + mmOfPrecipitation[7] + mmOfPrecipitation[8]);
var percentSpringSummerPrecip = (springSummerPrecip / totalPrecip) * 100;
if (percentSpringSummerPrecip >= 70) {
littlePrecipThreshold += 280;
} else if (percentSpringSummerPrecip >= 30) {
littlePrecipThreshold += 140;
}
}
hotEnoughForB = false;
for (let i = 0; i < temps.length; i++) {
if (parseFloat(temps[i]) > 10) {
hotEnoughForB = true;
}
}
if (parseFloat(totalPrecip) <= parseFloat(littlePrecipThreshold)) {
console.log("Dry enough for B.");
if (hotEnoughForB) {
console.log("Hot and dry. Is B.");
// at this point its def B
if ((parseFloat(totalPrecip)) <= (littlePrecipThreshold / 2)) {
// BW
console.log("Very dry. Is BW. (" + totalPrecip + " / 2 <= " + littlePrecipThreshold + ")");
if (parseFloat(avgtemp) > 18) {
console.log("Avg temp above 18 Celcius. Is BWh. (" + avgtemp + "C)");
koppenCode = "BWh";
} else {
console.log("Avg temp below 18 Celcius. Is BWk. (" + avgtemp + "C)");
koppenCode = "BWk";
}
} else {
// BS
console.log("Dry, but not very dry. Is BS.");
if (avgtemp > 18) {
console.log("Avg temp above 18 Celcius. Is BSh.");
koppenCode = "BSh";
} else {
console.log("Avg temp below 18 Celcius. Is BSk.");
koppenCode = "BSk";
}
}
}
}
if (koppenCode == "") {
// Group C: Temperate climates
// Also includes Group D: Continental climates
var coldestMonth = 999;
for (let i = 0; i < temps.length; i++) {
if (parseFloat(temps[i]) < coldestMonth) {
coldestMonth = parseFloat(temps[i]);
}
}
var hottestMonth = -999;
for (let i = 0; i < temps.length; i++) {
if (parseFloat(temps[i]) > hottestMonth) {
hottestMonth = temps[i];
}
}
var driestMonth = 999;
for (let i = 0; i < mmOfPrecipitation.length; i++) {
if (parseFloat(mmOfPrecipitation[i]) < driestMonth) {
driestMonth = parseFloat(mmOfPrecipitation[i]);
}
}
var wettestMonth = -999;
for (let i = 0; i < mmOfPrecipitation.length; i++) {
if (parseFloat(mmOfPrecipitation[i]) > wettestMonth) {
wettestMonth = parseFloat(mmOfPrecipitation[i]);
}
}
var monthsAbove10 = 0;
for (let i = 0; i < temps.length; i++) {
if (parseFloat(temps[i]) > 10) {
monthsAbove10 += 1;
}
}
// using -3C as cutoff, some use 0C
// used for w/s/f distinction
var wettestSummer = -1;
var driestSummer = 9999;
var wettestWinter = -1;
var driestWinter = 9999;
winterAvgPrec = [];
summerAvgPrec = [];
if (parseFloat(document.getElementById('lat').value) < 0) {
console.log("South of equator");
summerAvgPrec.push(mmOfPrecipitation[9], mmOfPrecipitation[10], mmOfPrecipitation[11], mmOfPrecipitation[0], mmOfPrecipitation[1], mmOfPrecipitation[2]);
winterAvgPrec.push(mmOfPrecipitation[3], mmOfPrecipitation[4], mmOfPrecipitation[5], mmOfPrecipitation[6], mmOfPrecipitation[7], mmOfPrecipitation[8]);
} else {
console.log("North of equator");
winterAvgPrec.push(mmOfPrecipitation[9], mmOfPrecipitation[10], mmOfPrecipitation[11], mmOfPrecipitation[0], mmOfPrecipitation[1], mmOfPrecipitation[2]);
summerAvgPrec.push(mmOfPrecipitation[3], mmOfPrecipitation[4], mmOfPrecipitation[5], mmOfPrecipitation[6], mmOfPrecipitation[7], mmOfPrecipitation[8]);
}
for (let i = 0; i < summerAvgPrec.length; i++) {
if (summerAvgPrec[i] > wettestSummer) {
wettestSummer = summerAvgPrec[i];
}
if (winterAvgPrec[i] > wettestWinter) {
wettestWinter = winterAvgPrec[i];
}
if (summerAvgPrec[i] < driestSummer) {
driestSummer = summerAvgPrec[i];
}
if (winterAvgPrec[i] < driestWinter) {
driestWinter = winterAvgPrec[i];
}
}
if (coldestMonth >= -3) {
console.log("Temps barely (if at all) averages below freezing. Köppen climate is in group C...");
if (hottestMonth > 22 & monthsAbove10 >= 4) {
console.log("Hottest month averages above 22C. Ending letter must be a. (" + hottestMonth + "C)");
if (parseFloat(wettestSummer / 10) > driestWinter & driestMonth < 40) {
console.log("Wettest summer month (" + wettestSummer + ") is over 10x as wet as the driest winter month (" + driestWinter + "). Cwa.");
koppenCode = "Cwa";
} else if (parseFloat(wettestWinter / 3) > driestSummer & driestMonth < 40) {
console.log("Wettest winter month (" + wettestWinter + ") is over 3x as wet as the driest summer month (" + driestSummer + "). Csa.");
koppenCode = "Csa";
} else {
console.log("No significant precipitation change by season. Cfa.");
koppenCode = "Cfa";
}
} else {
console.log("Hottest month averages below 22C. Ending letter must be b or c. (" + hottestMonth + "C)");
if (monthsAbove10 >= 4) {
console.log("4 or more months averaging above 10c. (" + monthsAbove10 + ") Ending letter must be b.");
if (parseFloat(wettestSummer / 10) > driestWinter & driestMonth < 40) {
console.log("Wettest summer month (" + wettestSummer + ") is over 10x as wet as the driest winter month (" + driestWinter + "). Cwb.");
koppenCode = "Cwb";
} else if (parseFloat(wettestWinter / 3) > driestSummer & driestMonth < 40) {
console.log("Wettest winter month (" + wettestWinter + ") is over 3x as wet as the driest summer month (" + driestSummer + "). Csb.");
koppenCode = "Csb";
} else {
console.log("No significant precipitation change by season. Cfb.");
koppenCode = "Cfb";
}
} else {
console.log("3 or less months averaging above 10c. (" + monthsAbove10 + ") Ending letter must be c.");
if (parseFloat(wettestSummer / 10) > driestWinter & driestMonth < 40) {
console.log("Wettest summer month (" + wettestSummer + ") is over 10x as wet as the driest winter month (" + driestWinter + "). Cwc.");
koppenCode = "Cwc";
} else if (parseFloat(wettestWinter / 3) > driestSummer & driestMonth < 40) {
console.log("Wettest winter month (" + wettestWinter + ") is over 3x as wet as the driest summer month (" + driestSummer + "). Csc.");
koppenCode = "Csc";
} else {
console.log("No significant precipitation change by season. Cfc.");
koppenCode = "Cfc";
}
}
}
} else if (hottestMonth >= 10) {
console.log("At least one monthly temp averages below freezing, and the hottest month gets above 10C. Köppen climate is in group D...");
if (hottestMonth >= 22) {
console.log("Hottest month averages above 22C. Ending letter must be a. (" + hottestMonth + "C)");
if (parseFloat(wettestSummer / 10) > driestWinter & driestMonth < 40) {
console.log("Wettest summer month (" + wettestSummer + ") is over 10x as wet as the driest winter month (" + driestWinter + "). Dwa.");
koppenCode = "Dwa";
} else if (parseFloat(wettestWinter / 3) > driestSummer & driestMonth < 40) {
console.log("Wettest winter month (" + wettestWinter + ") is over 3x as wet as the driest summer month (" + driestSummer + "). Dsa.");
koppenCode = "Dsa";
} else {
console.log("No significant precipitation change by season. Dfa.");
koppenCode = "Dfa";
}
} else {
console.log("Hottest month averages below 22C. Ending letter must be b, c, or d. (" + hottestMonth + "C)");
if (monthsAbove10 >= 4) {
console.log("4 or more months (" + monthsAbove10 + ") above 10C. Ending letter must be b.");
if (parseFloat(wettestSummer / 10) > driestWinter & driestMonth < 40) {
console.log("Wettest summer month (" + wettestSummer + ") is over 10x as wet as the driest winter month (" + driestWinter + "). Dwb.");
koppenCode = "Dwb";
} else if (parseFloat(wettestWinter / 3) > driestSummer & driestMonth < 40) {
console.log("Wettest winter month (" + wettestWinter + ") is over 3x as wet as the driest summer month (" + driestSummer + "). Dsb.");
koppenCode = "Dsb";
} else {
console.log("No significant precipitation change by season. Dfb.");
koppenCode = "Dfb";
}
} else if (coldestMonth < -38) {
console.log("Coldest month gets below -38C. Ending letter must be d.");
if (parseFloat(wettestSummer / 10) > driestWinter & driestMonth < 40) {
console.log("Wettest summer month (" + wettestSummer + ") is over 10x as wet as the driest winter month (" + driestWinter + "). Dwd.");
koppenCode = "Dwd";
} else if (parseFloat(wettestWinter / 3) > driestSummer & driestMonth < 40) {
console.log("Wettest winter month (" + wettestWinter + ") is over 3x as wet as the driest summer month (" + driestSummer + "). Dsd.");
koppenCode = "Dsd";
} else {
console.log("No significant precipitation change by season. Dfd.");
koppenCode = "Dfd";
}
} else {
console.log("1-3 months (" + monthsAbove10 + ") above 10C, with all above -38C. Ending letter must be c.");
if (parseFloat(wettestSummer / 10) > driestWinter & driestMonth < 40) {
console.log("Wettest summer month (" + wettestSummer + ") is over 10x as wet as the driest winter month (" + driestWinter + "). Dwc.");
koppenCode = "Dwc";
} else if (parseFloat(wettestWinter / 3) > driestSummer & driestMonth < 40) {
console.log("Wettest winter month (" + wettestWinter + ") is over 3x as wet as the driest summer month (" + driestSummer + "). Dsc.");
koppenCode = "Dsc";
} else {
console.log("No significant precipitation change by season. Dfc.");
koppenCode = "Dfc";
}
}
}
} else {
console.log("Hottest month is below 10C. (" + hottestMonth + "C) Köppen climate is in group E...");
if (hottestMonth > 0) {
console.log("Hottest month is above freezing. (" + hottestMonth + "C) Is ET.");
koppenCode = "ET";
} else {
console.log("Hottest month is below freezing. (" + hottestMonth + "C) Is EF.");
koppenCode = "EF";
}
}
}
if (koppenCode == "") {
alert("It appears that something is broken with the Köppen Calculator at this location!");
}
} else {
koppenCode = "Too far from a station to reliably tell.";
}
climateColor(koppenCode);
document.getElementById('stationLocation').innerHTML = ("Closest station is " + allTextLines[closestStation].split(',')[0] + " at a distance of " + distKM + "km (Coords: " + allTextLines[closestStation].split(',')[2] + ", " + allTextLines[closestStation].split(',')[1] + ")");
document.getElementById('code').innerHTML = (koppenCode);
}
function climateColor(koppenCode) {
switch(koppenCode) {
case "Af":
document.getElementById('body').style.backgroundColor="#0000FE";
document.getElementById('body').style.color="white";
break;
case "Am":
document.getElementById('body').style.backgroundColor="#0077FF";
document.getElementById('body').style.color="white";
break;
case "Aw":
document.getElementById('body').style.backgroundColor="#46A9Fa";
document.getElementById('body').style.color="white";
break;
case "As":
document.getElementById('body').style.backgroundColor="#46A9Fa";
document.getElementById('body').style.color="white";
break;
case "BWh":
document.getElementById('body').style.backgroundColor="#FE0000";
document.getElementById('body').style.color="white";
break;
case "BWk":
document.getElementById('body').style.backgroundColor="#FE9695";
document.getElementById('body').style.color="black";
break;
case "BSh":
document.getElementById('body').style.backgroundColor="#F5A301";
document.getElementById('body').style.color="white";
break;
case "BSk":
document.getElementById('body').style.backgroundColor="#FFDB63";
document.getElementById('body').style.color="black";
break;
case "Csa":
document.getElementById('body').style.backgroundColor="#FFFF00";
document.getElementById('body').style.color="black";
break;
case "Csb":
document.getElementById('body').style.backgroundColor="#C6C700";
document.getElementById('body').style.color="black";
break;
case "Csc":
document.getElementById('body').style.backgroundColor="#969600";
document.getElementById('body').style.color="white";
break;
case "Cwa":
document.getElementById('body').style.backgroundColor="#96FF96";
document.getElementById('body').style.color="black";
break;
case "Cwb":
document.getElementById('body').style.backgroundColor="#63C764";
document.getElementById('body').style.color="black";
break;
case "Cwc":
document.getElementById('body').style.backgroundColor="#329633";
document.getElementById('body').style.color="white";
break;
case "Cfa":
document.getElementById('body').style.backgroundColor="#C6FF4E";
document.getElementById('body').style.color="black";
break;
case "Cfb":
document.getElementById('body').style.backgroundColor="#66FF33";
document.getElementById('body').style.color="black";
break;
case "Cfc":
document.getElementById('body').style.backgroundColor="#33C701";
document.getElementById('body').style.color="white";
break;
case "Dsa":
document.getElementById('body').style.backgroundColor="#FF00FE";
document.getElementById('body').style.color="black";
break;
case "Dsb":
document.getElementById('body').style.backgroundColor="#C600C7";
document.getElementById('body').style.color="white";
break;
case "Dsc":
document.getElementById('body').style.backgroundColor="#963295";
document.getElementById('body').style.color="white";
break;
case "Dsd":
document.getElementById('body').style.backgroundColor="#966495";
document.getElementById('body').style.color="white";
break;
case "Dwa":
document.getElementById('body').style.backgroundColor="#ABB1FF";
document.getElementById('body').style.color="black";
break;
case "Dwb":
document.getElementById('body').style.backgroundColor="#5A77DB";
document.getElementById('body').style.color="white";
break;
case "Dwc":
document.getElementById('body').style.backgroundColor="#4C51B5";
document.getElementById('body').style.color="white";
break;
case "Dwd":
document.getElementById('body').style.backgroundColor="#320087";
document.getElementById('body').style.color="white";
break;
case "Dfa":
document.getElementById('body').style.backgroundColor="#00FFFF";
document.getElementById('body').style.color="black";
break;
case "Dfb":
document.getElementById('body').style.backgroundColor="#38C7FF";
document.getElementById('body').style.color="black";
break;
case "Dfc":
document.getElementById('body').style.backgroundColor="#007E7D";
document.getElementById('body').style.color="white";
break;
case "Dfd":
document.getElementById('body').style.backgroundColor="#00455E";
document.getElementById('body').style.color="white";
break;
case "ET":
document.getElementById('body').style.backgroundColor="#B2B2B2";
document.getElementById('body').style.color="white";
break;
case "EF":
document.getElementById('body').style.backgroundColor="#686868";
document.getElementById('body').style.color="white";
break;
default:
document.getElementById('body').style.backgroundColor="#cccccc";
document.getElementById('body').style.color="black";
break;
}
}
function updateLonLat() {
var center = (map.getCenter().transform(
map.getProjectionObject(), // transform from WGS 1984
new OpenLayers.Projection("EPSG:4326")).toString());
var splitCoords = center.split(',');
var splitLon = splitCoords[0].split('=');
var splitLat = splitCoords[1].split('=');
document.getElementById('long').value = splitLon[1];
document.getElementById('lat').value = splitLat[1];
moveCenterMarker(splitLon[1], splitLat[1]);
}