{"id":20892,"date":"2024-01-20T22:59:23","date_gmt":"2024-01-21T03:59:23","guid":{"rendered":"https:\/\/reactivemusic.net\/?p=20892"},"modified":"2024-01-21T03:21:45","modified_gmt":"2024-01-21T08:21:45","slug":"mbta-boston-train-map","status":"publish","type":"post","link":"https:\/\/reactivemusic.net\/?p=20892","title":{"rendered":"MBTA Boston train map"},"content":{"rendered":"<p>This post describes an update of a previous version. The old version can be found here: <a href=\"https:\/\/reactivemusic.net\/?p=20329\">https:\/\/reactivemusic.net\/?p=20329<\/a><\/p>\n<p><iframe loading=\"lazy\" title=\"MBTA Boston train map test\" width=\"525\" height=\"295\" src=\"https:\/\/www.youtube.com\/embed\/1g7v2kQw0kE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h3>Moving markers<\/h3>\n<p>In the previous version, all of the markers for each train line were deleted and redrawn in a group at the polling interval. In this version the train markers move to their new location when the data is polled.<\/p>\n<p>The map is drawn using Leaflet. The moving marker library is from Ivan Sanchez\u00a0<a href=\"https:\/\/www.npmjs.com\/package\/leaflet.marker.slideto\">https:\/\/www.npmjs.com\/package\/leaflet.marker.slideto<\/a><\/p>\n<p>The project uses the MBTA JSON API, to query vehicle data for each train line. the geo coordinates of the trains are sent via websockets to the client map page.<\/p>\n<p>This project is a work in progress and not available yet.<\/p>\n<p>Files:<\/p>\n<p>node server: internetsensors\/mbtanode2\/index.html<\/p>\n<p>html map client: internetsensors\/mbtanode2\/mbtatrain2.html<\/p>\n<h3>Instructions<\/h3>\n<pre>\/\/ to run, type node index.js at a command line.\r\n\/\/ then open a web browser to: http:\/\/127.0.0.1:8124\/\r\n\/\/ type 'go' into the text box below the map, and press 'send' button\r\n\/\/ in a few seconds the train markers will magically appear<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This post describes an update of a previous version. The old version can be found here: https:\/\/reactivemusic.net\/?p=20329 Moving markers In the previous version, all of the markers for each train line were deleted and redrawn in a group at the polling interval. In this version the train markers move to their new location when the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/reactivemusic.net\/?p=20892\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MBTA Boston train map&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[230,143,275],"tags":[161,6,12],"class_list":["post-20892","post","type-post","status-publish","format-standard","hentry","category-development","category-interactive-media-art","category-internet-sensors","tag-api","tag-interactive-media","tag-web-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MBTA Boston train map - reactive music<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/reactivemusic.net\/?p=20892\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MBTA Boston train map - reactive music\" \/>\n<meta property=\"og:description\" content=\"This post describes an update of a previous version. The old version can be found here: https:\/\/reactivemusic.net\/?p=20329 Moving markers In the previous version, all of the markers for each train line were deleted and redrawn in a group at the polling interval. In this version the train markers move to their new location when the &hellip; Continue reading &quot;MBTA Boston train map&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/reactivemusic.net\/?p=20892\" \/>\n<meta property=\"og:site_name\" content=\"reactive music\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-21T03:59:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-21T08:21:45+00:00\" \/>\n<meta name=\"author\" content=\"Tom Zicarelli\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tom Zicarelli\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=20892#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=20892\"},\"author\":{\"name\":\"Tom Zicarelli\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\"},\"headline\":\"MBTA Boston train map\",\"datePublished\":\"2024-01-21T03:59:23+00:00\",\"dateModified\":\"2024-01-21T08:21:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=20892\"},\"wordCount\":154,\"keywords\":[\"API\",\"interactive media\",\"web development\"],\"articleSection\":[\"development\",\"interactive media art\",\"internet-sensors\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=20892\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/?p=20892\",\"name\":\"MBTA Boston train map - reactive music\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#website\"},\"datePublished\":\"2024-01-21T03:59:23+00:00\",\"dateModified\":\"2024-01-21T08:21:45+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=20892#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/reactivemusic.net\\\/?p=20892\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=20892#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/reactivemusic.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MBTA Boston train map\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#website\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/\",\"name\":\"reactive music\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/reactivemusic.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\",\"name\":\"Tom Zicarelli\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"caption\":\"Tom Zicarelli\"},\"sameAs\":[\"http:\\\/\\\/tomzicarelli.com\"],\"url\":\"https:\\\/\\\/reactivemusic.net\\\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MBTA Boston train map - reactive music","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/reactivemusic.net\/?p=20892","og_locale":"en_US","og_type":"article","og_title":"MBTA Boston train map - reactive music","og_description":"This post describes an update of a previous version. The old version can be found here: https:\/\/reactivemusic.net\/?p=20329 Moving markers In the previous version, all of the markers for each train line were deleted and redrawn in a group at the polling interval. In this version the train markers move to their new location when the &hellip; Continue reading \"MBTA Boston train map\"","og_url":"https:\/\/reactivemusic.net\/?p=20892","og_site_name":"reactive music","article_published_time":"2024-01-21T03:59:23+00:00","article_modified_time":"2024-01-21T08:21:45+00:00","author":"Tom Zicarelli","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tom Zicarelli","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/reactivemusic.net\/?p=20892#article","isPartOf":{"@id":"https:\/\/reactivemusic.net\/?p=20892"},"author":{"name":"Tom Zicarelli","@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571"},"headline":"MBTA Boston train map","datePublished":"2024-01-21T03:59:23+00:00","dateModified":"2024-01-21T08:21:45+00:00","mainEntityOfPage":{"@id":"https:\/\/reactivemusic.net\/?p=20892"},"wordCount":154,"keywords":["API","interactive media","web development"],"articleSection":["development","interactive media art","internet-sensors"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/reactivemusic.net\/?p=20892","url":"https:\/\/reactivemusic.net\/?p=20892","name":"MBTA Boston train map - reactive music","isPartOf":{"@id":"https:\/\/reactivemusic.net\/#website"},"datePublished":"2024-01-21T03:59:23+00:00","dateModified":"2024-01-21T08:21:45+00:00","author":{"@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571"},"breadcrumb":{"@id":"https:\/\/reactivemusic.net\/?p=20892#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/reactivemusic.net\/?p=20892"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/reactivemusic.net\/?p=20892#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/reactivemusic.net\/"},{"@type":"ListItem","position":2,"name":"MBTA Boston train map"}]},{"@type":"WebSite","@id":"https:\/\/reactivemusic.net\/#website","url":"https:\/\/reactivemusic.net\/","name":"reactive music","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/reactivemusic.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571","name":"Tom Zicarelli","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","caption":"Tom Zicarelli"},"sameAs":["http:\/\/tomzicarelli.com"],"url":"https:\/\/reactivemusic.net\/?author=2"}]}},"_links":{"self":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/20892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20892"}],"version-history":[{"count":3,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/20892\/revisions"}],"predecessor-version":[{"id":20904,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/20892\/revisions\/20904"}],"wp:attachment":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}