Skip to content

Instantly share code, notes, and snippets.

@mvtango
Last active August 29, 2015 14:03
Show Gist options
  • Save mvtango/d30fcd864f1989d3b4a7 to your computer and use it in GitHub Desktop.
Save mvtango/d30fcd864f1989d3b4a7 to your computer and use it in GitHub Desktop.
West Hamburg Traffic Jam
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Traffic layer</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script>
function initialize() {
var myLatlng = new google.maps.LatLng(53.556583,9.929222);
var mapOptions = {
zoom: 14,
center: myLatlng,
disableDefaultUI: true
}
var styles = [
{
stylers: [
{ hue: "#101010" },
{ saturation: -80 }
]
},{
featureType: "road",
elementType: "geometry",
stylers: [
{ lightness: 100 },
{ visibility: "simplified" }
]
},{
featureType: "road",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}, {
featureType: "poi",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}, {
featureType: "poi",
elementType: "icons",
stylers: [
{ visibility: "off" }
]
}, {
featureType: "administrative",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}, {
featureType: "transit",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}, {
featureType: "transit",
elementType: "icons",
stylers: [
{ visibility: "off" }
]
}, {
featureType: "water",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}
];
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
map.setOptions({styles: styles});
var trafficLayer = new google.maps.TrafficLayer();
trafficLayer.setMap(map);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment