-
Notifications
You must be signed in to change notification settings - Fork 2
/
seaeditor.html
685 lines (632 loc) · 30.3 KB
/
seaeditor.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
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
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
<canvas id=a width=2048 height=1024></canvas>
<br>
<textarea id=o cols=99 rows=4></textarea>
<style>
* { margin: 0 }
canvas { background: url(map.jpg) no-repeat 4px 0; background-size: 2036px auto }
textarea { position: fixed; bottom: 0; font-size: 6px }
</style>
<script>
o.value = "";
c = a.getContext("2d");
started = 0;
x = 0;
y = 0;
points = [];
capital = 0;
points_old = {
"HawaiiHonolulu":[22,143,22,143,16,104,127,24,145,1,113,25],
"AlaskaJuneau":[44,60,48,71,33,64,49,60,88,65,73,47,43,77,65,75,66,87,81,6,76,82,3,11,90,73,98,122,25,114,11,97,84,91,23,26,18,56,27,1,81,105,19,48,9,3,9,1,122,113,122,127,4,77,8,127,6,76,8,127,10,75,127,12,74,16],
"WashingtonOlympia":[55,87,54,91,14,43,77,104,73],
"NevadaCarson city":[58,107,63,116,33,45,77,107],
"New mexicoSanta fe":[71,114,68,111,109,10,40,10,44],
"New yorkAlbany":[101,98,102,93,108,66,74,33,10,33],
"FloridaTallahassee":[92,126,92,126,88,66,40,11,2,105,114,88,57,41],
"IllinoisSpringfield":[87,105,87,111,58,35,10,97,107],
"OhioColumbus":[93,105,91,107,42,11,105,90],
"Rhode islandProvidence":[104,103,104,103,32,80,104],
"South carolinaColumbia":[94,118,91,116,11,2,91,49],
"TexasAustin":[79,125,71,123,123,17,122,104,2,49,19,43,65,75,41,74,107,74],
"MarylandAnnapolis":[99,107,98,106,9,106],
"North carolinaRaleigh":[96,114,95,116,75,33,15,113,82],
"UtahSalt lake city":[65,103,66,100,74,109,12,44,73],
"VirginiaRichmond":[98,110,98,106,121,105,78,18,26],
"West virginiaCharleston":[94,109,93,109,26,1,97,81],
"PennsylvaniaHarrisburg":[99,104,95,105,41,12,113,81,73],
"MassachusettsBoston":[104,99,104,99,73,104,10],
"ConnecticutHartford":[103,102,102,101,97,17,32],
"AlabamaMontgomery":[89,119,91,121,50,73,108,8,40,9],
"CaliforniaSacramento":[57,110,58,100,75,106,121,116,4,9,41,63],
"ColoradoDenver":[72,106,68,112,14,44,78],
"GeorgiaAtlanta":[91,118,91,121,50,4,113,97,48,74],
"MichiganLansing":[91,95,89,101,36,82,58,18,113,17,122,107],
"North dakotaBismarck":[76,89,80,91,78,43,14],
"MontanaHelena":[65,89,73,83,108,77,82,53],
"NebraskaLincoln":[80,103,80,98,78,105,9,105,14],
"ArizonaPhoenix":[65,119,68,112,109,73,66,42,33],
"ArkansasLittle rock":[84,116,82,119,42,11,120,98,74],
"New hampshireConcord":[104,97,104,93,106,72],
"New jerseyTrenton":[101,104,101,107,33,65,113,80,121],
"DelawareDover":[100,107,100,107,105,33],
"OklahomaOklahoma city":[79,115,82,112,79,104,10,105,12],
"IdahoBoise":[62,97,66,100,76,47,16,117,17],
"OregonSalem":[55,94,54,100,44,14,108],
"IndianaIndianapolis":[90,105,91,101,106,89,72,43,16],
"IowaDes moines":[83,101,81,103,12,33,65,76],
"KansasTopeka":[81,107,75,106,14,106,78],
"South dakotaPierre":[76,94,73,91,107,14,43],
"KentuckyFrankfort":[91,109,91,107,89,82,112,12,17,48],
"TennesseeNashville":[89,114,86,113,14,89,76],
"LouisianaBaton rouge":[86,127,86,129,66,43,9,98,9,120],
"MaineAugusta":[105,95,104,99,42,28,106,120],
"VermontMontpelier":[103,96,102,93,9,98,80],
"MinnesotaSt paul":[83,93,80,97,46,9,4,82,106,121],
"MississippiJackson":[86,121,86,115,9,108,80,48,73],
"WisconsinMadison":[87,97,88,99,34,72,58,73,106,121,1],
"MissouriJefferson city":[84,109,82,113,43,56,12,97,122,104],
"WyomingCheyenne":[72,100,73,102,44,77,88,107],
"Ru,Russia,Moscow":[155,50,151,23,9,4,97,75,122,21,41,9,97,21,12,57,6,24,58,20,108,82,10,26,2,60,25,5,58,12,49,14,19,11,4,85,9,18,15,10,123,17,11,24,12,3,12,113,14,40,11,2,107,74,2,87,74,90,113,97,92,51,30,18,49,91,49,92,66,82,74,93,4,97,105,95,49,17,34,82,58,50,75,105,82,65,89,74,70,105,77,81,69,58,81,67,84,105,76,65,82,97,122,81,114,88,67,73,57,33,25,67,49,81,33,49,73,43,9,65,26,51,24,48,127,169,21,49,21,11,65,74,86,97,1,127,193,6,18,1,127,195,7,12,81,127,199,9,12,66,127,230,14,75,25,2,127,235,14,56,81,127,230,53,106,113,99,46,127,2,32,32,3,18,71,107,127,2,19,1,74,127,142,53,17,1],
"Cn,China,Beijing":[211,78,221,74,33,17,34,82,57,64,50,65,82,113,82,97,10,112,84,64,98,74,80,73,56,74,57,66,41,66,97,81,104,81,113,84,105,124,105,6,16,1,25,3,98,1,121,41,10,121,1,21,25,35,51,18,65,88,65,32,18,105,17,25,8,127,206,112,48,9],
"Ca,Canada,Ottawa":[75,69,81,70,49,90,73,89,73,112,74,27,64,73,59,89,65,79,79,77,80,58,8,59,33,65,49,57,88,65,72,47,40,2,19,10,1,11,3,10,1,48,17,2,9,33,1,97,18,57,64,25,57,11,89,80,123,9,88,121,34,73,57,26,9,89,18,121,9,66,10,121,1,9,2,89,9,3,90,57,73,123,104,66,122,68,56,80,73,32,10,56,25,69,89,113,74,89,65,121,8,82,65,122,81,98,1,112,5,9,97,122,25,49,17,41,56,32,42,10,2,105,121,26,122,114,2,113,82,88,76,91,19,8,105,1,17,112,84,33,89,127,89,59,104,1,113,80,65,73,25,33,127,40,19,33,12,1,73,90,73,127,45,19,24,12,2,57,10,105,2,81,65,83,67,11,65,74,127,42,12,10,17,73,127,46,13,17,2,25,2,81,74,127,54,7,121,11,56,127,55,11,3,16,40,127,57,16,88,2,17,57,127,60,11,1,16,121,15,24,78,56,15,22,9,19,79,76,81,77,3,73,65,73,89,2,11,82,65,127,68,31,97,1,24,9,127,51,9,81,64,17,127,61,8,73,1,127,58,6,8,127,71,36,88,72,127,76,27,80,64,127,72,37,104,24,127,36,57,57,8,127,73,49,80,24],
"Fr,France,Paris":[130,63,130,59,2,8,112,104,88,104,113,88,72,64,104,80,65,80,33,49,65,24,9,56,9,127,135,74,104,16,48],
"Dz,Algeria,Algiers":[131,84,131,110,9,24,19,48,57,32,42,57,34,73,80,73,72,89,105,81,89,81,104],
"Ar,Argentina,Buenos aires":[87,189,87,189,35,26,40,89,73,33,66,48,73,90,105,98,106,97,111,98,114,9,41,26,49,27,57,1,33,19,127,80,225,11,66,56],
"Au,Australia,Canberra":[234,190,235,190,105,82,56,80,73,50,72,41,97,58,75,83,73,89,65,33,52,8,49,26,9,17,33,26,2,33,17,10,98,3,34,41,114,16,116,125,107,127,231,199,114,25,32],
"At,Austria,Vienna":[140,64,138,64,112,74,1,10,33,65],
"Be,Belgium,Brussels":[132,59,130,59,2,24,56],
"Br,Brazil,Brasilia":[95,161,79,136,113,105,82,106,3,25,113,3,105,8,120,106,1,104,8,105,91,2,113,33,27,41,20,33,25,43,27,41,71,73,65,24,50,97,73,81,50,89,65,114,73,48],
"Bg,Bulgaria,Sofia":[145,74,145,76,9,16,120,40,32,64,80,73,97],
"Ae,United arab emirates,Abu dhabi":[167,103,169,101,98,66],
"Cl,Chile,Santiago":[79,187,81,172,49,42,89,113,104,97,106,97,106,98,107,33,106,90,1,89,113,105,122,9,33,56,73,50,35,46,33,42,34,40],
"Hr,Croatia,Zagreb":[140,68,140,68,88,72,121,1,57,16,1,40,64,72,40],
"Cu,Cuba,Havana":[70,105,70,105,9,4,80,73,48,64,72,64,88,72],
"Cz,Czech republic,Prague":[139,61,139,59,81,121,10,24],
"Dk,Denmark,Copenhagen":[137,50,135,52,9,25,81,41,81,104],
"Ec,Ecuador,Quito":[73,139,73,136,89,104,114,33,17,32],
"Eg,Egypt,Cairo":[151,95,153,93,112,97,48,114,120,113,79,46,9,120,17],
"Ee,Estonia,Tallinn":[146,43,146,43,81,120,16,112,16,120,8,48,32],
"No,Norway,Oslo":[136,42,136,42,121,40,33,49,17,41,17,24,18,120,9,32,9,112,17,65,75,80,73,81,90,98,84,107,1,24,17],
"Fi,Finland,Helsinki":[146,41,146,41,9,17,25,51,32,49,73,104,73,64,80,2,105,8,91,105],
"De,Germany,Berlin":[138,56,133,61,41,25,8,48,8,120,9,114,82,1,88,112,75,32],
"Gr,Greece,Athens":[145,82,145,82,104,58,25,16,9,112,73,112,56,114],
"Hu,Hungary,Budapest":[142,66,142,65,17,1,80,89,73,48,32],
"Es,Spain,Madrid":[125,78,131,74,88,65,80,64,75,104,9,106,88,121,18,34,17],
"Ch,Switzerland,Berne":[134,66,133,67,112,16,9,48,73],
"Gb,United kingdom,London":[129,58,125,60,17,73,26,48,72,40,64,33,17,97,16,120,88,122,104,1,97,127,123,53,9,48,80],
"Is,Iceland,Reykjavik":[113,34,113,34,65,9,65,17,120,10,24,122,83],
"In,India,New delhi":[183,97,181,87,9,16,113,105,9,89,4,9,56,16,104,9,32,24,9,121,72,89,98,49,57,80,113,97,88,91,81,105,99,56,54,43,97,65,16,65,16,9,57,32,8,27],
"Id,Indonesia,Jakarta":[204,147,204,147,88,1,9,1,12,17,76,64,75,127,216,153,8,32,127,214,153,72,16,127,203,146,65,50,61,2,121,2,105,121,127,206,136,1,17,33,9,105,120,90,104,75,49,127,213,146,8,41,121,49,17,73,48,10,24,80,73,72,104,97,127,219,135,120,104,64,127,221,139,121,113,32,2,113,88,9,43,65,89,64,49],
"Ir,Iran,Tehran":[165,86,160,80,115,88,121,113,9,113,1,16,121,10,25,65,48,24,49,33,57,65,81,104,73,58,72,65],
"Iq,Iraq,Baghdad":[160,89,162,91,113,81,65,57,72,48,17,33,9,113,88],
"Ie,Ireland,Dublin":[124,54,124,53,113,82,48,24,48],
"Il,Israel,Jerusalem":[154,92,154,92],
"It,Italy,Rome":[137,75,137,75,58,88,49,16,9,48,2,89,123,1,112,64,104,97,80,57,9,24,58,127,136,78,64,105,24],
"Jm,Jamaica,Kingston":[74,112,74,112,72,1],
"Jp,Japan,Tokyo":[227,86,227,86,120,24,34,50,1,25,57,90,112,97,120,91,73,90,105,25,48,17,88,104,16,40,8,104,25,120],
"Lb,Lebanon,Beirut":[154,88,153,90,24,8,88],
"Lt,Lithuania,Vilnius":[147,52,147,52,24,56,74,104,121],
"Lu,Luxembourg,Luxembourg":[133,61,133,61],
"Mk,Macedonia,Skopje":[144,75,144,77,24,56,97],
"Mg,Madagascar,Antananarivo":[162,165,160,167,97,113,1,39,49,90,81],
"Mx,Mexico,Mexico city":[58,110,60,100,107,122,9,33,17,121,90,72,104,72,104,57,81,70,33,62,49,72,113,121,114,65,32,66,9,59,49,1,2,16,10,122,17,121,104],
"Mc,Monaco,Monaco":[134,72,134,72],
"Ma,Morocco,Rabat":[124,88,122,92,104,90,10,24,18,40,17,41,73,64],
"Gy,Guyana,Georgetown":[88,128,88,128,112,97,121,73,56,32,57,25],
"Ly,Libya,Tripoli":[138,90,140,104,88,73,57,48,32,42,18,121,9,120,16,48,16,2,111,104,72],
"Np,Nepal,Kathmandu":[189,98,185,96,25,121,3,112,73],
"Nl,Netherlands,Amsterdam":[132,56,134,55,64,89,104,9],
"Nz,New zealand,Wellington":[252,200,252,200,98,72,97,73,40,25,17,33,1,32,64,33,58,1,112,2,89,97],
"Kp,North korea,Pyongyang":[218,80,218,76,89,120,104,9,24,64,17,33,82],
"Ps,Palestine,Jerusalem":[154,92,154,92],
"Py,Paraguay,Asuncion":[88,175,87,178,33,66,48,33,9,120,104,1,104,8,105,81],
"Pe,Peru,Lima":[74,155,74,155,51,64,33,113,33,17,32,121,9,104,81,106,120,8,121,105,88,113,80,66,57,40],
"Ph,Philippines,Manila":[214,117,214,117,48,33,8,105,88,2,113,72,57,88,1,97,50,97,89,32,25,40,9,127,215,128,25,112,25,105,80,120,72,48],
"Pl,Poland,Warsaw":[143,56,139,59,3,9,25,48,41,74,64,82],
"Pt,Portugal,Lisbon":[122,81,122,81,113,25,41,32,73],
"Ro,Romania,Bucharest":[147,71,143,68,122,9,16,120,25,72,40,57,80,72,80],
"Qa,Qatar,Doha":[165,102,165,103,56,24,112],
"Sa,Saudi arabia,Riyadh":[162,102,163,97,121,104,122,9,97,82,73,104,74,88,50,64,51,57,40,8,16,48,17,8,122],
"Sg,Singapore,Singapore":[202,136,202,136],
"Sk,Slovakia,Bratislava":[141,64,142,62,8,9,120,73,89,65,24,8],
"Si,Slovenia,Ljubljana":[139,68,140,67,73,104,9],
"Za,South africa,Pretoria":[149,175,151,170,73,90,104,65,97,50,107,72,64,88,116,9,16,9,18,33,25,32,64,32],
"Kr,South korea,Seoul":[218,82,218,82,9,112,104,82,24],
"Se,Sweden,Stockholm":[142,43,142,43,81,112,97,81,32,49,41,24,48,41,8,33,26,17,2,105,72,97,81,98,8],
"Tw,Taiwan,Taipei":[215,102,215,102,80,105,24],
"Tn,Tunisia,Tunis":[136,84,135,83,8,120,104,88,121,88,80,57,33,40],
"Tr,Turkey,Ankara":[152,79,147,76,16,2,24,10,1,8,17,121,105,120,74,80,74,64,104,65,88,65,49,16,8,48,88,72],
"Ua,Ukraine,Kiev":[150,60,153,59,1,8,1,97,80,72,88,112,81,56,16,65,97,64,25,65,81,66,9,56,25,48,9,2,32,17],
"Uy,Uruguay,Montevideo":[89,190,87,188,34,1,121,104,81],
"Us,Usa,Washington dc":[75,80,75,80],
"Ve,Venezuela,Caracas":[81,123,81,123,10,1,121,72,97,120,80,65,113,104,73,56,42,80,56,72,57,33,120,16,8],
"Va,Vatican city,Vatican city":[138,75,138,75],
"Vn,Vietnam,Hanoi":[204,108,205,107,89,112,122,106,91,50,9,33,50,64,32,58,10],
"Af,Afghanistan,Kabul":[177,87,172,86,97,113,104,10,25,8,26,40,24,17,81,48,72,88,64,72,90],
"Ad,Andorra,Andorra la vella":[130,74,130,74],
"Al,Albania,Tirana":[143,76,143,79,56,40,24,120,104,16],
"By,Belarus,Minsk":[148,54,147,52,81,105,9,1,9,33,50,73,80],
"Ba,Bosnia and herzegovina,Sarajevo":[142,72,142,71,64,72,112,121,24,32],
"Bf,Burkina faso,Ouagadougou":[127,120,125,123,33,18,122,89,64,97,56,72],
"Cf,Central african republic,Bangui":[142,132,142,134,65,104,48,49,19,8,25,113,123,74,88,65],
"Cm,Cameroon,Yaounde":[137,133,139,120,100,64,88,105,112,10,1,40,56,49,16,40,56,16],
"Cd,Democratic republic of the congo,Kinshasa":[140,145,142,134,97,112,88,97,88,72,88,10,113,8,24,9,97,121,9,121,8,32,64,41,9,57,43,34,56,72,64,74,88,65],
"Ci,Cote d'ivoire,Yamoussoukro":[125,129,127,131,73,81,32,56,33,48,9,120,8,112,97],
"Cr,Costa rica,San jose":[69,124,68,122,104,1,24,56],
"Co,Colombia,Santa fe de bogota":[76,131,79,144,16,41,49,9,42,80,56,72,49,40,24,82,97,80,120,105,97,2,121,9],
"Bo,Bolivia,La paz":[81,162,80,154,106,88,120,105,114,25,112,16,8,33,9,112,41,48,72,41,67,40,64],
"Cv,Cape verde,Praia":[112,117,112,117,127,111,114],
"Cy,Cyprus,Nicosia":[152,86,152,86,8,88,72],
"Bj,Benin,Porto novo":[130,129,130,129,41,56,32,16,120,112,88,105],
"Kh,Cambodia,Phnom penh":[203,121,202,122,49,9,17,104,97],
"Dm,Dominica,Roseau":[85,116,85,116],
"Cg,Congo,Brazzaville":[139,144,137,145,56,25,120,24,41,72,24,1,41,1,97,112,88,97,88],
"Do,Dominican republic,Santo domingo":[79,112,79,112,9,66,105],
"Gq,Equatorial guinea,Malabo":[135,133,135,133,127,135,137,9,40,72],
"Gt,Guatemala,Guatemala city":[65,117,66,113,73,120,112,64,105,17,32,80],
"Ht,Haiti,Port-au-prince":[77,112,78,113,65,8,56,9],
"Hn,Honduras,Tegucigalpa":[67,118,66,115,9,1,81,88,65],
"Jo,Jordan,Amman":[154,91,154,91,8,24,120,88,104,88,72],
"Kz,Kazakhstan,Astana":[179,59,190,62,66,72,60,89,58,73,84,97,120,76,65,81,89,104,122,17,8,105,64,89,1,104,9,112,42,17,1,121,17,114,8,17,24,8,16,9,1,8,41,16,32,16,8],
"Xk,Kosovo,Pristina":[144,74,144,74,88,48],
"Kw,Kuwait,Kuwait city":[163,96,161,96,17,113],
"La,Laos,Vientiane":[201,112,200,107,24,121,8,104,80,1,113,112,73,32,49,81,49],
"Ke,Kenya,Nairobi":[155,140,153,140,40,32,49,24,3,24,8,97,105,120,88,97,58],
"My,Malaysia,Kuala lumpur":[200,133,200,133,50,121,8,120,104,113,65,127,206,136,1,18,40,18,65,91,72,104,64],
"Ml,Mali,Bamako":[123,120,125,102,72,106,113,105,75,88,113,1,112,9,33,19,9,32,41,64],
"Mt,Malta,Valletta":[139,85,139,85],
"Md,Moldova,Chisinau":[149,66,150,66,65,72,121,112,16],
"Pk,Pakistan,Islamabad":[180,89,172,95,10,25,8,26,40,24,17,122,80,73,114,91,72,104,121,73,88,48,75,32,16,48,64],
"Pa,Panama,Panama city":[73,125,70,124,1,16,1,104,72,40,72,88,65],
"Sm,San marino,San marino":[137,71,137,71],
"Sn,Senegal,Dakar":[117,117,121,120,75,48,33,9],
"Rs,Serbia,Belgrade":[143,70,142,68,8,122,104,80,65,32],
"Sc,Seychelles,Victoria":[168,145,168,145,127,165,152,127,162,152],
"So,Somalia,Mogadishu":[161,135,158,141,56,41,25,18,25,72,66,33,104,9,16,10,98],
"Lk,Sri lanka,Colombo":[185,128,185,128,33,113,104,72],
"Sd,Sudan,Khartoum":[152,116,155,114,16,50,64,78,105,72,106,89,115,25,120,10,26,105,26,41],
"Tz,Tanzania,Dodoma":[154,147,153,140,88,64,72,112,97,114,1,121,8,18,64,41,48,58],
"Th,Thailand,Bangkok":[200,118,202,122,49,9,40,49,73,40,56,81,112,113,104,112,104,97,113,120,8,49,56,33,48],
"Ye,Yemen,San'a":[160,116,160,120,22,49,80,73,104,74,88],
"Zw,Zimbabwe,Harare":[150,164,147,164,17,24,2,105,97,73,58],
"Ag,Antigua and barbuda,St john's":[85,113,85,113,127,85,114],
"Am,Armenia,Yerevan":[160,78,160,78,56,8,121,80],
"Az,Azerbaijan,Baku":[164,78,164,78,49,88,72,112,65,121,104,8,120,16],
"Ao,Angola,Luanda":[138,151,137,163,12,112,16,9,56,41,16,33,80,56,40,32,73,88,72,49,74,115],
"Bs,The bahamas,Nassau":[74,102,74,102,127,75,103,127,76,105],
"Bh,Bahrain,Manama":[164,100,164,100],
"Bd,Bangladesh,Dhaka":[193,104,191,101,16,121,113,72,81,33],
"Bb,Barbados,Bridgetown":[87,119,87,119],
"Bz,Belize,Belmopan":[66,113,66,113,97,16,33],
"Bt,Bhutan,Thimphu":[192,98,191,98,16,1,112,73],
"Bw,Botswana,Gaborone":[147,174,147,174,26,59,80,73,107,114,33,1],
"Bn,Brunei,Bandar seri begawan":[210,131,210,131,88,8],
"Bi,Burundi,Bujumbura":[149,143,149,143,17,98],
"Td,Chad,N'djamena":[139,121,140,104,88,113,105,89,104,114,88,120,104,9,24,16,8,33,48,25,42],
"Km,Comoros,Moroni":[159,155,159,155,127,160,156],
"Dj,Djibouti,Djibouti":[159,122,159,122,80,25,113],
"Sv,El salvador,San salvador":[66,119,66,119,73,17,121],
"Er,Eritrea,Asmara":[156,116,159,120,58,49,89,105,17,1,112],
"Et,Ethiopia,Addis ababa":[156,125,158,132,80,9,17,26,72,65,48,64,32,72,40,65,90,97,104,88,1,105,2,32],
"Fj,Fiji,Suva":[255,165,255,165,48,88,120,127,255,162,8,88],
"Ga,Gabon,Libreville":[135,138,135,139,32,9,48,9,88,8,105,88,64,97,57],
"Gm,Gambia,Banjul":[117,119,117,119,9,64],
"Ge,Georgia,Tbilisi":[160,76,160,76,1,48,66,73,1,104],
"Gh,Ghana,Accra":[129,130,129,130,43,72,80,105,97,1],
"Gd,Grenada,St george's":[85,121,85,121],
"Gn,Guinea,Conakry":[119,124,123,128,32,50,74,89,121,17,112,8],
"Gw,Guinea-bissau,Bissau":[117,121,119,120,112,81,49],
"Ki,Kiribati,Tarawa":[251,136,251,136,127,252,139,127,251,134,127,7,142,127,7,145,127,8,144,127,17,135,127,22,153],
"Kg,Kyrgyzstan,Bishkek":[181,74,178,76,25,9,9,1,89,80,72,88,74,18],
"Lv,Latvia,Riga":[146,48,144,49,10,120,8,41,80,56,80,88,56],
"Ls,Lesotho,Maseru":[148,181,148,181,16,120,88,72],
"Lr,Liberia,Monrovia":[121,129,120,128,25,121,113,72],
"Li,Liechtenstein,Vaduz":[136,66,136,66],
"Mw,Malawi,Lilongwe":[153,158,152,158,32,41,113,104,120,112,104,72,48],
"Mv,Maldives,Male":[181,132,181,132,127,181,138,127,180,135],
"Mh,Marshall islands,Majuro":[250,128,250,128,127,247,125,127,250,125,127,247,122,127,244,122],
"Mr,Mauritania,Nouakchott":[117,112,125,102,72,106,113,105,75,88,48,73,40,50,10,32,16,41,9,40],
"Mu,Mauritius,Port louis":[169,167,169,167],
"Fm,Micronesia,Palikir":[240,128,240,128,127,237,131,127,236,128,127,235,125,127,228,124,127,226,125,127],
"Mn,Mongolia,Ulan bator":[204,65,211,62,97,10,120,84,64,98,74,80,73,64,74,58,65,41,66,19,2,9,41,3,9,2,8,25],
"Me,Montenegro,Podgorica":[142,74,142,76,48,16,120],
"Mz,Mozambique,Maputo":[152,175,152,177,32,17,41,56,26,17,32,43,89,80,64,88,114,88,56,40,64,81,112,1,105,97,105,104],
"Mm,Myanmar,Naypyidaw":[196,110,198,125,33,51,88,72,41,57,34,27,121,98,1,112,88,80,104,113,105,112],
"Na,Namibia,Windhoek":[141,171,139,171,52,1,10,12,112,64,80,73,111,65,80,50],
"Nr,Nauru,Yaren":[247,139,247,139],
"Ni,Nicaragua,Managua":[68,121,68,122,57,16,17,8,97,113],
"Ne,Niger,Niamey":[130,119,131,121,25,2,16,9,33,25,41,49,73,82,89,73,113,97,73],
"Ng,Nigeria,Abuja":[134,125,131,121,25,2,16,9,32,113,100,56,80,104,81,57,64],
"Om,Oman,Muscat":[170,104,168,106,33,112,8,121,92,81,49,18],
"Pw,Palau,Melekeok":[224,127,224,127,104,48],
"Pg,Papua new guinea,Port moresby":[233,152,233,152,57,89,65,43,3,121,113,121,127,234,146,8,25,105,73,127,239,148,64,40],
"Rw,Rwanda,Kigali":[150,141,149,142,24,8,112,81],
"Kn,St kitts and nevis,Basseterre":[84,113,84,113],
"Lc,St lucia,Castries":[86,118,86,118],
"Vc,St vincent and the grenadines,Kingstown":[85,119,85,119],
"Ws,Samoa,Apia":[7,158,7,158],
"St,Sao tome and principle,Sao tome":[133,138,133,138,127,134,136],
"Sl,Sierra leone,Freetown":[119,127,120,129,25,48,81],
"Sb,Solomon islands,Honiara":[242,152,242,152,120,48,127,243,153,8,80,127,243,152,56,127,241,149,120,64,127,240,150],
"Ss,South sudan,Juba":[151,131,147,123,120,10,26,106,88,1,104,89,73,48,80,59,33],
"Sr,Suriname,Paramaribo":[90,130,88,129,97,122,32,8,41],
"Sy,Syria,Damascus":[154,89,154,89,88,1,25,17,33,72,80,74,105,8],
"Tj,Tajikistan,Dushanbe":[177,81,177,81,56,8,32,9,81,10,121,82,32,72,88,80],
"Tl,Timor-leste,Dili":[217,151,217,151,9,81],
"Tg,Togo,Lome":[129,129,129,130,16,41,56],
"To,Tonga,Nuku'alofa":[5,169,5,169,127,5,167,127,6,165],
"Tt,Trinidad and tobago,Port of spain":[85,123,85,123,112,32],
"Tm,Turkmenistan,Ashgabat":[170,82,170,82,64,81,50,1,48,72,24,2,33,124,2,72,90,72],
"Tv,Tuvalu,Funafuti":[255,151,255,151,127,253,147],
"Ug,Uganda,Kampala":[152,138,152,138,89,72,40,34,9,113],
"Uz,Uzbekistan,Tashkent":[178,76,178,76,80,72,50,88,72,66,73,106,1,40,16,112,8,112,121,2,32,56,8,32,10,64],
"Vu,Vanuatu,Port vila":[248,164,248,164,127,247,160,104,48,127,248,165],
"Zm,Zambia,Lusaka":[149,160,147,165,65,56,41,8,33,2,112,16,57,41,9,121,106,81,112,64,89],
"Ck,Cook islands,Avarua":[16,169,16,169,127,13,157,127,15,153],
"Nu,Niue,Alofi":[9,165,9,165,127,10,167],
"Sz,Swaziland,Mbabane":[151,176,151,176,120,80,40],
"Greenland":[85,4,85,73,122,14,2,114,1,73,122,97,115,122,2,36,21,25,11,18,33,49,18,65,17,65,18,10,24,77,66,79,78,82],
"Gibraltar":[125,85],
"Guadeloupe":[85,115],
"Hong kong":[209,106],
"Guam":[231,119],
"Cayman islands":[71,110],
"Martinique":[86,117],
"St martin":[84,112],
"French polynesia":[24,160,127,26,161,127,27,163,127,28,161,127,28,165,127,29,164],
"St helena":[125,161],
"St barthelemy":[84,112],
"Reunion":[168,168],
"New caledonia":[247,170,80,57],
"Puerto rico":[82,112,72,80,64,120],
"Wallis and futuna":[4,154,127,3,155,127,3,158],
"French guiana":[92,131,97,72,41],
"Guernsey":[127,61],
"British indian ocean territory":[180,146,127,180,149],
"Mayotte":[161,156],
"St pierre and miquelon":[89,67],
"Anguilla":[84,112],
"American samoa":[8,159],
"Faroe islands":[124,38],
"Bermuda":[83,91],
"Us minor outlying islands":[15,139,127,4,138,127,4,137,127,14,130,127,14,129,127,9,114,127,4,98],
"French southern territories":[179,214,88,72,32,112],
"British virgin islands":[83,112],
"Us virgin islands":[83,113],
"Netherlands antilles":[79,120,127,80,120],
"Aruba":[79,120],
"Aland islands":[143,41],
"South georgia":[103,224,64,121,127,109,227,127,110,230,127,110,232,127,109,234],
"Bonaire":[81,121],
"Bouvet island":[131,224],
"Cocos islands":[197,156],
"Curacao":[80,120],
"Christmas island":[203,153],
"Western sahara":[116,107,10,32,16,41,9,32,74,89,104],
"Falkland islands":[87,218,8,89,127,86,219,32,104],
"Heard island and mcdonald islands":[181,221],
"Isle of man":[125,53],
"Jersey":[127,62],
"Macau":[208,108],
"Northern marianas":[232,114],
"Montserrat":[84,114],
"Norfolk island":[247,180],
"Pitcairn islands":[37,175,127,38,174,127,41,174],
"Svalbard and jan mayen":[123,20,88],
"Tokelau":[7,151],
"Antartica":[76,255,18,121,35,20,91,124,127,124,255,20,15,4,15,26,2,23,15,7,14,22,15,4,21,4,21,12,7,15,5],
"Turks and caicos islands":[78,107],
"Svalbard":[140,11,68,12,18,3,75,3,73,65],
}
circles = {
"Bering":[125,26,7],
"Gulf of alaska":[13,27,5],
"Okhotsk":[117,27,5],
"Sea of japan":[111,36,5],
"Seto":[111,44,1],
"East china sea":[109,47,3],
"South china sea":[105,59,3],
"Beibu gulf":[102,55,1],
"Sulu":[106,63,1],
"Celebes":[107,66,2],
"Bohol":[108,63,1],
"Philippine sea":[111,58,5],
"Flores":[107,74,1],
"Banda":[109,73,2],
"Arafura":[112,75,2],
"Tasman sea":[121,99,5],
"Yellow sea":[108,44,2],
"Bohai":[106,40,1],
"Coral sea":[119,80,4],
"Gulf of carpentaria":[113,80,2],
"Hudson bay":[34,21,4],
"James bay":[35,28,1],
"Baffin bay":[37,7,2],
"Gulf of st lawrence":[42,32,2],
"Caribbean sea":[36,58,3],
"Gulf of mexico":[32,51,3],
"Sargasso":[43,46,5],
"North sea":[65,24,2],
"Baltic sea":[71,25,2],
"Gulf of bothnia":[71,19,1],
"Irish sea":[62,27,1],
"Celtic sea":[61,31,2],
"English channel":[63,30,1],
"Mediterranean sea":[68,47,7],
"Adriatic sea":[70,35,2],
"Aegean sea":[73,41,1],
"Black sea":[76,36,3],
"Azov":[77,34,1],
"Ionian sea":[70,41,1],
"Ligurian sea":[67,36,1],
"Mirtoon":[73,42,1],
"Tyrrhenian":[68,39,1],
"Gulf of sidra":[70,47,2],
"Marmara":[74,39,1],
"Sea of crete":[73,42,1],
"Red sea":[77,55,4],
"Gulf of aden":[81,60,2],
"Persian gulf":[82,50,2],
"Gulf of oman":[85,52,1],
"Arabian sea":[87,60,5],
"Bay of bengal":[95,59,4],
"Gulf of thailand":[100,63,2],
"Java":[103,73,2],
"Timor sea":[109,78,2],
"Barents":[78,7,5],
"Kara":[86,9,3],
"Beaufort sea":[15,7,6],
"Amundsen gulf":[22,11,2],
"Greenland sea":[58,8,3],
"Chukchi":[3,8,4],
"Laptev":[107,4,6],
"East siberian sea":[121,6,6],
"Amundsen":[28,125,9],
"Weddell":[52,125,8],
"Ross":[125,125,8],
"Great australian bight":[109,96,4],
"Gulf st vincent":[113,96,1],
"Spencer gulf":[112,94,1],
"Aral":[84,35,1],
"Caspian":[82,38,3],
"Dead sea":[76,46,1],
"Salton":[23,44,1],
"Gulf of guinea":[65,68,3],
"Norwegian sea":[65,10,5],
};
paths = { };
data =
["Bering","Gulf of alaska","Okhotsk","Sea of japan","Seto","East china sea","South china sea","Beibu gulf","Sulu","Celebes","Bohol","Philippine sea","Flores","Banda","Arafura","Tasman sea","Yellow sea","Bohai","Coral sea","Gulf of carpentaria","Hudson bay","James bay","Baffin bay","Gulf of st lawrence","Caribbean sea","Gulf of mexico","Sargasso","North sea","Baltic sea","Gulf of bothnia","Irish sea","Celtic sea","English channel","Mediterranean sea","Adriatic sea","Aegean sea","Black sea","Azov","Ionian sea","Ligurian sea","Mirtoon","Tyrrhenian","Gulf of sidra","Marmara","Sea of crete","Red sea","Gulf of aden","Persian gulf","Gulf of oman","Arabian sea","Bay of bengal","Gulf of thailand","Java","Timor sea","Barents","Kara","Beaufort sea","Amundsen gulf","Greenland sea","Chukchi","Laptev","East siberian sea","Amundsen","Weddell","Ross","Great australian bight","Gulf st vincent","Spencer gulf","Aral","Caspian","Dead sea","Salton","Gulf of guinea","Norwegian sea"],
count = 50;
diststep = 16;
// Avoided chars:
// \0 (0)
// \r (13)
// \ (92)
// ` (96)
// ~ (126)
// [DEL] (127)
a.onclick = function(e){
newx = e.pageX;
newy = e.pageY;
if(!started){
newx = Math.round(e.pageX / 16) * 16;
newy = Math.round(e.pageY / (16/2)) * (16/2);
if(newx != 0 && newx != 13 && newx != 92 && newx != 96 && newx != 126 && newx != 127
&& newy != 0 && newy != 13 && newy != 92 && newy != 96 && newy != 126 && newy != 127){
if(!capital) started=2
else started = 1;
x = newx;
y = newy;
points.push(newx/16, newy/(16/2));
o.value += [newx/16, newy/(16/2)];
console.log("center",newx,newy);
}
}
else if(started == 1){
newx = Math.round(e.pageX / diststep) * diststep + diststep;
newy = Math.round(e.pageY / (diststep/2)) * (diststep/2);
if(newx != 0 && newx != 13 && newx != 96 && newx != 126 && newx != 127
&& newy != 0 && newy != 13 && newy != 96 && newy != 126 && newy != 127){
started = 2;
x = newx;
y = newy;
points.push(newx/diststep, newy/(diststep/2));
o.value += "," + [newx/diststep, newy/(diststep/2)];
}
}
else {
closestPoint();
number = (distance) / 16;
if(number != 0 && number != 13 && number != 96 && number != 126 && number != 127){
//console.log(distance,angle);
points.push(number);
x = newx;
y = newy;
o.value += "," + number;
onkeydown({keyCode: 78});
}
}
}
dist=0;
a.onmousemove = function(e){
distbackup = diststep;
diststep = 6;
capitalbackup = capital;
capital = 1;
color="blue";
line="black";
close = 1;
a.width ^= 0;
c.fillStyle="#fff";
c.fillRect(0,0,2500,2000)
c.fillStyle="black";
emoji = 0;
fill = 0;
for(j in circles){
c.beginPath();
c.lineWidth = 1;
//c.moveTo(x=circles[j][0]*16, y=circles[j][1]*16/2);
c.arc(x=circles[j][0]*16,y=circles[j][1]*16/2,circles[j][2]*16,0,7);
c.lineWidth = 2;
c.strokeStyle = "blue";
c.stroke();
c.fillStyle="rgba(128,128,255,.5)";
c.fill();
//c.closePath();
}
for(j in circles){
c.beginPath();
c.lineWidth = 1;
//c.moveTo(x=circles[j][0]*16, y=circles[j][1]*16/2);
c.arc(x=circles[j][0]*16 - 2048,y=circles[j][1]*16/2,circles[j][2]*16,0,7);
c.lineWidth = 2;
c.strokeStyle = "blue";
c.stroke();
c.fillStyle="rgba(128,128,255,.5)";
c.fill();
//c.closePath();
}
for(j in points_old){
if(j == "HawaiiHonolulu") { diststep=6; fill=1; color="black"; }
if(j == "Ru,Russia,Moscow") { diststep=8; fill=1; color="black"; }
if(j == "Greenland") { capital=0; }
if(j == "Sahara") { fill=1; close = 1; line="yellow"; color = "yellow" }
if(j == "Amazon rainforest") { fill=1; close = 1; line="green"; color = "green" }
if(j == "Superior") { emoji = 0; fill=1; color="#0df"; line = "#0df" }
if(j == "Amazone") { fill=0; close = 0; line="#0df" }
if(j == "Cape canaveral") { emoji = 1 }
if(j == "Mount everest") { emoji = 2 }
if(j == "Etna") { emoji = 3 }
if(emoji){
c.font="30px arial";
c.fillText(["","⭐","🗻","🌋"][emoji], points_old[j][0] * diststep - 16, points_old[j][1] * (diststep/2) )
}
else {
c.beginPath();
c.lineWidth = 1;
for(i = capital ? 0 : -1; i < points_old[j].length; i++){
J = points_old[j][i];
//console.log(J);
if(i == (capital ? 0 : -2)) { /* wait... */ }
else if(i == (capital ? 1 : -1) || J == 127){
if(J==127){
if(close)c.lineTo(x0,y0);
c.lineWidth = 2
c.strokeStyle=line;
c.stroke();
if(fill)c.fillStyle=color;
if(fill)c.fill();
}
c.beginPath();
c.moveTo(x0=x=points_old[j][i+1]*diststep-diststep, y0=y=points_old[j][i+2]*diststep/2);
//console.log(x0,y0);
c.lineTo(x,y+1);
i += 2;
}
else {
A = -((J>>3)-1)* Math.PI/8,
D = (J&7)*diststep+diststep,
c.lineTo(x=Math.floor(x+D*Math.cos(A)),y=Math.floor(y+D*Math.sin(A)))
}
}
if(close) c.lineTo(x0,y0);
c.lineWidth = 2
c.strokeStyle=line;
c.stroke();
if(fill)c.fillStyle=color;
if(fill)c.fill();
}
}
/*if(points[0]){
for(i = capital ? 0 : -1; i < points.length; i++){
J = points[i];
//console.log(J);
if(i == (capital ? 0 : -2)) { }
else if(i == (capital ? 1 : -1) || J == 127){
if(J==127){
c.lineTo(x0,y0);
c.lineWidth = 2
//c.strokeStyle="white";
c.stroke();
//if(fill)c.fillStyle="green";
//if(fill)c.fill();
}
c.beginPath();
c.moveTo(x0=x=points[i+1]*diststep-diststep, y0=y=points[i+2]*diststep/2);
//console.log(x0,y0);
c.lineTo(x,y+1);
i += 2;
}
else {
A = -((J>>3)-1)* Math.PI/8,
D = (J&7)*diststep+diststep,
c.lineTo(x=Math.floor(x+D*Math.cos(A)),y=Math.floor(y+D*Math.sin(A)))
}
}
//c.lineTo(x0,y0);
c.lineWidth = 2
//c.strokeStyle="white";
c.stroke();
//if(fill)c.fillStyle="green";
//if(fill)c.fill();
}
*/
diststep=16;
if(e){
newx = e.pageX;
newy = e.pageY;
//console.log(newx,newy);
closestPoint();
//console.log(newx,newy);
if(started == 2){
c.beginPath();
c.lineWidth = 1;
c.moveTo(centerx=points[0]*16, centery=points[1]*16/2);
//console.log(x,y,newx,newy)
if(typeof distance !== "undefined") c.arc(centerx,centery,distance,0,7);
c.stroke();
//c.closePath();
}
else {
c.fillStyle = "black";
c.fillRect(Math.round(e.pageX / 16) * 16, Math.round(e.pageY / (16/2)) * (16/2), 4, 4);
}
}
diststep = distbackup;
capital = capitalbackup;
}
closestPoint = function(){
if(typeof centerx === "undefined")return;
dx = newx - centerx;
dy = newy - centery;
angle = 0;
distance = 0;
//angle = (((Math.round((Math.atan2(dx, dy))/(2*Math.PI)*16))%16)+8)%16;
distance = Math.round(Math.hypot(dx,dy)/16) * 16;
//console.log(distance);
//console.log(angle, (distance - 8) / diststep)
//angle_rad = -(angle) * Math.PI/8 - Math.PI / 2;
//newx = Math.floor(x + distance * Math.cos(angle_rad));
//newy = Math.floor(y + distance * Math.sin(angle_rad));
}
onkeydown = function(e){
// N (\n)
if(e.keyCode == 78){
started = 0;
if(o.value && !circles[data[count]] )circles[data[count]] = points;
points = [];
o.value += (o.value ? '],\n' : "") + '"' + data[count++] + '":[';
o.scrollTop = 10000;
}
// I (del)
if(e.keyCode == 73){
started = 1;
points.push(127);
o.value += ",127";
}
}
onload = function(){
onkeydown({keyCode: 78});
a.onmousemove();
}
</script>