} margin: 50px auto; border: 1px solid black; width: 800px; height: 600px; #map { } font-family: Arial, sans-serif; body { /* Add some basic styling to the page */
Visualizing the Plumbing Network in Melbourne
const map = new google.maps.Map(document.getElementById("map"), { zoom: 13, center: { lat: -37.7833, lng: 144.9735 }, maxZoom: 18 }); // Add markers to the map at specific locations const marker1 = new google.maps.Marker({ position: { lat: -37.7842, lng: 144.9747 }, label: "Older Plumbing System" }); const marker2 = new google.maps.Marker({ position: { lat: -37.7853, lng: 144.9755 }, label: "Younger Plumbing System" }); // Add a bounds layer to the map const bounds = new google.maps.LatLngBounds({ center: { lat: -37.7833, lng: 144.9735 }, size: { width: 800, height: 600 } }); // Draw roads and add a colors layer to the map const roadLayer = new google.maps.MapColorLayer({ key: "https://maps.googleapis.com/maps/api/directions/json?key=YOUR_API_KEY&origin=-37.7833,144.9735&destination=-37.7842,144.9747&mode=driving", color: "#000000", styles: [ { type: "path", strokeStyle: "solid", color: "#FFFFFF" }, { type: "line", weight: 4 } ] }); const trafficLayer = new google.maps.MapColorLayer({ key: "https://maps.googleapis.com/maps/api/directions/json?key=YOUR_API_KEY&origin=-37.7833,144.9735&destination=-37.7842,144.9747&mode=transit", color: "#FF0000", styles: [ { type: "path", strokeStyle: "solid", color: "#FFFFFF" }, { type: "line", weight: 4 } ] }); // Add a traffic layer to the map const trafficLayer2 = new google.maps.MapColorLayer({ key: "https://maps.googleapis.com/maps/api/directions/json?key=YOUR_API_KEY&origin=-37.7833,144.9735&destination=-37.7842,144.9747&mode=transit", color: "#FFFF00", styles: [ { type: "path", strokeStyle: "solid", color: "#FFFFFF" }, { type: "line", weight: 4 } ] }); // Add a traffic layer to the map const trafficLayer3 = new google.maps.MapColorLayer({ key: "https://maps.googleapis.com/maps/api/directions/json?key=YOUR_API_KEY&origin=-37.7833,144.9735&destination=-37.7842,144.9747&mode=transit", color: "#FF9900", styles: [ { type: "path", strokeStyle: "solid", color: "#FFFFFF" }, { type: "line", weight: 4 } ] }); // Add a traffic layer to the map const trafficLayer3 = new google.maps.MapColorLayer({ key: "https://maps.googleapis.com/maps/api/directions/json?key=YOUR_API_KEY&origin=-37.7833,144.9735&destination=-37.7842,144.9747&mode=transit", color: "#FFFF00", styles: [ { type: "path", strokeStyle: "solid", color: "#FFFFFF" }, { type: "line", weight: 4 } ] });