I would like to have a widget that shows google map at home location with displaying the trafic arround.
I found this possible options:
Tried the first one but of course it doesn’t work
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
</style>
<div id="map"></div>
<script>
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 13,
center: {lat: 34.04924594193164, lng: -118.24104309082031}
});
var trafficLayer = new google.maps.TrafficLayer();
trafficLayer.setMap(map);
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=API_KEY&callback=initMap">
</script>
Any one can help to guide me in the right direction?
Cheers!
did you replace API_KEY with a generated Google API Key? I did, but it still didn’t work, too. Storing this code locally as html an opening in a browser does work.
You have a header and footer button that you can’t remove but it’s better than nothing.
You can go to https://www.waze.com/en/livemap to recenter the map and get a permalink with the coordinates and zoom (button in the bottom-right corner).