Skip to content

Instantly share code, notes, and snippets.

@brendannee
Created May 24, 2011 06:50
Show Gist options
  • Save brendannee/988231 to your computer and use it in GitHub Desktop.
Save brendannee/988231 to your computer and use it in GitHub Desktop.
Add Google Transit layer to Google Maps API
var transitOptions = {
getTileUrl: function(coord, zoom) {
return "http://mt1.google.com/vt/lyrs=m@155076273,transit:comp|vm:&" +
"hl=en&opts=r&s=Galil&z=" + zoom + "&x=" + coord.x + "&y=" + coord.y;
},
tileSize: new google.maps.Size(256, 256),
isPng: true
};
var transitMapType = new google.maps.ImageMapType(transitOptions);
map.overlayMapTypes.insertAt(0, transitMapType);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment