Skip to content

Instantly share code, notes, and snippets.

@enjalot
Last active August 18, 2019 11:07
Show Gist options
  • Save enjalot/18cb7a77b2d9de597b86 to your computer and use it in GitHub Desktop.
Save enjalot/18cb7a77b2d9de597b86 to your computer and use it in GitHub Desktop.
dots on a map: setup

This is a simple setup of Leaflet (via Mapbox) with d3 to show dots on a map. This can serve as a base for many interesting geographically based visualizations

Nice overview of using d3 + Leaflet. I found this slightly simpler to use than Mike's classic post.

Built with blockbuilder.org

lat lon
51.475542 -0.038495
51.54907 -0.038173
51.476571 -0.038108
51.487963 -0.037947
51.475435 -0.037937
51.567367 -0.03775
51.527836 -0.03732
51.475188 -0.037175
51.475542 -0.037153
51.475658 -0.037089
51.475803 -0.036778
51.475843 -0.036252
51.545587 -0.036177
51.475653 -0.036123
51.480798 -0.035609
51.506618 -0.03548
51.486106 -0.035372
51.465945 -0.035212
51.47617 -0.035104
51.474587 -0.034943
51.486076 -0.034825
51.477651 -0.034589
51.490428 -0.034364
51.47748 -0.033838
51.508862 -0.033774
51.524585 -0.03376
51.505864 -0.033591
51.48465 -0.033484
51.476017 -0.033388
51.525753 -0.033087
51.505129 -0.032819
51.475663 -0.032722
51.529892 -0.032669
51.501349 -0.032508
51.54921 -0.031896
51.529204 -0.031843
51.483995 -0.03181
51.54504 -0.031156
51.48475 -0.031049
51.551525 -0.03087
51.475462 -0.030663
51.51176 -0.030502
51.525486 -0.030298
51.470965 -0.029944
51.509103 -0.029869
51.53812 -0.029343
51.521579 -0.028524
51.512895 -0.028066
51.536052 -0.02754
51.475141 -0.02732
51.475876 -0.027288
51.526901 -0.026843
51.526901 -0.026843
51.475168 -0.026757
51.538895 -0.026682
51.504244 0.026682
51.479952 -0.026323
51.478857 -0.026242
51.497248 -0.02621
51.474767 -0.026178
51.478753 -0.026103
51.478733 -0.026087
51.477915 -0.026081
51.476879 -0.026019
51.48019 -0.025936
51.477741 -0.025894
51.477567 -0.025856
51.502745 -0.025684
51.480714 -0.02547
51.526981 -0.025427
51.474734 -0.025389
51.474773 -0.025148
51.485632 -0.025116
51.474694 -0.025022
51.526875 -0.024869
51.479679 -0.024729
51.474557 -0.02459
51.492118 -0.024306
51.527629 -0.024188
51.542535 -0.024118
51.543045 -0.024043
51.474319 -0.023893
51.543078 -0.023823
51.476251 -0.023603
51.527591 -0.02355
51.543702 -0.023362
51.467402 -0.023088
51.542578 -0.022948
51.54464 -0.022877
51.538647 -0.022723
51.541261 -0.022573
51.53124 -0.022348
51.538378 -0.021972
51.534981 -0.021768
51.528296 -0.021682
51.536779 -0.021446
51.536866 -0.021232
51.540153 -0.021092
51.540703 -0.020806
51.538808 -0.020642
51.505 -0.020333
51.539468 -0.020202
51.514705 -0.019735
51.528366 -0.019665
51.528343 -0.019596
51.503666 -0.019333
51.478068 -0.01914
51.48036 -0.019097
51.477978 -0.019086
51.504956 -0.019043
51.502933 -0.018783
51.527482 -0.0187
51.469147 -0.018501
51.480794 -0.018196
51.529711 -0.018078
51.52857 -0.018051
51.48781 -0.017943
51.509837 -0.017595
51.480367 -0.017595
51.484329 0.017423
51.527329 -0.017359
51.481396 -0.017187
51.528857 -0.017107
51.526674 -0.017021
51.510682 -0.016779
51.486834 0.016071
51.473163 -0.014784
51.481556 -0.014752
51.523063 -0.014424
51.477935 -0.013271
51.479525 -0.012928
51.484563 0.012874
51.510825 -0.012767
51.478142 -0.012402
51.516534 -0.011898
51.524271 -0.01127
51.511266 -0.011222
51.480531 -0.010648
51.483895 -0.010643
51.486547 -0.010288
51.509219 -0.010182
51.48316 -0.010063
51.480761 -0.009891
51.489456 -0.009731
51.482906 -0.009655
51.481022 -0.009613
51.481382 -0.009548
51.509663 -0.009527
51.480792 -0.009436
51.482324 -0.009001
51.482324 -0.009001
51.482932 -0.00825
51.527322 -0.007966
51.480353 -0.007531
51.48048 -0.007209
51.52622 -0.007172
51.505967 -0.00693
51.477881 0.006201
51.483652 -0.005934
51.504731 0.005855
51.483564 -0.005589
51.483564 -0.005589
51.482839 -0.005493
51.482639 -0.0053
51.474807 0.005064
51.509363 -0.004645
51.523924 -0.004098
51.475502 -0.003755
51.509376 -0.003529
51.508281 0.0031
51.510191 -0.002993
51.478062 -0.001668
51.478062 -0.001668
51.478065 -0.001469
51.486848 0.001427
51.486848 0.001427
51.477798 -0.001212
51.477674 -0.001158
51.5073509 -0.1277583
51.5145956 -0.33857
51.5073509 -0.1277583
51.51312000000001 -0.127595
51.5073509 -0.1277583
51.51043199999999 -0.1299702
51.5155598 -0.1161289
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5117321 -0.1232697
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5149571 -0.1211454
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5185658 -0.1149099
51.5073509 -0.1277583
51.5073509 -0.1277583
51.515861 -0.129694
51.5073509 -0.1277583
51.51508990000001 -0.1336483
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5231081 -0.1292042
51.52150289999999 -0.1203547
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5247339 -0.1369032
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5296213 -0.2012849
51.5232581 -0.1842212
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5289223 -0.2014895
51.56222289999999 -0.1985282
51.5073509 -0.1277583
51.4971813 -0.2019931
51.5043483 -0.1975741
51.5202428 -0.1702298
51.5171041 -0.1728799
51.52064799999999 -0.1782033
51.5096281 -0.1703541
51.5073509 -0.1277583
51.5073509 -0.1277583
51.52111 -0.20104
51.5124887 -0.1824116
51.5148513 -0.1938418
51.51433309999999 -0.1761285
51.5073509 -0.1277583
51.5157727 -0.1647027
51.51651769999999 -0.1766506
51.5176717 -0.1738984
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5134339 -0.183801
51.5136609 -0.1132125
51.51359249999999 -0.1668292
51.520272 -0.135336
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5161319 -0.1473296
51.5145956 -0.33857
51.5073509 -0.1277583
51.5134907 -0.1345023
51.5073509 -0.1277583
51.538309 -0.2071641
51.5207027 -0.1344628
51.5073509 -0.1277583
51.5136143 -0.1365486
51.5098192 -0.1310514
51.5073509 -0.1277583
51.513481 -0.14655
51.5073509 -0.1277583
51.5111972 -0.1347663
51.5073509 -0.1277583
51.5136143 -0.1365486
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5226389 -0.14044
51.5109735 -0.1508328
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5124411 -0.1318767
51.51801400000001 -0.1354301
51.5060812 -0.149544
51.5222916 -0.1387333
51.5073509 -0.1277583
51.5138699 -0.1396175
51.5073509 -0.1277583
51.5136143 -0.1365486
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5156031 -0.161764
51.5244218 -0.1664283
51.5192139 -0.144492
51.5107896 -0.1317263
51.518169 -0.1430276
51.5038277 -0.1019775
51.5073509 -0.1277583
51.50259759999999 -0.1517873
51.5073509 -0.1277583
51.466427 -0.123675
51.4923886 -0.1050748
51.5073509 -0.1277583
51.4723055 -0.1220312
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4697136 -0.1189939
51.4660641 -0.102184
51.5073509 -0.1277583
51.4775697 -0.112791
51.5073509 -0.1277583
51.5353974 -0.1147066
51.478284 -0.1142466
51.4815584 -0.0264139
51.47551540000001 -0.1378307
51.4819076 -0.1251319
51.5073509 -0.1277583
51.4716916 -0.1331236
51.47551540000001 -0.1378307
51.5073509 -0.1277583
51.49662499999999 -0.1634219
51.4789481 -0.2086299
51.5007732 -0.1781484
51.5073509 -0.1277583
51.5073509 -0.1277583
51.498034 -0.1799239
51.501382 -0.176053
51.5237433 -0.0668366
51.5010095 -0.1932794
51.5010095 -0.1932794
51.4980918 -0.1814716
51.4978095 -0.1745235
51.4998446 -0.1772095
51.5073509 -0.1277583
51.5010095 -0.1932794
51.500633 -0.1691499
51.5073509 -0.1277583
51.4998069 -0.1691373
51.49671499999999 -0.1763672
51.49432 -0.18263
51.46929979999999 -0.2116285
51.48220569999999 -0.1969622
51.4696946 -0.2101711
51.47906760000001 -0.1920313
51.4667798 -0.2131116
51.480068 -0.189926
51.4806908 -0.2111959
51.4773313 -0.2017231
51.480068 -0.189926
51.5073509 -0.1277583
51.4844337 -0.2049439
51.4769525 -0.2096969
51.4788475 -0.1982514
51.4773313 -0.2017231
51.4735744 -0.1993563
51.47949980000001 -0.1990462
51.3912756 -0.2470864
51.4804417 -0.2037237
51.480677 -0.2058802
51.3912756 -0.2470864
51.4811556 -0.1987405
51.480677 -0.2058802
51.480239 -0.1966625
51.5073509 -0.1277583
51.48971969999999 -0.189263
51.5073509 -0.1277583
51.49034049999999 -0.1958622
51.49375029999999 -0.1943072
51.49211829999999 -0.193179
51.49034049999999 -0.1958622
51.4933169 -0.1921479
51.490643 -0.1887315
51.493726 -0.1932648
51.4904986 -0.1991069
51.5073509 -0.1277583
51.48727 -0.19558
51.46231 -0.13857
51.4578309 -0.1481652
51.457819 -0.1427723
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4621432 -0.1399972
51.48450330000001 -0.1751143
51.4832845 -0.1692853
51.485093 -0.174936
51.485093 -0.174936
51.4846367 -0.1606804
51.4919309 -0.1617253
51.48324119999999 -0.1672116
51.485093 -0.174936
51.485093 -0.174936
51.485093 -0.174936
51.4999574 -0.1635268
51.4946147 -0.1628318
51.4899368 -0.1668178
51.50856779999999 -0.0685133
51.485093 -0.174936
51.4860982 -0.1613697
51.485093 -0.174936
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4870463 -0.1625369
51.5073509 -0.1277583
51.5073509 -0.1277583
51.524765 -0.092719
51.5073509 -0.1277583
51.4791075 -0.1564981
51.4818232 -0.1443989
51.477992 -0.14823
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4852999 -0.1911445
51.4891792 -0.1841048
51.4848806 -0.1786719
51.4894353 -0.1819277
51.4879591 -0.1876951
51.4782173 -0.1816507
51.656737 -0.107869
51.479647 -0.1785303
51.5073509 -0.1277583
51.485093 -0.174936
51.5073509 -0.1277583
51.5073509 -0.1277583
51.483365 -0.1765175
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4997002 -0.1544549
51.5083894 -0.1394816
51.5024597 -0.1348109
51.4572897 -0.205565
51.5073509 -0.1277583
51.5008748 -0.1223288
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4939534 -0.1260942
51.4985447 -0.1407959
51.4959119 -0.1476978
51.4998438 -0.1258632
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4915335 -0.1290035
51.4908194 -0.1528763
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4952103 -0.1438979
51.5073509 -0.1277583
51.5354349 -0.1403994
51.5354349 -0.1403994
51.5073509 -0.1277583
51.5073509 -0.1277583
51.49580899999999 -0.13944
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5230283 -0.124033
51.5073509 -0.1277583
51.447222 0.04805599999999999
51.4781321 -0.0259971
51.466788 -0.066991
51.4815584 -0.0264139
51.5073509 -0.1277583
51.4776179 -0.0225955
51.4815584 -0.0264139
51.5073509 -0.1277583
51.5073509 -0.1277583
51.46939 -0.02269
51.5073509 -0.1277583
51.48847749999999 -0.0364349
51.4815584 -0.0264139
51.47530279999999 -0.037763
51.479706 -0.024497
51.4894226 -0.0346273
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4652843 -0.2597627
51.4815293 -0.1007667
51.475561 -0.0908654
51.47039299999999 -0.0936
51.5966598 -0.1776482
51.474191 -0.06913699999999999
51.5073509 -0.1277583
51.4792967 0.0237645
51.5073509 -0.1277583
51.5312327 0.0605822
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4879407 -0.09556039999999999
51.4894977 -0.0836997
51.4842695 -0.0840519
51.5073509 -0.1277583
51.492568 -0.08696279999999999
51.489876 -0.09289689999999999
51.5312327 0.0605822
51.489876 -0.09289689999999999
51.5073509 -0.1277583
51.4915826 -0.0927595
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4922908 -0.0670827
51.49858210000001 -0.0691276
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4982345 -0.04599210000000001
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4982345 -0.04599210000000001
51.50072900000001 -0.0582621
51.4982345 -0.04599210000000001
51.5061137 -0.1020885
51.5073509 -0.1277583
51.4624771 -0.0500312
51.4704809 -0.0446527
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4711504 -0.0405998
51.5617945 -0.1904614
51.4751354 -0.0393556
51.471022 -0.040245
51.471022 -0.040245
51.5002144 -0.1907216
51.5073509 -0.1277583
51.4957428 -0.1085865
51.5073509 -0.1277583
51.4936821 -0.1007288
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4957797 -0.1198461
51.4907797 -0.1209723
51.5073509 -0.1277583
51.4913023 -0.1144069
51.5073509 -0.1277583
51.4879638 -0.1115584
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4941127 -0.1087635
51.5073509 -0.1277583
51.48981209999999 -0.1188038
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.48257659999999 -0.0076589
51.48257659999999 -0.0076589
51.5073509 -0.1277583
51.4477253 -0.0060468
51.5073509 -0.1277583
51.48452460000001 0.0168706
51.5073509 -0.1277583
51.5054564 -0.07535649999999999
51.4402386 -0.3722122
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4897032 -0.0790435
51.50379909999999 -0.0980978
51.5034702 -0.0915695
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.503733 -0.0808455
51.5073509 -0.1277583
51.5005458 -0.1053294
51.49920729999999 -0.08800609999999999
51.503901 -0.0749999
51.5028201 -0.0967494
51.5147546 -0.13608
51.5010397 -0.1914084
51.5069124 -0.0911203
51.5033938 -0.08797189999999999
51.49920729999999 -0.08800609999999999
51.53640859999999 -0.161131
51.5073509 -0.1277583
51.5320336 -0.1703011
51.535228 -0.1630104
51.5073509 -0.1277583
51.53666550000001 -0.1624174
51.5367909 -0.1830032
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.53202719999999 -0.1816467
51.525431 -0.169368
51.5230806 -0.1725068
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5341304 -0.1651823
51.531786 -0.1770044
51.5073509 -0.1277583
51.52472960000001 -0.1699432
51.5303635 -0.1811704
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5533845 -0.1993421
51.536998 -0.1902147
51.5500841 -0.1996786
51.5536993 -0.1988158
51.4842932 -0.3081026
51.5073509 -0.1277583
51.5507928 -0.1357605
51.5540005 -0.1437469
51.5543385 -0.1401906
51.5507928 -0.1357605
51.6044286 -0.1906647
51.5594249 -0.1516889
51.5490134 -0.1410166
51.550371 -0.140445
51.5073509 -0.1277583
51.5036729 -0.0909644
51.5073509 -0.1277583
51.5511419 -0.1403439
51.5540005 -0.1437469
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5557554 -0.1451923
51.5473039 -0.142005
51.5073509 -0.1277583
51.556394 -0.148184
51.56001389999999 -0.1807368
51.5659834 -0.1347797
51.5604279 -0.1815351
51.4807608 0.0784633
51.5518631 -0.1673925
51.55951959999999 -0.1793808
51.5556747 -0.1763896
51.5576658 -0.1787801
51.5500682 -0.1774451
51.5556715 -0.1762025
51.55829809999999 -0.1952419
51.5408925 -0.09707189999999999
51.5585315 -0.1808132
51.5073509 -0.1277583
51.52665289999999 -0.13713
51.5266242 -0.1379941
51.5073509 -0.1277583
51.5267685 -0.1455003
51.536583 -0.158585
51.5225746 -0.1553482
51.5073509 -0.1277583
51.521323 -0.1681059
51.5347587 -0.1387293
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.53391500000001 -0.1528457
51.5759654 -0.0728738
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4969849 -0.4043773
51.4672227 -0.2844675
51.5434163 -0.1174761
51.5439553 -0.1169043
51.5638304 -0.128907
51.5073509 -0.1277583
51.5449776 -0.1163195
51.5449776 -0.1163195
51.5597205 -0.09863659999999999
51.5527299 -0.0904895
51.5073509 -0.1277583
51.5611463 -0.0956663
51.62251999999999 -0.35751
51.557834 -0.0986749
51.5532056 -0.1118413
51.559526 -0.1023197
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.54071 -0.09625
51.5412621 -0.08813879999999999
51.52750959999999 -0.08764799999999999
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4930774 -0.12678
51.5073509 -0.1277583
51.5301543 -0.0937163
51.5073509 -0.1277583
51.5073509 -0.1277583
51.4970217 -0.0365803
51.54071 -0.09625
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5352087 -0.0864616
51.5073509 -0.1277583
51.5313734 -0.0916302
51.4598756 -0.2193194
51.5193403 -0.1614574
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5280575 -0.0808864
51.5073509 -0.1277583
51.5412621 -0.08813879999999999
51.5280575 -0.0808864
51.514187 -0.1081125
51.5073509 -0.1277583
51.5150102 -0.1022723
51.3964689 0.0285746
51.5073509 -0.1277583
51.5162491 -0.1063938
51.5142797 -0.0995076
51.5073509 -0.1277583
51.5162491 -0.1063938
51.5073509 -0.1277583
51.5115983 -0.1096887
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.516292 -0.1023982
51.5051523 -0.0756511
51.5224984 -0.0640123
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.57113709999999 -0.09371789999999999
51.5090503 -0.0824481
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.52353910000001 0.0506279
51.5073509 -0.1277583
51.5073509 -0.1277583
51.514187 -0.1081125
51.5257373 -0.0811648
51.59268059999999 -0.1813409
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.52041149999999 -0.0864588
51.5194379 -0.090277
51.5163974 -0.08859489999999999
51.5190925 -0.0940787
51.5073509 -0.1277583
51.5190925 -0.0940787
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.52544409999999 -0.09799519999999999
51.52544409999999 -0.09799519999999999
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5182947 -0.0864325
51.51964419999999 -0.1098656
51.5073509 -0.1277583
51.5073509 -0.1277583
51.524765 -0.092719
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5073509 -0.1277583
51.5477031 -0.0464398
51.503951 -0.2390302
51.5073509 -0.1277583
51.5466698 -0.0467445
51.5073509 -0.1277583
51.5416444 -0.0700274
51.5073509 -0.1277583
51.5435837 -0.0687361
51.5432133 -0.0656592
51.5409224 -0.0601511
51.5409224 -0.0601511
51.5462484 -0.0566069
51.5416444 -0.0700274
51.5412774 -0.0646194
51.5416444 -0.0700274
51.5404108 -0.0460392
51.55809000000001 -0.0427767
51.56165 -0.057
51.55710089999999 -0.04548199999999999
51.55969200000001 -0.0499585
51.52685169999999 -0.035912
51.53077529999999 -0.0293506
51.52685169999999 -0.035912
51.5334077 -0.0414135
51.53077529999999 -0.0293506
51.52786 -0.02091
51.52694 -0.0251
51.530627 -0.028353
51.5250757 -0.0198422
51.5293597 -0.0319477
51.5304678 -0.0217884
51.53077529999999 -0.0293506
51.5304678 -0.0217884
51.53077529999999 -0.0293506
51.5269736 -0.0667204
51.52813399999999 -0.06165119999999999
51.5320788 -0.0509621
51.5257742 -0.072035
51.5273431 -0.0557257
51.52813399999999 -0.06165119999999999
51.5284258 -0.0714727
51.5340767 -0.0579732
51.5251911 -0.0672101
51.52813399999999 -0.06165119999999999
51.5238988 -0.06715399999999999
51.5268476 -0.05821320000000001
51.5312681 -0.0449973
51.5311443 -0.0675041
51.5299773 -0.07735489999999999
51.5311443 -0.0675041
51.5269736 -0.0667204
51.5269736 -0.0667204
51.5313096 -0.06335439999999999
51.5311443 -0.0675041
51.5285787 -0.0538383
51.5257742 -0.072035
51.5245866 -0.0726124
51.52813399999999 -0.06165119999999999
51.5269736 -0.0667204
51.5240625 -0.0666948
51.5097502 -0.017595
51.5124894 -0.0343247
51.5097502 -0.017595
51.5076507 -0.0237321
51.5123792 -0.0087975
51.4966118 -0.0146551
51.5054306 -0.0235333
51.5173162 -0.0153133
51.5097502 -0.017595
51.5153723 -0.004954399999999999
51.50703 -0.02028
51.5122697 -0.0106234
51.5122697 -0.0106234
51.5097502 -0.017595
51.5122697 -0.0106234
51.50703 -0.02028
51.50703 -0.02028
51.5094924 -0.0361604
51.5093218 0.005400299999999999
51.5211453 -0.0793585
51.5120687 -0.07064379999999999
51.5224161 -0.0581794
51.5240018 -0.07507319999999999
51.5195336 -0.0739712
51.5176228 -0.0557553
51.5190516 -0.0763204
51.5202262 -0.0731107
51.5176228 -0.0557553
51.5247123 -0.0769333
51.519783 -0.0711834
51.5186833 -0.077141
51.5176228 -0.0557553
51.5176228 -0.0557553
51.5032733 -0.0614962
51.5099721 -0.0596983
51.5099721 -0.0596983
51.5131111 -0.0701036
51.5192451 -0.0730208
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script src='https://api.mapbox.com/mapbox.js/v2.2.3/mapbox.js'></script>
<link href='https://api.mapbox.com/mapbox.js/v2.2.3/mapbox.css' rel='stylesheet' />
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
#map {
position:absolute;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
L.mapbox.accessToken = 'pk.eyJ1IjoiZW5qYWxvdCIsImEiOiJjaWhtdmxhNTIwb25zdHBsejk0NGdhODJhIn0.2-F2hS_oTZenAWc0BMf_uw'
//Setup our Leaflet map using Mapbox.js
var map = L.mapbox.map('map', 'mapbox.pencil', {maxZoom: 18, minZoom: 14})
.setView([51.5119112,-0.10000], 15);
// Setup our svg layer that we can manipulate with d3
var svg = d3.select(map.getPanes().overlayPane)
.append("svg");
var g = svg.append("g").attr("class", "leaflet-zoom-hide");
function project(ll) {
// our data came from csv, make it Leaflet friendly
var a = [+ll.lat, +ll.lon];
// convert it to pixel coordinates
var point = map.latLngToLayerPoint(L.latLng(ll))
return point;
}
d3.csv("dots.csv", function(err, data) {
var dots = g.selectAll("circle.dot")
.data(data)
dots.enter().append("circle").classed("dot", true)
.attr("r", 1)
.style({
fill: "#0082a3",
"fill-opacity": 0.6,
stroke: "#004d60",
"stroke-width": 1
})
.transition().duration(1000)
.attr("r", 6)
function render() {
// We need to reposition our SVG and our containing group when the map
// repositions via zoom or pan
// https://github.com/zetter/voronoi-maps/blob/master/lib/voronoi_map.js
var bounds = map.getBounds();
var topLeft = map.latLngToLayerPoint(bounds.getNorthWest())
var bottomRight = map.latLngToLayerPoint(bounds.getSouthEast())
svg.style("width", map.getSize().x + "px")
.style("height", map.getSize().y + "px")
.style("left", topLeft.x + "px")
.style("top", topLeft.y + "px");
g.attr("transform", "translate(" + -topLeft.x + "," + -topLeft.y + ")");
// We reproject our data with the updated projection from leaflet
g.selectAll("circle.dot")
.attr({
cx: function(d) { return project(d).x},
cy: function(d) { return project(d).y},
})
}
// re-render our visualization whenever the view changes
map.on("viewreset", function() {
render()
})
map.on("move", function() {
render()
})
// render our initial visualization
render()
})
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment