{"id":134,"date":"2005-07-29T17:08:00","date_gmt":"2005-07-30T01:08:00","guid":{"rendered":"http:\/\/crazedmonkey.com\/blog\/uncategorised\/ttcgooglemap-for-all.html"},"modified":"2006-10-22T23:04:12","modified_gmt":"2006-10-23T03:04:12","slug":"ttcgooglemap-for-all","status":"publish","type":"post","link":"http:\/\/crazedmonkey.com\/blog\/programming\/ttcgooglemap-for-all.html","title":{"rendered":"TTC Google Maps for all!"},"content":{"rendered":"<p>I just spent a few minutes factoring out my <a href=\"http:\/\/crazedmonkey.com\/ttcgooglemap\/\" title=\"TTC subway map using Google Maps\">TTC subway map<\/a> Javascript code so that it can be called to insert the TTC subway into any Google Map:<\/p>\n<pre><code>&lt;div id=\"map\"&gt;\n&lt;script src=\"http:\/\/crazedmonkey.com\/ttcgooglemap\/ttcgooglemaps.js\" \ntype=\"text\/javascript\"&gt;&lt;\/script&gt;\n&lt;script type=\"text\/javascript\"&gt;\n&lt;!--\n    var map = new GMap( document.getElementById( \"map\" ) );\n    map.addControl( new GSmallMapControl() );\n    map.centerAndZoom( new GPoint( -79.386871, 43.660241 ), 4 );\n\n    \/\/ Add your own markers and polylines here.\n\n    drawTtcSubwayMap( map );\n--&gt;\n&lt;\/script&gt;\n<\/code><\/pre>\n<p>There are two other additional functions, <code>drawTtcSubwayMapColor()<\/code> and <code>writeTtcSubwayStations()<\/code>, which can be used to specify the colors for the different subway lines and to display the colour-coded list in a <code>div<\/code>, respectively. I might add more helper methods later if there is a demand for them.<\/p>\n<p>You can affect how the stations appear in the info pop-up by styling <code>div<\/code> elements of the <code>station<\/code> class.<\/p>\n<p>Originally I had thought to limit access to my Javascript file to those who asked permission to use it. Doing so would make me aware of how people were using the map. For now, people are free to link the Javascript in their pages. All I ask is that you leave a comment on my weblog with a link to your page, and include the following HTML somewhere near the map:<\/p>\n<pre><code>&lt;p&gt;TTC station code and coordinates provided by \n&lt;a href=\"http:\/\/crazedmonkey.com\/\"&gt;Ian Stevens&lt;\/a&gt; and his \n&lt;a href=\"http:\/\/crazedmonkey.com\/ttcgooglemap\/\"&gt;TTC Subway Google Map&lt;\/a&gt;.&lt;\/p&gt;\n<\/code><\/pre>\n<p>Linking, not copying, the script has its advantages, namely that any changes or additions that I make will propagate to your map. There are also a few known bugs, all of which have to do with Internet Explorer, that I hope to address soon.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just spent a few minutes factoring out my <a href=\"http:\/\/crazedmonkey.com\/ttcgooglemap\/\" title=\"TTC subway map using Google Maps\">TTC subway map<\/a> Javascript code so that it can be called to insert the TTC subway into any Google Map:<\/p>\n<p> &lt;div id=&#8221;map&#8221;&gt; &lt;script src=&#8221;http:\/\/crazedmonkey.com\/ttcgooglemap\/ttcgooglemaps.js&#8221; type=&#8221;text\/javascript&#8221;&gt;&lt;\/script&gt; &lt;script type=&#8221;text\/javascript&#8221;&gt; &lt;!&#8211; var map = new GMap( document.getElementById( &#8220;map&#8221; ) ); map.addControl( new&nbsp;&hellip;&nbsp;<a class=\"read_more\" href=\"http:\/\/crazedmonkey.com\/blog\/programming\/ttcgooglemap-for-all.html\" rel=\"bookmark\" title=\"Continue reading &ldquo;TTC Google Maps for all!&rdquo;\"><span>Read more<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[2,26,875],"tags":[],"_links":{"self":[{"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/posts\/134"}],"collection":[{"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/comments?post=134"}],"version-history":[{"count":0,"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/posts\/134\/revisions"}],"wp:attachment":[{"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/media?parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/categories?post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/tags?post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}