Skip to content

Instantly share code, notes, and snippets.

@michellechandra
Created Oct 1, 2014
Embed
What would you like to do?
CitiBike Hoods Map
<html>
<head>
<meta charset=utf-8 />
<title>Map of CitiBike Stations as Communities</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.0.1/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.0.1/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'></div>
<script>
L.mapbox.accessToken = '<pk.eyJ1IjoibWljaGVsbGVjaGFuZHJhMiIsImEiOiJJbXR1T1NVIn0>';
var stations = [
[504,"1 Ave & E 15 St",40.73221853,-73.98165557,2],
[2003,"1 Ave & E 18 St",40.73416059,-73.98024289,8],
[536,"1 Ave & E 30 St",40.74144387,-73.97536082,8],
[455,"1 Ave & E 44 St",40.75001986,-73.96905301,8],
[489,"10 Ave & W 28 St",40.75066386,-74.00176802,8],
[458,"11 Ave & W 27 St",40.751396,-74.005226,8],
[478,"11 Ave & W 41 St",40.76030096,-73.99884222,8],
[530,"11 Ave & W 59 St",40.771522,-73.990541,8],
[514,"12 Ave & W 40 St",40.76087502,-74.00277668,8],
[528,"2 Ave & E 31 St",40.74290902,-73.97706058,19],
[290,"2 Ave & E 58 St",40.76020258,-73.96478473,8],
[298,"3 Ave & Schermerhorn St",40.68683208,-73.9796772,26],
[474,"5 Ave & E 29 St",40.7451677,-73.98683077,10],
[2004,"6 Ave & Broome St",40.724399,-74.004704,10],
[377,"6 Ave & Canal St",40.72243797,-74.00566443,6],
[505,"6 Ave & W 33 St",40.74901271,-73.98848395,0],
[521,"8 Ave & W 31 St",40.75044999,-73.99481051,6],
[490,"8 Ave & W 33 St",40.751551,-73.993934,61],
[447,"8 Ave & W 52 St",40.76370739,-73.9851615,61],
[404,"9 Ave & W 14 St",40.7405826,-74.00550867,48],
[463,"9 Ave & W 16 St",40.74206539,-74.00443172,7],
[434,"9 Ave & W 18 St",40.74317449,-74.00366443,57],
[509,"9 Ave & W 22 St",40.7454973,-74.00197139,57],
[479,"9 Ave & W 45 St",40.76019252,-73.9912551,61],
[270,"Adelphi St & Myrtle Ave",40.69308257,-73.97178913,26],
[312,"Allen St & E Houston St",40.722055,-73.989111,39],
[361,"Allen St & Hester St",40.71605866,-73.99190759,26],
[401,"Allen St & Rivington St",40.72019576,-73.98997825,7],
[271,"Ashland Pl & Hanson Pl",40.68528172,-73.97805813,26],
[83,"Atlantic Ave & Fort Greene Pl",40.68382604,-73.97632328,26],
[398,"Atlantic Ave & Furman St",40.69165183,-73.9999786,26],
[339,"Avenue D & E 12 St",40.72580614,-73.97422494,20],
[302,"Avenue D & E 3 St",40.72082834,-73.97793172,20],
[266,"Avenue D & E 8 St",40.72368361,-73.97574813,20],
[346,"Bank St & Hudson St",40.73652889,-74.00618026,17],
[238,"Bank St & Washington St",40.7361967,-74.00859207,17],
[417,"Barclay St & Church St",40.71291224,-74.01020234,44],
[127,"Barrow St & Hudson St",40.73172428,-74.00674436,31],
[355,"Bayard St & Baxter St",40.71602118,-73.99974372,1],
[443,"Bedford Ave & S 9th St",40.70853074,-73.96408963,26],
[356,"Bialystoker Pl & Delancey St",40.71622644,-73.98261206,20],
[395,"Bond St & Schermerhorn St",40.68807003,-73.98410637,26],
[260,"Broad St & Bridge St",40.70365182,-74.01167797,20],
[304,"Broadway & Battery Pl",40.70463334,-74.01361706,31],
[389,"Broadway & Berry St",40.71044554,-73.96525063,26],
[285,"Broadway & E 14 St",40.73454567,-73.99074142,45],
[402,"Broadway & E 22 St",40.7403432,-73.98955109,32],
[444,"Broadway & W 24 St",40.7423543,-73.98915076,16],
[486,"Broadway & W 29 St",40.7462009,-73.98855723,23],
[498,"Broadway & W 32 St",40.74854862,-73.98808416,29],
[267,"Broadway & W 36 St",40.75097711,-73.98765428,61],
[362,"Broadway & W 37 St",40.75172632,-73.98753523,61],
[533,"Broadway & W 39 St",40.75299641,-73.98721619,61],
[465,"Broadway & W 41 St",40.75513557,-73.98658032,37],
[173,"Broadway & W 49 St",40.76064679,-73.98442659,61],
[500,"Broadway & W 51 St",40.76228826,-73.98336183,61],
[469,"Broadway & W 53 St",40.76344058,-73.98268129,61],
[468,"Broadway & W 55 St",40.7652654,-73.98192338,61],
[457,"Broadway & W 58 St",40.76695317,-73.98169333,61],
[499,"Broadway & W 60 St",40.76915505,-73.98191841,61],
[427,"Bus Slip & State St",40.701907,-74.013942,20],
[321,"Cadman Plaza E & Red Cross Pl",40.69991755,-73.98971773,26],
[232,"Cadman Plaza E & Tillary St",40.69597683,-73.99014892,26],
[314,"Cadman Plaza West & Montague St",40.69383,-73.990539,26],
[307,"Canal St & Rutgers St",40.71427487,-73.98990025,54],
[419,"Carlton Ave & Park Ave",40.69580705,-73.97355569,26],
[368,"Carmine St & 6 Ave",40.73038599,-74.00214988,58],
[2009,"Catherine St & Monroe St",40.71117444,-73.99682619,20],
[2006,"Central Park S & 6 Ave",40.76590936,-73.97634151,61],
[387,"Centre St & Chambers St",40.71273266,-74.0046073,26],
[386,"Centre St & Worth St",40.71494807,-74.00234482,24],
[332,"Cherry St",40.71219906,-73.97948148,20],
[358,"Christopher St & Greenwich St",40.73291553,-74.00711384,3],
[391,"Clark St & Henry St",40.69760127,-73.99344559,26],
[420,"Clermont Ave & Lafayette Ave",40.68764484,-73.96968902,26],
[421,"Clermont Ave & Park Ave",40.69573398,-73.97129668,26],
[151,"Cleveland Pl & Spring St",40.7218158,-73.99720307,47],
[306,"Cliff St & Fulton St",40.70823502,-74.00530063,13],
[343,"Clinton Ave & Flushing Ave",40.69794,-73.96986848,26],
[366,"Clinton Ave & Myrtle Ave",40.693261,-73.968896,26],
[350,"Clinton St & Grand St",40.71559509,-73.9870295,20],
[143,"Clinton St & Joralemon St",40.69239502,-73.99337909,26],
[216,"Columbia Heights & Cranberry St",40.70037867,-73.99548059,26],
[342,"Columbia St & Rivington St",40.71739973,-73.98016555,20],
[278,"Concord St & Bridge St",40.69766564,-73.98476437,26],
[416,"Cumberland St & Lafayette Ave",40.68753406,-73.97265183,26],
[467,"Dean St & 4 Ave",40.68312489,-73.97895137,26],
[324,"DeKalb Ave & Hudson Ave",40.689888,-73.981013,26],
[241,"DeKalb Ave & S Portland Ave",40.68981035,-73.97493121,26],
[409,"DeKalb Ave & Skillman St",40.6906495,-73.95643107,26],
[258,"DeKalb Ave & Vanderbilt Ave",40.68940747,-73.96885458,26],
[296,"Division St & Bowery",40.71413089,-73.9970468,34],
[276,"Duane St & Greenwich St",40.71748752,-74.0104554,17],
[390,"Duffield St & Willoughby St",40.69221589,-73.9842844,26],
[280,"E 10 St & 5 Ave",40.73331967,-73.99510132,33],
[445,"E 10 St & Avenue A",40.72740794,-73.98142006,59],
[326,"E 11 St & 1 Ave",40.72953837,-73.98426726,38],
[237,"E 11 St & 2 Ave",40.73047309,-73.98672378,56],
[357,"E 11 St & Broadway",40.73261787,-73.99158043,34],
[483,"E 12 St & 3 Ave",40.73223272,-73.98889957,32],
[433,"E 13 St & Avenue A",40.72955361,-73.98057249,1],
[511,"E 14 St & Avenue B",40.72938685,-73.97772429,5],
[297,"E 15 St & 3 Ave",40.734232,-73.986923,52],
[496,"E 16 St & 5 Ave",40.73726186,-73.99238967,60],
[475,"E 16 St & Irving Pl",40.73524276,-73.98758561,21],
[497,"E 17 St & Broadway",40.73704984,-73.99009296,30],
[325,"E 19 St & 3 Ave",40.73624527,-73.98473765,2],
[403,"E 2 St & 2 Ave",40.72502876,-73.99069656,8],
[301,"E 2 St & Avenue B",40.72217444,-73.98368779,36],
[150,"E 2 St & Avenue C",40.7208736,-73.98085795,20],
[461,"E 20 St & 2 Ave",40.73587678,-73.98205027,15],
[487,"E 20 St & FDR Drive",40.73314259,-73.97573881,20],
[503,"E 20 St & Park Ave",40.73827428,-73.98751968,15],
[545,"E 23 St & 1 Ave",40.736502,-73.97809472,51],
[491,"E 24 St & Park Ave S",40.74096374,-73.98602213,60],
[174,"E 25 St & 1 Ave",40.7381765,-73.97738662,61],
[507,"E 25 St & 2 Ave",40.73912601,-73.97973776,18],
[2012,"E 27 St & 1 Ave",40.739445,-73.976806,20],
[428,"E 3 St & 1 Ave",40.72467721,-73.98783413,11],
[546,"E 30 St & Park Ave S",40.74444921,-73.98303529,35],
[476,"E 31 St & 3 Ave",40.74394314,-73.97966069,53],
[472,"E 32 St & Park Ave",40.7457121,-73.98194829,12],
[526,"E 33 St & 5 Ave",40.74765947,-73.98490707,61],
[160,"E 37 St & Lexington Ave",40.748238,-73.978311,61],
[518,"E 39 St & 2 Ave",40.74780373,-73.9734419,44],
[167,"E 39 St & 3 Ave",40.7489006,-73.97604882,61],
[439,"E 4 St & 2 Ave",40.7262807,-73.98978041,46],
[153,"E 40 St & 5 Ave",40.75206231,-73.9816324,7],
[517,"E 41 St & Madison Ave",40.752141,-73.979782,61],
[519,"E 42 St & Vanderbilt Ave",40.752416,-73.97837,59],
[2017,"E 43 St & 2 Ave",40.75022392,-73.97121414,61],
[318,"E 43 St & Vanderbilt Ave",40.75320159,-73.9779874,41],
[440,"E 45 St & 3 Ave",40.75255434,-73.97282625,61],
[516,"E 47 St & 1 Ave",40.75206862,-73.96784384,57],
[164,"E 47 St & 2 Ave",40.75323098,-73.97032517,61],
[359,"E 47 St & Park Ave",40.75510267,-73.97498696,61],
[228,"E 48 St & 3 Ave",40.7546011,-73.97187886,61],
[393,"E 5 St & Avenue C",40.72299208,-73.97995466,20],
[454,"E 51 St & 1 Ave",40.75455731,-73.96592976,61],
[522,"E 51 St & Lexington Ave",40.75714758,-73.97207836,61],
[441,"E 52 St & 2 Ave",40.756014,-73.967416,61],
[367,"E 53 St & Lexington Ave",40.75828065,-73.97069431,61],
[456,"E 53 St & Madison Ave",40.7597108,-73.97402311,61],
[385,"E 55 St & 2 Ave",40.75797322,-73.96603308,61],
[2023,"E 55 St & Lexington Ave",40.75968085,-73.97031366,61],
[464,"E 56 St & 3 Ave",40.75934501,-73.96759673,61],
[137,"E 56 St & Madison Ave",40.761628,-73.972924,61],
[305,"E 58 St & 3 Ave",40.76095756,-73.96724467,61],
[2022,"E 59 St & Sutton Pl",40.75849116,-73.95920622,61],
[317,"E 6 St & Avenue B",40.72453734,-73.98185424,8],
[411,"E 6 St & Avenue D",40.72228087,-73.97668709,20],
[432,"E 7 St & Avenue A",40.72621788,-73.98379855,4],
[394,"E 9 St & Avenue C",40.72521311,-73.97768752,2],
[263,"Elizabeth St & Hester St",40.71729,-73.996375,26],
[354,"Emerson Pl & Myrtle Ave",40.69363137,-73.96223558,26],
[501,"FDR Drive & E 35 St",40.744219,-73.97121214,20],
[242,"Flushing Ave & Carlton Ave",40.69788349,-73.97350332,26],
[531,"Forsyth St & Broome St",40.71893904,-73.99266288,40],
[412,"Forsyth St & Canal St",40.7158155,-73.99422366,26],
[372,"Franklin Ave & Myrtle Ave",40.694528,-73.958089,26],
[79,"Franklin St & W Broadway",40.71911552,-74.00666661,21],
[418,"Front St & Gold St",40.70224,-73.982578,26],
[351,"Front St & Maiden Ln",40.70530954,-74.00612572,28],
[2000,"Front St & Washington St",40.70255088,-73.98940236,26],
[397,"Fulton St & Clermont Ave",40.68415748,-73.96922273,26],
[365,"Fulton St & Grand Ave",40.68223166,-73.9614583,26],
[243,"Fulton St & Rockwell Pl",40.688226,-73.979382,26],
[384,"Fulton St & Waverly Ave",40.68317813,-73.9659641,26],
[316,"Fulton St & William St",40.70955958,-74.00653609,5],
[218,"Gallatin Pl & Livingston St",40.69028437,-73.98707105,26],
[281,"Grand Army Plaza & Central Park S",40.7643971,-73.97371465,61],
[2010,"Grand St & Greene St",40.72165481,-74.00234737,42],
[471,"Grand St & Havemeyer St",40.71286844,-73.95698119,26],
[229,"Great Jones St",40.72743423,-73.99379025,19],
[284,"Greenwich Ave & 8 Ave",40.73901691,-74.00263761,47],
[383,"Greenwich Ave & Charles St",40.735238,-74.000271,9],
[329,"Greenwich St & N Moore St",40.72043411,-74.01020609,24],
[147,"Greenwich St & Warren St",40.71542197,-74.01121978,46],
[436,"Hancock St & Bedford Ave",40.68216564,-73.95399026,26],
[431,"Hanover Pl & Livingston St",40.68864636,-73.98263429,26],
[249,"Harrison St & Hudson St",40.71870987,-74.0090009,17],
[157,"Henry St & Atlantic Ave",40.69089272,-73.99612349,26],
[502,"Henry St & Grand St",40.714215,-73.981346,17],
[407,"Henry St & Poplar St",40.700469,-73.991454,26],
[406,"Hicks St & Montague St",40.69512845,-73.99595065,26],
[268,"Howard St & Centre St",40.71910537,-73.99973337,53],
[146,"Hudson St & Reade St",40.71625008,-74.0091059,9],
[392,"Jay St & Tech Pl",40.695065,-73.987167,26],
[376,"John St & William St",40.70862144,-74.00722156,30],
[261,"Johnson St & Gold St",40.69474881,-73.98362464,26],
[233,"Joralemon St & Adams St",40.69246277,-73.98963911,26],
[282,"Kent Ave & S 11 St",40.70827295,-73.96834101,26],
[364,"Lafayette Ave & Classon Ave",40.68900443,-73.96023854,26],
[274,"Lafayette Ave & Fort Greene Pl",40.68691865,-73.976682,26],
[399,"Lafayette Ave & St James Pl",40.68851534,-73.9647628,26],
[293,"Lafayette St & E 8 St",40.73028666,-73.9907647,27],
[250,"Lafayette St & Jersey St",40.72456089,-73.99565293,40],
[161,"LaGuardia Pl & W 3 St",40.72917025,-73.99810231,48],
[248,"Laight St & Hudson St",40.72185379,-74.00771779,17],
[323,"Lawrence St & Willoughby St",40.69236178,-73.98631746,26],
[396,"Lefferts Pl & Franklin Ave",40.68034242,-73.95576894,26],
[320,"Leonard St & Church St",40.717571,-74.005549,54],
[120,"Lexington Ave & Classon Ave",40.68676793,-73.95928168,26],
[537,"Lexington Ave & E 24 St",40.74025878,-73.98409214,24],
[540,"Lexington Ave & E 26 St",40.74147286,-73.98320928,43],
[195,"Liberty St & Broadway",40.70905623,-74.01043382,19],
[257,"Lispenard St & Broadway",40.71939226,-74.00247214,13],
[2008,"Little West St & 1 Pl",40.70569254,-74.01677685,15],
[128,"MacDougal St & Prince St",40.72710258,-74.00297088,11],
[252,"MacDougal St & Washington Sq",40.73226398,-73.99852205,57],
[437,"Macon St & Nostrand Ave",40.68098339,-73.95004798,26],
[340,"Madison St & Clinton St",40.71269042,-73.98776323,20],
[291,"Madison St & Montgomery St",40.713126,-73.984844,20],
[264,"Maiden Ln & Pearl St",40.70706456,-74.00731853,36],
[408,"Market St & Cherry St",40.71076228,-73.99400398,20],
[375,"Mercer St & Bleecker St",40.72679454,-73.99695094,37],
[303,"Mercer St & Spring St",40.72362738,-73.99949601,42],
[539,"Metropolitan Ave & Bedford Ave",40.71534825,-73.96024116,26],
[344,"Monroe St & Bedford Ave",40.6851443,-73.95380904,26],
[289,"Monroe St & Classon Ave",40.6845683,-73.95881081,26],
[251,"Mott St & Prince St",40.72317958,-73.99480012,41],
[309,"Murray St & West St",40.7149787,-74.013012,25],
[245,"Myrtle Ave & St Edwards St",40.69327018,-73.97703874,26],
[144,"Nassau St & Navy St",40.69839895,-73.98068914,26],
[311,"Norfolk St & Broome St",40.7172274,-73.98802084,0],
[217,"Old Fulton St",40.70277159,-73.99383605,26],
[337,"Old Slip & Front St",40.7037992,-74.00838676,20],
[119,"Park Ave & St Edwards St",40.69608941,-73.97803415,26],
[319,"Park Pl & Church St",40.71336124,-74.00937622,52],
[414,"Pearl St & Anchorage Pl",40.70281858,-73.98765762,26],
[415,"Pearl St & Hanover Square",40.7047177,-74.00926027,27],
[279,"Peck Slip & Front Street",40.707873,-74.00167,20],
[247,"Perry St & Bleecker St",40.73535398,-74.00483091,17],
[295,"Pike St & E Broadway",40.71406667,-73.99293911,20],
[331,"Pike St & Monroe St",40.71173107,-73.99193043,20],
[400,"Pitt St & Stanton St",40.71926081,-73.98178024,20],
[2005,"Railroad Ave & Kay Ave",40.70531194,-73.97100056,26],
[330,"Reade St & Broadway",40.71450451,-74.00562789,39],
[473,"Rivington St & Chrystie St",40.72110063,-73.9919254,26],
[349,"Rivington St & Ridge St",40.71850211,-73.98329859,20],
[481,"S 3 St & Bedford Ave",40.71260486,-73.96264403,26],
[460,"S 4 St & Wythe Ave",40.71285887,-73.96590294,26],
[532,"S 5 Pl & S 4 St",40.710451,-73.960876,26],
[353,"S Portland Ave & Hanson Pl",40.68539567,-73.97431458,26],
[2001,"Sands St & Navy St",40.699773,-73.979927,26],
[300,"Shevchenko Pl & E 7 St",40.728145,-73.990214,25],
[3002,"South End Ave & Liberty St",40.711512,-74.015756,4],
[315,"South St & Gouverneur Ln",40.70355377,-74.00670227,3],
[259,"South St & Whitehall St",40.70122128,-74.01234218,20],
[224,"Spruce St & Nassau St",40.71146364,-74.00552427,55],
[308,"St James Pl & Oliver St",40.71307916,-73.99851193,20],
[82,"St James Pl & Pearl St",40.71117416,-74.00016545,20],
[438,"St Marks Pl & 1 Ave",40.72779126,-73.98564945,55],
[236,"St Marks Pl & 2 Ave",40.7284186,-73.98713956,14],
[265,"Stanton St & Chrystie St",40.72229346,-73.99147535,26],
[341,"Stanton St & Mangin St",40.71782143,-73.97628939,20],
[310,"State St & Smith St",40.68926942,-73.98912867,26],
[410,"Suffolk St & Stanton St",40.72066442,-73.98517977,45],
[336,"Sullivan St & Washington Sq",40.73047747,-73.99906065,50],
[382,"University Pl & E 14 St",40.73492695,-73.99200509,9],
[327,"Vesey Pl & River Terrace",40.7153379,-74.01658354,58],
[345,"W 13 St & 6 Ave",40.73649403,-73.99704374,16],
[223,"W 13 St & 7 Ave",40.73781509,-73.99994661,48],
[225,"W 14 St & The High Line",40.74195138,-74.00803013,17],
[482,"W 15 St & 7 Ave",40.73935542,-73.99931783,54],
[212,"W 16 St & The High Line",40.74334935,-74.00681753,44],
[116,"W 17 St & 8 Ave",40.74177603,-74.00149746,44],
[168,"W 18 St & 6 Ave",40.73971301,-73.99456405,38],
[459,"W 20 St & 11 Ave",40.746745,-74.007756,57],
[334,"W 20 St & 7 Ave",40.74238787,-73.99726235,15],
[470,"W 20 St & 8 Ave",40.74345335,-74.00004031,61],
[435,"W 21 St & 6 Ave",40.74173969,-73.99415556,51],
[462,"W 22 St & 10 Ave",40.74691959,-74.00451887,0],
[453,"W 22 St & 8 Ave",40.74475148,-73.99915362,49],
[446,"W 24 St & 7 Ave",40.74487634,-73.99529885,50],
[466,"W 25 St & 6 Ave",40.74395411,-73.99144871,23],
[388,"W 26 St & 10 Ave",40.74971775,-74.00295035,61],
[494,"W 26 St & 8 Ave",40.74734825,-73.99723551,61],
[442,"W 27 St & 7 Ave",40.746647,-73.993915,35],
[512,"W 29 St & 9 Ave",40.7500727,-73.99839279,61],
[379,"W 31 St & 7 Ave",40.749156,-73.9916,61],
[492,"W 33 St & 7 Ave",40.75019995,-73.99093085,61],
[525,"W 34 St & 11 Ave",40.75594159,-74.0021163,61],
[448,"W 37 St & 10 Ave",40.75660359,-73.9979009,61],
[485,"W 37 St & 5 Ave",40.75038009,-73.98338988,61],
[523,"W 38 St & 8 Ave",40.75466591,-73.99138152,41],
[488,"W 39 St & 9 Ave",40.75645824,-73.99372222,61],
[380,"W 4 St & 7 Ave S",40.73401143,-74.00293877,22],
[477,"W 41 St & 8 Ave",40.75640548,-73.9900262,5],
[529,"W 42 St & 8 Ave",40.7575699,-73.99098507,61],
[515,"W 43 St & 10 Ave",40.76009437,-73.99461843,61],
[484,"W 44 St & 5 Ave",40.75500254,-73.98014437,61],
[493,"W 45 St & 6 Ave",40.7568001,-73.98291153,61],
[2021,"W 45 St & 8 Ave",40.75929124,-73.98859651,61],
[508,"W 46 St & 11 Ave",40.76341379,-73.99667444,61],
[495,"W 47 St & 10 Ave",40.76269882,-73.99301222,61],
[450,"W 49 St & 8 Ave",40.76227205,-73.98788205,61],
[510,"W 51 St & 6 Ave",40.7606597,-73.98042047,61],
[72,"W 52 St & 11 Ave",40.76727216,-73.99392888,61],
[520,"W 52 St & 5 Ave",40.75992262,-73.97648516,61],
[449,"W 52 St & 9 Ave",40.76461837,-73.98789473,61],
[480,"W 53 St & 10 Ave",40.76669671,-73.99061728,61],
[423,"W 54 St & 9 Ave",40.76584941,-73.98690506,61],
[513,"W 56 St & 10 Ave",40.768254,-73.988639,61],
[352,"W 56 St & 6 Ave",40.76340613,-73.97722479,61],
[422,"W 59 St & 10 Ave",40.770513,-73.988038,61],
[348,"W Broadway & Spring St",40.72490985,-74.00154702,14],
[347,"W Houston St & Hudson St",40.72873888,-74.00748842,12],
[152,"Warren St & Church St",40.71473993,-74.00910627,10],
[275,"Washington Ave & Greene Ave",40.68650065,-73.96563307,26],
[313,"Washington Ave & Park Ave",40.69610226,-73.96751037,26],
[262,"Washington Park",40.69178232,-73.97372989,26],
[369,"Washington Pl & 6 Ave",40.73224119,-74.00026394,29],
[335,"Washington Pl & Broadway",40.72903917,-73.99404649,18],
[294,"Washington Square E",40.73049393,-73.9957214,60],
[405,"Washington St & Gansevoort St",40.739323,-74.008119,33],
[534,"Water - Whitehall Plaza",40.70255065,-74.0127234,17],
[328,"Watts St & Greenwich St",40.72405549,-74.00965965,17],
[426,"West St & Chambers St",40.71754834,-74.01322069,56],
[363,"West Thames St",40.70834698,-74.01713445,50],
[360,"William St & Pine St",40.70717936,-74.00887308,43],
[244,"Willoughby Ave & Hall St",40.69196035,-73.96536851,26],
[373,"Willoughby Ave & Walworth St",40.69331716,-73.95381995,26],
[239,"Willoughby St & Fleet St",40.69196566,-73.9813018,26],
[2002,"Wythe Ave & Metropolitan Ave",40.716887,-73.963198,26],
[430,"York St & Jay St",40.7014851,-73.98656928,26]
];
var mapboxTiles = L.tileLayer('https://{s}.tiles.mapbox.com/v3/michellechandra2.jkn6gol7/{z}/{x}/{y}.png', {
attribution: '<a href="http://www.mapbox.com/about/maps/" target="_blank">Terms &amp; Feedback</a>'
});
var map = L.map('map')
.addLayer(mapboxTiles)
.setView([40.739, -73.986], 13);
var set_col = [];
var path_color;
var map_and_color = {};
var length_of_unique_stations=0;
console.log("Stations length - " + stations.length);
for(var i = 0; i<stations.length-1; i++) {
//console.log("Map -" +map_and_color[stations[i][4]]);
if(stations[i][4] || stations[i][4] === 0){
if(!map_and_color[stations[i][4]]){
path_color = '#'+Math.floor(Math.random()*16777215).toString(16);
//console.log(path_color);
map_and_color[stations[i][4]] = path_color;
++length_of_unique_stations;
//console.log("Station added to map - " + stations[i][4]);
// set_col = [stations[i][4], path_color];
//map_and_color[stations[i][4]] = "";
//path_color =
}
else if(map_and_color[stations[i][4]]){
//console.log("Station already in map - " + stations[i][4]);
path_color = map_and_color[stations[i][4]];
//console.log("Path color - " + path_color);
}
else{
console.log("error");
}
}
else {
console.log("Undefined detected - " + stations[i][0] + "," +stations[i][4]);
}
var path_options = {
radius : 10,
color : '#FFF',
weight : 1,
fillOpacity : 1.0,
fillColor : path_color
};
L.circleMarker([stations[i][2], stations[i][3]], path_options).addTo(map);
}
console.log(map_and_color);
console.log("Unique - "+length_of_unique_stations);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment