-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex_map.html
1160 lines (923 loc) · 46.6 KB
/
index_map.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
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<title>World City Populations Interactive Map 1950-2035</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="description" content="Explore the global urban transformation with an interactive map of city populations from 1950-2035. Identify the world's fastest growing cities and regions, and urbanisation cycles of growth and decline. Data is from the UN World Urbanization Prospects 2018." />
<meta property="og:url" content="http://luminocity3d.org/WorldCity/" />
<meta property="og:title" content="World City Populations Interactive Map 1950-2035" />
<meta property="og:description" content="An interactive map of city populations across the globe, exploring the changes between 1950 and 2035. Identify the world's fastest growing cities and regions, and urbanisation cycles of growth and decline." />
<meta property="og:image" content="https://www.luminocity3d.org/WorldCity/WorldCityPreview.png" />
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@citygeographics">
<meta name="twitter:title" content="Mapping the Global Urban Transformation 1950-2035">
<meta name="twitter:description" content="Explore an interactive map of the dramatic changes in city populations across the globe between 1950 and 2035. Identify the world's fastest growing cities and regions, and urbanisation cycles of growth and decline.">
<meta name="twitter:image" content="https://www.luminocity3d.org/WorldCity/WorldCityPreview.png">
<link rel="stylesheet" href="https://libs.cartocdn.com/cartodb.js/v3/3.15/themes/css/cartodb.css" />
<style>
html, body, #map {
height: 100%;
padding: 0;
margin: 0;
}
#chartContainer { width:450px; height: 170px; }
.leaflet-container {
background: #ddd;
}
.leaflet-popup {
position:absolute;
text-align:center;
pointer-events:none;
background-color:transparent;
box-shadow:none;
z-index: 5;
}
.leaflet-popup-content-wrapper {
padding:0;
margin:0;
text-align:left;
pointer-events:all;
background-color: rgba(230,230,230,0.95);
border: 1px solid rgba(140,140,140,0.4);
border-radius: 6px;
box-shadow:none;
}
.leaflet-popup-content {
padding:0;
margin:0;
line-height:inherit;
background-color:transparent;
box-shadow:none;
font: normal 11px Verdana, sans-serif;
}
.leaflet-popup-content p {
padding:0;
margin:0;
background-color:transparent;
box-shadow:none;
font: normal 11px Verdana, sans-serif;
}
.leaflet-popup-content p.title{
padding:8px 5px 7px 32px;
margin:0;
font: normal 15px Verdana, sans-serif;
background-color: #F2F2F2;
border-radius: 6px 6px 0 0;
}
.leaflet-popup-content table{
padding:5px;
margin:0;
width: 400px;
background-color: #F2F2F2;
border-radius: 0 0 6px 6px;
}
.leaflet-popup-content table tr td{
padding:0;
margin:0;
width: 90px;
height: 30px;
text-align: center;
font: normal 12px Verdana, sans-serif;
}
.leaflet-popup-content table tr td.y1950{
background-color: rgba(0,51,68,0.7);
color: #FFF;
}
.leaflet-popup-content table tr td.y1990{
background-color: rgba(5,122,162,0.7);
}
.leaflet-popup-content table tr td.y2015{
background-color: rgba(114,219,255,0.7);
}
.leaflet-popup-content table tr td.y2030{
background-color: rgba(201,251,251,0.7);
}
.leaflet-popup-content table tr td.title{
padding:0;
margin:0;
width: 120px;
text-align: left;
font: bold 12px Verdana, sans-serif;
}
.leaflet-popup-content table tr.pop td {
font: bold 12px Verdana, sans-serif;
}
.leaflet-popup-tip-container {
width:0px;
height:0px;
margin:0 auto;
position:relative;
}
.leaflet-popup-tip {
width:0;
height:0;
margin:0;
border-left:0 solid transparent;
border-right:0 solid transparent;
border-top:0 solid transparent;
box-shadow:none;
}
#worldcitiestitle {
position: absolute;
left: 48px;
top: 10px;
z-index: 6;
border-radius: 6px;
border-left: 1px solid rgba(150,150,150,0.5);
border-right: 1px solid rgba(150,150,150,0.5);
border-top: 1px solid rgba(200,200,200,0.5);
border-bottom: 1px solid rgba(120,120,120,0.5);
background: linear-gradient(rgba(255,255,255,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(200,200,200,0.9));
background-opacity: 0.7;
min-width: 380px;
}
.leaflet-control-zoom.leaflet-bar.leaflet-control {
border: 1px solid rgba(130,130,130,0.5);
}
.leaflet-bar a {
background: rgba(230,230,230,0.9);
width: 28px !important;
height: 28px !important;
line-height: 28px !important;
}
.leaflet-bar {
box-shadow: none;
}
.leaflet-bar a.leaflet-disabled {
background: rgba(215,215,215,0.9);
}
.leaflet-control-zoom-in {
border-bottom: 1px solid rgba(35,87,146,0.2) !important;
font-size: 18px !important;
}
.leaflet-control-zoom-out {
font-size: 18px !important;
}
h1 {
padding: 2px 0 0 0;
margin: 0 12px 0 12px;
font: bold 32px Calibri,Arial, sans-serif;
color: #444;
letter-spacing:-2px;
}
#legendTable {
width: 405px;
padding: 0 0 10px 6px;
margin: 0;
border: 0;
}
#legendTable table {
margin: 0;
padding: 0;
}
#legendTable table td {
text-align: left;
margin: 0;
padding: 0;
}
#legendTable table td.button {
padding: 3px 0 0 0;
vertical-align: top;
}
#legendTable table td.legendtd {
width: 260px;
}
#legendTable table td.credit {
text-align: right;
margin: 0;
padding: 13px 0 2px 0;
width: 145px;
font: normal 10px Tahoma, Arial, sans-serif;
color: #777;
line-height: 1.3;
vertical-align: bottom;
}
#legendTable table td.credit a {
color: #777;
}
.fb-like {
margin: 0 10px 0 8px;
}
#legend {
width: 260px;
}
#legend ul {
margin: 0 20px 15px 0px;
padding: 0 2px 2px 2px;
display: inline;
}
#legend ul li {
margin: 0 0 0 4px;
padding: 0;
list-style: none;
font: italic bold 12px sans-serif;
color: #333;
display: inline;
}
#legtext {
margin: 0 5px 5px 5px;
padding: 0;
font: italic 12px Arial,sans-serif;
color: #333;
}
#shareButtons {
margin: 0;
padding: 2px 10px 2px 4px;
position: absolute;
left: 38px;
bottom: 0;
z-index: 1;
border-radius: 6px 6px 0 0;
border-left: 1px solid rgba(150,150,150,0.5);
border-right: 1px solid rgba(150,150,150,0.5);
border-top: 1px solid rgba(200,200,200,0.5);
border-bottom: 1px solid rgba(120,120,120,0.5);
background: linear-gradient(rgba(255,255,255,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(200,200,200,0.9));
background-opacity: 0.7;
min-width: 210px;
}
#shareButtons table {
margin: 0;
padding: 0;
}
#shareButtons table td {
text-align: left;
margin: 0;
padding: 0;
}
#shareButtons table td.button {
padding: 3px 0 0 0;
vertical-align: top;
}
.cartodb-logo {
right: 0px !important;
bottom: 10px !important;
left: auto !important;
}
.cartodb-logo a img {
right: 10px !important;
bottom: 10px !important;
left: auto !important;
}
#guidepanel {
margin: 0;
padding: 0;
position: absolute;
left: 38px;
bottom: 43px;
height: 423px;
z-index: 1;
border-radius: 6px 6px 0 0;
border-left: 1px solid rgba(150,150,150,0.5);
border-right: 1px solid rgba(150,150,150,0.5);
border-top: 1px solid rgba(200,200,200,0.5);
border-bottom: 1px solid rgba(120,120,120,0.5);
background: linear-gradient(rgba(255,255,255,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9));
background-opacity: 0.7;
max-width: 420px;
display: none;
}
#guidepanel p {
font: normal 14px Verdana, Arial, sans-serif;
line-height: 160%;
margin: 0 0 10px 0;
padding: 0;
}
.maplink {
text-decoration: underline;
color:#057aa2;
}
.maplink:hover {
cursor: pointer;
}
#analysislink {
text-decoration: underline;
color:#057aa2;
}
#analysislink:hover {
cursor: pointer;
}
#guidepanel h3 {
font: italic bold 15px Verdana, Arial, sans-serif;
line-height: 100%;
margin: 15px 0 5px 0;
padding: 0;
}
#guideheader {
padding: 0;
margin: 0;
font: normal 10px Tahoma, Arial, sans-serif;
color: #444;
}
#guideheader ul{
border-radius: 6px 6px 0 0;
margin: 0 0 0 0;
padding: 0 7px 27px 15px;
border-bottom: 1px solid rgba(35,87,146,0.4);
background-color: rgba(230,230,230,0.9);
}
#guideheader ul li{
float: left;
margin: -1px 3px 0 10px;
padding: 4px 9px 6px 9px;
display: inline-block;
border-top: 1px solid rgba(35,87,146,0.4);
border-left: 1px solid rgba(35,87,146,0.4);
border-right: 1px solid rgba(35,87,146,0.4);
border-radius: 0 0 0 0;
background-color: rgba(220,220,220,0.75);
}
#guideheader ul li h2{
color: #777;
font: bold 14px Tahoma, Arial, sans-serif;
margin: 0;
padding: 0;
}
#guideheader ul li a{
color: #333;
}
#guideheader ul li.selected{
border-bottom: 2px solid rgba(245,245,245,1);
background-color: rgba(256,256,256,0.75);
}
#guideheader ul li.unselected:hover{
background-color: rgba(14,188,231,0.5);
cursor: pointer;
color: #fff;
}
#guidecontent {
display: block;
clear: both;
overflow: auto;
max-height: 394px;
padding: 0 15px 0 25px;
}
#analysiscontent {
display: none;
clear: both;
overflow: auto;
max-height: 394px;
min-width: 390px;
padding: 0 15px 0 25px;
}
#selectintro {
font: normal 14px Verdana, Arial, sans-serif;
line-height: 100%;
margin: 0 0 5px 0;
padding: 0;
}
#analysiscontent select {
font: bold 15px Tahoma, Arial, sans-serif;
line-height: 150%;
margin: 0 0 10px 0;
padding: 3px 5px 3px 5px;
color: #333;
}
#analysiscontent select option {
}
#analysiscontent table {
width: 360px;
font: normal 14px Verdana, Arial, sans-serif;
line-height: 120%;
}
#analysiscontent table tr td {
padding: 2px 0 2px 0;
background: #f9f9f9;
text-align: center;
}
#analysiscontent table tr.header td {
padding: 5px 0 5px 0;
font: bold 14px Verdana, Arial, sans-serif;
background: #6c909c;
color: #fff;
}
#minimiseguide {
float: right;
margin: 0 0 0 2px;
padding: 4px 6px 7px 6px;
font: 22px Tahoma, Arial, sans-serif;
color: rgb(31,80,137);
line-height: 0.75;
z-index: 1000;
border-radius: 0 4px 0 0;
background-color: rgba(200,200,200,0.5);
}
#minimiseguide:hover {
background-color: rgba(31,80,137,1);
color: #fff;
cursor: pointer;
}
#guidetab {
color: #333;
margin: 0;
padding: 8px 10px 10px 10px;
position: absolute;
left: 290px;
bottom: 0;
z-index: 1;
border-radius: 6px 6px 0 0;
border-left: 1px solid rgba(150,150,150,0.5);
border-right: 1px solid rgba(150,150,150,0.5);
border-top: 1px solid rgba(200,200,200,0.5);
border-bottom: 1px solid rgba(120,120,120,0.5);
background: linear-gradient(rgba(255,255,255,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9));
background-opacity: 0.7;
font: bold 14px Tahoma, Arial, sans-serif;
}
#guidetab:hover {
cursor: pointer;
background: rgba(14,188,231,0.5);
color: #fff;
}
#analysistab {
color: #333;
margin: 0;
padding: 8px 10px 10px 10px;
position: absolute;
left: 400px;
bottom: 0;
z-index: 1;
border-radius: 6px 6px 0 0;
border-left: 1px solid rgba(150,150,150,0.5);
border-right: 1px solid rgba(150,150,150,0.5);
border-top: 1px solid rgba(200,200,200,0.5);
border-bottom: 1px solid rgba(120,120,120,0.5);
background: linear-gradient(rgba(255,255,255,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9),rgba(230,230,230,0.9));
background-opacity: 0.7;
font: bold 14px Tahoma, Arial, sans-serif;
}
#analysistab:hover {
cursor: pointer;
background: rgba(14,188,231,0.5);
color: #fff;
}
</style>
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div id="map">
</div>
<div id="worldcitiestitle">
<h1>World City Populations <span style="color:#057aa2;">1950</span> - <span style="color:#72dbff;">2035</span></h1>
<div id="legendTable">
<table>
<tr>
<td class="legendtd">
<div id="legend">
<div id="legtext">Circle areas proportional to populations in-</div>
<ul>
<li><span style="background-color:#003344;border-radius: 11px;padding:3px 8px 3px 8px;margin:0 3px 0 2px;"> </span>1950</li>
<li><span style="background-color:#057aa2;border-radius: 11px;padding:3px 8px 3px 8px;margin:0 3px 0 2px;"> </span>1990</li>
<li><span style="background-color:#72dbff;border-radius: 11px;padding:3px 8px 3px 8px;margin:0 3px 0 2px;"> </span>2015</li>
<li><span style="background-color:#c3fff2;border-radius: 11px;padding:3px 8px 3px 8px;margin:0 3px 0 2px;"> </span>2035</li>
</ul>
</div>
</td>
<td class="credit">Data: <a href="http://esa.un.org/unpd/wup/" target="_blank">United Nations 2018</a><br />Design: <a href="http://citygeographics.org/about" target="_blank">D A Smith</a> <a href="http://www.casa.ucl.ac.uk/" target="_blank">CASA, UCL</a></td>
</tr>
</table>
</div>
</div>
<div id="shareButtons">
<table>
<tr>
<td class="button">
<div class="fb-like" data-href="https://luminocity3d.org/WorldCity/" data-layout="button_count" data-action="like" data-colorscheme="light" data-show-faces="false" data-share="true"></div>
</td>
<td class="button">
<a href="https://twitter.com/share" data-text="Mapping the global urban transformation, 1950-2030" data-counturl="luminocity3d.org/WorldCity" class="twitter-share-button" data-via="citygeographics" data-dnt="true">Tweet</a>
<script type="text/javascript">
window.twttr=(function(d,s,id){var t,js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return}js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);return window.twttr||(t={_e:[],ready:function(f){t._e.push(f)}})}(document,"script","twitter-wjs"));
</script></td>
</tr></table>
</div>
<div id="guidepanel">
<div id="minimiseguide">-</div>
<div id="guideheader">
<ul>
<li id="guideh2" class="selected"><h2>Map Guide</h2></li>
<li id="analysish2" class="unselected"><h2>Analysis</h2></li>
</ul>
</div>
<div id="guidecontent">
<h3>The Global Urban Transformation</h3>
<p>This map visualises the radical transformation that has occurred across the globe in the last 60 years, from a 30% urban world in 1950, to a 54% urban world in 2015 and a predicted 68% urban world in 2050. In 1950 there were 740m people living in cities; there are now 4 billion, rising to a predicted 6.6b by 2050. The circles on the map are proportional to city populations in 1950, 1990, 2015 and 2035. Move your mouse over cities to explore their detailed dynamics. Data is from the <a href="http://esa.un.org/unpd/wup/" target="_blank">UN World Urban Propospects 2018</a>. The technique of overlaying proportional circles to show population change over time was first developed in a static map at <a href="https://lsecities.net/ua/" target="_blank">LSE Cities Urban Age</a> by <a href="http://www2.port.ac.uk/portsmouth-school-of-architecture/staff/guido-robazza.html" target="_blank">Guido Robazza</a>.</p>
<p>Industrialisation and urban growth in the 19th and early 20th centuries were powered by Western Europe and the North-Eastern USA, but the urban population of these regions has been relatively static since 1950. Recent growth is instead the result of rapid urbanisation in China, India, Latin America and increasingly Africa. Over half of the world's urban population is now is Asia, with China alone comprising 20% of the global total. Asia and Africa will together account for 90% of the additional 2.3b urban dwellers predicted between 2015 and 2050.</p>
<p>The pace of recent change at the city level is unprecedented in human history. <span class="maplink" id="ShanghaiLink">Shanghai</span> (click on the city link to focus the map) gained 16 million people between 1990 and 2015, <span class="maplink" id="BeijingLink">Beijing</span> 13.6 million, <span class="maplink" id="DhakaLink">Dhaka</span> 11 million. <span class="maplink" id="DelhiLink">Delhi</span> gained 16 million residents between 1990-2015 and is now the world’s second largest city of 26m. Delhi is predicted to overtake Tokyo to become the world's largest city by 2030, with a predicted 43m residents by 2035.</p>
<p>Small towns like <span class="maplink" id="ShenzhenLink">Shenzhen</span>, <span class="maplink" id="XiamenLink">Xiamen</span> and <span class="maplink" id="DubaiLink">Dubai</span> have become cities of several million in little over two decades. While the proportion of urban residents living in large cities is increasing, it is important to realise that 50% of the global urban population live in settlements of less than 0.5m. The minimum population threshold for cities included in this map is 0.4m.</p>
<p>Our increasingly urban world now frames many of society’s greatest challenges. From global equality to health, education, prosperity and, not least, sustainability, solutions need to be interwoven with fostering liveable, efficient and inclusive cities.</p>
<h3>Waves of Growth</h3>
<p>We can see distinct waves of urban growth and stagnation over time. In the 1960s and 1970s, economic growth in <span class="maplink" id="JapanLink">Japan</span>, <span class="maplink" id="MexicoLink">Mexico</span>, <span class="maplink" id="BrazilLink">Brazil</span> and later <span class="maplink" id="KoreaLink">South Korea</span> produced rapid urban growth. This growth peaked in 1990 in Japan, in 2000 in South Korea, and city populations are now peaking in Latin America. This is the typical urbanisation cycle of population stabilisation following development.</p>
<p><span class="maplink" id="ChinaLink">China</span> and <span class="maplink" id="IndiaLink">India’s</span> rapid growth has been much more recent, accelerating in the 1990s and 2000s. China’s growth is predicted to slow over the next two decades, with its total population peaking around 2025, although it's rate of urbanisation will continue to rise towards 70% in 2030. India’s population growth will continue much longer to around 2060. There remains a huge rural Indian population of 800 million people, a significant proportion of which will urbanise in coming decades. </p>
<p>Meanwhile many sub-Saharan African countries are just beginning their rapid urban expansion. <span class="maplink" id="LagosLink">Lagos</span> is set to gain 12 million residents between 2015 and 2035, <span class="maplink" id="KinshasaLink">Kinshasa</span> 15 million, <span class="maplink" id="SalaamLink">Dar es Salaam</span> 8 million, <span class="maplink" id="LuandaLink">Luanda</span> 7.5 million. Urbanisation in Africa will ideally bring the scale of poverty reduction achieved in countries like China, though clearly there are many challenges and huge diversity across the region.</p>
<h3>Find Out More</h3>
<p><a id="analysislink">Analysis page</a>- Query the city data and select cities according to their population and growth during different time periods.</p>
<p><a href="http://esa.un.org/unpd/wup/" target="_blank">UN World Urbanisation Prospects</a>- The dataset used to make this visualisation, with detailed reporting on the future of the world's cities.</p>
<p><a href="http://citygeographics.org/2015/12/09/mapping-the-global-urban-transformation/" target="_blank">Mapping tools used</a>- more information on how this visualisation was created</p>
</div>
<div id="analysiscontent">
<br/>
<div id="selectintro">Choose a data query to select city groups:</div>
<select id="selectquery">
<option value="Q1">Largest Cities 1950</option>
<option value="Q2">Largest Cities 1990</option>
<option value="Q3" selected="selected">Largest Cities 2015</option>
<option value="Q4">Largest Cities 2035</option>
<option value="Q5">Highest Absolute Growth 1950-1990</option>
<option value="Q6">Highest Absolute Growth 1990-2015</option>
<option value="Q7">Highest Absolute Growth 2015-2035</option>
<option value="Q8">Lowest Absolute Growth 1950-1990</option>
<option value="Q9">Lowest Absolute Growth 1990-2015</option>
<option value="Q10">Lowest Absolute Growth 2015-2035</option>
<option value="Q11">Global and National Pop. Totals</option>
</select>
<table id="querytable">
<tr class="header"><td>Rank</td><td>City Name</td><td>Population 2015</td></tr>
<tr><td>1</td><td>Tokyo</td><td>37.3 million</td></tr>
<tr><td>2</td><td>Delhi</td><td>25.9 million</td></tr>
<tr><td>3</td><td>Shanghai</td><td>23.5 million</td></tr>
<tr><td>4</td><td>Mexico City</td><td>21.3 million</td></tr>
<tr><td>5</td><td>Sao Paulo</td><td>20.9 million</td></tr>
<tr><td>6</td><td>Mumbai</td><td>19.3 million</td></tr>
<tr><td>7</td><td>Osaka</td><td>19.3 million</td></tr>
<tr><td>8</td><td>Cairo</td><td>18.8 million</td></tr>
<tr><td>9</td><td>New York</td><td>18.6 million</td></tr>
<tr><td>10</td><td>Beijing</td><td>18.4 million</td></tr>
<tr><td>11</td><td>Dhaka</td><td>17.6 million</td></tr>
<tr><td>12</td><td>Buenos Aires</td><td>14.3 million</td></tr>
</table>
</div>
</div>
<div id="guidetab">Map Guide</div>
<div id="analysistab">Analysis</div>
<!-- include cartodb.js library -->
<script src="https://libs.cartocdn.com/cartodb.js/v3/3.15/cartodb.js"></script>
<script charset="utf-8" src="https://d3js.org/d3.v3.min.js"></script>
<script charset="utf-8" src="https://cdnjs.cloudflare.com/ajax/libs/dimple/2.1.2/dimple.latest.min.js"></script>
<script>
function main() {
var closeTooltip;
var oldCityDataIndex;
var oldCityDataIndex2;
var sql = new cartodb.SQL({ user: 'duncansmith', format: 'geojson' });
var cityHighlight = L.geoJson();
var cityHighlight2 = L.geoJson();
var analysis = 0;
function selectLineStyle(layer) {
var linethick = 3;
var lineopacity = 1;
if (map.getZoom() == 3) {
linethick = 2.5;
};
if (map.getZoom() == 4) {
linethick = 3;
};
if (map.getZoom() == 5) {
linethick = 3.5;
};
if (map.getZoom() == 6) {
linethick = 4;
};
layer.setStyle({
weight: linethick,
opacity: lineopacity
});
}
var map = L.map('map',{
minZoom: 2,
maxZoom: 7,
worldCopyJump: true
}).setView([12, 10], 3);
function mapFocusOn(lat,long,zoom) {
map.setView([lat,long],zoom);
};
//var hash = new L.Hash(map);
var ShanghaiLinkButton = document.getElementById('ShanghaiLink');
var BeijingLinkButton = document.getElementById('BeijingLink');
var DelhiLinkButton = document.getElementById('DelhiLink');
var DhakaLinkButton = document.getElementById('DhakaLink');
var ShenzhenLinkButton = document.getElementById('ShenzhenLink');
var XiamenLinkButton = document.getElementById('XiamenLink');
var DubaiLinkButton = document.getElementById('DubaiLink');
var JapanLinkButton = document.getElementById('JapanLink');
var MexicoLinkButton = document.getElementById('MexicoLink');
var BrazilLinkButton = document.getElementById('BrazilLink');
var KoreaLinkButton = document.getElementById('KoreaLink');
var ChinaLinkButton = document.getElementById('ChinaLink');
var IndiaLinkButton = document.getElementById('IndiaLink');
var LagosLinkButton = document.getElementById('LagosLink');
var KinshasaLinkButton = document.getElementById('KinshasaLink');
var SalaamLinkButton = document.getElementById('SalaamLink');
var LuandaLinkButton = document.getElementById('LuandaLink');
ShanghaiLinkButton.addEventListener('click', function() {
map.setView([31.22,121.46],6);
}, false);
BeijingLinkButton.addEventListener('click', function() {
map.setView([39.91,116.40],6);
}, false);
DelhiLinkButton.addEventListener('click', function() {
map.setView([28.67,77.22],6);
}, false);
DhakaLinkButton.addEventListener('click', function() {
map.setView([23.71,90.41],6);
}, false);
ShenzhenLinkButton.addEventListener('click', function() {
map.setView([22.54,114.06],6);
}, false);
XiamenLinkButton.addEventListener('click', function() {
map.setView([24.48,118.08],6);
}, false);
DubaiLinkButton.addEventListener('click', function() {
map.setView([25.27,55.31],6);
}, false);
JapanLinkButton.addEventListener('click', function() {
map.setView([35.69,139.69],6);
}, false);
MexicoLinkButton.addEventListener('click', function() {
map.setView([19.43,-99.14],5);
}, false);
BrazilLinkButton.addEventListener('click', function() {
map.setView([-15.78,-47.93],5);
}, false);
KoreaLinkButton.addEventListener('click', function() {
map.setView([37.57,126.98],6);
}, false);
ChinaLinkButton.addEventListener('click', function() {
map.setView([30.58,114.27],5);
}, false);
IndiaLinkButton.addEventListener('click', function() {
map.setView([21.15,79.1],5);
}, false);
LagosLinkButton.addEventListener('click', function() {
map.setView([6.45,3.40],6);
}, false);
KinshasaLinkButton.addEventListener('click', function() {
map.setView([-4.33,15.31],6);
}, false);
SalaamLinkButton.addEventListener('click', function() {
map.setView([-6.82,39.27],6);
}, false);
LuandaLinkButton.addEventListener('click', function() {
map.setView([-8.84,13.23],6);
}, false);
var selectQuery = document.getElementById('selectquery');
function queryHighlight() {
if (analysis==1) {
var zoomRatio;
if (map.getZoom() == 3) {zoomRatio = 19;};
if (map.getZoom() == 4) {zoomRatio = 11;};
if (map.getZoom() == 5) {zoomRatio = 7.8;};
if (map.getZoom() == 6) {zoomRatio = 6;};
if (map.getZoom() == 7) {zoomRatio = 5;};
var query = "SELECT * FROM un_wup_2014 WHERE af2015>265";
if (document.getElementById('selectquery').value=="Q1") {query = "SELECT * FROM unwup2018miller2 WHERE af1950>107.5";document.getElementById('querytable').innerHTML= "<tr class='header'><td>Rank</td><td>City Name</td><td>Population 1950</td></tr><tr><td>1</td><td>New York</td><td>12.3 million</td></tr><tr><td>2</td><td>Tokyo</td><td>11.3 million</td></tr><tr><td>3</td><td>London</td><td>8.4 million</td></tr><tr><td>4</td><td>Osaka</td><td>7.0 million</td></tr><tr><td>5</td><td>Paris</td><td>6.3 million</td></tr><tr><td>6</td><td>Moscow</td><td>5.4 million</td></tr><tr><td>7</td><td>Buenos Aires</td><td>5.1 million</td></tr><tr><td>8</td><td>Chicago</td><td>5.0 million</td></tr><tr><td>9</td><td>Kolkata</td><td>4.5 million</td></tr><tr><td>10</td><td>Shanghai</td><td>4.3 million</td></tr><tr><td>11</td><td>Los Angeles</td><td>4.0 million</td></tr><tr><td>12</td><td>Mexico City</td><td>3.4 million</td></tr>"};
if (document.getElementById('selectquery').value=="Q2") {query = "SELECT * FROM unwup2018miller2 WHERE p1990>9600";document.getElementById('querytable').innerHTML= "<tr class='header'><td>Rank</td><td>City Name</td><td>Population 1990</td></tr><tr><td>1</td><td>Tokyo</td><td>32.5 million</td></tr><tr><td>2</td><td>Osaka</td><td>18.4 million</td></tr><tr><td>3</td><td>New York</td><td>16.1 million</td></tr><tr><td>4</td><td>Mexico City</td><td>15.6 million</td></tr><tr><td>5</td><td>Sao Paulo</td><td>14.8 million</td></tr><tr><td>6</td><td>Mumbai</td><td>12.4 million</td></tr><tr><td>7</td><td>Kolkata</td><td>10.9 million</td></tr><tr><td>8</td><td>Los Angeles</td><td>10.9 million</td></tr><tr><td>9</td><td>Seoul</td><td>10.5 million</td></tr><tr><td>10</td><td>Beunos Aires</td><td>11.1 million</td></tr><tr><td>11</td><td>Cairo</td><td>9.9 million</td></tr><tr><td>12</td><td>Rio de Jan.</td><td>9.6 million</td></tr>"};
if (document.getElementById('selectquery').value=="Q3") {query = "SELECT * FROM unwup2018miller2 WHERE p2015>14700";document.getElementById('querytable').innerHTML= "<tr class='header'><td>Rank</td><td>City Name</td><td>Population 2015</td></tr><tr><td>1</td><td>Tokyo</td><td>37.2 million</td></tr><tr><td>2</td><td>Delhi</td><td>25.9 million</td></tr><tr><td>3</td><td>Shanghai</td><td>23.5 million</td></tr><tr><td>4</td><td>Mexico City</td><td>21.3 million</td></tr><tr><td>5</td><td>Sao Paulo</td><td>20.9 million</td></tr><tr><td>6</td><td>Mumbai</td><td>19.3 million</td></tr><tr><td>7</td><td>Osaka</td><td>19.3 million</td></tr><tr><td>8</td><td>Cairo</td><td>18.8 million</td></tr><tr><td>9</td><td>New York</td><td>18.6 million</td></tr><tr><td>10</td><td>Beijing</td><td>18.4 million</td></tr><tr><td>11</td><td>Dhaka</td><td>17.6 million</td></tr><tr><td>12</td><td>Buenos Aires</td><td>14.7 million</td></tr>"};
if (document.getElementById('selectquery').value=="Q4") {query = "SELECT * FROM unwup2018miller2 WHERE p2035>23000";document.getElementById('querytable').innerHTML= "<tr class='header'><td>Rank</td><td>City Name</td><td>Population 2035</td></tr><tr><td>1</td><td>Delhi</td><td>43.3 million</td></tr><tr><td>2</td><td>Tokyo</td><td>36 million</td></tr><tr><td>3</td><td>Shanghai</td><td>34.3 million</td></tr><tr><td>4</td><td>Dhaka</td><td>31.2 million</td></tr><tr><td>5</td><td>Cairo</td><td>28.5 million</td></tr><tr><td>6</td><td>Mumbai</td><td>27.3 million</td></tr><tr><td>7</td><td>Kinshasa</td><td>26.7 million</td></tr><tr><td>8</td><td>Mexico City</td><td>25.4 million</td></tr><tr><td>9</td><td>Beijing</td><td>25.3 million</td></tr><tr><td>10</td><td>Sao Paulo</td><td>24.5 million</td></tr><tr><td>11</td><td>Lagos</td><td>24.4 million</td></tr><tr><td>12</td><td>Karachi</td><td>23.1 million</td></tr>"};
if (document.getElementById('selectquery').value=="Q5") {query = "SELECT * FROM unwup2018miller2 WHERE growth1990>6400";document.getElementById('querytable').innerHTML= "<tr class='header'><td>Rank</td><td>City Name</td><td>Pop. Growth 1950-1990</td></tr><tr><td>1</td><td>Tokyo</td><td>21.3 million</td></tr><tr><td>2</td><td>Sao Paulo</td><td>12.4 million</td></tr><tr><td>3</td><td>Mexico City</td><td>12.3 million</td></tr><tr><td>4</td><td>Osaka</td><td>11.4 million</td></tr><tr><td>5</td><td>Seoul</td><td>9.5 million</td></tr><tr><td>6</td><td>Mumbai</td><td>9.3 million</td></tr><tr><td>7</td><td>Delhi</td><td>8 million</td></tr><tr><td>8</td><td>Cairo</td><td>7.4 million</td></tr><tr><td>9</td><td>Los Angeles</td><td>6.8 million</td></tr><tr><td>10</td><td>Jakarta</td><td>6.7 million</td></tr><tr><td>11</td><td>Rio de Janeiro</td><td>6.7 million</td></tr><tr><td>12</td><td>Manila</td><td>6.4 million</td></tr>"};
if (document.getElementById('selectquery').value=="Q6") {query = "SELECT * FROM unwup2018miller2 WHERE growth2015>7400";document.getElementById('querytable').innerHTML= "<tr class='header'><td>Rank</td><td>City Name</td><td>Pop. Growth 1990-2015</td></tr><tr><td>1</td><td>Delhi</td><td>16.5 million</td></tr><tr><td>2</td><td>Shanghai</td><td>14.9 million</td></tr><tr><td>3</td><td>Beijing</td><td>11.6 million</td></tr><tr><td>4</td><td>Dhaka</td><td>11.0 million</td></tr><tr><td>5</td><td>Shenzhen</td><td>10.4 million</td></tr><tr><td>6</td><td>Chongqing</td><td>9.4 million</td></tr><tr><td>7</td><td>Cairo</td><td>8.9 million</td></tr><tr><td>8</td><td>Guangzhou</td><td>8.4 million</td></tr><tr><td>9</td><td>Tianjin</td><td>8.0 million</td></tr><tr><td>10</td><td>Kinshasa</td><td>7.9 million</td></tr><tr><td>11</td><td>Istanbul</td><td>7.5 million</td></tr><tr><td>12</td><td>Lagos</td><td>7.5 million</td></tr>"};
if (document.getElementById('selectquery').value=="Q7") {query = "SELECT * FROM unwup2018miller2 WHERE growth2035>7400";document.getElementById('querytable').innerHTML= "<tr class='header'><td>Rank</td><td>City Name</td><td>Pop. Growth 2015-2035</td></tr><tr><td>1</td><td>Delhi</td><td>17.5 million</td></tr><tr><td>2</td><td>Kinshasa</td><td>15.1 million</td></tr><tr><td>3</td><td>Dhaka</td><td>13.6 million</td></tr><tr><td>4</td><td>Lagos</td><td>12.2 million</td></tr><tr><td>5</td><td>Shanghai</td><td>10.9 million</td></tr><tr><td>6</td><td>Cairo</td><td>9.7 million</td></tr><tr><td>7</td><td>Karachi</td><td>8.8 million</td></tr><tr><td>8</td><td>Lahore</td><td>8.7 million</td></tr><tr><td>9</td><td>Dar es Salaam</td><td>8.3 million</td></tr><tr><td>10</td><td>Mumbai</td><td>8.3 million</td></tr><tr><td>11</td><td>Bangalore</td><td>7.9 million</td></tr><tr><td>12</td><td>Luanda</td><td>7.5 million</td></tr>"};
if (document.getElementById('selectquery').value=="Q8") {query = "SELECT * FROM unwup2018miller2 WHERE growth1990<-40";document.getElementById('querytable').innerHTML= "<tr class='header'><td>Rank</td><td>City Name</td><td>Pop. Growth 1950-1990</td></tr><tr><td>1</td><td>London</td><td>-1.6 million</td></tr><tr><td>2</td><td>Liverpool</td><td>-0.5 million</td></tr><tr><td>3</td><td>Copenhagen</td><td>-0.2 million</td></tr><tr><td>4</td><td>Newcastle</td><td>-0.2 million</td></tr><tr><td>5</td><td>Manchester</td><td>-0.1 million</td></tr><tr><td>6</td><td>The Hague</td><td>-0.1 million</td></tr><tr><td>7</td><td>Scranton</td><td>-0.1 million</td></tr><tr><td>8</td><td>Leeds</td><td>-0.1 million</td></tr><tr><td>9</td><td>Glasgow</td><td>-0.1 million</td></tr><tr><td>10</td><td>Leipzig</td><td>0.0 million</td></tr><tr><td>11</td><td>Vienna</td><td>0.0 million</td></tr><tr><td>12</td><td>Hull</td><td>0.0 million</td></tr>"};
if (document.getElementById('selectquery').value=="Q9") {query = "SELECT * FROM unwup2018miller2 WHERE growth2015<-140";document.getElementById('querytable').innerHTML= "<tr class='header'><td>Rank</td><td>City Name</td><td>Pop. Growth 1990-2015</td></tr><tr><td>1</td><td>Seoul</td><td>-0.6 million</td></tr><tr><td>2</td><td>Aleppo</td><td>-0.6 million</td></tr><tr><td>3</td><td>Busan</td><td>-0.3 million</td></tr><tr><td>4</td><td>Budapest</td><td>-0.3 million</td></tr><tr><td>5</td><td>Riga</td><td>-0.3 million</td></tr><tr><td>6</td><td>Yichun</td><td>-0.2 million</td></tr><tr><td>7</td><td>Bucharest</td><td>-0.2 million</td></tr><tr><td>8</td><td>Dnipropetrovsk</td><td>-0.2 million</td></tr><tr><td>9</td><td>Donetsk</td><td>-0.2 million</td></tr><tr><td>10</td><td>Nizhniy Nov.</td><td>-0.2 million</td></tr><tr><td>11</td><td>Tbilisi</td><td>-0.1 million</td></tr><tr><td>12</td><td>Kharkiv</td><td>-0.1 million</td></tr>"};
if (document.getElementById('selectquery').value=="Q10") {query = "SELECT * FROM unwup2018miller2 WHERE growth2035<-69";document.getElementById('querytable').innerHTML= "<tr class='header'><td>Rank</td><td>City Name</td><td>Pop. Growth 2015-2035</td></tr><tr><td>1</td><td>Tokyo</td><td>-1.2 million</td></tr><tr><td>2</td><td>Osaka</td><td>-1.0 million</td></tr><tr><td>3</td><td>Kitakyushu</td><td>-0.2 million</td></tr><tr><td>4</td><td>Donetsk</td><td>-0.1 million</td></tr><tr><td>5</td><td>Dnipropetrovsk</td><td>-0.1 million</td></tr><tr><td>6</td><td>Hiroshima</td><td>-0.1 million</td></tr><tr><td>7</td><td>Nagoya</td><td>-0.1 million</td></tr><tr><td>8</td><td>Bucharest</td><td>-0.1 million</td></tr><tr><td>9</td><td>Krivoi Rog</td><td>-0.1 million</td></tr><tr><td>10</td><td>Lodz</td><td>-0.1 million</td></tr><tr><td>11</td><td>Zaporizhzhya</td><td>-0.1 million</td></tr><tr><td>12</td><td>Sapporo</td><td>-0.1 million</td></tr>"};
if (document.getElementById('selectquery').value=="Q11") {query = "SELECT * FROM unwup2018miller2 WHERE af2015=-999";document.getElementById('querytable').innerHTML= "<tr class='header'><td>Country</td><td>Pop.<br />2015</td><td>%<br />Urb.</td><td>Pop.<br />2035</td><td>%<br />Urb.</td></tr><tr><td>World Tot.</td><td>7.3b</td><td>54%</td><td>8.9b</td><td>63%</td></tr><tr><td>China</td><td>1.4b</td><td>56%</td><td>1.4b</td><td>74%</td></tr><tr><td>India</td><td>1.31b</td><td>33%</td><td>1.56b</td><td>43%</td></tr><tr><td>USA</td><td>320m</td><td>82%</td><td>365m</td><td>86%</td></tr><tr><td>Indonesia</td><td>258m</td><td>54%</td><td>305m</td><td>66%</td></tr><tr><td>Brazil</td><td>206m</td><td>86%</td><td>229m</td><td>90%</td></tr><tr><td>Pakistan</td><td>189m</td><td>36%</td><td>261m</td><td>43%</td></tr><tr><td>Nigeria</td><td>181m</td><td>48%</td><td>297m</td><td>62%</td></tr><tr><td>Bangladesh</td><td>161m</td><td>34%</td><td>191m</td><td>49%</td></tr><tr><td>Russia</td><td>143m</td><td>74%</td><td>138m</td><td>79%</td></tr><tr><td>Japan</td><td>127m</td><td>91%</td><td>118m</td><td>93%</td></tr><tr><td>Mexico</td><td>125m</td><td>79%</td><td>153m</td><td>85%</td></tr>"};
sql.execute(query).done(function(geojson) {
cartodb.log.log("Geojson Length " + geojson.features.length);
for (var i = 0; i < geojson.features.length; i++) {
geojson.features[i].geometry.coordinates[0] = geojson.features[i].geometry.coordinates[0]*0.9989;
geojson.features[i].geometry.coordinates[1] = geojson.features[i].properties['lat3'];
}
map.removeLayer(cityHighlight2);
cityHighlight2 = L.geoJson(geojson, {
pointToLayer: function(feature, latlng) {
return L.circleMarker(latlng, {
radius: (feature.properties.af2030/zoomRatio),
opacity: 0,
fillOpacity: 0.3,
fillColor: '#ffc000',
color: '#ffc000',
weight: 0
})
}
});
selectLineStyle(cityHighlight2);
cityHighlight2.addTo(map);
});
}
};
selectQuery.addEventListener('change', function() {
analysis = 1;
queryHighlight();
}, false);
// L.tileLayer('http://tile.casa.ucl.ac.uk/duncan/WorldBackground/{z}/{x}/{y}.png', {
// }).addTo(map);
cartodb.createLayer(map, 'https://duncansmith.carto.com/api/v2/viz/aae02b16-c5ae-11e5-a902-0ecd1babdde5/viz.json')
.addTo(map,1)
.on('done', function(layer) {
layer.getSubLayer(1).setInteraction(true);
cartodb.log.log("Layer has " + layer.getSubLayerCount() + " sublayer(s).");
layer.on('featureOver', function(e, latlng, pos, data) {
cartodb.log.log("FeatureOver");
cartodb.log.log(e);
cartodb.log.log(latlng);
cartodb.log.log(pos);
cartodb.log.log(pos.x);
document.getElementById("map").style.cursor = "pointer";
var CityDataIndex = (data.cartodb_id - 1);
cartodb.log.log(data.cartodb_id);
cartodb.log.log(data);
if (CityDataIndex != oldCityDataIndex2) {
var pbounds = map.getPixelBounds();
var minbounds = pbounds.min;
var maxbounds = pbounds.max;
var offsetx = 200;
var offsety = 400;
var bottomdistance = (maxbounds.y-minbounds.y)-pos.y;
var rightdistance = (maxbounds.x-minbounds.x)-pos.x;
if (pos.x < 490) {offsetx=(700-pos.x);offsety=300;};
if (bottomdistance < 400) {offsety=-80;};
if (rightdistance < 380) {offsetx=(-250+rightdistance);};
var offsetp = new L.Point(offsetx, offsety);
var popup = new L.Popup({ autoPan: false, closeButton: false, offset: offsetp, minWidth: 400});
popup.setLatLng(latlng);
}
var zoomRatio;
if (map.getZoom() == 2) {zoomRatio = 28;};
if (map.getZoom() == 3) {zoomRatio = 19;};
if (map.getZoom() == 4) {zoomRatio = 11;};
if (map.getZoom() == 5) {zoomRatio = 7.8;};
if (map.getZoom() == 6) {zoomRatio = 6;};
if (map.getZoom() == 7) {zoomRatio = 6;};
if (CityDataIndex != oldCityDataIndex) {
sql.execute("SELECT * FROM unwup2018miller2 WHERE cartodb_id="+data.cartodb_id).done(function(geojson) {
var coordinates = geojson.features[0].geometry.coordinates;
cartodb.log.log("Properties Test-");
cartodb.log.log(geojson.features[0].properties['lat2']);
geojson.features[0].geometry.coordinates[0] = geojson.features[0].geometry.coordinates[0]*0.9989;
geojson.features[0].geometry.coordinates[1] = geojson.features[0].properties['lat3'];
map.removeLayer(cityHighlight);
cityHighlight = L.geoJson(geojson, {
pointToLayer: function(feature, latlng2) {
return L.circleMarker(latlng2, {
radius: (feature.properties.af2035/zoomRatio),
opacity: 0,
fillOpacity: 0.2,
fillColor: '#fff64c',
color: '#fff64c',
weight: 0
})
}
});
selectLineStyle(cityHighlight);
cityHighlight.addTo(map);
});
oldCityDataIndex = CityDataIndex;
}
d3.csv("CityData_WUP2018.csv", function(CityData) {
//console.log(CityData[0]);
popup.setContent("<p class='title'><span style='font-weight:bold; color:#000;'> " + CityData[CityDataIndex].UrbanAgglomeration + " </span> <span style='color:#666;'> " + CityData[CityDataIndex].Country + " </span></p>" + "<div id='chartContainer'></div>" + "<table><tr><td class='title'>Year</td><td>1950</td><td>1990</td><td>2015</td><td>2035</td></tr><tr class='pop'><td class='title'>Population</td><td class='y1950'>" + (CityData[CityDataIndex].a1950/1000).toFixed(1) + "m</td><td class='y1990'>" + (CityData[CityDataIndex].a1990/1000).toFixed(1) + "m</td><td class='y2015'>" + (CityData[CityDataIndex].a2015/1000).toFixed(1) + "m</td><td class='y2030'>" + (CityData[CityDataIndex].a2035/1000).toFixed(1) + "m</td></tr><tr><td class='title'>Global Rank</td><td>" + CityData[CityDataIndex].r1950 + "</td><td>" + CityData[CityDataIndex].r1990 + "</td><td>" + CityData[CityDataIndex].r2015 + "</td><td>" + CityData[CityDataIndex].r2035 + "</td></tr><tr><td class='title'>National Rank</td><td>" + CityData[CityDataIndex].nr1950 + "</td><td>" + CityData[CityDataIndex].nr1990 + "</td><td>" + CityData[CityDataIndex].nr2015 + "</td><td>" + CityData[CityDataIndex].nr2035 + "</td></tr></table>");
if (!popup._map) popup.openOn(map);
window.clearTimeout(closeTooltip);
if (!L.Browser.ie && !L.Browser.opera) {
layer.bringToFront();
}
var svg = dimple.newSvg("#chartContainer", 420, 220);
chartdata = [
{ "City":"Hist","Date":"1950","Population":(CityData[CityDataIndex].a1950*1000) },
{ "City":"Hist","Date":"1960","Population":(CityData[CityDataIndex].a1960*1000) },
{ "City":"Hist","Date":"1970","Population":(CityData[CityDataIndex].a1970*1000) },
{ "City":"Hist","Date":"1980","Population":(CityData[CityDataIndex].a1980*1000) },
{ "City":"Hist","Date":"1990","Population":(CityData[CityDataIndex].a1990*1000) },
{ "City":"Hist","Date":"2000","Population":(CityData[CityDataIndex].a2000*1000) },
{ "City":"Hist","Date":"2010","Population":(CityData[CityDataIndex].a2010*1000)},
{ "City":"Hist","Date":"2015","Population":(CityData[CityDataIndex].a2015*1000) },
{ "City":"Proj","Date":"2015","Population":(CityData[CityDataIndex].a2015*1000) },
{ "City":"Proj","Date":"2020","Population":(CityData[CityDataIndex].a2020*1000) },
{ "City":"Proj","Date":"2030","Population":(CityData[CityDataIndex].a2030*1000) },
{ "City":"Proj","Date":"2035","Population":(CityData[CityDataIndex].a2035*1000) }
];
var myChart = new dimple.chart(svg, chartdata);
myChart.setBounds(38, 15, 340, 120);
myChart.defaultColors = [
new dimple.color("#54aae3"),
new dimple.color("#54aae3")
];