Changing the time of day
Change the appearance of the map to reflect the time of day.
<!DOCTYPE HTML>
<html>
<head>
<script src="https://cdn-webgl.eegeo.com/eegeojs/early_access/latest/eegeo.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.1/leaflet.css" rel="stylesheet" />
</head>
<body>
<div style="position: relative">
<div id="map" style="height: 400px"></div>
<script>
var map = L.eeGeo.map("map", "your_api_key_here", {
center: [37.7858, -122.401],
zoom: 16
});
var times = [L.eeGeo.themes.time.Dawn, L.eeGeo.themes.time.Day, L.eeGeo.themes.time.Dusk, L.eeGeo.themes.time.Night];
var timeIndex = 0;
setInterval(function() {
map.themes.setTime(times[timeIndex]);
timeIndex = (timeIndex + 1) % times.length;
}, 5000);
</script>
</div>
</body>
</html>