You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

621 lines
26 KiB

  1. <html><head>
  2. <title>NYC Bookstores</title>
  3. <meta charset="utf-8">
  4. <meta name="google-site-verification" content="hEfog9h0E3JQW91ZUZM5ayPb6DND0WbUa2_W8yTIuVw">
  5. <link rel="icon" type="image/png" href="/img/favicon.png">
  6. <link rel="apple-touch-icon" href="/img/social.jpg">
  7. <script type="text/javascript" src="js/jquery.js"></script>
  8. <script type="text/javascript" src="js/mustache.js"></script>
  9. <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-scrollTo/2.1.0/jquery.scrollTo.min.js"></script>
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <script src="https://api.mapbox.com/mapbox-gl-js/v0.34.0/mapbox-gl.js"></script>
  12. <link href="https://api.mapbox.com/mapbox-gl-js/v0.34.0/mapbox-gl.css" rel="stylesheet">
  13. <link href="https://fonts.googleapis.com/css?family=Acme|Lato" rel="stylesheet">
  14. <link media="screen" rel="stylesheet" type="text/css" href="css/site.css">
  15. <meta property="description" content="A Guide To The Many Independent Bookstores Of New York City">
  16. <meta name="twitter:card" content="summary">
  17. <meta name="twitter:site" content="www.nycbookstores.org">
  18. <meta name="twitter:title" content="NYC Bookstores">
  19. <meta name="twitter:description" content="A Guide To The Many Independent Bookstores Of New York City">
  20. <meta name="twitter:image" content="http://www.nycbookstores.org/img/social.jpg">
  21. <meta property="og:url" content="http://www.nycbookstores.org/">
  22. <meta property="og:title" content="NYC Bookstores">
  23. <meta property="og:description" content="A Guide To The Many Independent Bookstores Of New York City">
  24. <meta property="og:image" content="http://www.nycbookstores.org/img/social.jpg">
  25. </head>
  26. <body>
  27. <div id="wrapper">
  28. <h1>NYC Bookstores</h1>
  29. <div>
  30. <ul class="nav">
  31. <li><strong>The Many Independent Bookstores of New York City</strong></li>
  32. <li><a id="viewInfo">info</a></li>
  33. <li><a href="https://github.com/nyc-bookstores/nyc-bookstores.github.io" target="_blank">github</a></li>
  34. <li><a href="http://www.twitter.com/alazyreader" target="_blank">@alazyreader</a></li>
  35. </ul>
  36. </div>
  37. <div class="container">
  38. <div id="map"></div>
  39. <div id="info">
  40. <p>New York City loves its bookstores. We <a href="http://www.nytimes.com/2006/10/15/nyregion/thecity/15book.html" target="_blank">eulogize those that have faded</a> and celebrate when new ventures are launched. And while the historic <a href="http://untappedcities.com/2015/08/26/4th-avenue-the-history-of-nycs-book-row/" target="_blank">Book Row may have passed away in the 80s</a>, there are still plenty of stores dotting the map. Here, I have attempted to map out all of the currently-open general-interest independent booksellers in the city. Any store with regular-ish hours (excluding religious booksellers and appointment-only rare book sellers) is included.</p>
  41. <p>The listings here are kept up-to-date to the best of my ability. However, I make no promises about either the accuracy or reliability of the information. If you spot an error, or I&apos;ve missed a shop, please let me know by <a href="mailto:delta.mu.alpha@gmail.com" target="_blank">email</a> or <a href="https://www.twitter.com/alazyreader" target="_blank">twitter</a>. Based on the &quot;<a href="https://github.com/jlord/hack-spots" target="_blank">Hack Spots</a>&quot; website by <a href="http://www.twitter.com/jllord" target="_blank">@jllord</a>.</p>
  42. <p>There are currently <span id="storeCount"></span> stores indexed on this page.</p>
  43. </div>
  44. <div id="selected"></div>
  45. </div>
  46. <div class="clearfix"></div>
  47. <div class="container">
  48. <div id="Stores">
  49. <table>
  50. <tbody><tr><th class="tHeader">Name</th><th class="tHeader">Address</th></tr>
  51. <tr id="" class="spotRow">
  52. <td class="name">192 Books</td>
  53. <td>192 10th Ave, New York</td>
  54. </tr>
  55. <tr id="" class="spotRow">
  56. <td class="name">Alabaster Bookshop</td>
  57. <td>122 4th Ave, New York</td>
  58. </tr>
  59. <tr id="" class="spotRow">
  60. <td class="name">Albertine Books</td>
  61. <td>972 Fifth Ave, New York</td>
  62. </tr>
  63. <tr id="" class="spotRow">
  64. <td class="name">Archestratus</td>
  65. <td>160 Huron St, Brooklyn</td>
  66. </tr>
  67. <tr id="" class="spotRow">
  68. <td class="name">Argosy Books</td>
  69. <td>116 East 59th St, New York</td>
  70. </tr>
  71. <tr id="" class="spotRow">
  72. <td class="name">Astoria Bookshop</td>
  73. <td>31-29 31st St, Astoria</td>
  74. </tr>
  75. <tr id="" class="spotRow">
  76. <td class="name">Bankstreet Bookstore</td>
  77. <td>2780 Broadway, New York</td>
  78. </tr>
  79. <tr id="" class="spotRow">
  80. <td class="name">Ben&apos;s Books</td>
  81. <td>145 Ainslie St, Brooklyn</td>
  82. </tr>
  83. <tr id="" class="spotRow">
  84. <td class="name">Berl&apos;s Brooklyn Poetry Shop</td>
  85. <td>126A Front St, Brooklyn</td>
  86. </tr>
  87. <tr id="" class="spotRow">
  88. <td class="name">Better Read Than Dead</td>
  89. <td>867 Broadway, Brooklyn</td>
  90. </tr>
  91. <tr id="" class="spotRow">
  92. <td class="name">Bluestockings</td>
  93. <td>172 Allen Street, New York</td>
  94. </tr>
  95. <tr id="" class="spotRow">
  96. <td class="name">Bonnie Slotnick Cookbooks</td>
  97. <td>28 East 2nd St, New York</td>
  98. </tr>
  99. <tr id="" class="spotRow">
  100. <td class="name">Book Culture</td>
  101. <td>536 W 112th St, New York</td>
  102. </tr>
  103. <tr id="" class="spotRow">
  104. <td class="name">Book Culture on Broadway</td>
  105. <td>2915 Broadway, New York</td>
  106. </tr>
  107. <tr id="" class="spotRow">
  108. <td class="name">Book Culture on Columbus</td>
  109. <td>450 Columbus Ave, New York</td>
  110. </tr>
  111. <tr id="" class="spotRow">
  112. <td class="name">Book Thug Nation</td>
  113. <td>100 North 3rd St, Brooklyn</td>
  114. </tr>
  115. <tr id="" class="spotRow">
  116. <td class="name">bookbook</td>
  117. <td>266 Bleecker St, New York</td>
  118. </tr>
  119. <tr id="" class="spotRow">
  120. <td class="name">Bookmarc</td>
  121. <td>400 Bleecker St, New York</td>
  122. </tr>
  123. <tr id="" class="spotRow">
  124. <td class="name">BookMark Shoppe</td>
  125. <td>8415 3rd Avenue, Brooklyn</td>
  126. </tr>
  127. <tr id="" class="spotRow">
  128. <td class="name">Bookoff</td>
  129. <td>49 W 45nd St, New York</td>
  130. </tr>
  131. <tr id="" class="spotRow">
  132. <td class="name">Books Are Magic</td>
  133. <td>225 Smith St, Brooklyn</td>
  134. </tr>
  135. <tr id="" class="spotRow">
  136. <td class="name">Books Of Wonder</td>
  137. <td>18 West 18th St, New York</td>
  138. </tr>
  139. <tr id="" class="spotRow">
  140. <td class="name">Boulevard Books and Caf&#xE9;</td>
  141. <td>7518 13th Ave, Brooklyn</td>
  142. </tr>
  143. <tr id="" class="spotRow">
  144. <td class="name">Catland</td>
  145. <td>987 Flushing Ave, Brooklyn</td>
  146. </tr>
  147. <tr id="" class="spotRow">
  148. <td class="name">Chartwell Booksellers</td>
  149. <td>55 E 52nd St, New York</td>
  150. </tr>
  151. <tr id="" class="spotRow">
  152. <td class="name">Civil Service Book Shop</td>
  153. <td>38 Lispenard St, New York</td>
  154. </tr>
  155. <tr id="" class="spotRow">
  156. <td class="name">Clic Bookstore &amp; Gallery</td>
  157. <td>255 Centre St, New York</td>
  158. </tr>
  159. <tr id="" class="spotRow">
  160. <td class="name">Community Bookstore</td>
  161. <td>143 7th Ave, Brooklyn</td>
  162. </tr>
  163. <tr id="" class="spotRow">
  164. <td class="name">Dashwood Books</td>
  165. <td>33 Bond St, New York</td>
  166. </tr>
  167. <tr id="" class="spotRow">
  168. <td class="name">Desert Island Comics</td>
  169. <td>540 Metropolitan Ave, Brooklyn</td>
  170. </tr>
  171. <tr id="" class="spotRow">
  172. <td class="name">East Village Books</td>
  173. <td>99 St. Mark&apos;s Place, New York</td>
  174. </tr>
  175. <tr id="" class="spotRow">
  176. <td class="name">Every Thing Goes Book Cafe and Neighborhood Stage</td>
  177. <td>208 Bay St, Staten Island</td>
  178. </tr>
  179. <tr id="" class="spotRow">
  180. <td class="name">Freebird Books</td>
  181. <td>123 Columbia St, Brooklyn</td>
  182. </tr>
  183. <tr id="" class="spotRow">
  184. <td class="name">Greenlight Bookstore</td>
  185. <td>686 Fulton St, Brooklyn</td>
  186. </tr>
  187. <tr id="" class="spotRow">
  188. <td class="name">Here&apos;s A Book Store</td>
  189. <td>1964 Coney Island Ave, Brooklyn</td>
  190. </tr>
  191. <tr id="" class="spotRow">
  192. <td class="name">Housing Works Bookstore Caf&#xE9;</td>
  193. <td>126 Crosby St, New York</td>
  194. </tr>
  195. <tr id="" class="spotRow">
  196. <td class="name">Hullabaloo Books</td>
  197. <td>711A Franklin Ave, Brooklyn</td>
  198. </tr>
  199. <tr id="" class="spotRow">
  200. <td class="name">Human Relations Books</td>
  201. <td>1067 Flushing Ave, Brooklyn</td>
  202. </tr>
  203. <tr id="" class="spotRow">
  204. <td class="name">Idlewild Books Brooklyn</td>
  205. <td>249 Warren St, Brooklyn</td>
  206. </tr>
  207. <tr id="" class="spotRow">
  208. <td class="name">Idlewild Books Manhattan</td>
  209. <td>12 West 19th St, New York</td>
  210. </tr>
  211. <tr id="" class="spotRow">
  212. <td class="name">Idlewild Books Williamsburg</td>
  213. <td>218 Bedford Ave, Brooklyn</td>
  214. </tr>
  215. <tr id="" class="spotRow">
  216. <td class="name">James Cummins Bookseller</td>
  217. <td>699 Madison Ave, 7th Floor, New York</td>
  218. </tr>
  219. <tr id="" class="spotRow">
  220. <td class="name">Joanne Hendricks Cookbooks</td>
  221. <td>488 Greenwich St, New York</td>
  222. </tr>
  223. <tr id="" class="spotRow">
  224. <td class="name">Kinokunya</td>
  225. <td>1073 Avenue of the Americas, New York</td>
  226. </tr>
  227. <tr id="" class="spotRow">
  228. <td class="name">Kitchen Arts &amp; Letters</td>
  229. <td>1435 Lexington Ave, New York</td>
  230. </tr>
  231. <tr id="" class="spotRow">
  232. <td class="name">Loft Book Store Cafe</td>
  233. <td>350 Tompkins Ave, Brooklyn</td>
  234. </tr>
  235. <tr id="" class="spotRow">
  236. <td class="name">Logos Bookstore</td>
  237. <td>1575 York Ave, New York</td>
  238. </tr>
  239. <tr id="" class="spotRow">
  240. <td class="name">Mast Books</td>
  241. <td>66 Avenue A, New York</td>
  242. </tr>
  243. <tr id="" class="spotRow">
  244. <td class="name">McNally Jackson Books</td>
  245. <td>52 Prince St, New York</td>
  246. </tr>
  247. <tr id="" class="spotRow">
  248. <td class="name">Melville House Publishers</td>
  249. <td>46 John St, Brooklyn</td>
  250. </tr>
  251. <tr id="" class="spotRow">
  252. <td class="name">Mercer Street Books &amp; Records</td>
  253. <td>206 Mercer St, New York</td>
  254. </tr>
  255. <tr id="" class="spotRow">
  256. <td class="name">Molasses Books</td>
  257. <td>770 Hart St, Brooklyn</td>
  258. </tr>
  259. <tr id="" class="spotRow">
  260. <td class="name">Namaste Bookshop</td>
  261. <td>2 W 14th St, New York</td>
  262. </tr>
  263. <tr id="" class="spotRow">
  264. <td class="name">Pioneer Books</td>
  265. <td>289 Van Brunt St, Brooklyn</td>
  266. </tr>
  267. <tr id="" class="spotRow">
  268. <td class="name">Posman Books Chelsea Market</td>
  269. <td>75 9th Avenue, New York</td>
  270. </tr>
  271. <tr id="" class="spotRow">
  272. <td class="name">Posman Books Rockefeller Center</td>
  273. <td>30 Rockefeller Plaza, New York</td>
  274. </tr>
  275. <tr id="" class="spotRow">
  276. <td class="name">PowerHouse Arena</td>
  277. <td>28 Adams St, Brooklyn</td>
  278. </tr>
  279. <tr id="" class="spotRow">
  280. <td class="name">PowerHouse on 8th</td>
  281. <td>1111 8th Ave, Brooklyn</td>
  282. </tr>
  283. <tr id="" class="spotRow">
  284. <td class="name">Printed Matter</td>
  285. <td>195 10th Ave, New York</td>
  286. </tr>
  287. <tr id="" class="spotRow">
  288. <td class="name">Quest Bookshop</td>
  289. <td>240 E 53rd St, New York</td>
  290. </tr>
  291. <tr id="" class="spotRow">
  292. <td class="name">Respect For Life Books-N-Things</td>
  293. <td>537 Nostrand Ave, Brooklyn</td>
  294. </tr>
  295. <tr id="" class="spotRow">
  296. <td class="name">Revolution Books</td>
  297. <td>437 Malcolm X Blvd, New York</td>
  298. </tr>
  299. <tr id="" class="spotRow">
  300. <td class="name">Shakespeare &amp; Company</td>
  301. <td>939 Lexington Ave, New York</td>
  302. </tr>
  303. <tr id="" class="spotRow">
  304. <td class="name">Sister&apos;s Uptown Bookstore</td>
  305. <td>1942 Amsterdam Ave, New York</td>
  306. </tr>
  307. <tr id="" class="spotRow">
  308. <td class="name">Spoonbill</td>
  309. <td>99 Montrose Ave, Brooklyn</td>
  310. </tr>
  311. <tr id="" class="spotRow">
  312. <td class="name">Spoonbill &amp; Sugartown, Booksellers</td>
  313. <td>218 Bedford Ave, Brooklyn</td>
  314. </tr>
  315. <tr id="" class="spotRow">
  316. <td class="name">Stories</td>
  317. <td>458 Bergen St, Brooklyn</td>
  318. </tr>
  319. <tr id="" class="spotRow">
  320. <td class="name">Strand Bookstore</td>
  321. <td>828 Broadway, New York</td>
  322. </tr>
  323. <tr id="" class="spotRow">
  324. <td class="name">TASCHEN</td>
  325. <td>107 Greene St, New York</td>
  326. </tr>
  327. <tr id="" class="spotRow">
  328. <td class="name">Terrace Books</td>
  329. <td>242 Prospect Park West, Brooklyn</td>
  330. </tr>
  331. <tr id="" class="spotRow">
  332. <td class="name">The Austin Book Shop</td>
  333. <td>104-29 Jamaica Ave, Richmond Hill</td>
  334. </tr>
  335. <tr id="" class="spotRow">
  336. <td class="name">The Book Cellar</td>
  337. <td>1465 York Ave, New York</td>
  338. </tr>
  339. <tr id="" class="spotRow">
  340. <td class="name">The Center for Fiction</td>
  341. <td>17 East 47th St, New York</td>
  342. </tr>
  343. <tr id="" class="spotRow">
  344. <td class="name">The Corner Bookstore</td>
  345. <td>1313 Madison Ave, New York</td>
  346. </tr>
  347. <tr id="" class="spotRow">
  348. <td class="name">The Drama Book Shop</td>
  349. <td>250 West 40th St, New York</td>
  350. </tr>
  351. <tr id="" class="spotRow">
  352. <td class="name">The Mysterious Bookshop</td>
  353. <td>58 Warren St, New York</td>
  354. </tr>
  355. <tr id="" class="spotRow">
  356. <td class="name">Three Lives &amp; Company</td>
  357. <td>154 West 10th St, New York</td>
  358. </tr>
  359. <tr id="" class="spotRow">
  360. <td class="name">Topos Bookstore Cafe</td>
  361. <td>788 Woodward Ave, Brooklyn</td>
  362. </tr>
  363. <tr id="" class="spotRow">
  364. <td class="name">Turn The Page... Again</td>
  365. <td>39-15a Bell Blvd, Flushing</td>
  366. </tr>
  367. <tr id="" class="spotRow">
  368. <td class="name">Unnameable Books</td>
  369. <td>600 Vanderbilt Ave, Brooklyn</td>
  370. </tr>
  371. <tr id="" class="spotRow">
  372. <td class="name">Unoppressive Non-Imperialist Bargain Books</td>
  373. <td>34 Carmine St, New York</td>
  374. </tr>
  375. <tr id="" class="spotRow">
  376. <td class="name">Ursus Books</td>
  377. <td>50 East 78th St, Suite 1C, New York</td>
  378. </tr>
  379. <tr id="" class="spotRow">
  380. <td class="name">Westsider Rare &amp; Used Books</td>
  381. <td>2246 Broadway, New York</td>
  382. </tr>
  383. <tr id="" class="spotRow">
  384. <td class="name">Word Bookstore</td>
  385. <td>126 Franklin St, Brooklyn</td>
  386. </tr>
  387. <tr id="" class="spotRow">
  388. <td class="name">Word Up Books</td>
  389. <td>2113 Amsterdam Ave, New York</td>
  390. </tr>
  391. </tbody></table>
  392. </div>
  393. </div>
  394. </div><!-- end wrapper -->
  395. <script id="Table" type="text/html">
  396. <table>
  397. <tr><th class="tHeader">Name</th><th class="tHeader">Address</th></tr>
  398. {{#rows}}
  399. <tr id="{{rowNumber}}" class="spotRow">
  400. <td class="name">{{name}}</td>
  401. <td>{{address}}, {{city}}</td>
  402. </tr>
  403. {{/rows}}
  404. </table>
  405. </script>
  406. <script id="selectedStore" type="text/html">
  407. {{#store}}
  408. <h2>{{name}}</h2>
  409. <p class="address">{{address}}<p>
  410. <p class="address">{{city}},NY {{#postcode}} {{postcode}} {{/postcode}}</p>
  411. <p>
  412. <a href="https://maps.google.com/maps?q={{name}} {{address}},{{city}},NY" target="_blank">View in Google Maps</a>
  413. </p>
  414. <ul>
  415. <li>
  416. <span class="store-details">Events:</span> {{events}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  417. <span class="store-details">Caf&eacute;:</span> {{cafe}}
  418. </li>
  419. {{#website}}
  420. <li><a href='{{website}}' target="_blank">{{website}}</a></li>
  421. {{/website}}
  422. </ul>
  423. {{#description}}
  424. <p class="description">{{description}}</p>
  425. {{/description}}
  426. {{/store}}
  427. </script>
  428. <script>
  429. mapboxgl.accessToken = 'pk.eyJ1IjoiYWxhenlyZWFkZXIiLCJhIjoiY2lucDZhb2JxMHp6MHRxa2pvaTFoOWpuZyJ9.DILGYYxxt7A-A_lHHwp6tQ';
  430. var map = new mapboxgl.Map({
  431. container: 'map',
  432. style: 'mapbox://styles/mapbox/basic-v9',
  433. center: [-73.957292, 40.729071], // arbitrary center point
  434. zoom: 10,
  435. minZoom: 9,
  436. maxZoom: 17,
  437. dragRotate: false
  438. });
  439. var popup = new mapboxgl.Popup({
  440. closeOnClick: false,
  441. closeButton: false
  442. });
  443. document.addEventListener('DOMContentLoaded', function() {
  444. $.getJSON('./stores.json', function(data) {
  445. data.sort(
  446. function(a, b) {
  447. var aname = a.name.toLowerCase();
  448. var bname = b.name.toLowerCase();
  449. return aname === bname ? 0 : +(aname > bname) || -1;
  450. }
  451. )
  452. $.each(data, function(key, value) {
  453. value.rowNumber = key;
  454. value.slug = slugify(value.name);
  455. });
  456. $('#storeCount').html(data.length);
  457. window.data = data;
  458. loadMap(data);
  459. });
  460. });
  461. window.addEventListener("hashchange", function(e){
  462. updateViewBySlug(e.newURL.split('#')[1]);
  463. }, false);
  464. function updateHash(slug) {
  465. history.pushState(null, null, "#" + slug);
  466. }
  467. function slugify(str) {
  468. return str
  469. .toLowerCase()
  470. .replace(/é/g,'e')
  471. .replace(/&/g,' and ')
  472. .replace(/ /g,'-')
  473. .replace(/[']+/g,'')
  474. .replace(/[^\w-]+/g,'-')
  475. .replace(/-+/g,'-')
  476. .replace(/^-|-$/g,'');
  477. }
  478. function getStoreBySlug(slug) {
  479. var ret = false;
  480. $.each(window.data, function(key, value) {
  481. if (value.slug === slug) {
  482. ret = value;
  483. return false;
  484. }
  485. });
  486. return ret;
  487. }
  488. function updateViewBySlug(slug) {
  489. if (slug === "info" || slug === undefined) {
  490. showInfo(false);
  491. } else {
  492. var store = getStoreBySlug(slug);
  493. if (store) {
  494. updateSelectedStore(store, false);
  495. }
  496. }
  497. }
  498. function boundingBox(point) {
  499. // add some buffer to a point to give the user some leeway
  500. return [[point.x - 5, point.y - 5], [point.x + 5, point.y + 5]]
  501. }
  502. function updateSelectedStore(store, pushState=false) {
  503. map.flyTo({center: [store.long, store.lat]});
  504. popup.setLngLat([store.long, store.lat])
  505. .setHTML(store.name)
  506. .addTo(map);
  507. $('#info').hide();
  508. var template = $('#selectedStore').html();
  509. var rendered = Mustache.render(template, {store: store});
  510. $('#selected').html(rendered);
  511. $('#selected').show();
  512. if (pushState) {
  513. updateHash(store.slug);
  514. }
  515. }
  516. function showInfo(pushState=true) {
  517. $('#selected').hide();
  518. popup.remove();
  519. $('#info').show();
  520. if (pushState) {
  521. updateHash('info');
  522. }
  523. }
  524. function loadMap(data) {
  525. var geolocate = new mapboxgl.GeolocateControl();
  526. var points = [];
  527. $.each(data, function(key, value) {
  528. points.push({
  529. "type": "Feature",
  530. "geometry": {
  531. "type": "Point",
  532. "coordinates": [value.long, value.lat]
  533. },
  534. "properties": value
  535. });
  536. });
  537. map.on('load', function () {
  538. map.addLayer({
  539. "id": "stores",
  540. "type": "circle",
  541. "source": {
  542. "type": "geojson",
  543. "data": {
  544. "type": "FeatureCollection",
  545. "features": points
  546. }
  547. },
  548. "paint": {
  549. "circle-radius": 5,
  550. "circle-color": "#B9FCFC",
  551. "circle-stroke-width": 2,
  552. "circle-stroke-color": "#000000"
  553. }
  554. })
  555. map.addControl(new mapboxgl.NavigationControl(), 'top-left');
  556. map.addControl(geolocate, 'top-right');
  557. updateViewBySlug(window.location.hash.split("#")[1]);
  558. });
  559. map.on('click', function (e) {
  560. if (!map.getLayer('stores')) { return; }
  561. popup.remove();
  562. // Use queryRenderedFeatures to get features at a click event's point
  563. var features = map.queryRenderedFeatures(boundingBox(e.point), { layers: ['stores'] });
  564. // fly to the location of the click event
  565. if (features.length) {
  566. var store = features[0];
  567. // Get coordinates from the symbol and center the map on those coordinates
  568. updateSelectedStore(store.properties, true);
  569. }
  570. });
  571. // indicate that the symbols are clickable by changing the cursor style to 'pointer'.
  572. map.on('mousemove', function (e) {
  573. if (!map.getLayer('stores')) { return; }
  574. var features = map.queryRenderedFeatures(boundingBox(e.point), { layers: ['stores'] });
  575. map.getCanvas().style.cursor = features.length ? 'pointer' : '';
  576. });
  577. geolocate.on('geolocate', function (e) {
  578. map.setZoom(14);
  579. popup.setLngLat([e.coords.longitude, e.coords.latitude])
  580. .setHTML('Current Location')
  581. .addTo(map);
  582. });
  583. var template = $('#Table').html();
  584. var rendered = Mustache.render(template, {rows: data});
  585. $('#Stores').html(rendered);
  586. $("#Stores tbody tr").not(':first').on("click", function() {
  587. updateSelectedStore(data[$(this)[0].id], true);
  588. $(window).scrollTo($("#selected"), 250, {offset: {top: -15}});
  589. });
  590. $('#viewInfo').on("click", showInfo);
  591. };
  592. </script>
  593. </body></html>