Hello everyone! We are currently using below block of code as part of the Python script we are using to download Google Maps traffic data into HTML. However, the downloaded HTML goes beyond the boundary of a maximized Chrome browser. Meaning, I could still move the map up, down, and side to side. I wonder if there's a way to make it fill the Chrome browser upon downloading.
f = open(filename + '.html', 'wb')
message = """<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Traffic Layer</title>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: customized_zoom,
center: {lat: citycenter_lat, lng: citycenter_lon},
disableDefaultUI: true,"""+ bound_script+"""
styles: [{
featureType: "all",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}]
});""" + traffic_layer_script + """ }
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAsPpMEmyBT7YyhpKYenZId7bqPu0rDOhU&callback=initMap">
</script>
</body>
</html>"""
message = message.replace("citycenter_lat", lat)
message = message.replace("citycenter_lon", lon)
message = message.replace("customized_zoom", zoom)
# print(message)
message = message.encode(encoding='utf-8', errors='strict')
f.write(message)
f.close()
ding of Google Maps traffic images and encounter this issue on